www.mooseframework.org
ComputeEigenstrain.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
10 #include "ComputeEigenstrain.h"
11 
12 registerMooseObject("SolidMechanicsApp", ComputeEigenstrain);
13 registerMooseObject("SolidMechanicsApp", ADComputeEigenstrain);
14 
15 template <bool is_ad>
18 {
20  params.addClassDescription("Computes a constant Eigenstrain");
21  params.addRequiredParam<std::vector<Real>>(
22  "eigen_base", "Vector of values defining the constant base tensor for the Eigenstrain");
23  params.addParam<MaterialPropertyName>(
24  "prefactor", 1.0, "Name of material property defining the variable dependence");
25  return params;
26 }
27 
28 template <bool is_ad>
30  : ComputeEigenstrainBaseTempl<is_ad>(parameters),
31  _prefactor(this->template getGenericMaterialProperty<Real, is_ad>("prefactor"))
32 {
33  _eigen_base_tensor.fillFromInputVector(this->template getParam<std::vector<Real>>("eigen_base"));
34 }
35 
36 template <bool is_ad>
37 void
39 {
40  // Define Eigenstrain
41  _eigenstrain[_qp] = _eigen_base_tensor * _prefactor[_qp];
42 }
static InputParameters validParams()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
virtual void computeQpEigenstrain() override
Compute the eigenstrain and store in _eigenstrain.
ComputeEigenstrainTempl(const InputParameters &parameters)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void fillFromInputVector(const std::vector< Real > &input, FillMethod fill_method=autodetect)
static InputParameters validParams()
const T & getParam(const std::string &name) const
ComputeEigenstrainBase is the base class for eigenstrain tensors.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
RankTwoTensor _eigen_base_tensor
void addClassDescription(const std::string &doc_string)
registerMooseObject("SolidMechanicsApp", ComputeEigenstrain)
ComputeEigenstrain computes an Eigenstrain that is a function of a single variable defined by a base ...