Mesh Oriented datABase
(version 5.4.1)
Array-based unstructured mesh datastructure
|
#include <SimpleMoab.h>
Definition at line 123 of file SimpleMoab.h.
smoab::Interface::Interface | ( | const std::string & | file | ) | [inline] |
Definition at line 126 of file SimpleMoab.h.
References moab::Interface::load_file(), and Moab.
{ this->Moab = new moab::Core(); this->Moab->load_file( file.c_str() ); }
smoab::Interface::~Interface | ( | ) | [inline] |
smoab::Range smoab::Interface::createAdjacencies | ( | const smoab::Range & | range, |
int | dimension, | ||
const smoab::adjacency_type | type = smoab::UNION |
||
) | const [inline] |
Definition at line 432 of file SimpleMoab.h.
References moab::Interface::get_adjacencies(), and Moab.
Referenced by smoab::ExtractShell::findSkins().
{ //the smoab and moab adjacent intersection enums are in the same order const int adjType = static_cast< int >( type ); smoab::Range result; const bool create_if_missing = true; this->Moab->get_adjacencies( range, dimension, create_if_missing, result, adjType ); return result; }
int smoab::Interface::dimension | ( | const smoab::EntityHandle & | entity | ) | const [inline] |
Definition at line 204 of file SimpleMoab.h.
References moab::Interface::dimension_from_handle(), and Moab.
{ return this->Moab->dimension_from_handle( entity ); }
smoab::EntityType smoab::Interface::entityType | ( | const smoab::EntityHandle & | entity | ) | const [inline] |
Definition at line 211 of file SimpleMoab.h.
References Moab, and moab::Interface::type_from_handle().
{ return this->Moab->type_from_handle( entity ); }
smoab::Range smoab::Interface::findAdjacencies | ( | const smoab::EntityHandle & | entity, |
int | dimension | ||
) | const [inline] |
Definition at line 406 of file SimpleMoab.h.
References moab::Interface::get_adjacencies(), smoab::INTERSECT, and Moab.
{ const int adjType = static_cast< int >( smoab::INTERSECT ); smoab::Range result; const bool create_if_missing = false; this->Moab->get_adjacencies( &entity, 1, dimension, create_if_missing, result, adjType ); return result; }
smoab::Range smoab::Interface::findAdjacencies | ( | const smoab::Range & | range, |
int | dimension, | ||
const smoab::adjacency_type | type = smoab::UNION |
||
) | const [inline] |
Definition at line 416 of file SimpleMoab.h.
References moab::Interface::get_adjacencies(), and Moab.
{ //the smoab and moab adjacent intersection enums are in the same order const int adjType = static_cast< int >( type ); smoab::Range result; const bool create_if_missing = false; this->Moab->get_adjacencies( range, dimension, create_if_missing, result, adjType ); return result; }
smoab::Range smoab::Interface::findAllMeshEntities | ( | smoab::EntityHandle const & | entity, |
bool | recurse = false |
||
) | const [inline] |
Definition at line 234 of file SimpleMoab.h.
References moab::Interface::get_entities_by_handle(), and Moab.
{ smoab::Range result; this->Moab->get_entities_by_handle( entity, result, recurse ); return result; }
smoab::Range smoab::Interface::findDetachedEntities | ( | const moab::EntityHandle & | root | ) | const [inline] |
Definition at line 358 of file SimpleMoab.h.
References moab::Range::begin(), moab::Range::end(), moab::Interface::get_entities_by_type(), moab::Range::insert(), MBENTITYSET, Moab, moab::Interface::num_child_meshsets(), and moab::Interface::num_parent_meshsets().
{ smoab::Range detached; typedef moab::Range::const_iterator iterator; moab::Range sets; this->Moab->get_entities_by_type( root, moab::MBENTITYSET, sets ); for( iterator i = sets.begin(); i != sets.end(); ++i ) { int numParents = 0, numChildren = 0; this->Moab->num_parent_meshsets( *i, &numParents ); if( numParents == 0 ) { this->Moab->num_child_meshsets( *i, &numChildren ); if( numChildren == 0 ) { detached.insert( *i ); } } } return detached; }
smoab::Range smoab::Interface::findEntities | ( | const smoab::EntityHandle | root, |
moab::EntityType | type | ||
) | const [inline] |
Definition at line 223 of file SimpleMoab.h.
References moab::Interface::get_entities_by_type(), and Moab.
{ smoab::Range result; // get all the sets of that type in the mesh this->Moab->get_entities_by_type( root, type, result ); return result; }
smoab::Range smoab::Interface::findEntitiesWithDimension | ( | const smoab::EntityHandle | root, |
const int | dimension, | ||
bool | recurse = false |
||
) | const [inline] |
Definition at line 285 of file SimpleMoab.h.
References moab::Range::begin(), children, moab::Range::end(), moab::Interface::get_child_meshsets(), moab::Interface::get_entities_by_dimension(), and Moab.
Referenced by smoab::DataSetConverter::fill(), and findHighestDimensionEntities().
{ typedef smoab::Range::const_iterator iterator; smoab::Range result; this->Moab->get_entities_by_dimension( root, dimension, result, recurse ); if( recurse ) { smoab::Range children; this->Moab->get_child_meshsets( root, children, 0 ); for( iterator i = children.begin(); i != children.end(); ++i ) { this->Moab->get_entities_by_dimension( *i, dimension, result ); } } return result; }
smoab::Range smoab::Interface::findEntitiesWithMultipleParents | ( | const smoab::EntityHandle & | root | ) | const [inline] |
Definition at line 384 of file SimpleMoab.h.
References moab::Range::begin(), children, moab::Range::end(), moab::Interface::get_child_meshsets(), moab::Range::insert(), Moab, and moab::Interface::num_parent_meshsets().
{ smoab::Range multipleParents; typedef moab::Range::const_iterator iterator; //for all the elements in the range, find all items with multiple parents moab::Range children; this->Moab->get_child_meshsets( root, children, 0 ); for( iterator i = children.begin(); i != children.end(); ++i ) { int numParents = 0; this->Moab->num_parent_meshsets( *i, &numParents ); if( numParents > 1 ) { multipleParents.insert( *i ); } } return multipleParents; }
smoab::Range smoab::Interface::findEntitiesWithTag | ( | const smoab::Tag & | tag, |
smoab::EntityHandle | root, | ||
moab::EntityType | type = moab::MBENTITYSET |
||
) | const [inline] |
Definition at line 246 of file SimpleMoab.h.
References moab::Range::begin(), moab::Range::end(), moab::Interface::get_entities_by_type_and_tag(), getMoabTag(), moab::Range::insert(), smoab::Tag::isComparable(), Moab, t, moab::Interface::tag_get_data(), and smoab::Tag::value().
Referenced by vtkMoabReader::CreateSubBlocks().
{ smoab::Range result; moab::Tag t = this->getMoabTag( tag ); // get all the entities of that type in the mesh this->Moab->get_entities_by_type_and_tag( root, type, &t, NULL, 1, result ); if( tag.isComparable() ) { int value = 0; //now we have to remove any that doesn't match the tag value smoab::Range resultMatchingTag; typedef moab::Range::const_iterator iterator; for( iterator i = result.begin(); i != result.end(); ++i ) { value = 0; moab::EntityHandle handle = *i; this->Moab->tag_get_data( t, &handle, 1, &value ); if( value == tag.value() ) { resultMatchingTag.insert( *i ); } } return resultMatchingTag; } else { //we return all the items we found return result; } }
smoab::Range smoab::Interface::findEntityRootParents | ( | const smoab::EntityHandle & | root | ) | const [inline] |
Definition at line 332 of file SimpleMoab.h.
References moab::Range::begin(), moab::Range::end(), moab::Interface::get_entities_by_type(), moab::Range::insert(), MBENTITYSET, Moab, moab::Interface::num_child_meshsets(), and moab::Interface::num_parent_meshsets().
Referenced by vtkMoabReader::CreateSubBlocks().
{ smoab::Range parents; typedef moab::Range::const_iterator iterator; moab::Range sets; this->Moab->get_entities_by_type( root, moab::MBENTITYSET, sets ); for( iterator i = sets.begin(); i != sets.end(); ++i ) { int numParents = 0, numChildren = 0; this->Moab->num_parent_meshsets( *i, &numParents ); if( numParents == 0 ) { this->Moab->num_child_meshsets( *i, &numChildren ); if( numChildren >= 0 ) { parents.insert( *i ); } } } return parents; }
smoab::Range smoab::Interface::findHighestDimensionEntities | ( | const smoab::EntityHandle & | entity, |
bool | recurse = false |
||
) | const [inline] |
Definition at line 307 of file SimpleMoab.h.
References dim, findEntitiesWithDimension(), moab::Interface::get_number_entities_by_dimension(), and Moab.
Referenced by smoab::DataSetConverter::fill().
{ //the goal is to load all entities that are not entity sets of this //node, while also subsetting by the highest dimension //lets find the entities of only the highest dimension int num_ents = 0; int dim = 3; while( num_ents <= 0 && dim > 0 ) { this->Moab->get_number_entities_by_dimension( entity, dim, num_ents, recurse ); --dim; } ++dim; //reincrement to correct last decrement if( num_ents > 0 ) { //we have found entities of a given dimension return this->findEntitiesWithDimension( entity, dim, recurse ); } return smoab::Range(); }
smoab::Range smoab::Interface::getChildSets | ( | const smoab::EntityHandle & | root | ) | const [inline] |
Definition at line 454 of file SimpleMoab.h.
References children, moab::Interface::get_child_meshsets(), and Moab.
{ smoab::Range children; this->Moab->get_child_meshsets( root, children, 0 ); return children; }
T smoab::Interface::getDefaultTagVaue | ( | moab::Tag | tag | ) | const [inline] |
Definition at line 151 of file SimpleMoab.h.
References Moab, T, and moab::Interface::tag_get_default_value().
Referenced by smoab::FaceAdjRegionValues(), and smoab::detail::ReadSparseTag::fillRawArray().
{ T defaultValue; this->Moab->tag_get_default_value( tag, &defaultValue ); return defaultValue; }
T smoab::Interface::getDefaultTagVaue | ( | smoab::Tag | tag | ) | const [inline] |
Definition at line 160 of file SimpleMoab.h.
References getMoabTag().
{ return this->getDefaultTagVaue< T >( getMoabTag( tag ) ); }
moab::Tag smoab::Interface::getMoabTag | ( | const smoab::Tag & | simpleTag | ) | const [inline] |
Definition at line 142 of file SimpleMoab.h.
References smoab::Tag::dataType(), Moab, smoab::Tag::name(), and moab::Interface::tag_get_handle().
Referenced by smoab::detail::ReadSparseTag::fillRawArray(), findEntitiesWithTag(), getDefaultTagVaue(), and getTagData().
{ moab::Tag tag; this->Moab->tag_get_handle( simpleTag.name(), 1, simpleTag.dataType(), tag ); return tag; }
smoab::EntityHandle smoab::Interface::getRoot | ( | ) | const [inline] |
Definition at line 217 of file SimpleMoab.h.
References moab::Interface::get_root_set(), and Moab.
Referenced by vtkMoabReader::CreateSubBlocks().
{ return this->Moab->get_root_set(); }
T smoab::Interface::getTagData | ( | moab::Tag | tag, |
const smoab::EntityHandle & | entity, | ||
T | value | ||
) | const [inline] |
Definition at line 167 of file SimpleMoab.h.
References Moab, and moab::Interface::tag_get_data().
Referenced by smoab::FaceAdjRegionValues(), smoab::detail::ReadSparseTag::fillRawArray(), and getTagData().
{ this->Moab->tag_get_data( tag, &entity, 1, &value ); return value; }
T smoab::Interface::getTagData | ( | smoab::Tag | tag, |
const smoab::EntityHandle & | entity, | ||
T | value = T() |
||
) | const [inline] |
Definition at line 175 of file SimpleMoab.h.
References getMoabTag(), and getTagData().
{ return this->getTagData( getMoabTag( tag ), entity, value ); }
std::string smoab::Interface::name | ( | const smoab::EntityHandle & | entity | ) | const [inline] |
Definition at line 182 of file SimpleMoab.h.
References ErrorCode, MB_SUCCESS, MB_TYPE_OPAQUE, Moab, NAME_TAG_NAME, NAME_TAG_SIZE, nameTag, moab::Interface::tag_get_data(), and moab::Interface::tag_get_handle().
Referenced by vtkMoabReader::CreateSubBlocks().
{ moab::Tag nameTag; moab::ErrorCode rval = this->Moab->tag_get_handle( NAME_TAG_NAME, NAME_TAG_SIZE, moab::MB_TYPE_OPAQUE, nameTag ); if( rval != moab::MB_SUCCESS ) { return std::string(); } char name[NAME_TAG_SIZE]; rval = this->Moab->tag_get_data( nameTag, &entity, 1, &name ); if( rval != moab::MB_SUCCESS ) { return std::string(); } return std::string( name ); }
int smoab::Interface::numChildMeshSets | ( | const smoab::EntityHandle & | root | ) | const [inline] |
Definition at line 446 of file SimpleMoab.h.
References Moab, and moab::Interface::num_child_meshsets().
{ int numChildren; this->Moab->num_child_meshsets( root, &numChildren ); return numChildren; }
void smoab::Interface::printRange | ( | const smoab::Range & | range | ) | const [inline] |
Definition at line 496 of file SimpleMoab.h.
References moab::Range::begin(), moab::Range::end(), moab::Interface::list_entity(), and Moab.
{ typedef Range::const_iterator iterator; for( iterator i = range.begin(); i != range.end(); ++i ) { std::cout << "entity id: " << *i << std::endl; this->Moab->list_entity( *i ); } }
void smoab::Interface::remove | ( | smoab::Range const & | toDelete | ) | const [inline] |
Definition at line 463 of file SimpleMoab.h.
References moab::Interface::delete_entities(), and Moab.
Referenced by smoab::ExtractShell::findSkins().
{ this->Moab->delete_entities( toDelete ); }
smoab::EntityHandle smoab::Interface::sideElement | ( | smoab::EntityHandle const & | cell, |
int | dim, | ||
int | side | ||
) | const [inline] |
Definition at line 470 of file SimpleMoab.h.
References Moab, and moab::Interface::side_element().
{ smoab::EntityHandle result( 0 ); this->Moab->side_element( cell, dim, side, result ); return result; }
std::vector< smoab::EntityHandle > smoab::Interface::sideElements | ( | smoab::EntityHandle const & | cell, |
int | dim | ||
) | const [inline] |
Definition at line 480 of file SimpleMoab.h.
References Moab, moab::CN::NumSubEntities(), moab::Interface::side_element(), and moab::Interface::type_from_handle().
Referenced by smoab::ExtractShell::findSkins().
{ const EntityType volumeCellType = this->Moab->type_from_handle( cell ); const int numSides = static_cast< int >( moab::CN::NumSubEntities( volumeCellType, dim ) ); std::vector< smoab::EntityHandle > result( numSides ); for( int side = 0; side < numSides; ++side ) { smoab::EntityHandle* sideElem = &result[side]; //get memory of vector this->Moab->side_element( cell, dim, side, *sideElem ); } return result; }
friend class smoab::DataSetConverter [friend] |
Definition at line 505 of file SimpleMoab.h.
friend class smoab::detail::LoadGeometry [friend] |
Definition at line 506 of file SimpleMoab.h.
friend class smoab::detail::LoadPoly [friend] |
Definition at line 507 of file SimpleMoab.h.
moab::Interface* smoab::Interface::Moab [private] |
Definition at line 510 of file SimpleMoab.h.
Referenced by createAdjacencies(), dimension(), entityType(), findAdjacencies(), findAllMeshEntities(), findDetachedEntities(), findEntities(), findEntitiesWithDimension(), findEntitiesWithMultipleParents(), findEntitiesWithTag(), findEntityRootParents(), findHighestDimensionEntities(), getChildSets(), getDefaultTagVaue(), getMoabTag(), getRoot(), getTagData(), Interface(), name(), numChildMeshSets(), printRange(), remove(), sideElement(), sideElements(), and ~Interface().