3 #include "GeneralUserObject.h" 4 #include "MaterialBase.h" 7 #include "moab/Core.hpp" 8 #include "moab/Skinner.hpp" 9 #include "moab/GeomTopoTool.hpp" 10 #include "MBTagConventions.hpp" 26 virtual void execute()
override;
39 virtual moab::ErrorCode
check(
const moab::ErrorCode input)
const;
41 std::string
materialName(
const unsigned int & block,
const unsigned int &
density,
const unsigned int & temp)
const;
57 unsigned int nBins()
const;
71 virtual unsigned int getDensityBin(
const Elem *
const elem)
const;
80 return _blocks.at(elem->subdomain_id());
108 const std::string & param_name)
const;
120 virtual unsigned int getBin(
const unsigned int & temp_bin,
121 const unsigned int & density_bin,
122 const unsigned int & subdomain_bin)
const;
153 const std::shared_ptr<moab::Interface> &
moabPtr()
const {
return _moab; }
159 std::shared_ptr<moab::Interface>
_moab;
255 void createGroup(
const unsigned int &
id,
const std::string & name, moab::EntityHandle & group_set);
258 void createVol(
const unsigned int &
id, moab::EntityHandle & volume_set, moab::EntityHandle group_set);
262 moab::EntityHandle & surface_set,
264 const std::vector<VolData> & voldata);
274 unsigned int & surf_id,
276 const Real & factor);
285 const Real & factor)
const;
294 moab::Range & surface_tris);
297 moab::EntityHandle
createTri(
const std::vector<moab::EntityHandle> & vertices,
307 setTags(moab::EntityHandle ent, std::string name, std::string category,
unsigned int id,
int dim);
310 void setTagData(moab::Tag tag, moab::EntityHandle ent, std::string data,
unsigned int SIZE);
313 void setTagData(moab::Tag tag, moab::EntityHandle ent,
void * data);
319 const std::vector<std::vector<unsigned int>> &
getTetSets(ElemType type)
const;
333 void buildGraveyard(
unsigned int & vol_id,
unsigned int & surf_id);
346 void groupLocalElems(std::set<dof_id_type> elems, std::vector<moab::Range> & localElems);
353 moab::EntityHandle group,
354 unsigned int & vol_id,
355 unsigned int & surf_id,
356 moab::EntityHandle & volume_set);
359 virtual void write();
365 std::unique_ptr<moab::GeomTopoTool>
gtt;
const Real _temperature_bin_width
Temperature bin width.
Definition: MoabSkinner.h:177
std::vector< std::string > _material_names
Definition: MoabSkinner.h:184
virtual void makeDependentOnExternalAction()
Definition: MoabSkinner.h:99
void createSurfaces(moab::Range &reversed, VolData &voldata, unsigned int &surf_id)
Helper method to create MOAB surfaces with no overlaps.
const std::vector< std::vector< unsigned int > > & getTetSets(ElemType type) const
std::shared_ptr< moab::Interface > _moab
MOAB interface.
Definition: MoabSkinner.h:159
const Real & _temperature_min
Lower bound of temperature bins.
Definition: MoabSkinner.h:168
unsigned int _density_var_num
Auxiliary variable number for density.
Definition: MoabSkinner.h:440
const Real & _temperature_max
Upper bound of temperature bins.
Definition: MoabSkinner.h:171
bool _standalone
Whether this class runs by itself, or is controlled by an external class.
Definition: MoabSkinner.h:220
std::map< moab::EntityHandle, std::vector< VolData > > surfsToVols
Save some topological data: map from surface handle to vol handle and sense.
Definition: MoabSkinner.h:401
virtual void write()
Write MOAB volume and/or skin meshes to file.
static InputParameters validParams()
std::string materialName(const unsigned int &block, const unsigned int &density, const unsigned int &temp) const
virtual unsigned int getTemperatureBin(const Elem *const elem) const
void findSurface(const moab::Range ®ion, moab::EntityHandle group, unsigned int &vol_id, unsigned int &surf_id, moab::EntityHandle &volume_set)
Find the surfaces for the provided range and add to group.
virtual void initialize() override
bool _verbose
Whether to print diagnostic information.
Definition: MoabSkinner.h:162
void createSurfaceFromBox(const BoundingBox &box, const VolData &voldata, unsigned int &surf_id, bool normalout, const Real &factor)
std::string _density_name
Name of the MOOSE variable containing the density.
Definition: MoabSkinner.h:374
virtual void update()
Perform the skinning operation.
std::vector< std::set< dof_id_type > > _elem_bins
Mapping from total bin ID to a set of elements sorted into that bin.
Definition: MoabSkinner.h:392
void createSurf(const unsigned int &id, moab::EntityHandle &surface_set, moab::Range &faces, const std::vector< VolData > &voldata)
Helper method to create MOAB surface entity set.
void findSurfaces()
Group the binned elems into local temperature regions and find their surfaces.
unsigned int _n_block_bins
Number of block bins.
Definition: MoabSkinner.h:389
std::vector< Real > _density_bin_bounds
Bounds of the density bins.
Definition: MoabSkinner.h:425
unsigned int _n_density_bins
Number of density bins.
Definition: MoabSkinner.h:386
virtual void threadJoin(const UserObject &) override
Definition: MoabSkinner.h:32
virtual void finalize() override
std::unique_ptr< moab::GeomTopoTool > gtt
Topology tool for setting surface sense.
Definition: MoabSkinner.h:365
MoabSkinner(const InputParameters ¶meters)
void setTagData(moab::Tag tag, moab::EntityHandle ent, std::string data, unsigned int SIZE)
Helper function to wrap moab::tag_set_data for a string.
unsigned int nBins() const
Definition: MoabSkinner.h:225
void groupLocalElems(std::set< dof_id_type > elems, std::vector< moab::Range > &localElems)
Real _density_bin_width
Density bin width.
Definition: MoabSkinner.h:383
moab::EntityHandle createTri(const std::vector< moab::EntityHandle > &vertices, unsigned int v1, unsigned int v2, unsigned int v3)
Create MOAB tri surface element.
virtual unsigned int getBin(const unsigned int &temp_bin, const unsigned int &density_bin, const unsigned int &subdomain_bin) const
virtual void setScaling(const Real &scale)
Definition: MoabSkinner.h:87
const std::shared_ptr< moab::Interface > & moabPtr() const
Definition: MoabSkinner.h:153
moab::Tag name_tag
Tag for name of entity set.
Definition: MoabSkinner.h:419
virtual bool hasDensitySkinning() const
Definition: MoabSkinner.h:147
const std::string & _temperature_name
Name of the temperature variable.
Definition: MoabSkinner.h:165
moab::Tag geometry_dimension_tag
Tag for dimension for geometry.
Definition: MoabSkinner.h:404
void createGroup(const unsigned int &id, const std::string &name, moab::EntityHandle &group_set)
virtual unsigned int nDensityBins() const
Definition: MoabSkinner.h:141
moab::Tag id_tag
Tag for entitiy set ID.
Definition: MoabSkinner.h:407
const bool & _use_displaced
Whether the skinned mesh should be generated from a displaced mesh.
Definition: MoabSkinner.h:211
Definition: CardinalEnums.h:206
unsigned int getAuxiliaryVariableNumber(const std::string &name, const std::string ¶m_name) const
std::unique_ptr< NumericVector< Number > > _serialized_solution
Definition: MoabSkinner.h:156
const bool & _output_skins
Whether to output the MOAB mesh skins to a .h5m file.
Definition: MoabSkinner.h:199
virtual void setVerbosity(const bool &verbose)
Definition: MoabSkinner.h:93
std::map< dof_id_type, std::vector< moab::EntityHandle > > _id_to_elem_handles
Map from libmesh id to MOAB element entity handles.
Definition: MoabSkinner.h:368
MooseMesh & getMooseMesh()
Moose mesh.
const Real & _graveyard_scale_outer
Multiplier on bounding box for outer surface of graveyard.
Definition: MoabSkinner.h:196
const bool & _output_full
Whether to output the MOAB mesh to a .h5m file.
Definition: MoabSkinner.h:202
std::unique_ptr< moab::Skinner > skinner
Moab skinner for finding temperature surfaces.
Definition: MoabSkinner.h:362
void createCornerTris(const std::vector< moab::EntityHandle > &verts, unsigned int corner, unsigned int v1, unsigned int v2, unsigned int v3, bool normalout, moab::Range &surface_tris)
Create 3 tri faces stemming from one corner of a cude (an open tetrahedron)
Real _scaling
Length multiplier to get from [Mesh] units into OpenMC's centimeters.
Definition: MoabSkinner.h:214
moab::Tag geometry_resabs_tag
Tag needed by DAGMC.
Definition: MoabSkinner.h:413
std::vector< std::vector< unsigned int > > _tet4_nodes
Node ordering for a TET4 MOAB element, based on libMesh node numberings.
Definition: MoabSkinner.h:428
Sense
Encode the whether the surface normal faces into or out of the volume.
Definition: MoabSkinner.h:223
void buildGraveyard(unsigned int &vol_id, unsigned int &surf_id)
Build a graveyard volume around the domain.
std::vector< moab::EntityHandle > createNodesFromBox(const BoundingBox &box, const Real &factor) const
moab::Tag faceting_tol_tag
Tag for faceting tolerance.
Definition: MoabSkinner.h:410
void createVol(const unsigned int &id, moab::EntityHandle &volume_set, moab::EntityHandle group_set)
Helper method to create MOAB volume entity set.
unsigned int _n_write
Count number of times output files have been written.
Definition: MoabSkinner.h:217
moab::EntityHandle offset
Save the first tet entity handle.
Definition: MoabSkinner.h:371
virtual unsigned int getSubdomainBin(const Elem *const elem) const
Definition: MoabSkinner.h:78
Sense sense
Definition: MoabSkinner.h:233
moab::EntityHandle _all_tets
Entity handle to represent the set of all tets.
Definition: MoabSkinner.h:398
const Real & _graveyard_scale_inner
Multiplier on bounding box for inner surface of graveyard.
Definition: MoabSkinner.h:193
virtual moab::ErrorCode check(const moab::ErrorCode input) const
Definition: MoabSkinner.h:226
std::map< SubdomainID, unsigned int > _blocks
Blocks in the [Mesh].
Definition: MoabSkinner.h:395
virtual void sortElemsByResults()
Sort all the elements in the [Mesh] into bins for temperature, density, and subdomain.
const unsigned int & _n_temperature_bins
Number of temperature bins.
Definition: MoabSkinner.h:174
virtual void setMaterialNames(std::vector< std::string > names)
Definition: MoabSkinner.h:51
bool resetMOAB()
Clear MOAB entity sets.
const Real & _geom_tol
Geometry tolerence needed by DAGMC.
Definition: MoabSkinner.h:190
void setTags(moab::EntityHandle ent, std::string name, std::string category, unsigned int id, int dim)
Generic method to set the tags that DAGMC requires.
virtual unsigned int getDensityBin(const Elem *const elem) const
Real _density_max
Upper bound of density bins.
Definition: MoabSkinner.h:380
Skins the [Mesh] according to individual bins for temperature, density, and subdomain ID.
Definition: MoabSkinner.h:19
virtual void findBlocks()
Store a mapping from [Mesh] subdomain IDs to an index, to be used for binning by block ID.
moab::EntityHandle vol
Definition: MoabSkinner.h:232
std::vector< std::vector< unsigned int > > _tet10_nodes
Definition: MoabSkinner.h:434
bool _build_graveyard
Definition: MoabSkinner.h:208
moab::Tag category_tag
Tag for type of entity set.
Definition: MoabSkinner.h:416
const bool _bin_by_density
Whether elements are binned by density (in addition to temperature and block)
Definition: MoabSkinner.h:180
const Real BIN_TOLERANCE
Tolerance to use for comparing values to bin bounds.
Definition: MoabSkinner.h:446
const Real & _faceting_tol
Faceting tolerence needed by DAGMC.
Definition: MoabSkinner.h:187
void setGraveyard(bool build)
virtual void execute() override
virtual const bool & hasGraveyard() const
Definition: MoabSkinner.h:128
Encode MOAB information about volumes needed when creating surfaces.
Definition: MoabSkinner.h:230
Real _density_min
Lower bound of density bins.
Definition: MoabSkinner.h:377
void updateSurfData(moab::EntityHandle surface_set, const VolData &data)
Add parent-child metadata relating a surface to its volume.
void reset()
Clear mesh data.
const unsigned int NODES_PER_MOAB_TET
Number of nodes per MOAB tet (which are first order, so TET4)
Definition: MoabSkinner.h:443
std::vector< Real > _temperature_bin_bounds
Bounds of the temperature bins.
Definition: MoabSkinner.h:422
virtual void createTags()
Helper method to create MOAB tags.
unsigned int _temperature_var_num
Auxiliary variable number for temperature.
Definition: MoabSkinner.h:437