10#ifdef MOOSE_MFEM_ENABLED
14#include "libmesh/point.h"
25generateLinePoints(
const Point & start_point,
26 const Point & end_point,
27 unsigned int num_points,
28 const std::string & object_name)
31 mooseError(
"In MFEMVariableLineValueSampler \"",
33 "\": line must have at least 2 points, "
34 "for single points use MFEMVariablePointValueSampler.");
37 std::vector<Point> points;
38 points.reserve(num_points);
39 for (
const auto i_point : make_range(num_points))
42 Real t =
static_cast<Real
>(i_point) /
static_cast<Real
>(num_points - 1);
43 points.push_back(t * end_point + (1 - t) * start_point);
62 "The number of points to sample along the line");
71 generateLinePoints(parameters.get<Point>(
"start_point"),
72 parameters.get<Point>(
"end_point"),
73 parameters.get<unsigned
int>(
"num_points"),
74 parameters.getObjectName()))
registerMooseObject("MooseApp", MFEMVariableLineValueSampler)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
void ErrorVector unsigned int
MFEMVariableLineValueSampler(const InputParameters ¶meters)
static InputParameters validParams()
MFEM VectorPostprocessor base class for sampling a real-valued variable at a set of points.
static InputParameters validParams()