MeshTopoUtil contains general mesh utility functions. More...
#include <MeshTopoUtil.hpp>
Public Member Functions | |
MeshTopoUtil (Interface *impl) | |
~MeshTopoUtil () | |
ErrorCode | construct_aentities (const Range &vertices) |
generate all the AEntities bounding the vertices More... | |
ErrorCode | get_average_position (Range &entities, double *avg_position) |
given an entity, get its average position (avg vertex locations) More... | |
ErrorCode | get_average_position (const EntityHandle entity, double *avg_position) |
given an entity, get its average position (avg vertex locations) More... | |
ErrorCode | get_average_position (const EntityHandle *entities, const int num_entities, double *avg_position) |
given a set of entities, get their average position (avg vertex locations) More... | |
ErrorCode | get_manifold (const EntityHandle star_entity, const int target_dim, Range &manifold) |
get (target_dim)-dimensional manifold entities connected to star_entity; that is, the entities with <= 1 connected (target_dim+2)-dimensional adjacent entities; for target_dim=3, just return all of them just insert into the list, w/o clearing manifold list first More... | |
ErrorCode | star_entities (const EntityHandle star_center, std::vector< EntityHandle > &star_entities, bool &bdy_entity, const EntityHandle starting_star_entity=0, std::vector< EntityHandle > *star_entities_dp1=NULL, Range *star_entities_candidates_dp1=NULL) |
given an entity, find the entities of next higher dimension around that entity, ordered by connection through next higher dimension entities; if any of the star entities is in only entity of next higher dimension, on_boundary is returned true More... | |
ErrorCode | star_entities_nonmanifold (const EntityHandle star_entity, std::vector< std::vector< EntityHandle > > &stars, std::vector< bool > *bdy_flags=NULL, std::vector< std::vector< EntityHandle > > *dp2_stars=NULL) |
Get a series of (d+1)-dimensional stars around a d-dimensional entity, such that each star is on a (d+2)-manifold containing the d-dimensional entity; each star is either open or closed, and also defines a (d+2)-star whose entities are bounded by (d+1)-entities on the star and on the (d+2)-manifold. More... | |
ErrorCode | star_next_entity (const EntityHandle star_center, const EntityHandle last_entity, const EntityHandle last_dp1, Range *star_candidates_dp1, EntityHandle &next_entity, EntityHandle &next_dp1) |
given a star_center, a last_entity (whose dimension should be 1 greater than center) and last_dp1 (dimension 2 higher than center), returns the next star entity across last_dp1, and the next dp1 entity sharing next_entity; if star_candidates is non-empty, star must come from those More... | |
ErrorCode | get_bridge_adjacencies (Range &from_entities, int bridge_dim, int to_dim, Range &to_ents, int num_layers=1) |
get "bridge" or "2nd order" adjacencies, going through dimension bridge_dim More... | |
ErrorCode | get_bridge_adjacencies (const EntityHandle from_entity, const int bridge_dim, const int to_dim, Range &to_adjs) |
get "bridge" or "2nd order" adjacencies, going through dimension bridge_dim More... | |
EntityHandle | common_entity (const EntityHandle ent1, const EntityHandle ent2, const int dim) |
return a common entity of the specified dimension, or 0 if there isn't one More... | |
ErrorCode | opposite_entity (const EntityHandle parent, const EntityHandle child, EntityHandle &opposite_element) |
return the opposite side entity given a parent and bounding entity. This function is only defined for certain types of parent/child types; See MBCN.hpp::OppositeSide for details. More... | |
ErrorCode | split_entity_nonmanifold (EntityHandle split_ent, Range &old_adjs, Range &new_adjs, EntityHandle &new_entity) |
split entity which is non-manifold, that is, which has > 2 connected entities of next higher dimension; assumes that there are >= 2 connected regions of (d+2)-dimensional entities; a new d-entity is created for each region after the first, and it's made explicitly-adjacent to the region to which it corresponds More... | |
ErrorCode | split_entities_manifold (Range &entities, Range &new_entities, Range *fill_entities) |
split entities that are manifold (shared by two or less entities of each higher dimension), optionally creating an entity of next higher dimension to fill the gap More... | |
ErrorCode | split_entities_manifold (EntityHandle *entities, const int num_entities, EntityHandle *new_entities, Range *fill_entities, EntityHandle *gowith_ents=NULL) |
split entities that are manifold (shared by two or less entities of each higher dimension), optionally creating an entity of next higher dimension to fill the gap More... | |
bool | equivalent_entities (const EntityHandle entity, Range *equiv_ents=NULL) |
return whether entity is equivalent to any other of same type and same vertices; if equivalent entity is found, it's returned in equiv_ents and return value is true, false otherwise. More... | |
Private Attributes | |
Interface * | mbImpl |
MeshTopoUtil contains general mesh utility functions.
Definition at line 30 of file MeshTopoUtil.hpp.
|
inline |
Definition at line 33 of file MeshTopoUtil.hpp.
|
inline |
Definition at line 35 of file MeshTopoUtil.hpp.
EntityHandle moab::MeshTopoUtil::common_entity | ( | const EntityHandle | ent1, |
const EntityHandle | ent2, | ||
const int | dim | ||
) |
return a common entity of the specified dimension, or 0 if there isn't one
Definition at line 541 of file MeshTopoUtil.cpp.
References moab::Range::begin(), dim, moab::Range::empty(), ErrorCode, moab::Interface::get_adjacencies(), moab::Range::insert(), MB_SUCCESS, and mbImpl.
Referenced by moab::DualTool::foc_get_ents(), moab::DualTool::fs_check_quad_sense(), moab::AEntityFactory::get_element(), moab::DualTool::get_opposite_verts(), split_entity_nonmanifold(), moab::DualTool::split_pair_nonmanifold(), and star_next_entity().
generate all the AEntities bounding the vertices
Definition at line 37 of file MeshTopoUtil.cpp.
References moab::Range::clear(), ErrorCode, moab::Interface::get_adjacencies(), MB_SUCCESS, mbImpl, and moab::Interface::UNION.
Referenced by SphereDecomp::build_sphere_mesh(), and moab::DualTool::construct_dual().
bool moab::MeshTopoUtil::equivalent_entities | ( | const EntityHandle | entity, |
Range * | equiv_ents = NULL |
||
) |
return whether entity is equivalent to any other of same type and same vertices; if equivalent entity is found, it's returned in equiv_ents and return value is true, false otherwise.
Definition at line 978 of file MeshTopoUtil.cpp.
References moab::Interface::dimension_from_handle(), moab::dum, ErrorCode, moab::Interface::get_adjacencies(), moab::Interface::get_connectivity(), MB_SUCCESS, mbImpl, and moab::Range::swap().
Referenced by moab::DualTool::face_shrink(), moab::DualTool::rev_face_shrink(), and split_entities_manifold().
ErrorCode moab::MeshTopoUtil::get_average_position | ( | const EntityHandle * | entities, |
const int | num_entities, | ||
double * | avg_position | ||
) |
given a set of entities, get their average position (avg vertex locations)
given an entity, get its average position (avg vertex locations)
Definition at line 61 of file MeshTopoUtil.cpp.
References moab::Range::begin(), moab::Range::empty(), moab::Range::end(), entities, ErrorCode, moab::Interface::get_adjacencies(), moab::Interface::get_coords(), MB_SUCCESS, mbImpl, moab::Range::size(), and moab::Interface::UNION.
ErrorCode moab::MeshTopoUtil::get_average_position | ( | const EntityHandle | entity, |
double * | avg_position | ||
) |
given an entity, get its average position (avg vertex locations)
Definition at line 90 of file MeshTopoUtil.cpp.
References ErrorCode, get_average_position(), moab::Interface::get_connectivity(), moab::Interface::get_coords(), MB_SUCCESS, mbImpl, MBVERTEX, and moab::Interface::type_from_handle().
given an entity, get its average position (avg vertex locations)
Definition at line 53 of file MeshTopoUtil.cpp.
References entities.
Referenced by moab::DualTool::add_graphics_point(), MetisPartitioner::assemble_graph(), ZoltanPartitioner::assemble_graph(), MetisPartitioner::assemble_taggedsets_graph(), SphereDecomp::compute_nodes(), moab::DualTool::construct_dual_edges(), moab::DualTool::construct_dual_faces(), moab::DualTool::construct_dual_vertex(), get_average_position(), and ZoltanPartitioner::partition_owned_cells().
ErrorCode moab::MeshTopoUtil::get_bridge_adjacencies | ( | const EntityHandle | from_entity, |
const int | bridge_dim, | ||
const int | to_dim, | ||
Range & | to_adjs | ||
) |
get "bridge" or "2nd order" adjacencies, going through dimension bridge_dim
Definition at line 448 of file MeshTopoUtil.cpp.
References moab::Range::clear(), moab::CN::Dimension(), moab::Range::erase(), ErrorCode, moab::Interface::get_adjacencies(), moab::Interface::get_connectivity(), moab::Range::insert(), moab::Interface::INTERSECT, moab::MAX_SUB_ENTITIES, MB_SUCCESS, MBENTITYSET, mbImpl, MBPOLYGON, MBVERTEX, moab::Range::merge(), moab::CN::NumSubEntities(), moab::CN::SubEntityType(), moab::CN::SubEntityVertexIndices(), moab::TYPE_FROM_HANDLE(), moab::Interface::UNION, and moab::CN::VerticesPerEntity().
ErrorCode moab::MeshTopoUtil::get_bridge_adjacencies | ( | Range & | from_entities, |
int | bridge_dim, | ||
int | to_dim, | ||
Range & | to_ents, | ||
int | num_layers = 1 |
||
) |
get "bridge" or "2nd order" adjacencies, going through dimension bridge_dim
Definition at line 402 of file MeshTopoUtil.cpp.
References moab::Range::empty(), ErrorCode, moab::Interface::get_adjacencies(), MB_SUCCESS, mbImpl, moab::Range::merge(), nl, moab::subtract(), and moab::Interface::UNION.
Referenced by MetisPartitioner::assemble_graph(), ZoltanPartitioner::assemble_graph(), moab::TempestOnlineMap::ComputeAdjacencyRelations(), moab::TempestRemapper::ComputeOverlapMesh(), moab::DualTool::face_shrink(), moab::DualTool::foc_delete_dual(), moab::ParallelComm::get_ghosted_entities(), iMOAB_GetNeighborElements(), moab::DualTool::next_loop_vertex(), ZoltanPartitioner::partition_owned_cells(), and moab::DualTool::traverse_hyperplane().
ErrorCode moab::MeshTopoUtil::get_manifold | ( | const EntityHandle | star_entity, |
const int | target_dim, | ||
Range & | manifold | ||
) |
get (target_dim)-dimensional manifold entities connected to star_entity; that is, the entities with <= 1 connected (target_dim+2)-dimensional adjacent entities; for target_dim=3, just return all of them just insert into the list, w/o clearing manifold list first
Definition at line 372 of file MeshTopoUtil.cpp.
References moab::Range::begin(), moab::Range::end(), ErrorCode, moab::Interface::get_adjacencies(), moab::Range::insert(), MB_SUCCESS, mbImpl, moab::Range::merge(), and moab::Range::size().
Referenced by star_entities_nonmanifold().
ErrorCode moab::MeshTopoUtil::opposite_entity | ( | const EntityHandle | parent, |
const EntityHandle | child, | ||
EntityHandle & | opposite_element | ||
) |
return the opposite side entity given a parent and bounding entity. This function is only defined for certain types of parent/child types; See MBCN.hpp::OppositeSide for details.
return the opposite side entity given a parent and bounding entity. This function is only defined for certain types of parent/child types; See CN.hpp::OppositeSide for details.
parent | The parent element |
child | The child element |
opposite_element | The index of the opposite element |
Definition at line 560 of file MeshTopoUtil.cpp.
References child, moab::Interface::dimension_from_handle(), ErrorCode, MB_SUCCESS, mbImpl, moab::CN::OppositeSide(), moab::Interface::side_element(), moab::Interface::side_number(), and moab::Interface::type_from_handle().
Referenced by moab::ReadCCMIO::create_cell_from_faces(), and moab::DualTool::foc_get_ents().
ErrorCode moab::MeshTopoUtil::split_entities_manifold | ( | EntityHandle * | entities, |
const int | num_entities, | ||
EntityHandle * | new_entities, | ||
Range * | fill_entities, | ||
EntityHandle * | gowith_ents = NULL |
||
) |
split entities that are manifold (shared by two or less entities of each higher dimension), optionally creating an entity of next higher dimension to fill the gap
entities | The entities to be split |
new_entities | New entities, in order of correspondence to that of entities |
fill_entities | If non-NULL, create an entity of next higher dimension to fill the gap, passing it back in *fill_entities |
gowith_ents | If non-NULL, each of the new entities will adj to the corresponding gowith entities after the split; this parameter is ignored for boundary split entities; in that case, the split entity remains on the boundary (i.e. not adj to any entity of higher dimension). Dimension of gowith_ents must be the same as entities. |
Definition at line 606 of file MeshTopoUtil.cpp.
References moab::Interface::add_adjacencies(), moab::Range::begin(), moab::Interface::create_element(), dim, moab::CN::Dimension(), moab::Range::end(), entities, equivalent_entities(), ErrorCode, moab::Interface::get_adjacencies(), GET_CONNECT_DECL, moab::Range::insert(), MB_SUCCESS, MBEDGE, mbImpl, MBPOLYGON, MBPOLYHEDRON, moab::Range::rbegin(), moab::Interface::remove_adjacencies(), size, TC, moab::Interface::type_from_handle(), and moab::TYPE_FROM_HANDLE().
ErrorCode moab::MeshTopoUtil::split_entities_manifold | ( | Range & | entities, |
Range & | new_entities, | ||
Range * | fill_entities | ||
) |
split entities that are manifold (shared by two or less entities of each higher dimension), optionally creating an entity of next higher dimension to fill the gap
entities | The entities to be split |
new_entities | New entities, in order of correspondence to that of entities |
fill_entities | If non-NULL, create an entity of next higher dimension to fill the gap, passing it back in *fill_entities |
Definition at line 582 of file MeshTopoUtil.cpp.
References moab::Range::clear(), entities, ErrorCode, moab::Range::insert(), MB_SUCCESS, and moab::Range::merge().
Referenced by moab::DualTool::split_pair_nonmanifold().
ErrorCode moab::MeshTopoUtil::split_entity_nonmanifold | ( | EntityHandle | split_ent, |
Range & | old_adjs, | ||
Range & | new_adjs, | ||
EntityHandle & | new_entity | ||
) |
split entity which is non-manifold, that is, which has > 2 connected entities of next higher dimension; assumes that there are >= 2 connected regions of (d+2)-dimensional entities; a new d-entity is created for each region after the first, and it's made explicitly-adjacent to the region to which it corresponds
Definition at line 754 of file MeshTopoUtil.cpp.
References moab::Interface::add_adjacencies(), moab::Range::begin(), common_entity(), moab::Interface::create_element(), moab::Interface::create_vertex(), moab::Interface::dimension_from_handle(), moab::Range::end(), ErrorCode, moab::Interface::get_adjacencies(), moab::Interface::get_connectivity(), moab::Interface::get_coords(), moab::Range::insert(), mbImpl, MBVERTEX, moab::Interface::remove_adjacencies(), RR, moab::Interface::set_connectivity(), moab::subtract(), moab::Interface::type_from_handle(), and moab::Interface::UNION.
Referenced by moab::DualTool::split_pair_nonmanifold().
ErrorCode moab::MeshTopoUtil::star_entities | ( | const EntityHandle | star_center, |
std::vector< EntityHandle > & | star_entities, | ||
bool & | bdy_entity, | ||
const EntityHandle | starting_star_entity = 0 , |
||
std::vector< EntityHandle > * | star_entities_dp1 = NULL , |
||
Range * | star_entities_candidates_dp1 = NULL |
||
) |
given an entity, find the entities of next higher dimension around that entity, ordered by connection through next higher dimension entities; if any of the star entities is in only entity of next higher dimension, on_boundary is returned true
Definition at line 106 of file MeshTopoUtil.cpp.
References moab::Interface::dimension_from_handle(), moab::Range::erase(), ErrorCode, moab::Interface::get_adjacencies(), MB_SUCCESS, mbImpl, and star_next_entity().
Referenced by moab::DualTool::foc_get_stars(), moab::DualTool::get_radial_dverts(), and star_entities_nonmanifold().
ErrorCode moab::MeshTopoUtil::star_entities_nonmanifold | ( | const EntityHandle | star_entity, |
std::vector< std::vector< EntityHandle > > & | stars, | ||
std::vector< bool > * | bdy_flags = NULL , |
||
std::vector< std::vector< EntityHandle > > * | dp2_stars = NULL |
||
) |
Get a series of (d+1)-dimensional stars around a d-dimensional entity, such that each star is on a (d+2)-manifold containing the d-dimensional entity; each star is either open or closed, and also defines a (d+2)-star whose entities are bounded by (d+1)-entities on the star and on the (d+2)-manifold.
Definition at line 264 of file MeshTopoUtil.cpp.
References moab::Range::begin(), moab::Interface::dimension_from_handle(), moab::Range::empty(), moab::Range::end(), moab::Range::erase(), ErrorCode, moab::Interface::get_adjacencies(), get_manifold(), MB_SUCCESS, mbImpl, star_entities(), and moab::Interface::UNION.
ErrorCode moab::MeshTopoUtil::star_next_entity | ( | const EntityHandle | star_center, |
const EntityHandle | last_entity, | ||
const EntityHandle | last_dp1, | ||
Range * | star_candidates_dp1, | ||
EntityHandle & | next_entity, | ||
EntityHandle & | next_dp1 | ||
) |
given a star_center, a last_entity (whose dimension should be 1 greater than center) and last_dp1 (dimension 2 higher than center), returns the next star entity across last_dp1, and the next dp1 entity sharing next_entity; if star_candidates is non-empty, star must come from those
Definition at line 191 of file MeshTopoUtil.cpp.
References moab::Range::begin(), moab::Range::clear(), common_entity(), dim, moab::Interface::dimension_from_handle(), moab::Range::empty(), moab::Range::end(), moab::Range::erase(), ErrorCode, moab::Interface::get_adjacencies(), moab::Range::insert(), moab::intersect(), MB_SUCCESS, mbImpl, moab::Range::size(), and moab::Interface::UNION.
Referenced by star_entities().
|
private |
Definition at line 155 of file MeshTopoUtil.hpp.
Referenced by common_entity(), construct_aentities(), equivalent_entities(), get_average_position(), get_bridge_adjacencies(), get_manifold(), opposite_entity(), split_entities_manifold(), split_entity_nonmanifold(), star_entities(), star_entities_nonmanifold(), and star_next_entity().