www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ComputeStressBase Class Referenceabstract

ComputeStressBase is the base class for stress tensors. More...

#include <ComputeStressBase.h>

Inheritance diagram for ComputeStressBase:
[legend]

Public Member Functions

 ComputeStressBase (const InputParameters &parameters)
 

Protected Member Functions

virtual void initQpStatefulProperties () override
 
virtual void computeQpProperties () override
 
virtual void computeQpStress ()=0
 
void addQpInitialStress ()
 InitialStress Deprecation: remove this method. More...
 

Protected Attributes

const std::string _base_name
 
const std::string _elasticity_tensor_name
 
const MaterialProperty< RankTwoTensor > & _mechanical_strain
 
MaterialProperty< RankTwoTensor > & _stress
 
MaterialProperty< RankTwoTensor > & _elastic_strain
 
const MaterialProperty< RankFourTensor > & _elasticity_tensor
 
const MaterialProperty< RankTwoTensor > & _extra_stress
 Extra stress tensor. More...
 
std::vector< Function * > _initial_stress_fcn
 initial stress components More...
 
MaterialProperty< RankFourTensor > & _Jacobian_mult
 derivative of stress w.r.t. strain (_dstress_dstrain) More...
 
const bool _store_stress_old
 Parameter which decides whether to store old stress. This is required for HHT time integration and Rayleigh damping. More...
 
const bool _initial_stress_provided
 Whether initial stress was provided. InitialStress Deprecation: remove this. More...
 
MaterialProperty< RankTwoTensor > * _initial_stress
 Initial stress, if provided. InitialStress Deprecation: remove this. More...
 
const MaterialProperty< RankTwoTensor > * _initial_stress_old
 Old value of initial stress, which is needed to correctly implement finite-strain rotations. InitialStress Deprecation: remove this. More...
 

Detailed Description

ComputeStressBase is the base class for stress tensors.

Definition at line 19 of file ComputeStressBase.h.

Constructor & Destructor Documentation

ComputeStressBase::ComputeStressBase ( const InputParameters &  parameters)

Definition at line 40 of file ComputeStressBase.C.

41  : DerivativeMaterialInterface<Material>(parameters),
42  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
43  _elasticity_tensor_name(_base_name + "elasticity_tensor"),
44  _mechanical_strain(getMaterialPropertyByName<RankTwoTensor>(_base_name + "mechanical_strain")),
45  _stress(declareProperty<RankTwoTensor>(_base_name + "stress")),
46  _elastic_strain(declareProperty<RankTwoTensor>(_base_name + "elastic_strain")),
47  _elasticity_tensor(getMaterialPropertyByName<RankFourTensor>(_elasticity_tensor_name)),
48  _extra_stress(getDefaultMaterialProperty<RankTwoTensor>(_base_name + "extra_stress")),
49  _Jacobian_mult(declareProperty<RankFourTensor>(_base_name + "Jacobian_mult")),
50  _store_stress_old(getParam<bool>("store_stress_old")),
51  // InitialStress Deprecation: remove the following
52  _initial_stress_provided(getParam<std::vector<FunctionName>>("initial_stress").size() ==
53  LIBMESH_DIM * LIBMESH_DIM),
55  ? &declareProperty<RankTwoTensor>(_base_name + "initial_stress")
56  : nullptr),
58  ? &getMaterialPropertyOld<RankTwoTensor>(_base_name + "initial_stress")
59  : nullptr)
60 {
61 
62  if (getParam<bool>("use_displaced_mesh"))
63  mooseError("The stress calculator needs to run on the undisplaced mesh.");
64 
65  // InitialStress Deprecation: remove following initial stress stuff
66  const std::vector<FunctionName> & fcn_names(
67  getParam<std::vector<FunctionName>>("initial_stress"));
68  const unsigned num = fcn_names.size();
69 
70  if (!(num == 0 || num == LIBMESH_DIM * LIBMESH_DIM))
71  mooseError("Either zero or ",
72  LIBMESH_DIM * LIBMESH_DIM,
73  " initial stress functions must be provided. You supplied ",
74  num,
75  "\n");
76 
77  _initial_stress_fcn.resize(num);
78  for (unsigned i = 0; i < num; ++i)
79  _initial_stress_fcn[i] = &getFunctionByName(fcn_names[i]);
80 }
MaterialProperty< RankFourTensor > & _Jacobian_mult
derivative of stress w.r.t. strain (_dstress_dstrain)
const std::string _elasticity_tensor_name
std::vector< Function * > _initial_stress_fcn
initial stress components
const MaterialProperty< RankTwoTensor > * _initial_stress_old
Old value of initial stress, which is needed to correctly implement finite-strain rotations...
MaterialProperty< RankTwoTensor > & _stress
const bool _store_stress_old
Parameter which decides whether to store old stress. This is required for HHT time integration and Ra...
const MaterialProperty< RankTwoTensor > & _mechanical_strain
const std::string _base_name
const bool _initial_stress_provided
Whether initial stress was provided. InitialStress Deprecation: remove this.
const MaterialProperty< RankFourTensor > & _elasticity_tensor
MaterialProperty< RankTwoTensor > & _elastic_strain
const MaterialProperty< RankTwoTensor > & _extra_stress
Extra stress tensor.
MaterialProperty< RankTwoTensor > * _initial_stress
Initial stress, if provided. InitialStress Deprecation: remove this.

