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");
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.");
std::vector< VectorPostprocessorValue * > _meta_data
the vpp data is stored here
virtual void execute() override
Execute method.
VectorPostprocessorValue & _sideset_ids
the sideset id
Computes and outputs information (area, centroid, bounding box) about sidesets.
static InputParameters validParams()
const Elem *const & _current_side_elem
void gatherMax(T &value)
Gather the parallel max of the variable passed in.
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
std::map< BoundaryID, BoundaryData > _boundary_data
all data available through the meta_data_types is always accumulated
unsigned int size() const
Return the number of active items in the MultiMooseEnum.
std::vector< std::string > _vpp_entry_names
the type of meta data that is written to file
SidesetInfoVectorPostprocessor(const InputParameters ¶meters)
void gatherMin(T &value)
Gather the parallel min of the variable passed in.
MultiMooseEnum _meta_data_types
the type of meta data that is written to file
const Real & _current_side_volume
const BoundaryID & _current_boundary_id
void gatherSum(T &value)
Gather the parallel sum of the variable passed in.
virtual unsigned int dimension() const
Returns MeshBase::mesh_dimension(), (not MeshBase::spatial_dimension()!) of the underlying libMesh me...
boundary_id_type BoundaryID
registerMooseObject("MooseApp", SidesetInfoVectorPostprocessor)
static InputParameters validParams()
unsigned int numBoundaryIDs() const
Return the number of boundaries for this object.
VectorPostprocessorValue & declareVector(const std::string &vector_name)
Register a new vector to fill up.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void finalize() override
Finalize.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
Real dataHelper(BoundaryID bid, std::string mdat_tpe) const
a helper function for retrieving data from _boundary_info
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type...
virtual void threadJoin(const UserObject &y) override
Must override.
virtual const std::set< BoundaryID > & boundaryIDs() const
Return the boundary IDs for this object.
Base class for user-specific data.