https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
TotalLagrangianStressDivergenceBaseS< G > Class Template Reference

Enforce equilibrium with a total Lagrangian formulation. More...

#include <TotalLagrangianStressDivergenceBaseS.h>

Inheritance diagram for TotalLagrangianStressDivergenceBaseS< G >:
[legend]

Public Types

typedef std::vector< intJvarMap
 

Public Member Functions

 TotalLagrangianStressDivergenceBaseS (const InputParameters &parameters)
 
virtual void initialSetup () override
 
template<>
InputParameters validParams ()
 
template<>
void initialSetup ()
 
template<>
InputParameters validParams ()
 
template<>
void initialSetup ()
 
template<>
InputParameters validParams ()
 
template<>
void initialSetup ()
 
virtual void computeOffDiagJacobian (unsigned int jvar) override
 
unsigned int mapJvarToCvar (unsigned int jvar)
 
int mapJvarToCvar (unsigned int jvar, const JvarMap &jvar_map)
 
bool mapJvarToCvar (unsigned int jvar, unsigned int &cvar)
 
const JvarMapgetJvarMap ()
 
const JvarMapgetParameterJvarMap (std::string parameter_name)
 

Static Public Member Functions

static InputParameters baseParams ()
 
static InputParameters validParams ()
 

Protected Member Functions

virtual RankTwoTensor gradTest (unsigned int component) override
 
virtual RankTwoTensor gradTrial (unsigned int component) override
 
virtual void precalculateJacobianDisplacement (unsigned int component) override
 Prepare the average shape function gradients for stabilization. More...
 
virtual Real computeQpResidual () override
 
virtual Real computeQpJacobianDisplacement (unsigned int alpha, unsigned int beta) override
 
virtual Real computeQpJacobianTemperature (unsigned int cvar) override
 
virtual Real computeQpJacobianOutOfPlaneStrain () override
 
virtual void precalculateJacobian () override
 
virtual void precalculateOffDiagJacobian (unsigned int jvar) override
 
virtual Real computeQpJacobian () override
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar) override
 

Protected Attributes

const MaterialProperty< RankTwoTensor > & _pk1
 The 1st Piola-Kirchhoff stress. More...
 
const MaterialProperty< RankFourTensor > & _dpk1
 The derivative of the PK1 stress with respect to the deformation gradient. More...
 
const bool _large_kinematics
 If true use large deformation kinematics. More...
 
const bool _stabilize_strain
 If true calculate the deformation gradient derivatives for F_bar. More...
 
const std::string _base_name
 Prepend to the material properties. More...
 
const unsigned int _alpha
 Which component of the vector residual this kernel is responsible for. More...
 
const unsigned int _ndisp
 Total number of displacements/size of residual vector. More...
 
std::vector< unsigned int_disp_nums
 The displacement numbers. More...
 
std::vector< std::vector< RankTwoTensor > > _avg_grad_trial
 
const MaterialProperty< RankTwoTensor > & _F_ust
 The unmodified deformation gradient. More...
 
const MaterialProperty< RankTwoTensor > & _F_avg
 The element-average deformation gradient. More...
 
const MaterialProperty< RankTwoTensor > & _f_inv
 The inverse increment deformation gradient. More...
 
const MaterialProperty< RankTwoTensor > & _F_inv
 The inverse deformation gradient. More...
 
const MaterialProperty< RankTwoTensor > & _F
 The actual (stabilized) deformation gradient. More...
 
const MooseVariable_temperature
 Temperature, if provided. This is used only to get the trial functions. More...
 
const MooseVariable_out_of_plane_strain
 Out-of-plane strain, if provided. More...
 
std::vector< std::vector< const MaterialProperty< RankTwoTensor > * > > _deigenstrain_dargs
 Eigenstrain derivatives wrt generate coupleds. More...
 
const unsigned int _n_args
 

Private Member Functions

virtual RankTwoTensor gradTrialUnstabilized (unsigned int component)
 The unstabilized trial function gradient. More...
 
virtual RankTwoTensor gradTrialStabilized (unsigned int component)
 The stabilized trial function gradient. More...
 

