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

#include <ComputeReducedOrderEigenstrain.h>

Inheritance diagram for ComputeReducedOrderEigenstrain:
[legend]

Public Member Functions

 ComputeReducedOrderEigenstrain (const InputParameters &parameters)
 
void initQpStatefulProperties ()
 
void computeProperties ()
 
void computeQpEigenstrain ()
 Compute the eigenstrain and store in _eigenstrain. More...
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual void computeQpProperties ()
 
Real computeVolumetricStrainComponent (const Real volumetric_strain) const
 Helper function for models that compute the eigenstrain based on a volumetric strain. More...
 

Protected Attributes

const std::string _base_name
 Base name prepended to material property name. More...
 
std::string _eigenstrain_name
 Material property name for the eigenstrain tensor. More...
 
MaterialProperty< RankTwoTensor > & _eigenstrain
 Stores the current total eigenstrain. More...
 
bool & _step_zero
 Restartable data to check for the zeroth and first time steps for thermal calculations. More...
 

Private Member Functions

void applyEigenstrain (MaterialProperty< RankTwoTensor > &strain)
 Subtract adjusted eigenstrain from strain. More...
 
void sumEigenstrain ()
 Add contributions from every eigenstrain at each integration point. More...
 
void prepareEigenstrain ()
 Compute either the volume average or linear eigenstrain field in an element. More...
 

Private Attributes

std::vector< MaterialPropertyName > _input_eigenstrain_names
 
std::vector< const MaterialProperty< RankTwoTensor > * > _eigenstrains
 
SubProblem & _subproblem
 
const unsigned _ncols
 Number of columns in A matrix (1 plus mesh dimension) More...
 
const bool _second_order
 Whether the mesh is made of second order elements. More...
 
std::vector< RankTwoTensor_eigsum
 The sum of all eigenstrains at each integration point. More...
 
DenseMatrix< Real > _A
 The (num q points x ncols) array for the least squares. Holds 1, xcoor, ycoor, zcoor. More...
 
std::vector< DenseVector< Real > > _b
 The b array holding the unique eigenstrain components for each integration point. More...
 
DenseMatrix< Real > _AT
 Transpose of A. More...
 
DenseVector< Real > _ATb
 Transpose of A times b. More...
 
std::vector< DenseVector< Real > > _x
 The solution vector for each unique component of the adjusted eigenstrain. More...
 
std::vector< Real > _vals
 Vector to hold the adjusted strain as computed with _x. More...
 
RankTwoTensor _adjusted_eigenstrain
 Filled with _vals and subracted from strain. More...
 

Detailed Description

Definition at line 28 of file ComputeReducedOrderEigenstrain.h.

Constructor & Destructor Documentation

◆ ComputeReducedOrderEigenstrain()

ComputeReducedOrderEigenstrain::ComputeReducedOrderEigenstrain ( const InputParameters &  parameters)

Definition at line 30 of file ComputeReducedOrderEigenstrain.C.

31  : ComputeEigenstrainBase(parameters),
33  getParam<std::vector<MaterialPropertyName>>("input_eigenstrain_names")),
35  _subproblem(*parameters.get<SubProblem *>("_subproblem")),
36  _ncols(1 + _subproblem.mesh().dimension()),
37  _second_order(_subproblem.mesh().hasSecondOrderElements()),
38  _eigsum(),
39  _A(),
40  _b(6),
41  _AT(),
42  _ATb(_ncols),
43  _x(6, DenseVector<Real>(_ncols)),
44  _vals(6),
46 {
47  for (unsigned int i = 0; i < _eigenstrains.size(); ++i)
48  {
50  _eigenstrains[i] = &getMaterialProperty<RankTwoTensor>(_input_eigenstrain_names[i]);
51  }
52 }

Member Function Documentation

◆ applyEigenstrain()

void ComputeReducedOrderEigenstrain::applyEigenstrain ( MaterialProperty< RankTwoTensor > &  strain)
private

Subtract adjusted eigenstrain from strain.

◆ computeProperties()

void ComputeReducedOrderEigenstrain::computeProperties ( )

Definition at line 61 of file ComputeReducedOrderEigenstrain.C.

62 {
64 
66 
67  Material::computeProperties();
68 }

◆ computeQpEigenstrain()

void ComputeReducedOrderEigenstrain::computeQpEigenstrain ( )
virtual

Compute the eigenstrain and store in _eigenstrain.

Implements ComputeEigenstrainBase.

Definition at line 71 of file ComputeReducedOrderEigenstrain.C.

