www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ComputeStrainBase Class Reference

ComputeStrainBase is the base class for strain tensors. More...

#include <ComputeStrainBase.h>

Inheritance diagram for ComputeStrainBase:
[legend]

Public Member Functions

 ComputeStrainBase (const InputParameters &parameters)
 
virtual ~ComputeStrainBase ()
 

Protected Member Functions

virtual void initQpStatefulProperties () override
 

Protected Attributes

unsigned int _ndisp
 Coupled displacement variables. More...
 
std::vector< const VariableValue * > _disp
 
std::vector< const VariableGradient * > _grad_disp
 
std::string _base_name
 
MaterialProperty< RankTwoTensor > & _mechanical_strain
 
MaterialProperty< RankTwoTensor > & _total_strain
 
std::vector< MaterialPropertyName > _eigenstrain_names
 
std::vector< const MaterialProperty< RankTwoTensor > * > _eigenstrains
 
bool _volumetric_locking_correction
 
const Real & _current_elem_volume
 

Detailed Description

ComputeStrainBase is the base class for strain tensors.

Definition at line 19 of file ComputeStrainBase.h.

Constructor & Destructor Documentation

ComputeStrainBase::ComputeStrainBase ( const InputParameters &  parameters)

Definition at line 32 of file ComputeStrainBase.C.

33  : DerivativeMaterialInterface<Material>(parameters),
34  _ndisp(coupledComponents("displacements")),
35  _disp(3),
36  _grad_disp(3),
37  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
38  _mechanical_strain(declareProperty<RankTwoTensor>(_base_name + "mechanical_strain")),
39  _total_strain(declareProperty<RankTwoTensor>(_base_name + "total_strain")),
40  _eigenstrain_names(getParam<std::vector<MaterialPropertyName>>("eigenstrain_names")),
42  _volumetric_locking_correction(getParam<bool>("volumetric_locking_correction")),
43  _current_elem_volume(_assembly.elemVolume())
44 {
45  for (unsigned int i = 0; i < _eigenstrains.size(); ++i)
46  {
48  _eigenstrains[i] = &getMaterialProperty<RankTwoTensor>(_eigenstrain_names[i]);
49  }
50 
51  // Checking for consistency between mesh size and length of the provided displacements vector
52  if (_ndisp != _mesh.dimension())
53  mooseError(
54  "The number of variables supplied in 'displacements' must match the mesh dimension.");
55 
56  // fetch coupled variables and gradients (as stateful properties if necessary)
57  for (unsigned int i = 0; i < _ndisp; ++i)
58  {
59  _disp[i] = &coupledValue("displacements", i);
60  _grad_disp[i] = &coupledGradient("displacements", i);
61  }
62 
63  // set unused dimensions to zero
64  for (unsigned i = _ndisp; i < 3; ++i)
65  {
66  _disp[i] = &_zero;
67  _grad_disp[i] = &_grad_zero;
68  }
69 
70  if (_ndisp == 1 && _volumetric_locking_correction)
71  mooseError("Volumetric locking correction have to be set to false for 1-D problems.");
72 
73  if (getParam<bool>("use_displaced_mesh"))
74  mooseError("The strain calculator needs to run on the undisplaced mesh.");
75 }
const Real & _current_elem_volume
std::string _base_name
std::vector< const VariableValue * > _disp
MaterialProperty< RankTwoTensor > & _mechanical_strain
unsigned int _ndisp
Coupled displacement variables.
std::vector< MaterialPropertyName > _eigenstrain_names
MaterialProperty< RankTwoTensor > & _total_strain
std::vector< const MaterialProperty< RankTwoTensor > * > _eigenstrains
std::vector< const VariableGradient * > _grad_disp
virtual ComputeStrainBase::~ComputeStrainBase ( )
inlinevirtual

Definition at line 23 of file ComputeStrainBase.h.

23 {}

Member Function Documentation

void ComputeStrainBase::initQpStatefulProperties ( )
overrideprotectedvirtual

Reimplemented in ComputeCosseratIncrementalSmallStrain, and ComputeIncrementalStrainBase.

Definition at line 78 of file ComputeStrainBase.C.

Referenced by ~ComputeStrainBase().

79 {
80  _mechanical_strain[_qp].zero();
81  _total_strain[_qp].zero();
82 }
MaterialProperty< RankTwoTensor > & _mechanical_strain
MaterialProperty< RankTwoTensor > & _total_strain

Member Data Documentation

std::string ComputeStrainBase::_base_name
protected

Definition at line 33 of file ComputeStrainBase.h.

Referenced by ComputeStrainBase().

const Real& ComputeStrainBase::_current_elem_volume
protected
std::vector<const VariableValue *> ComputeStrainBase::_disp
protected
std::vector<MaterialPropertyName> ComputeStrainBase::_eigenstrain_names
protected
std::vector<const MaterialProperty<RankTwoTensor> *> ComputeStrainBase::_eigenstrains
protected
std::vector<const VariableGradient *> ComputeStrainBase::_grad_disp
protected
MaterialProperty<RankTwoTensor>& ComputeStrainBase::_mechanical_strain
protected
unsigned int ComputeStrainBase::_ndisp
protected
MaterialProperty<RankTwoTensor>& ComputeStrainBase::_total_strain
protected
bool ComputeStrainBase::_volumetric_locking_correction
protected

The documentation for this class was generated from the following files: