MOAB: Mesh Oriented datABase
(version 5.2.1)
|
#include <SimpleMoab.h>
Definition at line 85 of file SimpleMoab.h.
smoab::Interface::Interface | ( | const std::string & | file | ) | [inline] |
Definition at line 88 of file SimpleMoab.h.
References 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 404 of file SimpleMoab.h.
References 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 165 of file SimpleMoab.h.
References Moab.
{ return this->Moab->dimension_from_handle(entity); }
smoab::EntityType smoab::Interface::entityType | ( | const smoab::EntityHandle & | entity | ) | const [inline] |
Definition at line 172 of file SimpleMoab.h.
References Moab.
{ return this->Moab->type_from_handle(entity); }
smoab::Range smoab::Interface::findAdjacencies | ( | const smoab::EntityHandle & | entity, |
int | dimension | ||
) | const [inline] |
Definition at line 369 of file SimpleMoab.h.
References 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 385 of file SimpleMoab.h.
References 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 192 of file SimpleMoab.h.
References 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 321 of file SimpleMoab.h.
References moab::Range::begin(), moab::Range::end(), moab::Range::insert(), MBENTITYSET, and Moab.
{ 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 181 of file SimpleMoab.h.
References 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 246 of file SimpleMoab.h.
References moab::Range::begin(), children, moab::Range::end(), 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 347 of file SimpleMoab.h.
References moab::Range::begin(), children, moab::Range::end(), moab::Range::insert(), and Moab.
{ 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 205 of file SimpleMoab.h.
References moab::Range::begin(), moab::Range::end(), getMoabTag(), moab::Range::insert(), smoab::Tag::isComparable(), Moab, t, smoab::Tag::value(), and 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 295 of file SimpleMoab.h.
References moab::Range::begin(), moab::Range::end(), moab::Range::insert(), MBENTITYSET, and Moab.
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 269 of file SimpleMoab.h.
References dim, findEntitiesWithDimension(), 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 429 of file SimpleMoab.h.
References children, 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 116 of file SimpleMoab.h.
Referenced by smoab::FaceAdjRegionValues(), and smoab::detail::ReadSparseTag::fillRawArray().
T smoab::Interface::getDefaultTagVaue | ( | smoab::Tag | tag | ) | const [inline] |
Definition at line 125 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 104 of file SimpleMoab.h.
References smoab::Tag::dataType(), Moab, and smoab::Tag::name().
Referenced by smoab::detail::ReadSparseTag::fillRawArray(), findEntitiesWithTag(), getDefaultTagVaue(), and getTagData().
smoab::EntityHandle smoab::Interface::getRoot | ( | ) | const [inline] |
Definition at line 178 of file SimpleMoab.h.
References 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 132 of file SimpleMoab.h.
Referenced by smoab::FaceAdjRegionValues(), smoab::detail::ReadSparseTag::fillRawArray(), and getTagData().
T smoab::Interface::getTagData | ( | smoab::Tag | tag, |
const smoab::EntityHandle & | entity, | ||
T | value = T() |
||
) | const [inline] |
Definition at line 140 of file SimpleMoab.h.
References getMoabTag(), getTagData(), and value().
{ return this->getTagData(getMoabTag(tag),entity,value); }
std::string smoab::Interface::name | ( | const smoab::EntityHandle & | entity | ) | const [inline] |
Definition at line 147 of file SimpleMoab.h.
References MB_SUCCESS, MB_TYPE_OPAQUE, Moab, NAME_TAG_NAME, NAME_TAG_SIZE, and nameTag.
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 421 of file SimpleMoab.h.
References Moab.
{ int numChildren; this->Moab->num_child_meshsets(root,&numChildren); return numChildren; }
void smoab::Interface::printRange | ( | const smoab::Range & | range | ) | const [inline] |
Definition at line 475 of file SimpleMoab.h.
References moab::Range::begin(), moab::Range::end(), and Moab.
void smoab::Interface::remove | ( | smoab::Range const & | toDelete | ) | const [inline] |
Definition at line 438 of file SimpleMoab.h.
References 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 445 of file SimpleMoab.h.
References Moab.
{ 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 456 of file SimpleMoab.h.
References Moab, and moab::CN::NumSubEntities().
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 484 of file SimpleMoab.h.
friend class smoab::detail::LoadGeometry [friend] |
Definition at line 485 of file SimpleMoab.h.
friend class smoab::detail::LoadPoly [friend] |
Definition at line 486 of file SimpleMoab.h.
moab::Interface* smoab::Interface::Moab [private] |
Definition at line 488 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().