www.mooseframework.org
LineMaterialRankTwoSampler.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 
9 #include "RankTwoScalarTools.h"
10 
11 template <>
12 InputParameters
14 {
15  InputParameters params = validParams<LineMaterialSamplerBase<Real>>();
16  params.addClassDescription("Access a component of a RankTwoTensor");
17  params.addRequiredRangeCheckedParam<unsigned int>(
18  "index_i",
19  "index_i >= 0 & index_i <= 2",
20  "The index i of ij for the tensor to output (0, 1, 2)");
21  params.addRequiredRangeCheckedParam<unsigned int>(
22  "index_j",
23  "index_j >= 0 & index_j <= 2",
24  "The index j of ij for the tensor to output (0, 1, 2)");
25  return params;
26 }
27 
28 LineMaterialRankTwoSampler::LineMaterialRankTwoSampler(const InputParameters & parameters)
29  : LineMaterialSamplerBase<RankTwoTensor>(parameters),
30  _i(getParam<unsigned int>("index_i")),
31  _j(getParam<unsigned int>("index_j"))
32 {
33 }
34 
35 Real
37  const Point & /*curr_point*/)
38 {
39  return RankTwoScalarTools::component(property, _i, _j);
40 }
LineMaterialRankTwoSampler(const InputParameters &parameters)
Class constructor Sets up variables for output based on the properties to be output.
virtual Real getScalarFromProperty(const RankTwoTensor &property, const Point &curr_point)
Reduce the material property to a scalar for output Call through to RankTwoScalarTools::component() t...
Real component(const RankTwoTensor &r2tensor, unsigned int i, unsigned int j)
InputParameters validParams< LineMaterialRankTwoSampler >()