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

Material class to compute the elastic free energy and its derivatives. More...

#include <ElasticEnergyMaterial.h>

Inheritance diagram for ElasticEnergyMaterial:
[legend]

Public Member Functions

 ElasticEnergyMaterial (const InputParameters &parameters)
 
virtual void initialSetup () override
 

Protected Member Functions

virtual Real computeF () override
 
virtual Real computeDF (unsigned int i_var) override
 
virtual Real computeD2F (unsigned int i_var, unsigned int j_var) override
 

Protected Attributes

std::string _base_name
 
const MaterialProperty< RankTwoTensor > & _stress
 Stress tensor. More...
 
const MaterialProperty< RankFourTensor > & _elasticity_tensor
 Elasticity tensor derivatives. More...
 
std::vector< const MaterialProperty< RankFourTensor > * > _delasticity_tensor
 
std::vector< std::vector< const MaterialProperty< RankFourTensor > * > > _d2elasticity_tensor
 
const MaterialProperty< RankTwoTensor > & _strain
 Strain and derivatives. More...
 
std::vector< const MaterialProperty< RankTwoTensor > * > _dstrain
 
std::vector< std::vector< const MaterialProperty< RankTwoTensor > * > > _d2strain
 

Detailed Description

Material class to compute the elastic free energy and its derivatives.

Definition at line 26 of file ElasticEnergyMaterial.h.

Constructor & Destructor Documentation

◆ ElasticEnergyMaterial()

ElasticEnergyMaterial::ElasticEnergyMaterial ( const InputParameters &  parameters)

Definition at line 31 of file ElasticEnergyMaterial.C.

32  : DerivativeFunctionMaterialBase(parameters),
33  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
34  _stress(getMaterialPropertyByName<RankTwoTensor>(_base_name + "stress")),
35  _elasticity_tensor(getMaterialPropertyByName<RankFourTensor>(_base_name + "elasticity_tensor")),
36  _strain(getMaterialPropertyByName<RankTwoTensor>(_base_name + "elastic_strain"))
37 {
38  _dstrain.resize(_nargs);
39  _d2strain.resize(_nargs);
40  _delasticity_tensor.resize(_nargs);
41  _d2elasticity_tensor.resize(_nargs);
42 
43  // fetch stress and elasticity tensor derivatives (in simple eigenstrain models this is is only
44  // w.r.t. 'c')
45  for (unsigned int i = 0; i < _nargs; ++i)
46  {
47  _dstrain[i] = &getMaterialPropertyDerivativeByName<RankTwoTensor>(_base_name + "elastic_strain",
48  _arg_names[i]);
49  _delasticity_tensor[i] = &getMaterialPropertyDerivativeByName<RankFourTensor>(
50  _base_name + "elasticity_tensor", _arg_names[i]);
51 
52  _d2strain[i].resize(_nargs);
53  _d2elasticity_tensor[i].resize(_nargs);
54 
55  for (unsigned int j = 0; j < _nargs; ++j)
56  {
57  _d2strain[i][j] = &getMaterialPropertyDerivativeByName<RankTwoTensor>(
58  _base_name + "elastic_strain", _arg_names[i], _arg_names[j]);
59  _d2elasticity_tensor[i][j] = &getMaterialPropertyDerivativeByName<RankFourTensor>(
60  _base_name + "elasticity_tensor", _arg_names[i], _arg_names[j]);
61  }
62  }
63 }
const MaterialProperty< RankTwoTensor > & _stress
Stress tensor.
std::vector< std::vector< const MaterialProperty< RankTwoTensor > * > > _d2strain
const MaterialProperty< RankFourTensor > & _elasticity_tensor
Elasticity tensor derivatives.
std::vector< const MaterialProperty< RankTwoTensor > * > _dstrain
const MaterialProperty< RankTwoTensor > & _strain
Strain and derivatives.
std::vector< std::vector< const MaterialProperty< RankFourTensor > * > > _d2elasticity_tensor
std::vector< const MaterialProperty< RankFourTensor > * > _delasticity_tensor

Member Function Documentation

◆ computeD2F()

Real ElasticEnergyMaterial::computeD2F ( unsigned int  i_var,
unsigned int  j_var 
)
overrideprotectedvirtual

Definition at line 89 of file ElasticEnergyMaterial.C.

