https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ComputeVolumetricEigenstrain Class Reference

ComputeVolumetricEigenstrain computes an eigenstrain that is defined by a set of scalar material properties that summed together define the volumetric change. More...

#include <ComputeVolumetricEigenstrain.h>

Inheritance diagram for ComputeVolumetricEigenstrain:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 ComputeVolumetricEigenstrain (const InputParameters &parameters)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialPropertyByName (const std::string &name)
 
void validateDerivativeMaterialPropertyBase (const std::string &base)
 
const MaterialPropertyName derivativePropertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName derivativePropertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName derivativePropertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName derivativePropertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual void initialSetup ()
 
virtual void computeQpEigenstrain ()
 

Protected Attributes

const unsigned int _num_args
 number of variables the material depends on More...
 
const std::vector< MaterialPropertyName > _volumetric_material_names
 Names of the material properties that define volumetric change. More...
 
std::vector< const MaterialProperty< Real > * > _volumetric_materials
 The material properties that define volumetric change. More...
 
std::vector< std::vector< const MaterialProperty< Real > * > > _dvolumetric_materials
 first derivatives of the volumetric materials with respect to the args More...
 
std::vector< std::vector< std::vector< const MaterialProperty< Real > * > > > _d2volumetric_materials
 second derivatives of the volumetric materials with respect to the args More...
 
std::vector< MaterialProperty< RankTwoTensor > * > _delastic_strain
 first derivatives of the elastic strain with respect to the args More...
 
std::vector< std::vector< MaterialProperty< RankTwoTensor > * > > _d2elastic_strain
 second derivatives of the elastic strain with respect to the args More...
 

Detailed Description

ComputeVolumetricEigenstrain computes an eigenstrain that is defined by a set of scalar material properties that summed together define the volumetric change.

This also computes the derivatives of that eigenstrain with respect to a supplied set of variable dependencies.");

Definition at line 21 of file ComputeVolumetricEigenstrain.h.

Constructor & Destructor Documentation

◆ ComputeVolumetricEigenstrain()

ComputeVolumetricEigenstrain::ComputeVolumetricEigenstrain ( const InputParameters parameters)

Definition at line 29 of file ComputeVolumetricEigenstrain.C.

31  _num_args(coupledComponents("args")),
32  _volumetric_material_names(getParam<std::vector<MaterialPropertyName>>("volumetric_materials")),
38 {
39  for (unsigned int i = 0; i < _volumetric_material_names.size(); ++i)
40  _volumetric_materials[i] = &getMaterialProperty<Real>(_volumetric_material_names[i]);
41 
42  // fetch prerequisite derivatives and build elastic_strain derivatives and cross-derivatives
43  for (unsigned int i = 0; i < _volumetric_material_names.size(); ++i)
44  {
45  const MaterialPropertyName & vol_matl_name = _volumetric_material_names[i];
48  for (unsigned int j = 0; j < _num_args; ++j)
49  {
50  const VariableName & jname = coupledName("args", j);
51  _dvolumetric_materials[i][j] = &getMaterialPropertyDerivative<Real>(vol_matl_name, jname);
53 
54  for (unsigned int k = j; k < _num_args; ++k)
55  {
56  const VariableName & kname = coupledName("args", k);
58  &getMaterialPropertyDerivative<Real>("prefactor", jname, kname);
59  }
60  }
61  }
62 
63  for (unsigned int j = 0; j < _num_args; ++j)
64  {
65  const VariableName & jname = coupledName("args", j);
67  &declarePropertyDerivative<RankTwoTensor>(_base_name + "elastic_strain", jname);
68  _d2elastic_strain[j].resize(_num_args);
69 
70  for (unsigned int k = j; k < _num_args; ++k)
71  {
72  const VariableName & kname = coupledName("args", k);
74  &declarePropertyDerivative<RankTwoTensor>(_base_name + "elastic_strain", jname, kname);
75  }
76  }
77 }
std::vector< MaterialProperty< RankTwoTensor > * > _delastic_strain
first derivatives of the elastic strain with respect to the args
std::vector< std::vector< MaterialProperty< RankTwoTensor > * > > _d2elastic_strain
second derivatives of the elastic strain with respect to the args
std::vector< std::vector< std::vector< const MaterialProperty< Real > * > > > _d2volumetric_materials
second derivatives of the volumetric materials with respect to the args
const std::vector< MaterialPropertyName > _volumetric_material_names
Names of the material properties that define volumetric change.
const unsigned int _num_args
number of variables the material depends on
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
std::vector< std::vector< const MaterialProperty< Real > * > > _dvolumetric_materials
first derivatives of the volumetric materials with respect to the args
std::vector< const MaterialProperty< Real > * > _volumetric_materials
The material properties that define volumetric change.
static const std::string k
Definition: NS.h:130

Member Function Documentation

◆ computeQpEigenstrain()

void ComputeVolumetricEigenstrain::computeQpEigenstrain ( )
protectedvirtual

Definition at line 106 of file ComputeVolumetricEigenstrain.C.

