Cardinal
|
Skins the [Mesh] according to individual bins for temperature, density, and subdomain ID. More...
#include <MoabSkinner.h>
Classes | |
struct | VolData |
Encode MOAB information about volumes needed when creating surfaces. More... | |
Public Member Functions | |
MoabSkinner (const InputParameters ¶meters) | |
virtual void | execute () override |
virtual void | initialize () override |
virtual void | finalize () override |
virtual void | threadJoin (const UserObject &) override |
virtual moab::ErrorCode | check (const moab::ErrorCode input) const |
std::string | materialName (const unsigned int &block, const unsigned int &density, const unsigned int &temp) const |
virtual void | update () |
Perform the skinning operation. More... | |
virtual void | setMaterialNames (std::vector< std::string > names) |
unsigned int | nBins () const |
virtual unsigned int | getTemperatureBin (const Elem *const elem) const |
virtual unsigned int | getDensityBin (const Elem *const elem) const |
virtual unsigned int | getSubdomainBin (const Elem *const elem) const |
virtual void | setScaling (const Real &scale) |
virtual void | setVerbosity (const bool &verbose) |
virtual void | makeDependentOnExternalAction () |
unsigned int | getAuxiliaryVariableNumber (const std::string &name, const std::string ¶m_name) const |
void | reset () |
Clear mesh data. More... | |
virtual unsigned int | getBin (const unsigned int &temp_bin, const unsigned int &density_bin, const unsigned int &subdomain_bin) const |
virtual const bool & | hasGraveyard () const |
void | setGraveyard (bool build) |
virtual unsigned int | nDensityBins () const |
virtual bool | hasDensitySkinning () const |
const std::shared_ptr< moab::Interface > & | moabPtr () const |
Static Public Member Functions | |
static InputParameters | validParams () |
Protected Types | |
enum | Sense { BACKWARDS = -1, FORWARDS = 1 } |
Encode the whether the surface normal faces into or out of the volume. More... | |
Protected Member Functions | |
MooseMesh & | getMooseMesh () |
Moose mesh. More... | |
void | createMOABElems () |
virtual void | createTags () |
Helper method to create MOAB tags. More... | |
void | createGroup (const unsigned int &id, const std::string &name, moab::EntityHandle &group_set) |
void | createVol (const unsigned int &id, moab::EntityHandle &volume_set, moab::EntityHandle group_set) |
Helper method to create MOAB volume entity set. More... | |
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. More... | |
void | createSurfaces (moab::Range &reversed, VolData &voldata, unsigned int &surf_id) |
Helper method to create MOAB surfaces with no overlaps. More... | |
void | createSurfaceFromBox (const BoundingBox &box, const VolData &voldata, unsigned int &surf_id, bool normalout, const Real &factor) |
std::vector< moab::EntityHandle > | createNodesFromBox (const BoundingBox &box, const Real &factor) const |
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) More... | |
moab::EntityHandle | createTri (const std::vector< moab::EntityHandle > &vertices, unsigned int v1, unsigned int v2, unsigned int v3) |
Create MOAB tri surface element. More... | |
void | updateSurfData (moab::EntityHandle surface_set, const VolData &data) |
Add parent-child metadata relating a surface to its volume. More... | |
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. More... | |
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. More... | |
void | setTagData (moab::Tag tag, moab::EntityHandle ent, void *data) |
Helper function to wrap moab::tag_set_data for a generic pointer. More... | |
const std::vector< std::vector< unsigned int > > & | getTetSets (ElemType type) const |
void | buildGraveyard (unsigned int &vol_id, unsigned int &surf_id) |
Build a graveyard volume around the domain. More... | |
virtual void | findBlocks () |
Store a mapping from [Mesh] subdomain IDs to an index, to be used for binning by block ID. More... | |
virtual void | sortElemsByResults () |
Sort all the elements in the [Mesh] into bins for temperature, density, and subdomain. More... | |
void | findSurfaces () |
Group the binned elems into local temperature regions and find their surfaces. More... | |
void | groupLocalElems (std::set< dof_id_type > elems, std::vector< moab::Range > &localElems) |
bool | resetMOAB () |
Clear MOAB entity sets. More... | |
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. More... | |
virtual void | write () |
Write MOAB volume and/or skin meshes to file. More... | |
Protected Attributes | |
std::unique_ptr< NumericVector< Number > > | _serialized_solution |
std::shared_ptr< moab::Interface > | _moab |
MOAB interface. More... | |
bool | _verbose |
Whether to print diagnostic information. More... | |
const std::string & | _temperature_name |
Name of the temperature variable. More... | |
const Real & | _temperature_min |
Lower bound of temperature bins. More... | |
const Real & | _temperature_max |
Upper bound of temperature bins. More... | |
const unsigned int & | _n_temperature_bins |
Number of temperature bins. More... | |
const Real | _temperature_bin_width |
Temperature bin width. More... | |
const bool | _bin_by_density |
Whether elements are binned by density (in addition to temperature and block) More... | |
std::vector< std::string > | _material_names |
const Real & | _faceting_tol |
Faceting tolerence needed by DAGMC. More... | |
const Real & | _geom_tol |
Geometry tolerence needed by DAGMC. More... | |
const Real & | _graveyard_scale_inner |
Multiplier on bounding box for inner surface of graveyard. More... | |
const Real & | _graveyard_scale_outer |
Multiplier on bounding box for outer surface of graveyard. More... | |
const bool & | _output_skins |
Whether to output the MOAB mesh skins to a .h5m file. More... | |
const bool & | _output_full |
Whether to output the MOAB mesh to a .h5m file. More... | |
bool | _build_graveyard |
const bool & | _use_displaced |
Whether the skinned mesh should be generated from a displaced mesh. More... | |
Real | _scaling |
Length multiplier to get from [Mesh] units into OpenMC's centimeters. More... | |
unsigned int | _n_write |
Count number of times output files have been written. More... | |
bool | _standalone |
Whether this class runs by itself, or is controlled by an external class. More... | |
std::unique_ptr< moab::Skinner > | skinner |
Moab skinner for finding temperature surfaces. More... | |
std::unique_ptr< moab::GeomTopoTool > | gtt |
Topology tool for setting surface sense. More... | |
std::map< dof_id_type, std::vector< moab::EntityHandle > > | _id_to_elem_handles |
Map from libmesh id to MOAB element entity handles. More... | |
moab::EntityHandle | offset |
Save the first tet entity handle. More... | |
std::string | _density_name |
Name of the MOOSE variable containing the density. More... | |
Real | _density_min |
Lower bound of density bins. More... | |
Real | _density_max |
Upper bound of density bins. More... | |
Real | _density_bin_width |
Density bin width. More... | |
unsigned int | _n_density_bins |
Number of density bins. More... | |
unsigned int | _n_block_bins |
Number of block bins. More... | |
std::vector< std::set< dof_id_type > > | _elem_bins |
Mapping from total bin ID to a set of elements sorted into that bin. More... | |
std::map< SubdomainID, unsigned int > | _blocks |
Blocks in the [Mesh]. More... | |
moab::EntityHandle | _all_tets |
Entity handle to represent the set of all tets. More... | |
std::map< moab::EntityHandle, std::vector< VolData > > | surfsToVols |
Save some topological data: map from surface handle to vol handle and sense. More... | |
moab::Tag | geometry_dimension_tag |
Tag for dimension for geometry. More... | |
moab::Tag | id_tag |
Tag for entitiy set ID. More... | |
moab::Tag | faceting_tol_tag |
Tag for faceting tolerance. More... | |
moab::Tag | geometry_resabs_tag |
Tag needed by DAGMC. More... | |
moab::Tag | category_tag |
Tag for type of entity set. More... | |
moab::Tag | name_tag |
Tag for name of entity set. More... | |
std::vector< Real > | _temperature_bin_bounds |
Bounds of the temperature bins. More... | |
std::vector< Real > | _density_bin_bounds |
Bounds of the density bins. More... | |
std::vector< std::vector< unsigned int > > | _tet4_nodes |
Node ordering for a TET4 MOAB element, based on libMesh node numberings. More... | |
std::vector< std::vector< unsigned int > > | _tet10_nodes |
unsigned int | _temperature_var_num |
Auxiliary variable number for temperature. More... | |
unsigned int | _density_var_num |
Auxiliary variable number for density. More... | |
const unsigned int | NODES_PER_MOAB_TET = 4 |
Number of nodes per MOAB tet (which are first order, so TET4) More... | |
const Real | BIN_TOLERANCE = 1e-6 |
Tolerance to use for comparing values to bin bounds. More... | |
Skins the [Mesh] according to individual bins for temperature, density, and subdomain ID.
Skins a [Mesh] according to temperature, density, and subdomain. The MOAB surfaces bounding those grouped elements are then generated, providing geometry information needed for DAGMC to then track particles on this new geometry.
|
protected |
MoabSkinner::MoabSkinner | ( | const InputParameters & | parameters | ) |
|
protected |
Build a graveyard volume around the domain.
The graveyard is a containing volume which bounds the volume of interest. This is only needed if the skinned geometry is going to be input into a Monte Carlo solver. For performance reasons, a cubic shell is optimal. So, here we build two cubic surfaces, both larger than the bounding box of the "actual" geometry. We name this region "mat:Graveyard", so that when OpenMC parses the geometry it knows to assign "void" to this region, and set vacuum BCs on the outer surfaces of the cubic shell. The remaining space between the "actual" geometry and the inner graveyard surface is treated as the implicit complement of the rest of the geometry (e.g. a transmissive region).
|
virtual |
Wrap the error handling in MOAB to print errors to user
[in] | input | MOAB error code |
|
protected |
Create 3 tri faces stemming from one corner of a cude (an open tetrahedron)
|
protected |
Helper method to create MOAB group entity set
[in] | id | ID for the group |
[in] | name | name for the group |
[in] | group_set | group of entities |
|
protected |
Copy the libMesh [Mesh] into a MOAB mesh. This first loops through all of the nodes, and rebuilds each as a MOAB vertex. Then, we loop over all of the elements and rebuild each as a TET4 (if the libMesh mesh has TET10 elements, they are each rebuilt into 8 TET4 elements).
|
protected |
Create MOAB nodes from a bounding box
[in] | box | bounding box |
[in] | factor | multiplicative factor to resize the bounding box sides |
|
protected |
Helper method to create MOAB surface entity set.
|
protected |
Create a MOAB surface from a bounding box
|
protected |
Helper method to create MOAB surfaces with no overlaps.
|
protectedvirtual |
Helper method to create MOAB tags.
|
protected |
Create MOAB tri surface element.
|
protected |
Helper method to create MOAB volume entity set.
|
overridevirtual |
|
overridevirtual |
|
protectedvirtual |
Store a mapping from [Mesh] subdomain IDs to an index, to be used for binning by block ID.
|
protected |
Find the surfaces for the provided range and add to group.
|
protected |
Group the binned elems into local temperature regions and find their surfaces.
unsigned int MoabSkinner::getAuxiliaryVariableNumber | ( | const std::string & | name, |
const std::string & | param_name | ||
) | const |
Get variable number in the auxiliary system
[in] | name | variable name |
[in] | param_name | parameter name, for printing a helpful error message |
|
virtual |
Get total bin index given individual indices for the temperature, density, and subdomain bins
[in] | temp_bin | temperature bin |
[in] | density_bin | density bin |
[in] | subdomain_bin | subdomain ID bin |
|
virtual |
Get the bin index for the density
[in] | elem | element |
|
protected |
Moose mesh.
|
inlinevirtual |
Get the bin index for the subdomain
[in] | elem | element |
|
virtual |
Get the bin index for the temperature
[in] | elem | element |
|
protected |
Get the node numberings for the MOAB TET4 elements to build for each [Mesh] element
[in] | type | element type |
|
protected |
Group a given bin into local regions NB elems in param is a copy, localElems is a reference
|
inlinevirtual |
Whether density skinning is applied
|
inlinevirtual |
Whether the skinner builds a graveyard
|
overridevirtual |
|
inlinevirtual |
Indicate whether this userobject is run by itself (for testing purposes) or controlled by some other class.
std::string MoabSkinner::materialName | ( | const unsigned int & | block, |
const unsigned int & | density, | ||
const unsigned int & | temp | ||
) | const |
|
inline |
Get pointer to underlying moab interface
unsigned int MoabSkinner::nBins | ( | ) | const |
Get the total number of bins
|
inlinevirtual |
Number of density bins; if greater than 1, this means we must be re-generating OpenMC materials during the course of the simulation.
void MoabSkinner::reset | ( | ) |
Clear mesh data.
|
protected |
Clear MOAB entity sets.
void MoabSkinner::setGraveyard | ( | bool | build | ) |
Set the graveyard setting
[in] | build | whether to build a graveyard |
|
inlinevirtual |
Set the names to be used for naming the subdomains in the skinned mesh; there should be one name per subdomain.
[in] | names | names for subdomains |
|
inlinevirtual |
Set the length multiplier to get from [Mesh] units into centimeters
[in] | scale | multiplier |
|
protected |
Helper function to wrap moab::tag_set_data for a string.
|
protected |
Helper function to wrap moab::tag_set_data for a generic pointer.
|
protected |
Generic method to set the tags that DAGMC requires.
|
inlinevirtual |
Set the verbosity level
[in] | verbose | whether to print diagnostic information |
|
protectedvirtual |
Sort all the elements in the [Mesh] into bins for temperature, density, and subdomain.
|
inlineoverridevirtual |
|
virtual |
Perform the skinning operation.
|
protected |
Add parent-child metadata relating a surface to its volume.
|
static |
|
protectedvirtual |
Write MOAB volume and/or skin meshes to file.
|
protected |
Entity handle to represent the set of all tets.
|
protected |
Whether elements are binned by density (in addition to temperature and block)
|
protected |
Blocks in the [Mesh].
|
protected |
Whether to build a graveyard as two additional cube surfaces surrounding the mesh. This is only needed if the skinned geometry is fed into a Monte Carlo code.
|
protected |
Bounds of the density bins.
|
protected |
Density bin width.
|
protected |
Upper bound of density bins.
|
protected |
Lower bound of density bins.
|
protected |
Name of the MOOSE variable containing the density.
|
protected |
Auxiliary variable number for density.
|
protected |
Mapping from total bin ID to a set of elements sorted into that bin.
|
protected |
Faceting tolerence needed by DAGMC.
|
protected |
Geometry tolerence needed by DAGMC.
|
protected |
Multiplier on bounding box for inner surface of graveyard.
|
protected |
Multiplier on bounding box for outer surface of graveyard.
|
protected |
Map from libmesh id to MOAB element entity handles.
|
protected |
Material names corresponding to each subdomain. These are used to name the new skinned volumes in MOAB
|
protected |
MOAB interface.
|
protected |
Number of block bins.
|
protected |
Number of density bins.
|
protected |
Number of temperature bins.
|
protected |
Count number of times output files have been written.
|
protected |
Whether to output the MOAB mesh to a .h5m file.
|
protected |
Whether to output the MOAB mesh skins to a .h5m file.
|
protected |
Length multiplier to get from [Mesh] units into OpenMC's centimeters.
|
protected |
|
protected |
Whether this class runs by itself, or is controlled by an external class.
|
protected |
Bounds of the temperature bins.
|
protected |
Temperature bin width.
|
protected |
Upper bound of temperature bins.
|
protected |
Lower bound of temperature bins.
|
protected |
Name of the temperature variable.
|
protected |
Auxiliary variable number for temperature.
|
protected |
Node ordering for eight TET4 MOAB elements, based on libMesh node numberings for a TET10 element. We re-build the libMesh element into first-order MOAB elements.
|
protected |
Node ordering for a TET4 MOAB element, based on libMesh node numberings.
|
protected |
Whether the skinned mesh should be generated from a displaced mesh.
|
protected |
Whether to print diagnostic information.
|
protected |
Tolerance to use for comparing values to bin bounds.
|
protected |
Tag for type of entity set.
|
protected |
Tag for faceting tolerance.
|
protected |
Tag for dimension for geometry.
|
protected |
Tag needed by DAGMC.
|
protected |
Topology tool for setting surface sense.
|
protected |
Tag for entitiy set ID.
|
protected |
Tag for name of entity set.
|
protected |
Number of nodes per MOAB tet (which are first order, so TET4)
|
protected |
Save the first tet entity handle.
|
protected |
Moab skinner for finding temperature surfaces.
|
protected |
Save some topological data: map from surface handle to vol handle and sense.