www.mooseframework.org
ConstantAnisotropicMobility.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 /****************************************************************/
8 
9 template <>
10 InputParameters
12 {
13  InputParameters params = validParams<Material>();
14  params.addClassDescription("Provide a constant mobility tensor value");
15  params.addRequiredParam<MaterialPropertyName>("M_name",
16  "Name of the mobility tensor porperty to generate");
17  params.addRequiredRangeCheckedParam<std::vector<Real>>(
18  "tensor", "tensor_size=9", "Tensor values");
19  return params;
20 }
21 
23  : Material(parameters),
24  _M_values(getParam<std::vector<Real>>("tensor")),
25  _M_name(getParam<MaterialPropertyName>("M_name")),
26  _M(declareProperty<RealTensorValue>(_M_name))
27 {
28 }
29 
30 void
32 {
33  _M.resize(_fe_problem.getMaxQps());
34  for (unsigned int qp = 0; qp < _M.size(); ++qp)
35  for (unsigned int a = 0; a < LIBMESH_DIM; ++a)
36  for (unsigned int b = 0; b < LIBMESH_DIM; ++b)
37  _M[qp](a, b) = _M_values[a * 3 + b];
38 }
InputParameters validParams< ConstantAnisotropicMobility >()
std::vector< Real > _M_values
raw tensor values as passed in from the input file
MaterialProperty< RealTensorValue > & _M
ConstantAnisotropicMobility(const InputParameters &parameters)