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

CrackDataSampler is a type of VectorPostprocessor that outputs the values of domain integrals, printed along with positions and angles along the crack front. More...

#include <CrackDataSampler.h>

Inheritance diagram for CrackDataSampler:
[legend]

Public Member Functions

 CrackDataSampler (const InputParameters &parameters)
 Class constructor. More...
 
virtual ~CrackDataSampler ()
 Destructor. More...
 
virtual void initialize ()
 Initialize, clears the postprocessor vector. More...
 
virtual void execute ()
 Populates the postprocessor vector of values with the supplied postprocessors. More...
 
virtual void finalize ()
 

Protected Attributes

const CrackFrontDefinition *const _crack_front_definition
 
MooseEnum _position_type
 
std::vector< const PostprocessorValue * > _domain_integral_postprocessor_values
 The vector of PostprocessorValue objects that are used to get the values of the domain integral postprocessors. More...
 

Detailed Description

CrackDataSampler is a type of VectorPostprocessor that outputs the values of domain integrals, printed along with positions and angles along the crack front.

Definition at line 26 of file CrackDataSampler.h.

Constructor & Destructor Documentation

CrackDataSampler::CrackDataSampler ( const InputParameters &  parameters)

Class constructor.

Parameters
parametersThe input parameters

Definition at line 36 of file CrackDataSampler.C.

37  : GeneralVectorPostprocessor(parameters),
38  SamplerBase(parameters, this, _communicator),
39  _crack_front_definition(&getUserObject<CrackFrontDefinition>("crack_front_definition")),
40  _position_type(getParam<MooseEnum>("position_type"))
41 {
42  std::vector<PostprocessorName> pps_names(
43  getParam<std::vector<PostprocessorName>>("postprocessors"));
44  for (unsigned int i = 0; i < pps_names.size(); ++i)
45  {
46  if (!hasPostprocessorByName(pps_names[i]))
47  mooseError("In CrackDataSampler, postprocessor with name: ", pps_names[i], " does not exist");
48  _domain_integral_postprocessor_values.push_back(&getPostprocessorValueByName(pps_names[i]));
49  }
50  std::vector<std::string> var_names;
51  var_names.push_back(name());
52  SamplerBase::setupVariables(var_names);
53 }
std::vector< const PostprocessorValue * > _domain_integral_postprocessor_values
The vector of PostprocessorValue objects that are used to get the values of the domain integral postp...
const CrackFrontDefinition *const _crack_front_definition
MooseEnum _position_type
virtual CrackDataSampler::~CrackDataSampler ( )
inlinevirtual

Destructor.

Definition at line 38 of file CrackDataSampler.h.

38 {}

Member Function Documentation

void CrackDataSampler::execute ( )
virtual

Populates the postprocessor vector of values with the supplied postprocessors.

Definition at line 70 of file CrackDataSampler.C.

Referenced by ~CrackDataSampler().

71 {
72  if (processor_id() == 0)
73  {
74  std::vector<Real> values;
75  for (unsigned int i = 0; i < _domain_integral_postprocessor_values.size(); ++i)
76  {
77  values.clear();
78  const Point * crack_front_point = _crack_front_definition->getCrackFrontPoint(i);
79  Real position;
80  if (_position_type == "Angle")
82  else
84 
85  values.push_back(*_domain_integral_postprocessor_values[i]);
86  addSample(*crack_front_point, position, values);
87  }
88  }
89 }
std::vector< const PostprocessorValue * > _domain_integral_postprocessor_values
The vector of PostprocessorValue objects that are used to get the values of the domain integral postp...
const Point * getCrackFrontPoint(const unsigned int point_index) const
const CrackFrontDefinition *const _crack_front_definition
Real getAngleAlongFront(const unsigned int point_index) const
Real getDistanceAlongFront(const unsigned int point_index) const
MooseEnum _position_type
void CrackDataSampler::finalize ( )
virtual

Definition at line 92 of file CrackDataSampler.C.

Referenced by ~CrackDataSampler().

93 {
94  SamplerBase::finalize();
95 }
void CrackDataSampler::initialize ( )
virtual

Initialize, clears the postprocessor vector.

Definition at line 56 of file CrackDataSampler.C.

Referenced by ~CrackDataSampler().

57 {
60  mooseError("In CrackDataSampler, number of crack front nodes != number of domain integral "
61  "postprocessors");
63  mooseError(
64  "In CrackDataSampler, 'position_type = Angle' specified, but angle is not available. ",
65  "Must specify 'crack_mouth_boundary' in CrackFrontDefinition");
66  SamplerBase::initialize();
67 }
std::vector< const PostprocessorValue * > _domain_integral_postprocessor_values
The vector of PostprocessorValue objects that are used to get the values of the domain integral postp...
unsigned int getNumCrackFrontPoints() const
const CrackFrontDefinition *const _crack_front_definition
MooseEnum _position_type

Member Data Documentation

const CrackFrontDefinition* const CrackDataSampler::_crack_front_definition
protected

Definition at line 53 of file CrackDataSampler.h.

Referenced by execute(), and initialize().

std::vector<const PostprocessorValue *> CrackDataSampler::_domain_integral_postprocessor_values
protected

The vector of PostprocessorValue objects that are used to get the values of the domain integral postprocessors.

Definition at line 58 of file CrackDataSampler.h.

Referenced by CrackDataSampler(), execute(), and initialize().

MooseEnum CrackDataSampler::_position_type
protected

Definition at line 55 of file CrackDataSampler.h.

Referenced by execute(), and initialize().


The documentation for this class was generated from the following files: