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

#include <CrackFrontData.h>

Inheritance diagram for CrackFrontData:
[legend]

Public Member Functions

 CrackFrontData (const InputParameters &parameters)
 
virtual void initialize ()
 
virtual void execute ()
 
virtual Real getValue ()
 This will return the degrees of freedom in the system. More...
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Attributes

const CrackFrontDefinition *const _crack_front_definition
 
const unsigned int _crack_front_point_index
 
const Node * _crack_front_node
 
MooseMesh & _mesh
 
std::string _var_name
 
const Real _scale_factor
 
MooseVariable & _field_var
 

Detailed Description

Definition at line 25 of file CrackFrontData.h.

Constructor & Destructor Documentation

◆ CrackFrontData()

CrackFrontData::CrackFrontData ( const InputParameters &  parameters)

Definition at line 39 of file CrackFrontData.C.

40  : GeneralPostprocessor(parameters),
41  _crack_front_definition(&getUserObject<CrackFrontDefinition>("crack_front_definition")),
42  _crack_front_point_index(isParamValid("crack_front_point_index")
43  ? getParam<unsigned int>("crack_front_point_index")
44  : 0),
45  _crack_front_node(NULL),
46  _mesh(_subproblem.mesh()),
47  _var_name(parameters.get<VariableName>("variable")),
48  _scale_factor(getParam<Real>("scale_factor")),
49  _field_var(_subproblem.getStandardVariable(_tid, _var_name))
50 {
51  if (!_field_var.isNodal())
52  mooseError("CrackFrontData can be output only for nodal variables, variable '",
53  _var_name,
54  "' is not nodal");
55 }

Member Function Documentation

◆ execute()

virtual void CrackFrontData::execute ( )
inlinevirtual

Definition at line 33 of file CrackFrontData.h.

33 {}

◆ getValue()

Real CrackFrontData::getValue ( )
virtual

This will return the degrees of freedom in the system.

Definition at line 70 of file CrackFrontData.C.

71 {
72  Real value = 0;
73 
74  if (_crack_front_node->processor_id() == processor_id())
75  value = _field_var.getNodalValue(*_crack_front_node);
76 
77  gatherSum(value);
78 
79  return _scale_factor * value;
80 }

◆ initialize()

void CrackFrontData::initialize ( )
virtual

Definition at line 58 of file CrackFrontData.C.

59 {
60  if (!(_crack_front_point_index < _crack_front_definition->getNumCrackFrontPoints()))
61  mooseError("crack_front_point_index out of range in CrackFrontData");
63  mooseError("CrackFrontData not currently supported if crack front is defined with points "
64  "rather than nodes");
65 
67 }

◆ validParams()

InputParameters CrackFrontData::validParams ( )
static

Definition at line 24 of file CrackFrontData.C.

25 {
26  InputParameters params = GeneralPostprocessor::validParams();
27  params.addClassDescription("Determines which nodes are along the crack front");
28  params.addRequiredParam<VariableName>(
29  "variable", "The name of a variable whose value at the crack front is to be reported");
30  params.addRequiredParam<UserObjectName>("crack_front_definition",
31  "The CrackFrontDefinition user object name");
32  params.addParam<unsigned int>(
33  "crack_front_point_index",
34  "The index of the point on the crack front where data is to be reported");
35  params.addParam<Real>("scale_factor", 1, "A scale factor to be applied to the reported quantity");
36  return params;
37 }

Member Data Documentation

◆ _crack_front_definition

const CrackFrontDefinition* const CrackFrontData::_crack_front_definition
protected

Definition at line 41 of file CrackFrontData.h.

Referenced by initialize().

◆ _crack_front_node

const Node* CrackFrontData::_crack_front_node
protected

Definition at line 43 of file CrackFrontData.h.

Referenced by getValue(), and initialize().

◆ _crack_front_point_index

const unsigned int CrackFrontData::_crack_front_point_index
protected

Definition at line 42 of file CrackFrontData.h.

Referenced by initialize().

◆ _field_var

MooseVariable& CrackFrontData::_field_var
protected

Definition at line 47 of file CrackFrontData.h.

Referenced by CrackFrontData(), and getValue().

◆ _mesh

MooseMesh& CrackFrontData::_mesh
protected

Definition at line 44 of file CrackFrontData.h.

◆ _scale_factor

const Real CrackFrontData::_scale_factor
protected

Definition at line 46 of file CrackFrontData.h.

Referenced by getValue().

◆ _var_name

std::string CrackFrontData::_var_name
protected

Definition at line 45 of file CrackFrontData.h.

Referenced by CrackFrontData().


The documentation for this class was generated from the following files:
CrackFrontData::_field_var
MooseVariable & _field_var
Definition: CrackFrontData.h:47
CrackFrontData::_crack_front_point_index
const unsigned int _crack_front_point_index
Definition: CrackFrontData.h:42
CrackFrontDefinition::getCrackFrontNodePtr
const Node * getCrackFrontNodePtr(const unsigned int node_index) const
Definition: CrackFrontDefinition.C:1048
CrackFrontData::_mesh
MooseMesh & _mesh
Definition: CrackFrontData.h:44
CrackFrontData::_var_name
std::string _var_name
Definition: CrackFrontData.h:45
CrackFrontData::_scale_factor
const Real _scale_factor
Definition: CrackFrontData.h:46
CrackFrontData::_crack_front_node
const Node * _crack_front_node
Definition: CrackFrontData.h:43
validParams
InputParameters validParams()
CrackFrontData::_crack_front_definition
const CrackFrontDefinition *const _crack_front_definition
Definition: CrackFrontData.h:41
CrackFrontDefinition::hasCrackFrontNodes
bool hasCrackFrontNodes() const
Definition: CrackFrontDefinition.h:89