www.mooseframework.org
ComputeElasticityTensor.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 
11 #include "RotationTensor.h"
12 
13 registerMooseObject("SolidMechanicsApp", ComputeElasticityTensor);
15 
16 template <bool is_ad>
19 {
21  params.addClassDescription("Compute an elasticity tensor.");
22  params.addRequiredParam<std::vector<Real>>("C_ijkl", "Stiffness tensor for material");
23  params.addParam<MooseEnum>(
24  "fill_method", RankFourTensor::fillMethodEnum() = "symmetric9", "The fill method");
25  return params;
26 }
27 
28 template <bool is_ad>
30  const InputParameters & parameters)
31  : ComputeRotatedElasticityTensorBaseTempl<is_ad>(parameters),
32  _Cijkl(this->template getParam<std::vector<Real>>("C_ijkl"),
33  (RankFourTensor::FillMethod)(int)this->template getParam<MooseEnum>("fill_method"))
34 {
35  if (!isParamValid("elasticity_tensor_prefactor"))
37 
38  if (_Cijkl.isIsotropic())
40  else
41  {
42  // Use user-provided rotation matrix if given
43  if (parameters.isParamValid("rotation_matrix"))
45  else
46  {
47  // Define a rotation according to Euler angle parameters
48  RotationTensor R(_Euler_angles); // R type: RealTensorValue
49 
50  // rotate elasticity tensor
51  _Cijkl.rotate(R);
52  }
53  }
54 }
55 
56 template <bool is_ad>
57 void
59 {
60  // Assign elasticity tensor at a given quad point
61  _elasticity_tensor[_qp] = _Cijkl;
62 }
63 
registerMooseObject("SolidMechanicsApp", ComputeElasticityTensor)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void issueGuarantee(const MaterialPropertyName &prop_name, Guarantee guarantee)
virtual void computeQpElasticityTensor() override
ComputeRotatedElasticityTensorBase is an intermediate base class that rotates an elasticity tensor ba...
void addRequiredParam(const std::string &name, const std::string &doc_string)
bool isParamValid(const std::string &name) const
RankFourTensor _Cijkl
Individual material information.
ComputeElasticityTensor defines an elasticity tensor material object with a given base name...
bool isIsotropic() const
void rotate(const TypeTensor< T > &R)
This is a RealTensor version of a rotation matrix It is instantiated with the Euler angles...
static const std::string R
Definition: NS.h:147
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
const InputParameters & parameters() const
static MooseEnum fillMethodEnum()
ComputeElasticityTensorTempl(const InputParameters &parameters)
void ErrorVector unsigned int
bool isParamValid(const std::string &name) const