90 {
91  unsigned int i = argIndex(i_var);
92  unsigned int j = argIndex(j_var);
93 
94  // product rule d/dj computeDF
95  // TODO: simplify because doubleContraction commutes
96  return 0.5 * (((*_d2elasticity_tensor[i][j])[_qp] * _strain[_qp] +
97  (*_delasticity_tensor[i])[_qp] * (*_dstrain[j])[_qp] +
98  (*_delasticity_tensor[j])[_qp] * (*_dstrain[i])[_qp] +
99  _elasticity_tensor[_qp] * (*_d2strain[i][j])[_qp])
100  .doubleContraction(_strain[_qp]) +
101  ((*_delasticity_tensor[i])[_qp] * _strain[_qp] +
102  _elasticity_tensor[_qp] * (*_dstrain[i])[_qp])
103  .doubleContraction((*_dstrain[j])[_qp])
104 
105  +
106  ( // dstress/dj
107  (*_delasticity_tensor[j])[_qp] * _strain[_qp] +
108  _elasticity_tensor[_qp] * (*_dstrain[j])[_qp])
109  .doubleContraction((*_dstrain[i])[_qp]) +
110  _stress[_qp].doubleContraction((*_d2strain[i][j])[_qp]));
111 }
const MaterialProperty< RankTwoTensor > & _stress
Stress tensor.
std::vector< std::vector< const MaterialProperty< RankTwoTensor > * > > _d2strain
const MaterialProperty< RankFourTensor > & _elasticity_tensor
Elasticity tensor derivatives.
std::vector< const MaterialProperty< RankTwoTensor > * > _dstrain
const MaterialProperty< RankTwoTensor > & _strain
Strain and derivatives.
std::vector< std::vector< const MaterialProperty< RankFourTensor > * > > _d2elasticity_tensor
std::vector< const MaterialProperty< RankFourTensor > * > _delasticity_tensor

◆ computeDF()

Real ElasticEnergyMaterial::computeDF ( unsigned int  i_var)
overrideprotectedvirtual

Definition at line 79 of file ElasticEnergyMaterial.C.

80 {
81  unsigned int i = argIndex(i_var);
82 
83  // product rule d/di computeF (doubleContraction commutes)
84  return 0.5 * ((*_delasticity_tensor[i])[_qp] * _strain[_qp]).doubleContraction(_strain[_qp]) +
85  (_elasticity_tensor[_qp] * (*_dstrain[i])[_qp]).doubleContraction(_strain[_qp]);
86 }
const MaterialProperty< RankFourTensor > & _elasticity_tensor
Elasticity tensor derivatives.
std::vector< const MaterialProperty< RankTwoTensor > * > _dstrain
const MaterialProperty< RankTwoTensor > & _strain
Strain and derivatives.
std::vector< const MaterialProperty< RankFourTensor > * > _delasticity_tensor

◆ computeF()

Real ElasticEnergyMaterial::computeF ( )
overrideprotectedvirtual

Definition at line 73 of file ElasticEnergyMaterial.C.

74 {
75  return 0.5 * _stress[_qp].doubleContraction(_strain[_qp]);
76 }
const MaterialProperty< RankTwoTensor > & _stress
Stress tensor.
const MaterialProperty< RankTwoTensor > & _strain
Strain and derivatives.

◆ initialSetup()

void ElasticEnergyMaterial::initialSetup ( )
overridevirtual

Definition at line 66 of file ElasticEnergyMaterial.C.

67 {
68  validateCoupling<RankTwoTensor>(_base_name + "elastic_strain");
69  validateCoupling<RankFourTensor>(_base_name + "elasticity_tensor");
70 }

Member Data Documentation

◆ _base_name

std::string ElasticEnergyMaterial::_base_name
protected

Definition at line 38 of file ElasticEnergyMaterial.h.

Referenced by ElasticEnergyMaterial(), and initialSetup().

◆ _d2elasticity_tensor

std::vector<std::vector<const MaterialProperty<RankFourTensor> *> > ElasticEnergyMaterial::_d2elasticity_tensor
protected

Definition at line 48 of file ElasticEnergyMaterial.h.

Referenced by computeD2F(), and ElasticEnergyMaterial().

◆ _d2strain

std::vector<std::vector<const MaterialProperty<RankTwoTensor> *> > ElasticEnergyMaterial::_d2strain
protected

Definition at line 54 of file ElasticEnergyMaterial.h.

Referenced by computeD2F(), and ElasticEnergyMaterial().

◆ _delasticity_tensor

std::vector<const MaterialProperty<RankFourTensor> *> ElasticEnergyMaterial::_delasticity_tensor
protected

Definition at line 47 of file ElasticEnergyMaterial.h.

Referenced by computeD2F(), computeDF(), and ElasticEnergyMaterial().

◆ _dstrain

std::vector<const MaterialProperty<RankTwoTensor> *> ElasticEnergyMaterial::_dstrain
protected

Definition at line 53 of file ElasticEnergyMaterial.h.

Referenced by computeD2F(), computeDF(), and ElasticEnergyMaterial().

◆ _elasticity_tensor

const MaterialProperty<RankFourTensor>& ElasticEnergyMaterial::_elasticity_tensor
protected

Elasticity tensor derivatives.

Definition at line 46 of file ElasticEnergyMaterial.h.

Referenced by computeD2F(), and computeDF().

◆ _strain

const MaterialProperty<RankTwoTensor>& ElasticEnergyMaterial::_strain
protected

Strain and derivatives.

Definition at line 52 of file ElasticEnergyMaterial.h.

Referenced by computeD2F(), computeDF(), and computeF().

◆ _stress

const MaterialProperty<RankTwoTensor>& ElasticEnergyMaterial::_stress
protected

Stress tensor.

Definition at line 41 of file ElasticEnergyMaterial.h.

Referenced by computeD2F(), and computeF().


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