Class for constructing and querying skin of a mesh Class for constructing and querying skin of a mesh, defined as the outside lower-dimensional boundary of a mesh or a given set of entities. This class provides options for finding the forward- and reverse-oriented members of the skin. Several methods are available for computing the skin, e.g. using geometric topology sets, vertex-entity adjacencies, or directly from (n-1)-dimensional entities. More...
#include <Skinner.hpp>
Public Member Functions | |
Skinner (Interface *mdb) | |
constructor, takes mdb instance More... | |
~Skinner () | |
destructor More... | |
ErrorCode | find_geometric_skin (const EntityHandle meshset, Range &forward_target_entities) |
ErrorCode | find_skin (const EntityHandle meshset, const Range &entities, bool get_vertices, Range &output_handles, Range *output_reverse_handles=0, bool create_vert_elem_adjs=false, bool create_skin_elements=true, bool look_for_scd=false) |
will accept entities all of one dimension and return entities of n-1 dimension; NOTE: get_vertices argument controls whether vertices or entities of n-1 dimension are returned, and only one of these is allowed (i.e. this function returns only vertices or (n-1)-dimensional entities, but not both) More... | |
ErrorCode | find_skin (const EntityHandle this_set, const EntityHandle *entities, int num_entities, bool get_vertices, Range &output_handles, Range *output_reverse_handles=0, bool create_vert_elem_adjs=false, bool create_skin_elements=true, bool look_for_scd=false) |
will accept entities all of one dimension and return entities of n-1 dimension; NOTE: get_vertices argument controls whether vertices or entities of n-1 dimension are returned, and only one of these is allowed (i.e. this function returns only vertices or (n-1)-dimensional entities, but not both) More... | |
ErrorCode | find_skin (const EntityHandle this_set, const Range &entities, int dim, Range &skin_entities, bool create_vert_elem_adjs=false, bool create_skin_elements=true) |
get skin entities of prescribed dimension More... | |
ErrorCode | classify_2d_boundary (const Range &boundary, const Range &bar_elements, EntityHandle boundary_edges, EntityHandle inferred_edges, EntityHandle non_manifold_edges, EntityHandle other_edges, int &number_boundary_nodes) |
ErrorCode | classify_2d_boundary (const Range &boundary, const Range &mesh_1d_elements, Range &boundary_edges, Range &inferred_edges, Range &non_manifold_edges, Range &other_edges, int &number_boundary_nodes) |
given a skin of dimension 2, will classify and return edges as boundary, inferred, and non-manifold, and the rest (other) More... | |
Protected Member Functions | |
ErrorCode | initialize () |
ErrorCode | deinitialize () |
ErrorCode | find_skin_noadj (const Range &source_entities, Range &forward_target_entities, Range &reverse_target_entities) |
ErrorCode | add_adjacency (EntityHandle entity) |
void | add_adjacency (EntityHandle entity, const EntityHandle *conn, const int num_nodes) |
ErrorCode | remove_adjacency (EntityHandle entity) |
bool | entity_deletable (EntityHandle entity) |
void | find_match (EntityType type, const EntityHandle *conn, const int num_nodes, EntityHandle &match, Skinner::direction &direct) |
bool | connectivity_match (const EntityHandle *conn1, const EntityHandle *conn2, const int num_verts, Skinner::direction &direct) |
void | find_inferred_edges (Range &skin_boundary, Range &candidate_edges, Range &inferred_edges, double reference_angle_degrees) |
bool | has_larger_angle (EntityHandle &entity1, EntityHandle &entity2, double reference_angle_cosine) |
ErrorCode | find_skin_vertices (const EntityHandle this_set, const Range &entities, Range *skin_verts=0, Range *skin_elems=0, Range *rev_elems=0, bool create_if_missing=true, bool corners_only=false) |
Find vertices on the skin of a set of mesh entities. More... | |
ErrorCode | find_skin_vertices_1D (Tag tag, const Range &edges, Range &skin_verts) |
Skin edges. More... | |
ErrorCode | find_skin_vertices_2D (const EntityHandle this_set, Tag tag, const Range &faces, Range *skin_verts=0, Range *skin_edges=0, Range *reverse_edges=0, bool create_edges=false, bool corners_only=false) |
Skin faces. More... | |
ErrorCode | find_skin_vertices_3D (const EntityHandle this_set, Tag tag, const Range &entities, Range *skin_verts=0, Range *skin_faces=0, Range *reverse_faces=0, bool create_faces=false, bool corners_only=false) |
Skin volume mesh. More... | |
ErrorCode | create_side (const EntityHandle this_set, EntityHandle element, EntityType side_type, const EntityHandle *side_corners, EntityHandle &side_elem_handle_out) |
bool | edge_reversed (EntityHandle face, const EntityHandle edge_ends[2]) |
bool | face_reversed (EntityHandle region, const EntityHandle *face_conn, EntityType face_type) |
ErrorCode | find_skin_scd (const Range &source_entities, bool get_vertices, Range &output_handles, bool create_skin_elements) |
look for structured box comprising source_entities, and if one is found use structured information to find the skin More... | |
ErrorCode | skin_box (ScdBox *box, bool get_vertices, Range &output_handles, bool create_skin_elements) |
skin a structured box, taking advantage of structured information More... | |
Protected Attributes | |
Interface * | thisMB |
the MB instance that this works with More... | |
Tag | mDeletableMBTag |
Tag | mAdjTag |
int | mTargetDim |
Private Types | |
enum | direction { FORWARD = 1 , REVERSE = -1 } |
Class for constructing and querying skin of a mesh Class for constructing and querying skin of a mesh, defined as the outside lower-dimensional boundary of a mesh or a given set of entities. This class provides options for finding the forward- and reverse-oriented members of the skin. Several methods are available for computing the skin, e.g. using geometric topology sets, vertex-entity adjacencies, or directly from (n-1)-dimensional entities.
Definition at line 36 of file Skinner.hpp.
|
private |
Enumerator | |
---|---|
FORWARD | |
REVERSE |
Definition at line 39 of file Skinner.hpp.
|
inline |
moab::Skinner::~Skinner | ( | ) |
|
protected |
Definition at line 129 of file Skinner.cpp.
References ErrorCode, moab::Interface::get_connectivity(), mAdjTag, MB_CHK_ERR, MB_SUCCESS, moab::Interface::tag_get_data(), moab::Interface::tag_set_data(), and thisMB.
Referenced by classify_2d_boundary(), find_skin_noadj(), and initialize().
|
protected |
Definition at line 155 of file Skinner.cpp.
References mAdjTag, MB_SUCCESS, MBPOLYGON, moab::Interface::tag_get_data(), moab::Interface::tag_set_data(), thisMB, moab::TYPE_FROM_HANDLE(), and moab::CN::VerticesPerEntity().
ErrorCode moab::Skinner::classify_2d_boundary | ( | const Range & | boundary, |
const Range & | bar_elements, | ||
EntityHandle | boundary_edges, | ||
EntityHandle | inferred_edges, | ||
EntityHandle | non_manifold_edges, | ||
EntityHandle | other_edges, | ||
int & | number_boundary_nodes | ||
) |
Definition at line 659 of file Skinner.cpp.
References moab::Interface::add_entities(), moab::Interface::clear_meshset(), ErrorCode, MB_CHK_ERR, MB_SUCCESS, and thisMB.
ErrorCode moab::Skinner::classify_2d_boundary | ( | const Range & | boundary, |
const Range & | mesh_1d_elements, | ||
Range & | boundary_edges, | ||
Range & | inferred_edges, | ||
Range & | non_manifold_edges, | ||
Range & | other_edges, | ||
int & | number_boundary_nodes | ||
) |
given a skin of dimension 2, will classify and return edges as boundary, inferred, and non-manifold, and the rest (other)
Definition at line 687 of file Skinner.cpp.
References add_adjacency(), moab::Range::begin(), moab::Range::clear(), moab::Interface::create_element(), deinitialize(), moab::CN::Dimension(), moab::Range::empty(), moab::Range::end(), entity_deletable(), moab::Range::erase(), ErrorCode, moab::Range::find(), find_inferred_edges(), find_match(), moab::Interface::get_connectivity(), initialize(), moab::Range::insert(), moab::MAX_SUB_ENTITY_VERTICES, MB_CHK_ERR, MB_SUCCESS, MB_TAG_CREAT, MB_TAG_DENSE, MB_TYPE_INTEGER, MBEDGE, moab::CN::mConnectivityMap, mTargetDim, moab::CN::ConnMap::num_corners_per_sub_element, moab::CN::NumSubEntities(), moab::Range::size(), moab::CN::SubEntityNodeIndices(), moab::CN::SubEntityVertexIndices(), moab::Interface::tag_delete(), moab::Interface::tag_get_data(), moab::Interface::tag_get_handle(), moab::Interface::tag_set_data(), thisMB, moab::Interface::type_from_handle(), and moab::CN::VerticesPerEntity().
|
protected |
Definition at line 582 of file Skinner.cpp.
References FORWARD, and REVERSE.
Referenced by find_match().
|
protected |
Definition at line 1432 of file Skinner.cpp.
References moab::CN::Dimension(), ErrorCode, MB_CHK_ERR, MB_SUCCESS, MBEDGE, MBPOLYGON, moab::CN::SideNumber(), moab::CN::SubEntityNodeIndices(), moab::TYPE_FROM_HANDLE(), and moab::CN::VerticesPerEntity().
|
protected |
Definition at line 98 of file Skinner.cpp.
References entities, ErrorCode, moab::Interface::get_entities_by_type_and_tag(), mAdjTag, MB_CHK_ERR, MB_SUCCESS, MBMAXTYPE, MBVERTEX, mDeletableMBTag, moab::Interface::tag_delete(), moab::Interface::tag_get_data(), and thisMB.
Referenced by classify_2d_boundary(), and find_skin_noadj().
|
protected |
|
protected |
Definition at line 650 of file Skinner.cpp.
References ErrorCode, MB_SUCCESS, mDeletableMBTag, moab::Interface::tag_get_data(), and thisMB.
Referenced by classify_2d_boundary(), and find_skin_noadj().
|
protected |
Definition at line 1537 of file Skinner.cpp.
References moab::CN::Dimension(), ErrorCode, MB_SUCCESS, moab::CN::SideNumber(), moab::TYPE_FROM_HANDLE(), and moab::CN::VerticesPerEntity().
ErrorCode moab::Skinner::find_geometric_skin | ( | const EntityHandle | meshset, |
Range & | forward_target_entities | ||
) |
Definition at line 180 of file Skinner.cpp.
References moab::Range::begin(), moab::debug, moab::Range::empty(), moab::Range::end(), ErrorCode, GEOM_DIMENSION_TAG_NAME, moab::Interface::get_entities_by_handle(), moab::Interface::get_entities_by_type_and_tag(), moab::Range::insert(), MB_ENTITY_NOT_FOUND, MB_SUCCESS, MB_TAG_CREAT, MB_TAG_SPARSE, MB_TYPE_INTEGER, MBENTITYSET, moab::Interface::num_parent_meshsets(), moab::Range::size(), moab::Interface::tag_get_handle(), and thisMB.
|
protected |
Definition at line 900 of file Skinner.cpp.
References moab::Range::begin(), moab::Range::end(), ErrorCode, moab::Interface::get_adjacencies(), has_larger_angle(), moab::Range::insert(), MB_SUCCESS, MB_TAG_CREAT, MB_TYPE_BIT, SKINNER_PI, moab::Interface::tag_clear_data(), moab::Interface::tag_delete(), moab::Interface::tag_get_data(), moab::Interface::tag_get_handle(), and thisMB.
Referenced by classify_2d_boundary().
|
protected |
Definition at line 532 of file Skinner.cpp.
References connectivity_match(), ErrorCode, FORWARD, moab::Interface::get_connectivity(), mAdjTag, MB_SUCCESS, MBVERTEX, moab::Interface::tag_get_data(), thisMB, moab::Interface::type_from_handle(), and moab::CN::VerticesPerEntity().
Referenced by classify_2d_boundary(), and find_skin_noadj().
ErrorCode moab::Skinner::find_skin | ( | const EntityHandle | meshset, |
const Range & | entities, | ||
bool | get_vertices, | ||
Range & | output_handles, | ||
Range * | output_reverse_handles = 0 , |
||
bool | create_vert_elem_adjs = false , |
||
bool | create_skin_elements = true , |
||
bool | look_for_scd = false |
||
) |
will accept entities all of one dimension and return entities of n-1 dimension; NOTE: get_vertices argument controls whether vertices or entities of n-1 dimension are returned, and only one of these is allowed (i.e. this function returns only vertices or (n-1)-dimensional entities, but not both)
entities | The elements for which to find the skin |
get_vertices | If true, vertices on the skin are returned in the range, otherwise elements are returned |
output_handles | Range holding skin entities returned |
output_reverse_handles | Range holding entities on skin which are reversed wrt entities |
create_vert_elem_adjs | If true, this function will cause vertex-element adjacencies to be generated |
create_skin_elements | If true, this function will cause creation of skin entities, otherwise only skin entities already extant will be returned |
Definition at line 233 of file Skinner.cpp.
References moab::Core::a_entity_factory(), moab::AEntityFactory::create_vert_elem_adjacencies(), moab::Range::empty(), ErrorCode, find_skin_scd(), find_skin_vertices(), MB_SUCCESS, thisMB, and moab::AEntityFactory::vert_elem_adjacencies().
Referenced by MetisPartitioner::assemble_taggedsets_graph(), moab::GeomTopoTool::check_model(), moab::TempestRemapper::ComputeOverlapMesh(), moab::ParallelComm::create_interface_sets(), DeformMeshRemap::execute(), find_skin(), moab::GeomTopoTool::geometrize_surface_set(), get_imesh_mesh(), moab::LloydSmoother::initialize(), main(), moab::MergeMesh::merge_entities(), moab::MergeMesh::merge_higher_dimensions(), moab::ParallelMergeMesh::PopulateMySkinEnts(), moab::ParallelComm::resolve_shared_ents(), tag_depth(), and moab::WriteCCMIO::write_cells_and_faces().
|
inline |
will accept entities all of one dimension and return entities of n-1 dimension; NOTE: get_vertices argument controls whether vertices or entities of n-1 dimension are returned, and only one of these is allowed (i.e. this function returns only vertices or (n-1)-dimensional entities, but not both)
entities | Pointer to elements for which to find the skin |
num_entities | Number of entities in vector |
get_vertices | If true, vertices on the skin are returned in the range, otherwise elements are returned |
output_handles | Range holding skin entities returned |
output_reverse_handles | Range holding entities on skin which are reversed wrt entities |
create_vert_elem_adjs | If true, this function will cause vertex-element adjacencies to be generated |
create_skin_elements | If true, this function will cause creation of skin entities, otherwise only skin entities already extant will be returned |
Definition at line 286 of file Skinner.hpp.
References entities, and find_skin().
ErrorCode moab::Skinner::find_skin | ( | const EntityHandle | this_set, |
const Range & | entities, | ||
int | dim, | ||
Range & | skin_entities, | ||
bool | create_vert_elem_adjs = false , |
||
bool | create_skin_elements = true |
||
) |
get skin entities of prescribed dimension
entities | The elements for which to find the skin |
dim | Dimension of skin entities requested |
skin_entities | Range holding skin entities returned |
create_vert_elem_adjs | If true, this function will cause vertex-element adjacencies to be generated |
Definition at line 985 of file Skinner.cpp.
References moab::Interface::add_entities(), moab::Range::all_of_dimension(), dim, moab::Range::empty(), entities, ErrorCode, find_skin(), moab::Interface::get_adjacencies(), MB_CHK_ERR, MB_SUCCESS, moab::Range::merge(), moab::Range::swap(), thisMB, and moab::Interface::UNION.
|
protected |
use_adjs &&
use_adjs &&
Definition at line 386 of file Skinner.cpp.
References add_adjacency(), moab::Range::begin(), moab::Interface::create_element(), deinitialize(), moab::Interface::delete_entities(), moab::CN::Dimension(), moab::Range::empty(), moab::Range::end(), entity_deletable(), moab::Range::erase(), ErrorCode, moab::Range::find(), find_match(), FORWARD, moab::Interface::get_connectivity(), initialize(), moab::Range::insert(), moab::MAX_SUB_ENTITY_VERTICES, MB_SUCCESS, MBEDGE, MBPOLYGON, mTargetDim, moab::CN::NumSubEntities(), remove_adjacency(), moab::CN::SubEntityNodeIndices(), thisMB, moab::Interface::type_from_handle(), and moab::CN::VerticesPerEntity().
|
protected |
look for structured box comprising source_entities, and if one is found use structured information to find the skin
Definition at line 259 of file Skinner.cpp.
References moab::Range::contains(), ErrorCode, moab::ScdInterface::find_boxes(), MB_SUCCESS, moab::Range::merge(), moab::Interface::query_interface(), moab::Range::size(), skin_box(), and thisMB.
Referenced by find_skin().
|
protected |
Find vertices on the skin of a set of mesh entities.
entities | The elements for which to find the skin. Range may NOT contain vertices, polyhedra, or entity sets. All elements in range must be of the same dimension. |
skin_verts | Output: the vertices on the skin. |
skin_elems | Optional output: elements representing sides of entities that are on the skin |
create_if_missing | If skin_elemts is non-null and this is true, create new elements representing the sides of entities on the skin. If this is false, skin_elems will contain only those skin elements that already exist. |
Definition at line 1013 of file Skinner.cpp.
References dim, moab::CN::Dimension(), entities, ErrorCode, find_skin_vertices_1D(), find_skin_vertices_2D(), find_skin_vertices_3D(), moab::Interface::get_number_entities_by_dimension(), MB_SUCCESS, MB_TAG_CREAT, MB_TYPE_BIT, MB_TYPE_OUT_OF_RANGE, moab::Interface::tag_delete(), moab::Interface::tag_get_handle(), moab::Interface::tag_set_data(), thisMB, and moab::TYPE_FROM_HANDLE().
Referenced by find_skin().
|
protected |
Skin edges.
Return any vertices adjacent to exactly one of the input edges.
Definition at line 1083 of file Skinner.cpp.
References moab::Range::all_of_dimension(), moab::Range::begin(), moab::Range::end(), ErrorCode, moab::Interface::get_adjacencies(), moab::Interface::get_connectivity(), moab::Range::insert(), MB_SUCCESS, MB_TYPE_OUT_OF_RANGE, moab::Interface::tag_get_data(), and thisMB.
Referenced by find_skin_vertices().
|
protected |
Skin faces.
For the set of face sides (logical edges), return vertices on such sides and/or edges equivalent to such sides.
faces | Set of toplogically 2D entities to skin. |
skin_verts | If non-NULL, skin vertices will be added to this container. |
skin_edges | If non-NULL, skin edges will be added to this container |
reverse_edges | If skin_edges is not NULL and this is not NULL, then any existing skin edges that are reversed with respect to the skin side will be placed in this range instead of skin_edges. Note: this argument is ignored if skin_edges is NULL. |
create_edges | If true, edges equivalent to face sides on the skin that don't already exist will be created. Note: this parameter is honored regardless of whether or not skin edges or vertices are returned. |
corners_only | If true, only skin vertices that correspond to the corners of sides will be returned (i.e. no higher-order nodes.) This argument is ignored if skin_verts is NULL. |
Definition at line 1553 of file Skinner.cpp.
References moab::Range::all_of_dimension(), moab::Range::begin(), moab::AdjSides< CORNERS >::begin(), moab::AdjSides< CORNERS >::clear(), moab::Range::end(), moab::AdjSides< CORNERS >::end(), ErrorCode, moab::AdjSides< CORNERS >::find_and_unmark(), moab::CN::HasMidEdgeNodes(), moab::CN::HONodeIndex(), moab::ID_FROM_HANDLE(), moab::AdjSides< CORNERS >::insert(), moab::Range::insert(), MB_SUCCESS, MB_TYPE_OUT_OF_RANGE, MBEDGE, MBQUAD, MBTRI, moab::AdjSides< CORNERS >::num_skin(), moab::CN::SideNumber(), and moab::TYPE_FROM_HANDLE().
Referenced by find_skin_vertices().
|
protected |
Skin volume mesh.
For the set of element sides (logical faces), return vertices on such sides and/or faces equivalent to such sides.
entities | Set of toplogically 3D entities to skin. |
skin_verts | If non-NULL, skin vertices will be added to this container. |
skin_faces | If non-NULL, skin faces will be added to this container |
reverse_faces | If skin_faces is not NULL and this is not NULL, then any existing skin faces that are reversed with respect to the skin side will be placed in this range instead of skin_faces. Note: this argument is ignored if skin_faces is NULL. |
create_faces | If true, face equivalent to sides on the skin that don't already exist will be created. Note: this parameter is honored regardless of whether or not skin faces or vertices are returned. |
corners_only | If true, only skin vertices that correspond to the corners of sides will be returned (i.e. no higher-order nodes.) This argument is ignored if skin_verts is NULL. |
Definition at line 1768 of file Skinner.cpp.
References moab::Range::all_of_dimension(), moab::Range::begin(), moab::AdjSides< CORNERS >::begin(), moab::AdjSides< CORNERS >::clear(), moab::Range::end(), moab::AdjSides< CORNERS >::end(), entities, moab::Range::erase(), ErrorCode, moab::AdjSides< CORNERS >::find_and_unmark(), moab::CN::HasMidNodes(), moab::ID_FROM_HANDLE(), moab::AdjSides< CORNERS >::insert(), moab::Range::insert(), MB_SUCCESS, MB_TYPE_OUT_OF_RANGE, MBPOLYHEDRON, MBQUAD, MBTRI, MBVERTEX, moab::Range::merge(), moab::AdjSides< CORNERS >::num_skin(), moab::CN::NumSubEntities(), moab::CN::SideNumber(), moab::CN::SubEntityNodeIndices(), moab::CN::SubEntityVertexIndices(), moab::TYPE_FROM_HANDLE(), moab::Range::upper_bound(), and moab::CN::VerticesPerEntity().
Referenced by find_skin_vertices().
|
protected |
Definition at line 965 of file Skinner.cpp.
References moab::Util::normal(), and thisMB.
Referenced by find_inferred_edges().
|
protected |
Definition at line 53 of file Skinner.cpp.
References add_adjacency(), entities, ErrorCode, moab::Interface::get_entities_by_type(), mAdjTag, MB_CHK_ERR, MB_SUCCESS, MB_TAG_BIT, MB_TAG_CREAT, MB_TAG_DENSE, MB_TYPE_BIT, MB_TYPE_OPAQUE, MBVERTEX, mDeletableMBTag, mTargetDim, moab::Interface::tag_get_handle(), moab::Interface::tag_set_data(), thisMB, moab::TYPE_FROM_HANDLE(), and moab::CN::TypeDimensionMap.
Referenced by classify_2d_boundary(), and find_skin_noadj().
|
protected |
Definition at line 632 of file Skinner.cpp.
References ErrorCode, moab::Interface::get_connectivity(), mAdjTag, MB_CHK_ERR, MB_SUCCESS, moab::Interface::tag_get_data(), and thisMB.
Referenced by find_skin_noadj().
|
protected |
skin a structured box, taking advantage of structured information
Definition at line 296 of file Skinner.cpp.
References moab::ScdBox::box_max(), moab::ScdBox::box_min(), dim, ErrorCode, moab::ScdBox::get_adj_edge_or_face(), moab::Interface::get_adjacencies(), moab::HomCoord::i(), moab::Range::insert(), moab::HomCoord::j(), moab::HomCoord::k(), MB_SUCCESS, moab::Range::merge(), thisMB, and moab::Interface::UNION.
Referenced by find_skin_scd().
|
protected |
Definition at line 50 of file Skinner.hpp.
Referenced by add_adjacency(), deinitialize(), find_match(), initialize(), and remove_adjacency().
|
protected |
Definition at line 49 of file Skinner.hpp.
Referenced by deinitialize(), entity_deletable(), and initialize().
|
protected |
Definition at line 51 of file Skinner.hpp.
Referenced by classify_2d_boundary(), find_skin_noadj(), and initialize().
|
protected |
the MB instance that this works with
Definition at line 47 of file Skinner.hpp.
Referenced by add_adjacency(), classify_2d_boundary(), deinitialize(), entity_deletable(), find_geometric_skin(), find_inferred_edges(), find_match(), find_skin(), find_skin_noadj(), find_skin_scd(), find_skin_vertices(), find_skin_vertices_1D(), has_larger_angle(), initialize(), remove_adjacency(), and skin_box().