Detailed Description

template<class G>
class TotalLagrangianStressDivergenceBaseS< G >

Enforce equilibrium with a total Lagrangian formulation.

This class enforces equilibrium when used in conjunction with the corresponding strain calculator (CalculateStrainLagrangianKernel) and with either a stress calculator that provides the 1st PK stress ("pk1_stress") and the derivative of the 1st PK stress with respect to the deformation gradient ("pk1_jacobian")

This kernel should be used with the new "ComputeLagrangianStressBase" stress update system and the "ComputeLagrangianStrain" system for strains.

Definition at line 27 of file TotalLagrangianStressDivergenceBaseS.h.

Constructor & Destructor Documentation

◆ TotalLagrangianStressDivergenceBaseS()

Definition at line 23 of file TotalLagrangianStressDivergenceBaseS.C.

25  : LagrangianStressDivergenceBaseS(parameters),
26  _pk1(getMaterialPropertyByName<RankTwoTensor>(_base_name + "pk1_stress")),
27  _dpk1(getMaterialPropertyByName<RankFourTensor>(_base_name + "pk1_jacobian"))
28 {
29 }
LagrangianStressDivergenceBaseS(const InputParameters &parameters)
const std::string _base_name
Prepend to the material properties.
const MaterialProperty< RankFourTensor > & _dpk1
The derivative of the PK1 stress with respect to the deformation gradient.
const MaterialProperty< RankTwoTensor > & _pk1
The 1st Piola-Kirchhoff stress.

Member Function Documentation

◆ baseParams()

template<class G >
InputParameters TotalLagrangianStressDivergenceBaseS< G >::baseParams ( )
static

Definition at line 14 of file TotalLagrangianStressDivergenceBaseS.C.

Referenced by TotalLagrangianStressDivergenceBaseS< G >::validParams().

15 {
17  // This kernel requires use_displaced_mesh to be off
18  params.suppressParameter<bool>("use_displaced_mesh");
19  return params;
20 }
void suppressParameter(const std::string &name)

◆ computeQpJacobian()

Real LagrangianStressDivergenceBaseS::computeQpJacobian ( )
overrideprotectedvirtualinherited

Definition at line 115 of file LagrangianStressDivergenceBaseS.C.

116 {
118 }
const unsigned int _alpha
Which component of the vector residual this kernel is responsible for.
virtual Real computeQpJacobianDisplacement(unsigned int alpha, unsigned int beta)=0

◆ computeQpJacobianDisplacement()

template<class G >
Real TotalLagrangianStressDivergenceBaseS< G >::computeQpJacobianDisplacement ( unsigned int  alpha,
unsigned int  beta 
)
overrideprotectedvirtual

Implements LagrangianStressDivergenceBaseS.

Reimplemented in HomogenizedTotalLagrangianStressDivergenceA, and HomogenizedTotalLagrangianStressDivergenceR.

Definition at line 101 of file TotalLagrangianStressDivergenceBaseS.C.

103 {
104  // J_{alpha beta} = phi^alpha_{i, J} T_{iJkL} G^beta_{kL}
105  return gradTest(alpha).doubleContraction(_dpk1[_qp] * gradTrial(beta));
106 }
virtual RankTwoTensor gradTest(unsigned int component) override
Real doubleContraction(const RankTwoTensorTempl< Real > &a) const
static const std::string alpha
Definition: NS.h:134
const MaterialProperty< RankFourTensor > & _dpk1
The derivative of the PK1 stress with respect to the deformation gradient.
virtual RankTwoTensor gradTrial(unsigned int component) override

◆ computeQpJacobianOutOfPlaneStrain()

template<class G >
Real TotalLagrangianStressDivergenceBaseS< G >::computeQpJacobianOutOfPlaneStrain ( )
overrideprotectedvirtual

Implements LagrangianStressDivergenceBaseS.

Definition at line 128 of file TotalLagrangianStressDivergenceBaseS.C.

