https://mooseframework.inl.gov
ADComputeVolumetricEigenstrain.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
11 #include "RankTwoTensor.h"
12 
14 
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.");
21  params.addRequiredParam<std::vector<MaterialPropertyName>>(
22  "volumetric_materials", "List of scalar material properties defining the volumetric change");
23  return params;
24 }
25 
27  : ADComputeEigenstrainBase(parameters),
28  _volumetric_materials(
29  getParam<std::vector<MaterialPropertyName>>("volumetric_materials").size())
30 {
31  const auto volumetric_material_names =
32  getParam<std::vector<MaterialPropertyName>>("volumetric_materials");
33  for (unsigned int i = 0; i < volumetric_material_names.size(); ++i)
34  _volumetric_materials[i] = &getADMaterialProperty<Real>(volumetric_material_names[i]);
35 }
36 
37 void
39 {
40  ADReal volumetric_strain = 0.0;
41  for (unsigned int i = 0; i < _volumetric_materials.size(); ++i)
42  volumetric_strain += (*_volumetric_materials[i])[_qp];
43 
44  const auto eigenstrain_comp = computeVolumetricStrainComponent(volumetric_strain);
45  _eigenstrain[_qp].zero();
46  _eigenstrain[_qp].addIa(eigenstrain_comp);
47 }
std::vector< const ADMaterialProperty< Real > * > _volumetric_materials
The material properties that define volumetric change.
void addRequiredParam(const std::string &name, const std::string &doc_string)
virtual void computeQpEigenstrain()
Compute the eigenstrain and store in _eigenstrain.
unsigned int _qp
static InputParameters validParams()
GenericReal< is_ad > computeVolumetricStrainComponent(const GenericReal< is_ad > &volumetric_strain) const
Helper function for models that compute the eigenstrain based on a volumetric strain.
ComputeEigenstrainBase is the base class for eigenstrain tensors.
ADComputeVolumetricEigenstrain computes an eigenstrain that is defined by a set of scalar material pr...
GenericMaterialProperty< RankTwoTensor, is_ad > & _eigenstrain
Stores the current total eigenstrain.
void addClassDescription(const std::string &doc_string)
ADComputeVolumetricEigenstrain(const InputParameters &parameters)
registerMooseObject("SolidMechanicsApp", ADComputeVolumetricEigenstrain)