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 28 of file CrackDataSampler.h.

Constructor & Destructor Documentation

◆ CrackDataSampler()

CrackDataSampler::CrackDataSampler ( const InputParameters &  parameters)

Class constructor.

Parameters
parametersThe input parameters

Definition at line 40 of file CrackDataSampler.C.

41  : GeneralVectorPostprocessor(parameters),
42  SamplerBase(parameters, this, _communicator),
43  _crack_front_definition(&getUserObject<CrackFrontDefinition>("crack_front_definition")),
44  _position_type(getParam<MooseEnum>("position_type"))
45 {
46  std::vector<PostprocessorName> pps_names(
47  getParam<std::vector<PostprocessorName>>("postprocessors"));
48  for (unsigned int i = 0; i < pps_names.size(); ++i)
49  {
50  if (!hasPostprocessorByName(pps_names[i]))
51  mooseError("In CrackDataSampler, postprocessor with name: ", pps_names[i], " does not exist");
52  _domain_integral_postprocessor_values.push_back(&getPostprocessorValueByName(pps_names[i]));
53  }
54  std::vector<std::string> var_names;
55  var_names.push_back(name());
56  SamplerBase::setupVariables(var_names);
57 }
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
const std::string name
Definition: Setup.h:22
MooseEnum _position_type

◆ ~CrackDataSampler()

virtual CrackDataSampler::~CrackDataSampler ( )
inlinevirtual

Destructor.

Definition at line 40 of file CrackDataSampler.h.

40 {}

Member Function Documentation

◆ execute()

void CrackDataSampler::execute ( )
virtual

Populates the postprocessor vector of values with the supplied postprocessors.

Definition at line 74 of file CrackDataSampler.C.

75 {
76  if (processor_id() == 0)
77  {
78  std::vector<Real> values;
79  for (unsigned int i = 0; i < _domain_integral_postprocessor_values.size(); ++i)
80  {
81  values.clear();
82  const Point * crack_front_point = _crack_front_definition->getCrackFrontPoint(i);
83  Real position;
84  if (_position_type == "Angle")
86  else
88 
89  values.push_back(*_domain_integral_postprocessor_values[i]);
90  addSample(*crack_front_point, position, values);
91  }
92  }
93 }
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
Real getDistanceAlongFront(const unsigned int point_index) const
MooseEnum _position_type
Real getAngleAlongFront(const unsigned int point_index) const
const Point * getCrackFrontPoint(const unsigned int point_index) const

◆ finalize()

void CrackDataSampler::finalize ( )
virtual

Definition at line 96 of file CrackDataSampler.C.

97 {
98  SamplerBase::finalize();
99 }

◆ initialize()

void CrackDataSampler::initialize ( )
virtual

Initialize, clears the postprocessor vector.

Definition at line 60 of file CrackDataSampler.C.

61 {
64  mooseError("In CrackDataSampler, number of crack front nodes != number of domain integral "
65  "postprocessors");
67  mooseError(
68  "In CrackDataSampler, 'position_type = Angle' specified, but angle is not available. ",
69  "Must specify 'crack_mouth_boundary' in CrackFrontDefinition");
70  SamplerBase::initialize();
71 }
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

◆ _crack_front_definition

const CrackFrontDefinition* const CrackDataSampler::_crack_front_definition
protected

Definition at line 55 of file CrackDataSampler.h.

Referenced by execute(), and initialize().

◆ _domain_integral_postprocessor_values

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 60 of file CrackDataSampler.h.

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

◆ _position_type

MooseEnum CrackDataSampler::_position_type
protected

Definition at line 57 of file CrackDataSampler.h.

Referenced by execute(), and initialize().


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