Member Function Documentation

void ComputeStressBase::addQpInitialStress ( )
protected

InitialStress Deprecation: remove this method.

Adds initial stress, if it is provided, to _stress[_qp]. This function should NOT be used if you calculate stress using

stress = stress_old + elasticity * strain_increment

because stress_old will already include initial stress. However this function SHOULD be used if your code uses

stress = elasticity * (elastic_strain_old + strain_increment) or stress = elasticity * elastic_strain

since in these cases the elastic_strain and elastic_strain_old will not include any contribution from initial stress.

Definition at line 112 of file ComputeStressBase.C.

Referenced by ComputeLinearElasticStress::computeQpStress(), ComputeCosseratLinearElasticStress::computeQpStress(), ComputeFiniteStrainElasticStress::computeQpStress(), ComputeSmearedCrackingStress::computeQpStress(), ComputeMultipleInelasticStress::computeQpStressIntermediateConfiguration(), initQpStatefulProperties(), ComputeMultipleInelasticStress::updateQpState(), and ComputeMultipleInelasticStress::updateQpStateSingleModel().

113 {
115  _stress[_qp] += (*_initial_stress)[_qp];
116 }
MaterialProperty< RankTwoTensor > & _stress
const bool _initial_stress_provided
Whether initial stress was provided. InitialStress Deprecation: remove this.
void ComputeStressBase::computeQpProperties ( )
overrideprotectedvirtual

Reimplemented in ComputeBirchMurnaghanEquationOfStress, and ComputeStressEosBase.

Definition at line 99 of file ComputeStressBase.C.

100 {
101  // InitialStress Deprecation: remove the following 2 lines
103  (*_initial_stress)[_qp] = (*_initial_stress_old)[_qp];
104 
105  computeQpStress();
106 
107  // Add in extra stress
108  _stress[_qp] += _extra_stress[_qp];
109 }
virtual void computeQpStress()=0
MaterialProperty< RankTwoTensor > & _stress
const bool _initial_stress_provided
Whether initial stress was provided. InitialStress Deprecation: remove this.
const MaterialProperty< RankTwoTensor > & _extra_stress
Extra stress tensor.
virtual void ComputeStressBase::computeQpStress ( )
protectedpure virtual
void ComputeStressBase::initQpStatefulProperties ( )
overrideprotectedvirtual

Reimplemented in FiniteStrainHyperElasticViscoPlastic, FiniteStrainUObasedCP, FiniteStrainCrystalPlasticity, ComputeMultipleInelasticCosseratStress, ComputeMultipleInelasticStress, ComputeMultiPlasticityStress, ComputeLinearViscoelasticStress, ComputeSmearedCrackingStress, FiniteStrainPlasticMaterial, ComputeFiniteStrainElasticStressBirchMurnaghan, ComputeFiniteStrainElasticStress, ComputeIsotropicLinearElasticPFFractureStress, and ComputeCosseratStressBase.

Definition at line 83 of file ComputeStressBase.C.

Referenced by ComputeCosseratStressBase::initQpStatefulProperties(), ComputeFiniteStrainElasticStress::initQpStatefulProperties(), ComputeFiniteStrainElasticStressBirchMurnaghan::initQpStatefulProperties(), FiniteStrainPlasticMaterial::initQpStatefulProperties(), ComputeMultiPlasticityStress::initQpStatefulProperties(), and ComputeMultipleInelasticStress::initQpStatefulProperties().