72 {
73  if (_second_order)
74  {
75  for (unsigned i = 0; i < 6; ++i)
76  {
77  _vals[i] = _x[i](0);
78  for (unsigned j = 1; j < _ncols; ++j)
79  _vals[i] += _x[i](j) * _q_point[_qp](j - 1);
80  }
81  _adjusted_eigenstrain.fillFromInputVector(_vals);
82  }
84 }

◆ computeQpProperties()

void ComputeEigenstrainBase::computeQpProperties ( )
protectedvirtualinherited

Definition at line 49 of file ComputeEigenstrainBase.C.

50 {
51  if (_t_step >= 1)
52  _step_zero = false;
53 
54  // Skip the eigenstrain calculation in step zero because no solution is computed during
55  // the zeroth step, hence computing the eigenstrain in the zeroth step would result in
56  // an incorrect calculation of mechanical_strain, which is stateful.
57  if (!_step_zero)
59 }

◆ computeVolumetricStrainComponent()

Real ComputeEigenstrainBase::computeVolumetricStrainComponent ( const Real  volumetric_strain) const
protectedinherited

Helper function for models that compute the eigenstrain based on a volumetric strain.

This function computes the diagonal components of the eigenstrain tensor as logarithmic strains.

Parameters
volumetric_strainThe current volumetric strain to be applied
Returns
Current strain in one direction due to volumetric strain, expressed as a logarithmic strain

Definition at line 62 of file ComputeEigenstrainBase.C.

63 {
64  // The engineering strain in a given direction is:
65  // epsilon_eng = cbrt(volumetric_strain + 1.0) - 1.0
66  //
67  // We need to provide this as a logarithmic strain to be consistent with the strain measure
68  // used for finite strain:
69  // epsilon_log = log(1.0 + epsilon_eng)
70  //
71  // This can be simplified down to a more direct form:
72  // epsilon_log = log(cbrt(volumetric_strain + 1.0))
73  // or:
74  // epsilon_log = (1/3) log(volumetric_strain + 1.0)
75 
76  return std::log(volumetric_strain + 1.0) / 3.0;
77 }

◆ initQpStatefulProperties()

void ComputeReducedOrderEigenstrain::initQpStatefulProperties ( )
virtual

Reimplemented from ComputeEigenstrainBase.

Definition at line 55 of file ComputeReducedOrderEigenstrain.C.

56 {
57  _eigenstrain[_qp].zero();
58 }

◆ prepareEigenstrain()

void ComputeReducedOrderEigenstrain::prepareEigenstrain ( )
private

Compute either the volume average or linear eigenstrain field in an element.

Definition at line 99 of file ComputeReducedOrderEigenstrain.C.

100 {
101  // The eigenstrains can either be constant in an element or linear in x, y, z
102  // If constant, do volume averaging.
103  if (!_second_order || _qrule->n_points() == 1)
104  {
105  // Volume average
106  _adjusted_eigenstrain.zero();
107  Real vol = 0.0;
108  for (unsigned qp = 0; qp < _qrule->n_points(); ++qp)
109  {
110  _adjusted_eigenstrain += _eigsum[qp] * _JxW[qp] * _coord[qp];
111  vol += _JxW[qp] * _coord[qp];
112  }
113  _adjusted_eigenstrain /= vol;
114  }
115  else
116  {
117  // 1 x y z
118 
119  // Six sets (one for each unique component of eigen) of qp data
120  _A.resize(_qrule->n_points(), _ncols);
121  for (auto && b : _b)
122  b.resize(_qrule->n_points());
123 
124  for (unsigned qp = 0; qp < _qrule->n_points(); ++qp)
125  {
126  _A(qp, 0) = 1.0;
127  for (unsigned j = 1; j < _ncols; ++j)
128  _A(qp, j) = _q_point[qp](j - 1);
129 
130  _b[0](qp) = _eigsum[qp](0, 0);
131  _b[1](qp) = _eigsum[qp](1, 1);
132  _b[2](qp) = _eigsum[qp](2, 2);
133  _b[3](qp) = _eigsum[qp](1, 2);
134  _b[4](qp) = _eigsum[qp](0, 2);
135  _b[5](qp) = _eigsum[qp](0, 1);
136  }
137 
138  _A.get_transpose(_AT);
139  _A.left_multiply(_AT);
140  for (unsigned i = 0; i < 6; ++i)
141  {
142  _AT.vector_mult(_ATb, _b[i]);
143 
144  _A.cholesky_solve(_ATb, _x[i]);
145  }
146  }
147 }

Referenced by computeProperties().

◆ sumEigenstrain()

void ComputeReducedOrderEigenstrain::sumEigenstrain ( )
private

Add contributions from every eigenstrain at each integration point.

Definition at line 87 of file ComputeReducedOrderEigenstrain.C.

