Line data Source code
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 : 12 : registerMooseObject("SolidMechanicsApp", RankTwoTensorToSymmetricRankTwoTensor); 13 : registerMooseObject("SolidMechanicsApp", SymmetricRankTwoTensorToRankTwoTensor); 14 : registerMooseObject("SolidMechanicsApp", RankFourTensorToSymmetricRankFourTensor); 15 : registerMooseObject("SolidMechanicsApp", SymmetricRankFourTensorToRankFourTensor); 16 : 17 : template <typename T, bool symmetrize> 18 : InputParameters 19 560 : MandelConverter<T, symmetrize>::validParams() 20 : { 21 560 : InputParameters params = Material::validParams(); 22 1680 : params.addClassDescription("Converts material property of type " + 23 : demangle(typeid(FromType).name()) + " to type " + 24 : demangle(typeid(ToType).name())); 25 1120 : params.addRequiredParam<MaterialPropertyName>("from", "Material property to convert from"); 26 1120 : params.addRequiredParam<MaterialPropertyName>("to", "Material property to convert to"); 27 560 : return params; 28 0 : } 29 : 30 : template <typename T, bool symmetrize> 31 420 : MandelConverter<T, symmetrize>::MandelConverter(const InputParameters & params) 32 : : Material(params), 33 420 : _from(getMaterialProperty<FromType>("from")), 34 840 : _to(declareProperty<ToType>("to")) 35 : { 36 420 : } 37 : 38 : template <typename T, bool symmetrize> 39 : void 40 2304 : MandelConverter<T, symmetrize>::initQpStatefulProperties() 41 : { 42 2304 : computeQpProperties(); 43 2304 : } 44 : 45 : template <typename T, bool symmetrize> 46 : void 47 272256 : MandelConverter<T, symmetrize>::computeQpProperties() 48 : { 49 272256 : _to[_qp] = ToType(_from[_qp]); 50 272256 : } 51 : 52 : template class MandelConverter<RankTwoTensor, true>; 53 : template class MandelConverter<RankTwoTensor, false>; 54 : template class MandelConverter<RankFourTensor, true>; 55 : template class MandelConverter<RankFourTensor, false>;