84 {
85  _elastic_strain[_qp].zero();
86  _stress[_qp].zero();
87  // InitialStress Deprecation: remove the following
89  {
90  for (unsigned i = 0; i < LIBMESH_DIM; ++i)
91  for (unsigned j = 0; j < LIBMESH_DIM; ++j)
92  (*_initial_stress)[_qp](i, j) =
93  _initial_stress_fcn[i * LIBMESH_DIM + j]->value(_t, _q_point[_qp]);
94  }
96 }
std::vector< Function * > _initial_stress_fcn
initial stress components
MaterialProperty< RankTwoTensor > & _stress
void addQpInitialStress()
InitialStress Deprecation: remove this method.
const bool _initial_stress_provided
Whether initial stress was provided. InitialStress Deprecation: remove this.
MaterialProperty< RankTwoTensor > & _elastic_strain
MaterialProperty< RankTwoTensor > * _initial_stress
Initial stress, if provided. InitialStress Deprecation: remove this.

Member Data Documentation

const std::string ComputeStressBase::_base_name
protected
MaterialProperty<RankTwoTensor>& ComputeStressBase::_elastic_strain
protected
const MaterialProperty<RankFourTensor>& ComputeStressBase::_elasticity_tensor
protected
const std::string ComputeStressBase::_elasticity_tensor_name
protected
const MaterialProperty<RankTwoTensor>& ComputeStressBase::_extra_stress
protected
MaterialProperty<RankTwoTensor>* ComputeStressBase::_initial_stress
protected

Initial stress, if provided. InitialStress Deprecation: remove this.

Definition at line 74 of file ComputeStressBase.h.

Referenced by initQpStatefulProperties().

std::vector<Function *> ComputeStressBase::_initial_stress_fcn
protected

initial stress components

Definition at line 62 of file ComputeStressBase.h.

Referenced by ComputeStressBase(), and initQpStatefulProperties().

const MaterialProperty<RankTwoTensor>* ComputeStressBase::_initial_stress_old
protected

Old value of initial stress, which is needed to correctly implement finite-strain rotations. InitialStress Deprecation: remove this.

Definition at line 77 of file ComputeStressBase.h.

const bool ComputeStressBase::_initial_stress_provided
protected

Whether initial stress was provided. InitialStress Deprecation: remove this.

Definition at line 71 of file ComputeStressBase.h.

Referenced by addQpInitialStress(), computeQpProperties(), initQpStatefulProperties(), and ComputeFiniteStrainElasticStress::rotateQpInitialStress().

MaterialProperty<RankFourTensor>& ComputeStressBase::_Jacobian_mult
protected
const MaterialProperty<RankTwoTensor>& ComputeStressBase::_mechanical_strain
protected
const bool ComputeStressBase::_store_stress_old
protected

Parameter which decides whether to store old stress. This is required for HHT time integration and Rayleigh damping.

Definition at line 68 of file ComputeStressBase.h.

MaterialProperty<RankTwoTensor>& ComputeStressBase::_stress
protected

Definition at line 53 of file ComputeStressBase.h.

Referenced by addQpInitialStress(), ComputeMultipleInelasticCosseratStress::computeAdmissibleState(), ComputeMultipleInelasticStress::computeAdmissibleState(), computeQpProperties(), ComputeStressEosBase::computeQpProperties(), ComputeBirchMurnaghanEquationOfStress::computeQpProperties(), ComputeLinearElasticStress::computeQpStress(), ComputeStrainIncrementBasedStress::computeQpStress(), ComputeLinearElasticPFFractureStress::computeQpStress(), ComputeCosseratLinearElasticStress::computeQpStress(), ComputeFiniteStrainElasticStress::computeQpStress(), ComputeIsotropicLinearElasticPFFractureStress::computeQpStress(), ComputeFiniteStrainElasticStressBirchMurnaghan::computeQpStress(), FiniteStrainPlasticMaterial::computeQpStress(), ComputeMultiPlasticityStress::computeQpStress(), ComputeSmearedCrackingStress::computeQpStress(), ComputeLinearViscoelasticStress::computeQpStress(), ComputeMultipleInelasticStress::computeQpStressIntermediateConfiguration(), ComputeSmearedCrackingStress::crackingStressRotation(), ComputeMultipleInelasticStress::finiteStrainRotation(), initQpStatefulProperties(), FiniteStrainCrystalPlasticity::initQpStatefulProperties(), FiniteStrainUObasedCP::initQpStatefulProperties(), FiniteStrainHyperElasticViscoPlastic::initQpStatefulProperties(), ComputeMultiPlasticityStress::postReturnMap(), FiniteStrainUObasedCP::postSolveQp(), FiniteStrainHyperElasticViscoPlastic::postSolveQp(), FiniteStrainCrystalPlasticity::postSolveQp(), ComputeMultipleInelasticStress::updateQpState(), ComputeMultipleInelasticStress::updateQpStateSingleModel(), and LinearIsoElasticPFDamage::updateVar().


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