29 "The number of points to sample along the line");
32 "The Functions to sample along the line");
40 _start_point(getParam<Point>(
"start_point")),
41 _end_point(getParam<Point>(
"end_point")),
42 _num_points(getParam<unsigned
int>(
"num_points")),
43 _function_names(getParam<
std::vector<FunctionName>>(
"functions")),
44 _num_funcs(_function_names.size()),
45 _functions(_num_funcs),
53 std::vector<std::string> function_name_strings(
_num_funcs);
registerMooseObject("MooseApp", LineFunctionSampler)
void ErrorVector unsigned int
const Function & getFunctionByName(const FunctionName &name) const
Get a function with a given name.
This class is here to combine the VectorPostprocessor interface and the base class VectorPostprocesso...
static InputParameters validParams()
Point _end_point
End of the line.
unsigned int _num_funcs
Number of Functions we're sampling.
Point _start_point
Beginning of the line.
std::vector< Real > _ids
The ID to use for each point (yes, this is Real on purpose)
unsigned int _num_points
Number of points along the line.
std::vector< Point > _points
The points to evaluate at.
const std::vector< FunctionName > & _function_names
Names of the Functions.
std::vector< Real > _values
So we don't have to create and destroy this vector over and over again.
static InputParameters validParams()
virtual void finalize() override
Finalize.
std::vector< const Function * > _functions
Pointers to the Functions.
LineFunctionSampler(const InputParameters ¶meters)
virtual void execute() override
Execute method.
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
static void generatePointsAndIDs(const Point &start_point, const Point &end_point, unsigned int num_points, std::vector< Point > &points, std::vector< Real > &ids)
Helper function to generate the list of points along a line and a unique ID for each point.
Base class for VectorPostprocessors that need to do "sampling" of values in the domain.
virtual void addSample(const Point &p, const Real &id, const std::vector< Real > &values)
Call this with the value of every variable at each point you want to sample at.
void setupVariables(const std::vector< std::string > &variable_names)
You MUST call this in the constructor of the child class and pass down the name of the variables.
virtual void initialize()
Initialize the datastructures.
virtual void finalize()
Finalize the values.
static InputParameters validParams()
processor_id_type processor_id() const