https://mooseframework.inl.gov
MandelConverter.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 "MandelConverter.h"
11 
16 
17 template <typename T, bool symmetrize>
20 {
22  params.addClassDescription("Converts material property of type " +
23  demangle(typeid(FromType).name()) + " to type " +
24  demangle(typeid(ToType).name()));
25  params.addRequiredParam<MaterialPropertyName>("from", "Material property to convert from");
26  params.addRequiredParam<MaterialPropertyName>("to", "Material property to convert to");
27  return params;
28 }
29 
30 template <typename T, bool symmetrize>
32  : Material(params),
33  _from(getMaterialProperty<FromType>("from")),
34  _to(declareProperty<ToType>("to"))
35 {
36 }
37 
38 template <typename T, bool symmetrize>
39 void
41 {
42  computeQpProperties();
43 }
44 
45 template <typename T, bool symmetrize>
46 void
48 {
49  _to[_qp] = ToType(_from[_qp]);
50 }
51 
MandelConverter(const InputParameters &parameters)
registerMooseObject("SolidMechanicsApp", RankTwoTensorToSymmetricRankTwoTensor)
typename MandelConversion< T, symmetrize >::from FromType
void addRequiredParam(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
void initQpStatefulProperties() override
typename MandelConversion< T, symmetrize >::to ToType
const std::string name
Definition: Setup.h:20
void computeQpProperties() override
static InputParameters validParams()
std::string demangle(const char *name)
Convert tensorial material properties between Mandel notation and full notation.
void addClassDescription(const std::string &doc_string)