24 "A list of functions describing the initial stress. There must be 9 of these, corresponding " 25 "to the xx, yx, zx, xy, yy, zy, xz, yz, zz components respectively. To compute the " 26 "eigenstrain correctly, your elasticity tensor should not be time-varying in the first " 29 "A list of 9 AuxVariables describing the initial stress. If provided, each " 30 "of these is multiplied by its corresponding initial_stress function to " 31 "obtain the relevant component of initial stress.");
32 params.
addParam<std::string>(
"base_name",
33 "The base_name for the elasticity tensor that will be " 34 "used to compute strain from stress. Do not provide " 35 "any base_name if your elasticity tensor does not use " 43 _base_name(isParamValid(
"base_name") ? getParam<
std::string>(
"base_name") +
"_" :
""),
44 _elasticity_tensor(getMaterialPropertyByName<
RankFourTensor>(_base_name +
"elasticity_tensor")),
45 _eigenstrain_old(getMaterialPropertyOld<
RankTwoTensor>(_eigenstrain_name)),
46 _ini_aux_provided(isParamValid(
"initial_stress_aux")),
47 _ini_aux(_ini_aux_provided ? coupledValues(
"initial_stress_aux")
50 const std::vector<FunctionName> & fcn_names(
51 getParam<std::vector<FunctionName>>(
"initial_stress"));
52 const std::size_t num = fcn_names.size();
54 if (num != LIBMESH_DIM * LIBMESH_DIM)
57 "ComputeEigenstrainFromInitialStress: " +
Moose::stringify(LIBMESH_DIM * LIBMESH_DIM) +
58 " initial stress functions must be provided. You supplied " +
Moose::stringify(num) +
62 for (
unsigned i = 0; i < num; ++i)
68 if (aux_size != LIBMESH_DIM * LIBMESH_DIM)
70 "ComputeEigenstrainFromInitialStress: If you supply initial_stress_aux, " +
82 for (
unsigned i = 0; i < LIBMESH_DIM; ++i)
83 for (
unsigned j = 0;
j < LIBMESH_DIM; ++
j)
87 initial_stress(i,
j) *= (*
_ini_aux[i * LIBMESH_DIM +
j])[
_qp];
const MooseArray< Point > & _q_point
const bool _ini_aux_provided
Whether the user has supplied AuxVariables representing the initial stress.
registerMooseObject("SolidMechanicsApp", ComputeEigenstrainFromInitialStress)
ComputeEigenstrainFromInitialStress(const InputParameters ¶meters)
static InputParameters validParams()
std::vector< const Function * > _initial_stress_fcn
initial stress components
static InputParameters validParams()
const T & getParam(const std::string &name) const
ComputeEigenstrainBase is the base class for eigenstrain tensors.
void paramError(const std::string ¶m, Args... args) const
std::string stringify(const T &t)
ComputeEigenstrain computes an Eigenstrain that results from an initial stress The initial stress is ...
OutputTools< Real >::VariableValue VariableValue
unsigned int coupledComponents(const std::string &var_name) const
const Function & getFunctionByName(const FunctionName &name) const
GenericMaterialProperty< RankTwoTensor, is_ad > & _eigenstrain
Stores the current total eigenstrain.
const std::vector< const VariableValue * > _ini_aux
AuxVariables defining the initial stress.
const MaterialProperty< RankTwoTensor > & _eigenstrain_old
Stores the total eigenstrain in the previous step.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
const MaterialProperty< RankFourTensor > & _elasticity_tensor
elasticity tensor used to convert stress to strain
virtual void computeQpEigenstrain() override
Compute the eigenstrain and store in _eigenstrain.