129 {
130  return _dpk1[_qp].contractionKl(2, 2, gradTest(_alpha)) * _out_of_plane_strain->phi()[_j][_qp];
131 }
const unsigned int _alpha
Which component of the vector residual this kernel is responsible for.
const MooseVariable * _out_of_plane_strain
Out-of-plane strain, if provided.
const FieldVariablePhiValue & phi() const override
virtual RankTwoTensor gradTest(unsigned int component) override
const MaterialProperty< RankFourTensor > & _dpk1
The derivative of the PK1 stress with respect to the deformation gradient.

◆ computeQpJacobianTemperature()

template<class G >
Real TotalLagrangianStressDivergenceBaseS< G >::computeQpJacobianTemperature ( unsigned int  cvar)
overrideprotectedvirtual

Implements LagrangianStressDivergenceBaseS.

Definition at line 110 of file TotalLagrangianStressDivergenceBaseS.C.

111 {
112  usingTensorIndices(i_, j_, k_, l_);
113  // Multiple eigenstrains may depend on the same coupled var
114  RankTwoTensor total_deigen;
115  for (const auto deigen_darg : _deigenstrain_dargs[cvar])
116  total_deigen += (*deigen_darg)[_qp];
117 
118  const auto A = _f_inv[_qp].inverse();
119  const auto B = _F_inv[_qp].inverse();
120  const auto U = 0.5 * (A.template times<i_, k_, l_, j_>(B) + A.template times<i_, l_, k_, j_>(B));
121 
122  return -(_dpk1[_qp] * U * total_deigen).doubleContraction(gradTest(_alpha)) *
123  _temperature->phi()[_j][_qp];
124 }
const MooseVariable * _temperature
Temperature, if provided. This is used only to get the trial functions.
const unsigned int _alpha
Which component of the vector residual this kernel is responsible for.
const MaterialProperty< RankTwoTensor > & _f_inv
The inverse increment deformation gradient.
const FieldVariablePhiValue & phi() const override
virtual RankTwoTensor gradTest(unsigned int component) override
std::vector< std::vector< const MaterialProperty< RankTwoTensor > * > > _deigenstrain_dargs
Eigenstrain derivatives wrt generate coupleds.
const MaterialProperty< RankTwoTensor > & _F_inv
The inverse deformation gradient.
const MaterialProperty< RankFourTensor > & _dpk1
The derivative of the PK1 stress with respect to the deformation gradient.

◆ computeQpOffDiagJacobian()

Real LagrangianStressDivergenceBaseS::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtualinherited

Definition at line 121 of file LagrangianStressDivergenceBaseS.C.

122 {
123  // Bail if jvar not coupled
124  if (getJvarMap()[jvar] < 0)
125  return 0.0;
126 
127  // Off diagonal terms for other displacements
128  for (auto beta : make_range(_ndisp))
129  if (jvar == _disp_nums[beta])
131 
132  // Off diagonal temperature term due to eigenstrain
133  if (_temperature && jvar == _temperature->number())
135 
136  // Off diagonal term due to weak plane stress
139 
140  return 0;
141 }
const MooseVariable * _temperature
Temperature, if provided. This is used only to get the trial functions.
std::vector< unsigned int > _disp_nums
The displacement numbers.
const unsigned int _alpha
Which component of the vector residual this kernel is responsible for.
unsigned int number() const
const MooseVariable * _out_of_plane_strain
Out-of-plane strain, if provided.
const unsigned int _ndisp
Total number of displacements/size of residual vector.
virtual Real computeQpJacobianOutOfPlaneStrain()=0
virtual Real computeQpJacobianDisplacement(unsigned int alpha, unsigned int beta)=0
virtual Real computeQpJacobianTemperature(unsigned int cvar)=0
IntRange< T > make_range(T beg, T end)

◆ computeQpResidual()

template<class G >
Real TotalLagrangianStressDivergenceBaseS< G >::computeQpResidual ( )
overrideprotectedvirtual

Reimplemented in HomogenizedTotalLagrangianStressDivergenceA, and HomogenizedTotalLagrangianStressDivergenceR.

Definition at line 94 of file TotalLagrangianStressDivergenceBaseS.C.

