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

void initialSetup () override
 
virtual void initQpStatefulProperties () override
 
virtual void displacementIntegrityCheck ()
 

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
 
const MaterialProperty< RankTwoTensor > * _global_strain
 
bool _volumetric_locking_correction
 
const Real & _current_elem_volume
 

Detailed Description

ComputeStrainBase is the base class for strain tensors.

Definition at line 27 of file ComputeStrainBase.h.

Constructor & Destructor Documentation

◆ ComputeStrainBase()

ComputeStrainBase::ComputeStrainBase ( const InputParameters &  parameters)

Definition at line 37 of file ComputeStrainBase.C.

38  : DerivativeMaterialInterface<Material>(parameters),
39  _ndisp(coupledComponents("displacements")),
40  _disp(3),
41  _grad_disp(3),
42  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
43  _mechanical_strain(declareProperty<RankTwoTensor>(_base_name + "mechanical_strain")),
44  _total_strain(declareProperty<RankTwoTensor>(_base_name + "total_strain")),
45  _eigenstrain_names(getParam<std::vector<MaterialPropertyName>>("eigenstrain_names")),
47  _global_strain(isParamValid("global_strain")
48  ? &getMaterialProperty<RankTwoTensor>(_base_name + "global_strain")
49  : NULL),
50  _volumetric_locking_correction(getParam<bool>("volumetric_locking_correction")),
51  _current_elem_volume(_assembly.elemVolume())
52 {
53  for (unsigned int i = 0; i < _eigenstrains.size(); ++i)
54  {
56  _eigenstrains[i] = &getMaterialProperty<RankTwoTensor>(_eigenstrain_names[i]);
57  }
58 
60  paramError("volumetric_locking_correction", "has to be set to false for 1-D problems.");
61 
62  if (getParam<bool>("use_displaced_mesh"))
63  paramError("use_displaced_mesh", "The strain calculator needs to run on the undisplaced mesh.");
64 }
const Real & _current_elem_volume
std::string _base_name
std::vector< const VariableValue * > _disp
MaterialProperty< RankTwoTensor > & _mechanical_strain
unsigned int _ndisp
Coupled displacement variables.
const MaterialProperty< RankTwoTensor > * _global_strain
std::vector< MaterialPropertyName > _eigenstrain_names
MaterialProperty< RankTwoTensor > & _total_strain
std::vector< const MaterialProperty< RankTwoTensor > * > _eigenstrains
std::vector< const VariableGradient * > _grad_disp

◆ ~ComputeStrainBase()

virtual ComputeStrainBase::~ComputeStrainBase ( )
inlinevirtual

Definition at line 31 of file ComputeStrainBase.h.

31 {}

Member Function Documentation

◆ displacementIntegrityCheck()

void ComputeStrainBase::displacementIntegrityCheck ( )
protectedvirtual

Reimplemented in Compute2DFiniteStrain, Compute2DIncrementalStrain, and Compute2DSmallStrain.

Definition at line 86 of file ComputeStrainBase.C.

Referenced by initialSetup().

87 {
88  // Checking for consistency between mesh size and length of the provided displacements vector
89  if (_ndisp != _mesh.dimension())
90  paramError(
91  "displacements",
92  "The number of variables supplied in 'displacements' must match the mesh dimension.");
93 }
unsigned int _ndisp
Coupled displacement variables.

◆ initialSetup()

void ComputeStrainBase::initialSetup ( )
overrideprotected

Definition at line 67 of file ComputeStrainBase.C.

Referenced by ComputeIncrementalStrainBase::initialSetup(), and ComputeAxisymmetric1DSmallStrain::initialSetup().

68 {
70  // fetch coupled variables and gradients (as stateful properties if necessary)
71  for (unsigned int i = 0; i < _ndisp; ++i)
72  {
73  _disp[i] = &coupledValue("displacements", i);
74  _grad_disp[i] = &coupledGradient("displacements", i);
75  }
76 
77  // set unused dimensions to zero
78  for (unsigned i = _ndisp; i < 3; ++i)
79  {
80  _disp[i] = &_zero;
81  _grad_disp[i] = &_grad_zero;
82  }
83 }
virtual void displacementIntegrityCheck()
std::vector< const VariableValue * > _disp
unsigned int _ndisp
Coupled displacement variables.
std::vector< const VariableGradient * > _grad_disp

◆ initQpStatefulProperties()

void ComputeStrainBase::initQpStatefulProperties ( )
overrideprotectedvirtual

Reimplemented in ComputeCosseratIncrementalSmallStrain, and ComputeIncrementalStrainBase.

Definition at line 96 of file ComputeStrainBase.C.

97 {
98  _mechanical_strain[_qp].zero();
99  _total_strain[_qp].zero();
100 }
MaterialProperty< RankTwoTensor > & _mechanical_strain
MaterialProperty< RankTwoTensor > & _total_strain

Member Data Documentation

◆ _base_name

std::string ComputeStrainBase::_base_name
protected

Definition at line 43 of file ComputeStrainBase.h.

Referenced by ComputeStrainBase().

◆ _current_elem_volume

const Real& ComputeStrainBase::_current_elem_volume
protected

◆ _disp

std::vector<const VariableValue *> ComputeStrainBase::_disp
protected

◆ _eigenstrain_names

std::vector<MaterialPropertyName> ComputeStrainBase::_eigenstrain_names
protected

◆ _eigenstrains

std::vector<const MaterialProperty<RankTwoTensor> *> ComputeStrainBase::_eigenstrains
protected

◆ _global_strain

const MaterialProperty<RankTwoTensor>* ComputeStrainBase::_global_strain
protected

◆ _grad_disp

std::vector<const VariableGradient *> ComputeStrainBase::_grad_disp
protected

◆ _mechanical_strain

MaterialProperty<RankTwoTensor>& ComputeStrainBase::_mechanical_strain
protected

◆ _ndisp

unsigned int ComputeStrainBase::_ndisp
protected

◆ _total_strain

MaterialProperty<RankTwoTensor>& ComputeStrainBase::_total_strain
protected

◆ _volumetric_locking_correction

bool ComputeStrainBase::_volumetric_locking_correction
protected

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