13#include "libmesh/quadrature.h"
23 "meta_data_types", meta_data_types,
"Data types that are obtained and written to file.");
24 params.
addClassDescription(
"This VectorPostprocessor collects meta data for provided sidesets.");
31 _sideset_ids(declareVector(
"Boundary IDs"))
83 "_current_boundary_id not found in _boundary_data.");
90 Point lmin = box.min();
91 Point lmax = box.max();
93 for (
unsigned int j = 0; j < 3; ++j)
95 if (lmin(j) < bd.min(j))
98 if (lmax(j) > bd.max(j))
108 auto & bd = e.second;
110 for (
unsigned int j = 0; j < 3; ++j)
120 e.second.centroid /= e.second.area;
145 mooseAssert(vpp._boundary_data.find(e.first) != vpp._boundary_data.end(),
146 "Boundary not found in threadJoin");
147 auto & vpp_bd = vpp._boundary_data.find(e.first)->second;
148 auto & bd = e.second;
150 bd.area += vpp_bd.area;
151 bd.centroid += vpp_bd.centroid;
153 for (
unsigned int j = 0; j < 3; ++j)
155 if (vpp_bd.min(j) < bd.min(j))
156 bd.min(j) = vpp_bd.min(j);
158 if (vpp_bd.max(j) > bd.max(j))
159 bd.max(j) = vpp_bd.max(j);
168 "boundary id not found in _boundary_data.");
172 if (mdat_tpe ==
"centroid_x")
173 return bd.centroid(0);
174 else if (mdat_tpe ==
"centroid_y")
175 return bd.centroid(1);
176 else if (mdat_tpe ==
"centroid_z")
177 return bd.centroid(2);
178 else if (mdat_tpe ==
"min_x")
180 else if (mdat_tpe ==
"min_y")
182 else if (mdat_tpe ==
"min_z")
184 else if (mdat_tpe ==
"max_x")
186 else if (mdat_tpe ==
"max_y")
188 else if (mdat_tpe ==
"max_z")
190 else if (mdat_tpe ==
"area")
193 mooseError(
"meta_data_type not recognized. This should never happen.");
boundary_id_type BoundaryID
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
registerMooseObject("MooseApp", SidesetInfoVectorPostprocessor)
virtual const std::set< BoundaryID > & boundaryIDs() const
Return the boundary IDs for this object.
unsigned int numBoundaryIDs() const
Return the number of boundaries for this object.
virtual unsigned int dimension() const
Returns MeshBase::mesh_dimension(), (not MeshBase::spatial_dimension()!) of the underlying libMesh me...
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type.
void push_back(const std::string &names)
Insert operators Operator to insert (push_back) values into the enum.
unsigned int size() const
Return the number of active items in the MultiMooseEnum.
const Real & _current_side_volume
const Elem *const & _current_side_elem
const BoundaryID & _current_boundary_id
static InputParameters validParams()
Computes and outputs information (area, centroid, bounding box) about sidesets.
VectorPostprocessorValue & _sideset_ids
the sideset id
SidesetInfoVectorPostprocessor(const InputParameters ¶meters)
std::map< BoundaryID, BoundaryData > _boundary_data
all data available through the meta_data_types is always accumulated
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
virtual void threadJoin(const UserObject &y) override
Must override.
virtual void finalize() override
Finalize.
static InputParameters validParams()
MultiMooseEnum _meta_data_types
the type of meta data that is written to file
Real dataHelper(BoundaryID bid, std::string mdat_tpe) const
a helper function for retrieving data from _boundary_info
virtual void execute() override
Execute method.
std::vector< VectorPostprocessorValue * > _meta_data
the vpp data is stored here
std::vector< std::string > _vpp_entry_names
the type of meta data that is written to file
void gatherSum(T &value)
Gather the parallel sum of the variable passed in.
void gatherMin(T &value)
Gather the parallel min of the variable passed in.
void gatherMax(T &value)
Gather the parallel max of the variable passed in.
Base class for user-specific data.
VectorPostprocessorValue & declareVector(const std::string &vector_name)
Register a new vector to fill up.