-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding MaterialRealCMMAux and some other changes. #376
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c82f6ef
Changing material property type in Linear spring to be compatible wit…
cbolisetti 45dd85c
Added MaterialRealCMMAux auxkernel. Refs #376.
cbolisetti 7748e8c
Adding tests for MateralRealCMMAux. Refs #376.
cbolisetti e66bf46
Adding doco for MaterialRealCMMAux. Closes #376.
cbolisetti 1fd37bd
Addressing @somu15 comments.
cbolisetti 217598f
Fixing material parameter description in computeLRIslatorElasticity. …
cbolisetti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# MaterialRealCMMAux | ||
|
||
!syntax description /AuxKernels/MaterialRealCMMAux | ||
|
||
## Description | ||
|
||
`MaterialRealCMMAux` can be used to populate an `AuxVariable` with an element of a material property that is of type, ColumnMajorMatrix (CMM). In MASTODON, a common use case is accessing the deformation or force CMMs from link elements when the [`LinearSpring`](source/materials/LinearSpring.md) material or any of the seismic isolator materials (e.g., [`ComputeFPIsolatorElasticity`](source/materials/ComputeFPIsolatorElasticity.md)) is used. This `AuxKernel` and the corresponding `AuxVariable` should be block-restricted to blocks where the material property given by the `property` input parameter below is defined. | ||
|
||
For example, the following input file syntax will create the AuxVariable field called `global_force_x` with the X direction force in the spring element modeled using the LinearSpring material. Users can look at the LinearSpring.C file in the source code to see that this material has several material properties such as "global_forces", "global_moments", etc. In the case of the linear spring material, the "global_forces" material property is a CMM of size 6x1 and stores the forces in the spring in the global co-ordinate system. The AuxKernel to make this calculation is listed below. | ||
|
||
!listing test/tests/auxkernels/materialrealcmm/spring_static.i block=AuxKernels | ||
|
||
In this input, the AuxKernel takes the element (0, 0) from the CMM material property named, "global_forces" in the linear spring material. (See LinearSpring.C for other material properties.) In this example, the linear spring material is only defined in block '0' and therefore this AuxKernel and AuxVariable are also restricted to this block. The element (0, 0) of the material property "global_forces" corresponds to the axial force in the spring. Currently, in order to know what each of the elements in a material property CMM correspond to, users will either have to go through the source code or reach out to one of the MASTODON developers [here](help/contact_us.md). | ||
|
||
!syntax parameters /AuxKernels/MaterialRealCMMAux | ||
|
||
!syntax inputs /AuxKernels/MaterialRealCMMAux | ||
|
||
!syntax children /AuxKernels/MaterialRealCMMAux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/*************************************************/ | ||
/* DO NOT MODIFY THIS HEADER */ | ||
/* */ | ||
/* MASTODON */ | ||
/* */ | ||
/* (c) 2015 Battelle Energy Alliance, LLC */ | ||
/* ALL RIGHTS RESERVED */ | ||
/* */ | ||
/* Prepared by Battelle Energy Alliance, LLC */ | ||
/* With the U. S. Department of Energy */ | ||
/* */ | ||
/* See COPYRIGHT for full restrictions */ | ||
/*************************************************/ | ||
|
||
#pragma once | ||
|
||
// MOOSE includes | ||
#include "MaterialAuxBase.h" | ||
|
||
// Forward declarations | ||
class MaterialRealCMMAux; | ||
|
||
template <> | ||
InputParameters validParams<MaterialRealCMMAux>(); | ||
|
||
/** | ||
* AuxKernel for outputting a DenseMatrix<Real> material property component to an AuxVariable | ||
*/ | ||
class MaterialRealCMMAux : public MaterialAuxBase<ColumnMajorMatrix> | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
/** | ||
* Class constructor | ||
* @param parameters The input parameters for this AuxKernel | ||
*/ | ||
MaterialRealCMMAux(const InputParameters & parameters); | ||
|
||
protected: | ||
/// Returns the component of the tensor for output | ||
virtual Real getRealValue() override; | ||
|
||
/// The row index to output | ||
unsigned int _row; | ||
|
||
/// The column index to output | ||
unsigned int _col; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/*************************************************/ | ||
/* DO NOT MODIFY THIS HEADER */ | ||
/* */ | ||
/* MASTODON */ | ||
/* */ | ||
/* (c) 2015 Battelle Energy Alliance, LLC */ | ||
/* ALL RIGHTS RESERVED */ | ||
/* */ | ||
/* Prepared by Battelle Energy Alliance, LLC */ | ||
/* With the U. S. Department of Energy */ | ||
/* */ | ||
/* See COPYRIGHT for full restrictions */ | ||
/*************************************************/ | ||
|
||
#include "MaterialRealCMMAux.h" | ||
|
||
registerMooseObject("MastodonApp", MaterialRealCMMAux); | ||
|
||
defineLegacyParams(MaterialRealCMMAux); | ||
|
||
InputParameters | ||
MaterialRealCMMAux::validParams() | ||
{ | ||
InputParameters params = MaterialAuxBase<>::validParams(); | ||
params.addClassDescription( | ||
"Populate an auxiliary variable with an entry from a ColumnMajorMatrix material property."); | ||
params.addParam<unsigned int>("row", 0, "The row component to consider for this kernel"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How will the user know which row to use here? |
||
params.addParam<unsigned int>("column", 0, "The column component to consider for this kernel"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to previous, how to know which column to use? |
||
return params; | ||
} | ||
|
||
MaterialRealCMMAux::MaterialRealCMMAux(const InputParameters & parameters) | ||
: MaterialAuxBase<ColumnMajorMatrix>(parameters), | ||
_row(getParam<unsigned int>("row")), | ||
_col(getParam<unsigned int>("column")) | ||
{ | ||
} | ||
|
||
Real | ||
MaterialRealCMMAux::getRealValue() | ||
{ | ||
if (_row >= _prop[_qp].n() || _col >= _prop[_qp].m()) | ||
mooseError("In ", name(), " the row or column parameter is out of bounds."); | ||
return _prop[_qp](_row, _col); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This information is very helpful to the users.