https://mooseframework.inl.gov
ComputeCrystalPlasticityEigenstrainBase.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 
15 {
17 
18  // The return stress increment classes are intended to be iterative materials, so must set compute
19  // = false for all inheriting classes
20  params.set<bool>("compute") = false;
21  params.suppressParameter<bool>("compute");
22 
23  params.addRequiredParam<std::string>(
24  "deformation_gradient_name",
25  "Material property name for the deformation gradient tensor computed "
26  "by this model.");
27  return params;
28 }
29 
31  const InputParameters & parameters)
32  : ComputeEigenstrainBase(parameters),
33  _deformation_gradient_name(_base_name + getParam<std::string>("deformation_gradient_name")),
34  _deformation_gradient(declareProperty<RankTwoTensor>(_deformation_gradient_name)),
35  _deformation_gradient_old(getMaterialPropertyOld<RankTwoTensor>(_deformation_gradient_name)),
36  _crysrot(getMaterialProperty<RankTwoTensor>(
37  "crysrot")) // defined in the elasticity tensor classes for crystal plasticity
38 {
39 }
40 
41 void
43 {
45 
46  // Initialize deformation gradient to be identity
47  _deformation_gradient[_qp].zero();
48  _deformation_gradient[_qp].addIa(1.0);
49 }
50 
51 void
53 {
54  // updates the deformation gradient from the child class
56  // use the updated deformation gradient for the eigenstrain calculation
59 }
60 
61 void
63 {
64  _qp = qp;
65 }
66 
67 void
69 {
70  _substep_dt = substep_dt;
71 }
72 
73 const RankTwoTensor
75 {
76  return _deformation_gradient[_qp];
77 }
78 
79 const RankTwoTensor
81 {
82  return _deformation_gradient[_qp].inverse();
83 }
void setSubstepDt(const Real &substep_dt)
Sets the value of the _substep_dt for inheriting classes.
T & set(const std::string &name, bool quiet_mode=false)
static RankTwoTensorTempl Identity()
void addRequiredParam(const std::string &name, const std::string &doc_string)
void suppressParameter(const std::string &name)
void computeQpEigenstrain() override
Compute the eigenstrain and store in _eigenstrain.
unsigned int _qp
static InputParameters validParams()
virtual void computeQpDeformationGradient()=0
Compute the deformation gradient and store in _deformation_gradient.
ComputeCrystalPlasticityEigenstrainBase(const InputParameters &parameters)
ComputeEigenstrainBase is the base class for eigenstrain tensors.
Real _substep_dt
Substepping time step value used within the inheriting crystal plasticity eigenstrain calculations...
virtual void initQpStatefulProperties() override
We need to set initial values for deforamtion gradients too.
GenericMaterialProperty< RankTwoTensor, is_ad > & _eigenstrain
Stores the current total eigenstrain.
MaterialProperty< RankTwoTensor > & _deformation_gradient
Stores the deformation gradient.
void setQp(const unsigned int &qp)
Sets the value of the global variable _qp for inheriting classes.
virtual void initQpStatefulProperties() override