88 {
89  _eigsum.resize(_qrule->n_points());
90  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
91  {
92  _eigsum[_qp].zero();
93  for (auto es : _eigenstrains)
94  _eigsum[_qp] += (*es)[_qp];
95  }
96 }

Referenced by computeProperties().

◆ validParams()

InputParameters ComputeReducedOrderEigenstrain::validParams ( )
static

Definition at line 20 of file ComputeReducedOrderEigenstrain.C.

21 {
22  InputParameters params = ComputeEigenstrainBase::validParams();
23  params.addClassDescription("accepts eigenstrains and computes a reduced order eigenstrain for "
24  "consistency in the order of strain and eigenstrains.");
25  params.addRequiredParam<std::vector<MaterialPropertyName>>(
26  "input_eigenstrain_names", "List of eigenstrains to be applied in this strain calculation");
27  return params;
28 }

Member Data Documentation

◆ _A

DenseMatrix<Real> ComputeReducedOrderEigenstrain::_A
private

The (num q points x ncols) array for the least squares. Holds 1, xcoor, ycoor, zcoor.

Definition at line 60 of file ComputeReducedOrderEigenstrain.h.

Referenced by prepareEigenstrain().

◆ _adjusted_eigenstrain

RankTwoTensor ComputeReducedOrderEigenstrain::_adjusted_eigenstrain
private

Filled with _vals and subracted from strain.

Definition at line 72 of file ComputeReducedOrderEigenstrain.h.

Referenced by computeQpEigenstrain(), and prepareEigenstrain().

◆ _AT

DenseMatrix<Real> ComputeReducedOrderEigenstrain::_AT
private

Transpose of A.

Definition at line 64 of file ComputeReducedOrderEigenstrain.h.

Referenced by prepareEigenstrain().

◆ _ATb

DenseVector<Real> ComputeReducedOrderEigenstrain::_ATb
private

Transpose of A times b.

Definition at line 66 of file ComputeReducedOrderEigenstrain.h.

Referenced by prepareEigenstrain().

◆ _b

std::vector<DenseVector<Real> > ComputeReducedOrderEigenstrain::_b
private

The b array holding the unique eigenstrain components for each integration point.

Definition at line 62 of file ComputeReducedOrderEigenstrain.h.

Referenced by prepareEigenstrain().

◆ _base_name

const std::string ComputeEigenstrainBase::_base_name
protectedinherited

Base name prepended to material property name.

Definition at line 41 of file ComputeEigenstrainBase.h.

Referenced by ComputeReducedOrderEigenstrain().

◆ _eigenstrain

MaterialProperty<RankTwoTensor>& ComputeEigenstrainBase::_eigenstrain
protectedinherited

◆ _eigenstrain_name

std::string ComputeEigenstrainBase::_eigenstrain_name
protectedinherited

Material property name for the eigenstrain tensor.

Definition at line 44 of file ComputeEigenstrainBase.h.

◆ _eigenstrains

std::vector<const MaterialProperty<RankTwoTensor> *> ComputeReducedOrderEigenstrain::_eigenstrains
private

◆ _eigsum

std::vector<RankTwoTensor> ComputeReducedOrderEigenstrain::_eigsum
private

The sum of all eigenstrains at each integration point.

Definition at line 58 of file ComputeReducedOrderEigenstrain.h.

Referenced by prepareEigenstrain(), and sumEigenstrain().

◆ _input_eigenstrain_names

std::vector<MaterialPropertyName> ComputeReducedOrderEigenstrain::_input_eigenstrain_names
private

Definition at line 49 of file ComputeReducedOrderEigenstrain.h.

Referenced by ComputeReducedOrderEigenstrain().

◆ _ncols

const unsigned ComputeReducedOrderEigenstrain::_ncols
private

Number of columns in A matrix (1 plus mesh dimension)

Definition at line 54 of file ComputeReducedOrderEigenstrain.h.

Referenced by computeQpEigenstrain(), and prepareEigenstrain().

◆ _second_order

const bool ComputeReducedOrderEigenstrain::_second_order
private

Whether the mesh is made of second order elements.

Definition at line 56 of file ComputeReducedOrderEigenstrain.h.

Referenced by computeQpEigenstrain(), and prepareEigenstrain().

◆ _step_zero

bool& ComputeEigenstrainBase::_step_zero
protectedinherited

Restartable data to check for the zeroth and first time steps for thermal calculations.

Definition at line 60 of file ComputeEigenstrainBase.h.

Referenced by ComputeEigenstrainBase::computeQpProperties().

◆ _subproblem

SubProblem& ComputeReducedOrderEigenstrain::_subproblem
private

Definition at line 52 of file ComputeReducedOrderEigenstrain.h.

