www.mooseframework.org
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
RankTwoScalarAux Class Reference

RankTwoScalarAux uses the namespace RankTwoScalarTools to compute scalar values from Rank-2 tensors. More...

#include <RankTwoScalarAux.h>

Inheritance diagram for RankTwoScalarAux:
[legend]

Public Member Functions

 RankTwoScalarAux (const InputParameters &parameters)
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual Real computeValue ()
 

Protected Attributes

const MaterialProperty< RankTwoTensor > & _tensor
 
MooseEnum _scalar_type
 Determines the information to be extracted from the tensor by using the RankTwoScalarTools namespace, e.g., vonMisesStressL2norm, MaxPrincipal eigenvalue, etc. More...
 
const bool _has_selected_qp
 whether or not selected_qp has been set More...
 
const unsigned int _selected_qp
 The std::vector will be evaluated at this quadpoint only if defined. More...
 
const Point _point1
 
const Point _point2
 
Point _input_direction
 

Detailed Description

RankTwoScalarAux uses the namespace RankTwoScalarTools to compute scalar values from Rank-2 tensors.

Definition at line 24 of file RankTwoScalarAux.h.

Constructor & Destructor Documentation

◆ RankTwoScalarAux()

RankTwoScalarAux::RankTwoScalarAux ( const InputParameters &  parameters)

Definition at line 44 of file RankTwoScalarAux.C.

45  : NodalPatchRecovery(parameters),
46  _tensor(getMaterialProperty<RankTwoTensor>("rank_two_tensor")),
47  _scalar_type(getParam<MooseEnum>("scalar_type")),
48  _has_selected_qp(isParamValid("selected_qp")),
49  _selected_qp(_has_selected_qp ? getParam<unsigned int>("selected_qp") : 0),
50  _point1(parameters.get<Point>("point1")),
51  _point2(parameters.get<Point>("point2")),
52  _input_direction(parameters.get<Point>("direction") / parameters.get<Point>("direction").norm())
53 {
54 }

Member Function Documentation

◆ computeValue()

Real RankTwoScalarAux::computeValue ( )
protectedvirtual

Definition at line 57 of file RankTwoScalarAux.C.

58 {
59  unsigned int qp = _qp;
60  if (_has_selected_qp)
61  {
62  if (_selected_qp >= _q_point.size())
63  {
64  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
65  mooseError("RankTwoScalarAux. selected_qp specified as ",
67  " but there are only ",
68  _q_point.size(),
69  " quadpoints in the element");
70  }
71  qp = _selected_qp;
72  }
73 
75  _tensor[qp], _scalar_type, _point1, _point2, _q_point[qp], _input_direction);
76 }

◆ validParams()

InputParameters RankTwoScalarAux::validParams ( )
static

Definition at line 18 of file RankTwoScalarAux.C.

19 {
20  InputParameters params = NodalPatchRecovery::validParams();
21  params.addClassDescription("Compute a scalar property of a RankTwoTensor");
22  params.addRequiredParam<MaterialPropertyName>("rank_two_tensor",
23  "The rank two material tensor name");
24  params.addParam<MooseEnum>(
25  "scalar_type", RankTwoScalarTools::scalarOptions(), "Type of scalar output");
26  params.addParam<unsigned int>(
27  "selected_qp",
28  "Evaluate the tensor at this quadpoint. This option only needs to be used if "
29  "you are interested in a particular quadpoint in each element: otherwise do "
30  "not include this parameter in your input file");
31  params.addParamNamesToGroup("selected_qp", "Advanced");
32 
33  params.addParam<Point>(
34  "point1",
35  Point(0, 0, 0),
36  "Start point for axis used to calculate some cylindrical material tensor quantities");
37  params.addParam<Point>("point2",
38  Point(0, 1, 0),
39  "End point for axis used to calculate some material tensor quantities");
40  params.addParam<Point>("direction", Point(0, 0, 1), "Direction vector");
41  return params;
42 }

Member Data Documentation

◆ _has_selected_qp

const bool RankTwoScalarAux::_has_selected_qp
protected

whether or not selected_qp has been set

Definition at line 43 of file RankTwoScalarAux.h.

Referenced by computeValue().

◆ _input_direction

Point RankTwoScalarAux::_input_direction
protected

Definition at line 50 of file RankTwoScalarAux.h.

Referenced by computeValue().

◆ _point1

const Point RankTwoScalarAux::_point1
protected

Definition at line 48 of file RankTwoScalarAux.h.

Referenced by computeValue().

◆ _point2

const Point RankTwoScalarAux::_point2
protected

Definition at line 49 of file RankTwoScalarAux.h.

Referenced by computeValue().

◆ _scalar_type

MooseEnum RankTwoScalarAux::_scalar_type
protected

Determines the information to be extracted from the tensor by using the RankTwoScalarTools namespace, e.g., vonMisesStressL2norm, MaxPrincipal eigenvalue, etc.

Definition at line 40 of file RankTwoScalarAux.h.

Referenced by computeValue().

◆ _selected_qp

const unsigned int RankTwoScalarAux::_selected_qp
protected

The std::vector will be evaluated at this quadpoint only if defined.

Definition at line 46 of file RankTwoScalarAux.h.

Referenced by computeValue().

◆ _tensor

const MaterialProperty<RankTwoTensor>& RankTwoScalarAux::_tensor
protected

Definition at line 34 of file RankTwoScalarAux.h.

Referenced by computeValue().


The documentation for this class was generated from the following files:
RankTwoScalarTools::getQuantity
T getQuantity(const RankTwoTensorTempl< T > &tensor, const MooseEnum &scalar_type, const Point &point1, const Point &point2, const Point &curr_point, Point &direction)
Definition: RankTwoScalarTools.h:420
RankTwoScalarAux::_tensor
const MaterialProperty< RankTwoTensor > & _tensor
Definition: RankTwoScalarAux.h:34
RankTwoScalarAux::_has_selected_qp
const bool _has_selected_qp
whether or not selected_qp has been set
Definition: RankTwoScalarAux.h:43
validParams
InputParameters validParams()
RankTwoScalarAux::_scalar_type
MooseEnum _scalar_type
Determines the information to be extracted from the tensor by using the RankTwoScalarTools namespace,...
Definition: RankTwoScalarAux.h:40
RankTwoScalarAux::_point2
const Point _point2
Definition: RankTwoScalarAux.h:49
RankTwoScalarAux::_point1
const Point _point1
Definition: RankTwoScalarAux.h:48
RankTwoScalarTools::scalarOptions
MooseEnum scalarOptions()
Definition: RankTwoScalarTools.C:16
RankTwoScalarAux::_input_direction
Point _input_direction
Definition: RankTwoScalarAux.h:50
RankTwoScalarAux::_selected_qp
const unsigned int _selected_qp
The std::vector will be evaluated at this quadpoint only if defined.
Definition: RankTwoScalarAux.h:46