-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #376 from cbolisetti/cmmaux
Adding MaterialRealCMMAux and some other changes.
- Loading branch information
Showing
11 changed files
with
1,291 additions
and
39 deletions.
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"); | ||
params.addParam<unsigned int>("column", 0, "The column component to consider for this kernel"); | ||
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.