21 params.
addRequiredParam<FunctionName>(
"function",
"The weighting function.");
27 "Reporter with point data. " 28 "<reporter>/<name>.");
29 params.
addRequiredParam<std::string>(
"property_name",
"Material property base name");
31 "Offset locations for function evaluations");
40 _prop_name(getParam<
std::string>(
"property_name")),
41 _material(declareGenericProperty<
Real, is_ad>(_prop_name)),
42 _read_in_points(isParamValid(
"point_name")),
43 _coordx(isParamValid(
"x_coord_name")
46 _coordy(isParamValid(
"y_coord_name")
49 _coordz(isParamValid(
"z_coord_name")
52 _points(_read_in_points
55 _func(getFunction(
"function"))
59 paramError(
"Either supply x,y, and z reporters or a point reporter.");
67 auto num_pts = _read_in_points ? _points.size() : _coordx.size();
69 mooseAssert((_coordx.size() == _coordy.size()) && (_coordx.size() == _coordz.size()),
70 "Size of the coordinate offsets don't match.");
75 Point offset = _read_in_points ? _points[
idx] : Point(_coordx[
idx], _coordy[
idx], _coordz[
idx]);
77 _material[_qp] += computeOffsetFunction(offset);
85 return _func.value(_t, _q_point[_qp] - point_offset);
This class defines a material with an associated offset function.
static InputParameters validParams()
bool isParamValid(const std::string &name) const
Real computeOffsetFunction(const Point &point_offset)
Calculates the value of the function at the given offset point.
static InputParameters validParams()
virtual void computeQpProperties() override
ReporterOffsetFunctionMaterialTempl(const InputParameters ¶meters)
void paramError(const std::string ¶m, Args... args) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)
const ReporterMode REPORTER_MODE_REPLICATED
registerMooseObject("OptimizationApp", ReporterOffsetFunctionMaterial)