23 "value_name",
"reporter value name. This uses the reporter syntax <reporter>/<name>.");
26 "reporter x-coordinate name. This uses the reporter syntax <reporter>/<name>.");
29 "reporter y-coordinate name. This uses the reporter syntax <reporter>/<name>.");
32 "reporter z-coordinate name. This uses the reporter syntax <reporter>/<name>.");
34 "reporter point name. This uses the reporter syntax " 35 "<reporter>/<name>.");
37 "Name of vector-postprocessor or reporter vector containing " 38 "weights to scale value, default is assumed to be all 1s.");
39 params.
addParam<
bool>(
"combine_duplicates",
41 "Whether or not to combine duplicates internally by summing their values " 42 "times their weights");
49 params.
set<
bool>(
"drop_duplicate_points") =
true;
57 _combine_duplicates(getParam<bool>(
"combine_duplicates")),
58 _read_in_points(isParamValid(
"point_name")),
60 _ones_vec(_values.size(), 1.0),
61 _zeros_vec(_values.size(), 0.0),
62 _zeros_pts(_values.size(), Point()),
63 _coordx(isParamValid(
"x_coord_name")
66 _coordy(isParamValid(
"y_coord_name")
69 _coordz(isParamValid(
"z_coord_name")
72 _point(_read_in_points
75 _weight(isParamValid(
"weight_name")
81 paramError(
"Either supply x,y, and z reporters or a point reporter.");
89 const auto nval =
_values.size();
91 paramError(
"value_name",
"Value vector must not be empty.");
112 std::vector<Point> points(
_coordx.size());
139 "combine_duplicates must be true if reporter has duplicate points. Found " 144 auto &
value = it->second;
151 const auto nval =
_values.size();
152 if (reporterSize != nval)
158 ") does not match number of entries read for value_name (",
void addPoint(const Elem *elem, Point p, unsigned id=libMesh::invalid_uint)
Add the physical x,y,z point located in the element "elem" to the list of points this DiracKernel wil...
const OutputTools< T >::VariableTestValue & _test
Values of test functions at QPs.
ReporterPointSource(const InputParameters ¶meters)
const std::vector< Point > & _point
xyz point
virtual void addPoints() override
This is where the DiracKernel should call addPoint() for each point it needs to have a value distribu...
std::unordered_map< Point, Real > _point_to_weightedValue
map from an added point to it's weighted value
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
virtual Real computeQpResidual() override
This is the virtual that derived classes should override for computing the residual.
const std::vector< Real > & _coordx
x coordinate
registerMooseObject("MooseApp", ReporterPointSource)
A ReporterPointSource DiracKernel is used to create variable valued point sources.
Interface to allow object to consume Reporter values.
std::vector< Real > _ones_vec
convenience vectors (these are not const because reporters can change their size) ...
std::vector< Point > _zeros_pts
virtual const OutputTools< T >::VariableValue & value()
The value of the variable this object is operating on.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
std::vector< Real > _zeros_vec
void errorCheck(const std::string &input_name, std::size_t reporterSize)
A DiracKernel is used when you need to add contributions to the residual by means of multiplying some...
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const std::vector< Real > & _coordy
y coordinate
unsigned int _qp
Quadrature point index.
const bool _read_in_points
bool if data format read in is points
const std::vector< Real > & _values
values at each xyz coordinate
const ReporterMode REPORTER_MODE_REPLICATED
const bool _combine_duplicates
bool if duplicate points values and weights should be combined
unsigned int _i
i-th, j-th index for enumerating shape and test functions
void fillPoint(const Point &point, const dof_id_type id)
Add points and check for duplicate points.
const std::vector< Real > & _weight
weights to scale value by
auto index_range(const T &sizable)
The Reporter system is comprised of objects that can contain any number of data values.
Point _current_point
The current point.
static InputParameters validParams()
const std::vector< Real > & _coordz
z coordinate