◆ _vals

std::vector<Real> ComputeReducedOrderEigenstrain::_vals
private

Vector to hold the adjusted strain as computed with _x.

Definition at line 70 of file ComputeReducedOrderEigenstrain.h.

Referenced by computeQpEigenstrain().

◆ _x

std::vector<DenseVector<Real> > ComputeReducedOrderEigenstrain::_x
private

The solution vector for each unique component of the adjusted eigenstrain.

Definition at line 68 of file ComputeReducedOrderEigenstrain.h.

Referenced by computeQpEigenstrain(), and prepareEigenstrain().


The documentation for this class was generated from the following files:
ComputeReducedOrderEigenstrain::_AT
DenseMatrix< Real > _AT
Transpose of A.
Definition: ComputeReducedOrderEigenstrain.h:64
ComputeReducedOrderEigenstrain::_x
std::vector< DenseVector< Real > > _x
The solution vector for each unique component of the adjusted eigenstrain.
Definition: ComputeReducedOrderEigenstrain.h:68
ComputeReducedOrderEigenstrain::_A
DenseMatrix< Real > _A
The (num q points x ncols) array for the least squares. Holds 1, xcoor, ycoor, zcoor.
Definition: ComputeReducedOrderEigenstrain.h:60
ComputeReducedOrderEigenstrain::_vals
std::vector< Real > _vals
Vector to hold the adjusted strain as computed with _x.
Definition: ComputeReducedOrderEigenstrain.h:70
ComputeReducedOrderEigenstrain::prepareEigenstrain
void prepareEigenstrain()
Compute either the volume average or linear eigenstrain field in an element.
Definition: ComputeReducedOrderEigenstrain.C:99
ComputeReducedOrderEigenstrain::_second_order
const bool _second_order
Whether the mesh is made of second order elements.
Definition: ComputeReducedOrderEigenstrain.h:56
ComputeEigenstrainBase::_base_name
const std::string _base_name
Base name prepended to material property name.
Definition: ComputeEigenstrainBase.h:41
ComputeEigenstrainBase::validParams
static InputParameters validParams()
Definition: ComputeEigenstrainBase.C:17
ComputeEigenstrainBase::ComputeEigenstrainBase
ComputeEigenstrainBase(const InputParameters &parameters)
Definition: ComputeEigenstrainBase.C:31
ComputeEigenstrainBase::_step_zero
bool & _step_zero
Restartable data to check for the zeroth and first time steps for thermal calculations.
Definition: ComputeEigenstrainBase.h:60
ComputeReducedOrderEigenstrain::_subproblem
SubProblem & _subproblem
Definition: ComputeReducedOrderEigenstrain.h:52
ComputeEigenstrainBase::computeQpEigenstrain
virtual void computeQpEigenstrain()=0
Compute the eigenstrain and store in _eigenstrain.
ComputeReducedOrderEigenstrain::_ncols
const unsigned _ncols
Number of columns in A matrix (1 plus mesh dimension)
Definition: ComputeReducedOrderEigenstrain.h:54
ComputeReducedOrderEigenstrain::_eigsum
std::vector< RankTwoTensor > _eigsum
The sum of all eigenstrains at each integration point.
Definition: ComputeReducedOrderEigenstrain.h:58
ComputeReducedOrderEigenstrain::_b
std::vector< DenseVector< Real > > _b
The b array holding the unique eigenstrain components for each integration point.
Definition: ComputeReducedOrderEigenstrain.h:62
ComputeReducedOrderEigenstrain::sumEigenstrain
void sumEigenstrain()
Add contributions from every eigenstrain at each integration point.
Definition: ComputeReducedOrderEigenstrain.C:87
ComputeReducedOrderEigenstrain::_adjusted_eigenstrain
RankTwoTensor _adjusted_eigenstrain
Filled with _vals and subracted from strain.
Definition: ComputeReducedOrderEigenstrain.h:72
ComputeReducedOrderEigenstrain::_ATb
DenseVector< Real > _ATb
Transpose of A times b.
Definition: ComputeReducedOrderEigenstrain.h:66
ComputeReducedOrderEigenstrain::_eigenstrains
std::vector< const MaterialProperty< RankTwoTensor > * > _eigenstrains
Definition: ComputeReducedOrderEigenstrain.h:50
ComputeReducedOrderEigenstrain::_input_eigenstrain_names
std::vector< MaterialPropertyName > _input_eigenstrain_names
Definition: ComputeReducedOrderEigenstrain.h:49
ComputeEigenstrainBase::_eigenstrain
MaterialProperty< RankTwoTensor > & _eigenstrain
Stores the current total eigenstrain.
Definition: ComputeEigenstrainBase.h:47