95 {
96  return gradTest(_alpha).doubleContraction(_pk1[_qp]);
97 }
const unsigned int _alpha
Which component of the vector residual this kernel is responsible for.
virtual RankTwoTensor gradTest(unsigned int component) override
Real doubleContraction(const RankTwoTensorTempl< Real > &a) const
const MaterialProperty< RankTwoTensor > & _pk1
The 1st Piola-Kirchhoff stress.

◆ gradTest()

template<class G >
RankTwoTensor TotalLagrangianStressDivergenceBaseS< G >::gradTest ( unsigned int  component)
overrideprotectedvirtual

◆ gradTrial()

template<class G >
RankTwoTensor TotalLagrangianStressDivergenceBaseS< G >::gradTrial ( unsigned int  component)
overrideprotectedvirtual

◆ gradTrialStabilized()

template<class G >
RankTwoTensor TotalLagrangianStressDivergenceBaseS< G >::gradTrialStabilized ( unsigned int  component)
privatevirtual

The stabilized trial function gradient.

Definition at line 56 of file TotalLagrangianStressDivergenceBaseS.C.

57 {
58  // The base unstabilized trial function gradient
59  const auto Gb = G::gradOp(component, _grad_phi[_j][_qp], _phi[_j][_qp], _q_point[_qp]);
60  // The average trial function gradient
61  const auto Ga = _avg_grad_trial[component][_j];
62 
63  // The F-bar stabilization depends on kinematics
65  {
66  // Horrible thing, see the documentation for how we get here
67  const Real dratio = std::pow(_F_avg[_qp].det() / _F_ust[_qp].det(), 1.0 / 3.0);
68  const Real fact = (_F_avg[_qp].inverse().transpose().doubleContraction(Ga) -
69  _F_ust[_qp].inverse().transpose().doubleContraction(Gb)) /
70  3.0;
71  return dratio * (Gb + fact * _F_ust[_qp]);
72  }
73 
74  // The small kinematics modification is linear
75  return Gb + (Ga.trace() - Gb.trace()) / 3.0 * RankTwoTensor::Identity();
76 }
const bool _large_kinematics
If true use large deformation kinematics.
static const std::string component
Definition: NS.h:153
static RankTwoTensorTempl Identity()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< std::vector< RankTwoTensor > > _avg_grad_trial
const MaterialProperty< RankTwoTensor > & _F_ust
The unmodified deformation gradient.
const MaterialProperty< RankTwoTensor > & _F_avg
The element-average deformation gradient.
MooseUnits pow(const MooseUnits &, int)

◆ gradTrialUnstabilized()

template<class G >
RankTwoTensor TotalLagrangianStressDivergenceBaseS< G >::gradTrialUnstabilized ( unsigned int  component)
privatevirtual

The unstabilized trial function gradient.

Definition at line 48 of file TotalLagrangianStressDivergenceBaseS.C.

49 {
50  // Without F-bar stabilization, simply return the gradient of the trial functions
51  return G::gradOp(component, _grad_phi[_j][_qp], _phi[_j][_qp], _q_point[_qp]);
52 }
static const std::string component
Definition: NS.h:153

◆ initialSetup() [1/4]

Definition at line 26 of file TotalLagrangianStressDivergenceCentrosymmetricSphericalS.h.

27 {
28  if (getBlockCoordSystem() != Moose::COORD_RSPHERICAL)
29  mooseError("This kernel should only act in centrosymmetric spherical coordinates.");
30 }
void mooseError(Args &&... args)
COORD_RSPHERICAL

◆ initialSetup() [2/4]

Definition at line 26 of file TotalLagrangianStressDivergenceS.h.

27 {
28  if (getBlockCoordSystem() != Moose::COORD_XYZ)
29  mooseError("This kernel should only act in Cartesian coordinates.");
30 }
void mooseError(Args &&... args)

◆ initialSetup() [3/4]

Definition at line 26 of file TotalLagrangianStressDivergenceAxisymmetricCylindricalS.h.

27 {
28  if (getBlockCoordSystem() != Moose::COORD_RZ)
29  mooseError("This kernel should only act in axisymmetric cylindrical coordinates.");
30 }
void mooseError(Args &&... args)

◆ initialSetup() [4/4]

