www.mooseframework.org
MaterialSymmElasticityTensorAux.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 /*************************************************************************
8 *
9 * Welcome to HYRAX!
10 * Andrea M. Jokisaari
11 * CASL/MOOSE
12 *
13 * 18 April 2012
14 *
15 *************************************************************************/
16 
18 
19 template <>
20 InputParameters
22 {
23  InputParameters params = validParams<AuxKernel>();
24  // name of the material property of symm elasticity tensor type (probably "elasticity_tensor")
25  params.addRequiredParam<std::string>("tensor_matpro",
26  "The SymmElasticityTensor material property name");
27  params.addRequiredParam<int>("index", "The matrix index (0-20) to output");
28 
29  return params;
30 }
31 
33  : AuxKernel(parameters),
34  _tensor_matpro(getParam<std::string>("tensor_matpro")),
35  _index(getParam<int>("index")),
36  _tensor_prop(getMaterialProperty<SymmElasticityTensor>(_tensor_matpro))
37 {
38  if (_index < 0 || _index > 20)
39  mooseError("Please check your index specified for MaterialSymmElasticityTensorAux (between 0 "
40  "and 20).");
41 }
42 
43 Real
45 {
46  return (_tensor_prop[_qp]).valueAtIndex(_index);
47 }
This class defines a basic set of capabilities any elasticity tensor should have. ...
MaterialSymmElasticityTensorAux(const InputParameters &parameters)
InputParameters validParams< MaterialSymmElasticityTensorAux >()
const MaterialProperty< SymmElasticityTensor > & _tensor_prop