https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ComputeEigenstrain.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
10#include "ComputeEigenstrain.h"
11
14
15template <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
28template <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
36template <bool is_ad>
37void
39{
40 // Define Eigenstrain
41 _eigenstrain[_qp] = _eigen_base_tensor * _prefactor[_qp];
42}
registerMooseObject("SolidMechanicsApp", ComputeEigenstrain)
ComputeEigenstrainBase is the base class for eigenstrain tensors.
static InputParameters validParams()
ComputeEigenstrain computes an Eigenstrain that is a function of a single variable defined by a base ...
static InputParameters validParams()
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 addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
const T & getParam(const std::string &name) const
void fillFromInputVector(const std::vector< T > &input, FillMethod fill_method=autodetect)