template<class G >
virtual void TotalLagrangianStressDivergenceBaseS< G >::initialSetup ( )
overridevirtual

◆ precalculateJacobian()

void LagrangianStressDivergenceBaseS::precalculateJacobian ( )
overrideprotectedvirtualinherited

Definition at line 85 of file LagrangianStressDivergenceBaseS.C.

86 {
87  // Skip if we are not doing stabilization
88  if (!_stabilize_strain)
89  return;
90 
91  // We need the gradients of shape functions in the reference frame
92  _fe_problem.prepareShapes(_var.number(), _tid);
93  _avg_grad_trial[_alpha].resize(_phi.size());
95 }
const unsigned int _alpha
Which component of the vector residual this kernel is responsible for.
const bool _stabilize_strain
If true calculate the deformation gradient derivatives for F_bar.
std::vector< std::vector< RankTwoTensor > > _avg_grad_trial
virtual void precalculateJacobianDisplacement(unsigned int component)=0
Prepare the average shape function gradients for stabilization.

◆ precalculateJacobianDisplacement()

template<class G >
void TotalLagrangianStressDivergenceBaseS< G >::precalculateJacobianDisplacement ( unsigned int  component)
overrideprotectedvirtual

Prepare the average shape function gradients for stabilization.

Implements LagrangianStressDivergenceBaseS.

Definition at line 80 of file TotalLagrangianStressDivergenceBaseS.C.

81 {
82  // For total Lagrangian, the averaging is taken on the reference frame regardless of geometric
83  // nonlinearity. Convenient!
84  for (auto j : make_range(_phi.size()))
86  [this, component, j](unsigned int qp)
87  { return G::gradOp(component, _grad_phi[j][qp], _phi[j][qp], _q_point[qp]); },
88  _JxW,
89  _coord);
90 }
static const std::string component
Definition: NS.h:153
std::vector< std::vector< RankTwoTensor > > _avg_grad_trial
IntRange< T > make_range(T beg, T end)
auto elementAverage(const Functor &f, const MooseArray< Real > &JxW, const MooseArray< Real > &coord)
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")

◆ precalculateOffDiagJacobian()

void LagrangianStressDivergenceBaseS::precalculateOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtualinherited

Definition at line 98 of file LagrangianStressDivergenceBaseS.C.

99 {
100  // Skip if we are not doing stabilization
101  if (!_stabilize_strain)
102  return;
103 
104  for (auto beta : make_range(_ndisp))
105  if (jvar == _disp_nums[beta])
106  {
107  // We need the gradients of shape functions in the reference frame
108  _fe_problem.prepareShapes(jvar, _tid);
109  _avg_grad_trial[beta].resize(_phi.size());
111  }
112 }
std::vector< unsigned int > _disp_nums
The displacement numbers.
const unsigned int _ndisp
Total number of displacements/size of residual vector.
const bool _stabilize_strain
If true calculate the deformation gradient derivatives for F_bar.
std::vector< std::vector< RankTwoTensor > > _avg_grad_trial
IntRange< T > make_range(T beg, T end)
virtual void precalculateJacobianDisplacement(unsigned int component)=0
Prepare the average shape function gradients for stabilization.

◆ validParams() [1/4]

Definition at line 16 of file TotalLagrangianStressDivergenceAxisymmetricCylindricalS.h.

17 {
19  params.addClassDescription("Enforce equilibrium with a total Lagrangian formulation in "
20  "axisymmetric cylindrical coordinates.");
21  return params;
22 }
void addClassDescription(const std::string &doc_string)

◆ validParams() [2/4]

Definition at line 16 of file TotalLagrangianStressDivergenceS.h.

17 {
19  params.addClassDescription(
20  "Enforce equilibrium with a total Lagrangian formulation in Cartesian coordinates.");
21  return params;
22 }
void addClassDescription(const std::string &doc_string)

◆ validParams() [3/4]

Definition at line 16 of file TotalLagrangianStressDivergenceCentrosymmetricSphericalS.h.

17 {
19  params.addClassDescription("Enforce equilibrium with a total Lagrangian formulation in "
20  "centrosymmetric spherical coordinates.");
21  return params;
22 }
void addClassDescription(const std::string &doc_string)