107 {
108  Real volumetric_strain = 0;
109  for (unsigned int i = 0; i < _volumetric_materials.size(); ++i)
110  volumetric_strain += (*_volumetric_materials[i])[_qp];
111 
112  const Real eigenstrain_comp = computeVolumetricStrainComponent(volumetric_strain);
113  _eigenstrain[_qp].zero();
114  _eigenstrain[_qp].addIa(eigenstrain_comp);
115 
116  // TODO: Compute derivatives of the elastic strain wrt the variables specified in args
117 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< const MaterialProperty< Real > * > _volumetric_materials
The material properties that define volumetric change.

◆ initialSetup()

void ComputeVolumetricEigenstrain::initialSetup ( )
protectedvirtual

Definition at line 80 of file ComputeVolumetricEigenstrain.C.

81 {
82  for (auto vmn : _volumetric_material_names)
83  validateCoupling<Real>(vmn);
84 
85  for (unsigned int i = 0; i < _num_args; ++i)
86  {
87  const VariableName & iname = coupledName("args", i);
88  if (_fe_problem.isMatPropRequested(
89  derivativePropertyNameFirst(_base_name + "elastic_strain", iname)))
90  mooseError("Derivative of elastic_strain requested, but not yet implemented");
91  else
92  _delastic_strain[i] = nullptr;
93  for (unsigned int j = 0; j < _num_args; ++j)
94  {
95  const VariableName & jname = coupledName("args", j);
96  if (_fe_problem.isMatPropRequested(
97  derivativePropertyNameSecond(_base_name + "elastic_strain", iname, jname)))
98  mooseError("Second Derivative of elastic_strain requested, but not yet implemented");
99  else
100  _d2elastic_strain[i][j] = nullptr;
101  }
102  }
103 }
std::vector< MaterialProperty< RankTwoTensor > * > _delastic_strain
first derivatives of the elastic strain with respect to the args
std::vector< std::vector< MaterialProperty< RankTwoTensor > * > > _d2elastic_strain
second derivatives of the elastic strain with respect to the args
void mooseError(Args &&... args)
const MaterialPropertyName derivativePropertyNameSecond(const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
const MaterialPropertyName derivativePropertyNameFirst(const MaterialPropertyName &base, const SymbolName &c1) const
const std::vector< MaterialPropertyName > _volumetric_material_names
Names of the material properties that define volumetric change.
const unsigned int _num_args
number of variables the material depends on
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")

◆ validParams()

InputParameters ComputeVolumetricEigenstrain::validParams ( )
static

Definition at line 16 of file ComputeVolumetricEigenstrain.C.

17 {
19  params.addClassDescription("Computes an eigenstrain that is defined by a set of scalar material "
20  "properties that summed together define the volumetric change. This "
21  "also computes the derivatives of that eigenstrain with respect to a "
22  "supplied set of variable dependencies.");
23  params.addRequiredParam<std::vector<MaterialPropertyName>>(
24  "volumetric_materials", "List of scalar material properties defining the volumetric change");
25  params.addRequiredCoupledVar("args", "variable dependencies for the volumetric_expansion");
26  return params;
27 }
void addRequiredParam(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _d2elastic_strain

std::vector<std::vector<MaterialProperty<RankTwoTensor> *> > ComputeVolumetricEigenstrain::_d2elastic_strain
protected

second derivatives of the elastic strain with respect to the args

Definition at line 48 of file ComputeVolumetricEigenstrain.h.

Referenced by ComputeVolumetricEigenstrain(), and initialSetup().

◆ _d2volumetric_materials

std::vector<std::vector<std::vector<const MaterialProperty<Real> *> > > ComputeVolumetricEigenstrain::_d2volumetric_materials
protected

second derivatives of the volumetric materials with respect to the args

Definition at line 43 of file ComputeVolumetricEigenstrain.h.

Referenced by ComputeVolumetricEigenstrain().

◆ _delastic_strain

std::vector<MaterialProperty<RankTwoTensor> *> ComputeVolumetricEigenstrain::_delastic_strain
protected

first derivatives of the elastic strain with respect to the args

Definition at line 46 of file ComputeVolumetricEigenstrain.h.

Referenced by ComputeVolumetricEigenstrain(), and initialSetup().

◆ _dvolumetric_materials

std::vector<std::vector<const MaterialProperty<Real> *> > ComputeVolumetricEigenstrain::_dvolumetric_materials
protected

first derivatives of the volumetric materials with respect to the args

Definition at line 41 of file ComputeVolumetricEigenstrain.h.

Referenced by ComputeVolumetricEigenstrain().

◆ _num_args

const unsigned int ComputeVolumetricEigenstrain::_num_args
protected

number of variables the material depends on

Definition at line 33 of file ComputeVolumetricEigenstrain.h.

Referenced by ComputeVolumetricEigenstrain(), and initialSetup().

◆ _volumetric_material_names

const std::vector<MaterialPropertyName> ComputeVolumetricEigenstrain::_volumetric_material_names
protected

Names of the material properties that define volumetric change.

Definition at line 36 of file ComputeVolumetricEigenstrain.h.

Referenced by ComputeVolumetricEigenstrain(), and initialSetup().

◆ _volumetric_materials

std::vector<const MaterialProperty<Real> *> ComputeVolumetricEigenstrain::_volumetric_materials
protected

The material properties that define volumetric change.

Definition at line 38 of file ComputeVolumetricEigenstrain.h.

Referenced by computeQpEigenstrain(), and ComputeVolumetricEigenstrain().


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