www.mooseframework.org
LineMaterialRankTwoScalarSampler.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("Compute a scalar property of a RankTwoTensor");
17  params.addParam<MooseEnum>(
18  "scalar_type", RankTwoScalarTools::scalarOptions(), "A scalar to ouput");
19  params.addParam<Point>(
20  "point1",
21  Point(0, 0, 0),
22  "Start point for axis used to calculate some cylinderical material tensor quantities");
23  params.addParam<Point>("point2",
24  Point(0, 1, 0),
25  "End point for axis used to calculate some material tensor quantities");
26  params.addParam<Point>("direction", Point(0, 0, 1), "Direction vector");
27  return params;
28 }
29 
31  const InputParameters & parameters)
32  : LineMaterialSamplerBase<RankTwoTensor>(parameters),
33  _scalar_type(getParam<MooseEnum>("scalar_type")),
34  _point1(parameters.get<Point>("point1")),
35  _point2(parameters.get<Point>("point2")),
36  _direction(parameters.get<Point>("direction") / parameters.get<Point>("direction").norm())
37 {
38 }
39 
40 Real
42  const Point & curr_point)
43 {
45  property, _scalar_type, _point1, _point2, curr_point, _direction);
46 }
InputParameters validParams< LineMaterialRankTwoScalarSampler >()
LineMaterialRankTwoScalarSampler(const InputParameters &parameters)
Class constructor Sets up variables for output based on the properties to be output.
Real getQuantity(const RankTwoTensor &tensor, const MooseEnum scalar_type, const Point &point1, const Point &point2, const Point &curr_point, Point &direction)
virtual Real getScalarFromProperty(const RankTwoTensor &property, const Point &curr_point)
Reduce the RankTwoTensor material property to a scalar for output Call through to RankTwoScalarTools:...