◆ validParams() [4/4]

template<class G >
static InputParameters TotalLagrangianStressDivergenceBaseS< G >::validParams ( )
static

Member Data Documentation

◆ _alpha

const unsigned int LagrangianStressDivergenceBaseS::_alpha
protectedinherited

◆ _avg_grad_trial

std::vector<std::vector<RankTwoTensor> > LagrangianStressDivergenceBaseS::_avg_grad_trial
protectedinherited

◆ _base_name

const std::string LagrangianStressDivergenceBaseS::_base_name
protectedinherited

Prepend to the material properties.

Definition at line 69 of file LagrangianStressDivergenceBaseS.h.

◆ _deigenstrain_dargs

std::vector<std::vector<const MaterialProperty<RankTwoTensor> *> > LagrangianStressDivergenceBaseS::_deigenstrain_dargs
protectedinherited

Eigenstrain derivatives wrt generate coupleds.

Definition at line 107 of file LagrangianStressDivergenceBaseS.h.

Referenced by LagrangianStressDivergenceBaseS::LagrangianStressDivergenceBaseS().

◆ _disp_nums

std::vector<unsigned int> LagrangianStressDivergenceBaseS::_disp_nums
protectedinherited

◆ _dpk1

template<class G >
const MaterialProperty<RankFourTensor>& TotalLagrangianStressDivergenceBaseS< G >::_dpk1
protected

◆ _F

const MaterialProperty<RankTwoTensor>& LagrangianStressDivergenceBaseS::_F
protectedinherited

◆ _F_avg

const MaterialProperty<RankTwoTensor>& LagrangianStressDivergenceBaseS::_F_avg
protectedinherited

The element-average deformation gradient.

Definition at line 89 of file LagrangianStressDivergenceBaseS.h.

◆ _f_inv

const MaterialProperty<RankTwoTensor>& LagrangianStressDivergenceBaseS::_f_inv
protectedinherited

The inverse increment deformation gradient.

Definition at line 92 of file LagrangianStressDivergenceBaseS.h.

◆ _F_inv

const MaterialProperty<RankTwoTensor>& LagrangianStressDivergenceBaseS::_F_inv
protectedinherited

The inverse deformation gradient.

Definition at line 95 of file LagrangianStressDivergenceBaseS.h.

◆ _F_ust

const MaterialProperty<RankTwoTensor>& LagrangianStressDivergenceBaseS::_F_ust
protectedinherited

The unmodified deformation gradient.

Definition at line 86 of file LagrangianStressDivergenceBaseS.h.

◆ _large_kinematics

const bool LagrangianStressDivergenceBaseS::_large_kinematics
protectedinherited

◆ _ndisp

const unsigned int LagrangianStressDivergenceBaseS::_ndisp
protectedinherited

◆ _out_of_plane_strain

const MooseVariable* LagrangianStressDivergenceBaseS::_out_of_plane_strain
protectedinherited

Out-of-plane strain, if provided.

Definition at line 104 of file LagrangianStressDivergenceBaseS.h.

Referenced by LagrangianStressDivergenceBaseS::computeQpOffDiagJacobian().

◆ _pk1

template<class G >
const MaterialProperty<RankTwoTensor>& TotalLagrangianStressDivergenceBaseS< G >::_pk1
protected

◆ _stabilize_strain

const bool LagrangianStressDivergenceBaseS::_stabilize_strain
protectedinherited

If true calculate the deformation gradient derivatives for F_bar.

Definition at line 66 of file LagrangianStressDivergenceBaseS.h.

Referenced by LagrangianStressDivergenceBaseS::precalculateJacobian(), and LagrangianStressDivergenceBaseS::precalculateOffDiagJacobian().

◆ _temperature

const MooseVariable* LagrangianStressDivergenceBaseS::_temperature
protectedinherited

Temperature, if provided. This is used only to get the trial functions.

Definition at line 101 of file LagrangianStressDivergenceBaseS.h.

Referenced by LagrangianStressDivergenceBaseS::computeQpOffDiagJacobian().


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