https://mooseframework.inl.gov
LineMaterialRankTwoScalarSampler.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
11 #include "RankTwoScalarTools.h"
12 
14 
17 {
19  params.addClassDescription("Compute a scalar property of a RankTwoTensor");
20  params.addParam<MooseEnum>(
21  "scalar_type", RankTwoScalarTools::scalarOptions(), "A scalar to output");
22  params.addParam<Point>(
23  "point1",
24  Point(0, 0, 0),
25  "Start point for axis used to calculate some cylindrical material tensor quantities");
26  params.addParam<Point>("point2",
27  Point(0, 1, 0),
28  "End point for axis used to calculate some material tensor quantities");
29  params.addParam<Point>("direction", Point(0, 0, 1), "Direction vector");
30  return params;
31 }
32 
34  const InputParameters & parameters)
36  _scalar_type(getParam<MooseEnum>("scalar_type")),
37  _point1(parameters.get<Point>("point1")),
38  _point2(parameters.get<Point>("point2")),
39  _direction(parameters.get<Point>("direction") / parameters.get<Point>("direction").norm())
40 {
41 }
42 
43 Real
45  const Point & curr_point)
46 {
48  property, _scalar_type, _point1, _point2, curr_point, _direction);
49 }
T getQuantity(const RankTwoTensorTempl< T > &tensor, const MooseEnum &scalar_type, const Point &point1, const Point &point2, const Point &curr_point, Point &direction)
registerMooseObject("SolidMechanicsApp", LineMaterialRankTwoScalarSampler)
static InputParameters validParams()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
MooseEnum scalarOptions()
This enum is left for legacy calls.
LineMaterialRankTwoScalarSampler(const InputParameters &parameters)
Class constructor Sets up variables for output based on the properties to be output.
auto norm(const T &a) -> decltype(std::abs(a))
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
This class samples RankTwoTensor material properties for the integration points in all elements that ...
void addClassDescription(const std::string &doc_string)
virtual Real getScalarFromProperty(const RankTwoTensor &property, const Point &curr_point)
Reduce the RankTwoTensor material property to a scalar for output Call through to RankTwoScalarTools:...
const Elem & get(const ElemType type_in)