https://mooseframework.inl.gov
ConstantsFromElasticityTensor.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 "ElasticityTensorTools.h"
12 
13 #include "metaphysicl/raw_type.h"
14 
17 
18 template <bool is_ad>
21 {
23  params.addClassDescription("Calculate elastic constants from an isotropic elasticity tensor");
24  params.addParam<MaterialPropertyName>(
25  "elasticity_tensor", "elasticity_tensor", "The name of the elasticity tensor.");
26  params.addParam<std::string>("base_name",
27  "Optional parameter that allows the user to define "
28  "multiple mechanics material systems on the same "
29  "block, i.e. for multiple phases");
30 
31  return params;
32 }
33 
34 template <bool is_ad>
36  const InputParameters & parameters)
37  : Material(parameters),
38  GuaranteeConsumer(this),
39  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
40  _youngs_modulus(this->template declareGenericProperty<Real, is_ad>(
41  _base_name + "youngs_modulus_from_tensor")),
42  _poissons_ratio(this->template declareGenericProperty<Real, is_ad>(
43  _base_name + "poissons_ratio_from_tensor")),
44  _shear_modulus(this->template declareGenericProperty<Real, is_ad>(_base_name +
45  "shear_modulus_from_tensor")),
46  _bulk_modulus(this->template declareGenericProperty<Real, is_ad>(_base_name +
47  "bulk_modulus_from_tensor")),
48  _elasticity_tensor_name(getParam<MaterialPropertyName>("elasticity_tensor")),
49  _elasticity_tensor(this->template getGenericMaterialPropertyByName<RankFourTensor, is_ad>(
50  _base_name + _elasticity_tensor_name))
51 {
52 }
53 
54 template <bool is_ad>
55 void
57 {
58  if (!hasGuaranteedMaterialProperty(_base_name + _elasticity_tensor_name, Guarantee::ISOTROPIC))
59  mooseError("ConstantsFromElasticityTensor requires that the elasticity tensor be "
60  "guaranteed isotropic");
61 }
62 
63 template <bool is_ad>
64 void
66 {
67  const auto & elasticity_tensor = MetaPhysicL::raw_value(_elasticity_tensor[_qp]);
68 
73 }
74 
T getIsotropicShearModulus(const RankFourTensorTempl< T > &elasticity_tensor)
Get the shear modulus for an isotropic elasticity tensor param elasticity_tensor the tensor (must be ...
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void mooseError(Args &&... args)
auto raw_value(const Eigen::Map< T > &in)
This material computes the elastic constants such as Young&#39;s modulus from the elasticity tensor...
Real elasticity_tensor(unsigned int i, unsigned int j, unsigned int k, unsigned int l)
T getIsotropicBulkModulus(const RankFourTensorTempl< T > &elasticity_tensor)
Get the bulk modulus for an isotropic elasticity tensor param elasticity_tensor the tensor (must be i...
static InputParameters validParams()
registerMooseObject("SolidMechanicsApp", ConstantsFromElasticityTensor)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
T getIsotropicPoissonsRatio(const RankFourTensorTempl< T > &elasticity_tensor)
Get the Poisson&#39;s modulus for an isotropic elasticity tensor param elasticity_tensor the tensor (must...
void addClassDescription(const std::string &doc_string)
T getIsotropicYoungsModulus(const RankFourTensorTempl< T > &elasticity_tensor)
Get the Young&#39;s modulus for an isotropic elasticity tensor param elasticity_tensor the tensor (must b...
Add-on class that provides the functionality to check if guarantees for material properties are provi...
ConstantsFromElasticityTensorTempl(const InputParameters &parameters)