11 #include "PostprocessorInterface.h"
12 #include "SamplerBase.h"
25 params.addRequiredParam<std::vector<PostprocessorName>>(
26 "postprocessors",
"The postprocessors whose values are to be reported");
27 params.addRequiredParam<UserObjectName>(
"crack_front_definition",
28 "The CrackFrontDefinition user object name");
29 MooseEnum position_type(
"Angle Distance",
"Distance");
30 params.addParam<MooseEnum>(
33 "The method used to calculate position along crack front. Options are: " +
34 position_type.getRawNames());
35 params.addClassDescription(
"Outputs the values of a set of domain integral postprocessors as a "
36 "vector, along with their positions along the crack front.");
42 : GeneralVectorPostprocessor(parameters),
43 SamplerBase(parameters, this, _communicator),
45 _position_type(getParam<MooseEnum>(
"position_type"))
47 std::vector<PostprocessorName> pps_names(
48 getParam<std::vector<PostprocessorName>>(
"postprocessors"));
49 for (
unsigned int i = 0; i < pps_names.size(); ++i)
51 if (!hasPostprocessorByName(pps_names[i]))
52 mooseError(
"In CrackDataSampler, postprocessor with name: ", pps_names[i],
" does not exist");
55 std::vector<std::string> var_names;
56 var_names.push_back(
name());
57 SamplerBase::setupVariables(var_names);
65 mooseError(
"In CrackDataSampler, number of crack front nodes != number of domain integral "
69 "In CrackDataSampler, 'position_type = Angle' specified, but angle is not available. ",
70 "Must specify 'crack_mouth_boundary' in CrackFrontDefinition");
71 SamplerBase::initialize();
77 if (processor_id() == 0)
79 std::vector<Real> values;
91 addSample(*crack_front_point, position, values);
99 SamplerBase::finalize();