www.mooseframework.org
MaterialTensorAux.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 #include "MaterialTensorAux.h"
9 #include "SymmTensor.h"
10 
11 template <>
12 InputParameters
14 {
15  InputParameters params = validParams<AuxKernel>();
17  params.addRequiredParam<MaterialPropertyName>("tensor", "The material tensor name.");
18  params.addParam<unsigned int>("qp_select", "The quad point you want evaluated");
19  params.addClassDescription(
20  "Outputs quantities related to second-order tensors used as material properties");
21  return params;
22 }
23 
24 MaterialTensorAux::MaterialTensorAux(const InputParameters & parameters)
25  : AuxKernel(parameters),
26  _material_tensor_calculator(parameters),
27  _tensor(getMaterialProperty<SymmTensor>("tensor")),
28  _has_qp_select(isParamValid("qp_select")),
29  _qp_select(_has_qp_select ? getParam<unsigned int>("qp_select") : 0)
30 {
31 }
32 
33 Real
35 {
36  RealVectorValue direction;
37  unsigned int qp_call;
38 
39  if (_has_qp_select)
40  {
41  if (_qp_select < _q_point.size())
42  qp_call = _qp_select;
43  else
44  {
45  Moose::err << "qp_select = " << _qp_select << std::endl;
46  Moose::err << "qp = " << _qp << std::endl;
47  Moose::err << "q_point.size() = " << _q_point.size() << std::endl;
48  mooseError("The parameter qp_select is not valid");
49  }
50  }
51  else
52  qp_call = _qp;
53 
54  Real value =
55  _material_tensor_calculator.getTensorQuantity(_tensor[qp_call], _q_point[qp_call], direction);
56  return value;
57 }
InputParameters validParams< MaterialTensorCalculator >()
Real getTensorQuantity(const SymmTensor &tensor, const Point &curr_point, RealVectorValue &direction)
const MaterialProperty< SymmTensor > & _tensor
MaterialTensorAux(const InputParameters &parameters)
const unsigned int _qp_select
const bool _has_qp_select
MaterialTensorCalculator _material_tensor_calculator
InputParameters validParams< MaterialTensorAux >()
virtual Real computeValue()