MOAB: Mesh Oriented datABase
(version 5.4.1)
|
#include <PatchIterator.hpp>
Public Member Functions | |
PatchIterator (PatchSet *set) | |
bool | get_next_patch (PatchData &, MsqError &err) |
PatchSet * | get_patch_set () const |
void | reset () |
reset current position to beginning o | |
Private Attributes | |
PatchSet * | patchSet |
std::vector < PatchSet::PatchHandle > | patches |
std::vector< Mesh::ElementHandle > | elems |
std::vector< Mesh::VertexHandle > | verts |
std::vector < PatchSet::PatchHandle > ::iterator | current |
Definition at line 39 of file PatchIterator.hpp.
MBMesquite::PatchIterator::PatchIterator | ( | PatchSet * | set | ) | [inline] |
Definition at line 42 of file PatchIterator.hpp.
: patchSet( set ) {}
bool MBMesquite::PatchIterator::get_next_patch | ( | PatchData & | pd, |
MsqError & | err | ||
) |
Definition at line 37 of file PatchIterator.cpp.
References current, elems, MBMesquite::PatchSet::get_mesh(), MBMesquite::PatchData::get_mesh(), MBMesquite::PatchSet::get_patch(), MBMesquite::PatchSet::get_patch_handles(), MBMesquite::MsqError::INVALID_STATE, MSQ_ERRZERO, MSQ_SETERR, patches, patchSet, MBMesquite::PatchSet::set_mesh(), MBMesquite::PatchData::set_mesh(), MBMesquite::PatchData::set_mesh_entities(), and verts.
Referenced by MBMesquite::PatchData::fill_global_patch(), MBMesquite::PatchPowerMeanP::initialize_block_coordinate_descent(), and VtkTest::test_elements().
{ if( !patches.size() ) { if( pd.get_mesh() != patchSet->get_mesh() ) { if( pd.get_mesh() == 0 ) pd.set_mesh( patchSet->get_mesh() ); else if( patchSet->get_mesh() == 0 ) patchSet->set_mesh( pd.get_mesh() ); else { MSQ_SETERR( err ) ( "PatchSet and PatchData do not share the same Mesh instance.", MsqError::INVALID_STATE ); return false; } } patchSet->get_patch_handles( patches, err ); MSQ_ERRZERO( err ); current = patches.begin(); } if( current == patches.end() ) return false; patchSet->get_patch( *current, elems, verts, err ); MSQ_ERRZERO( err ); pd.set_mesh_entities( elems, verts, err ); MSQ_ERRZERO( err ); ++current; return true; }
PatchSet* MBMesquite::PatchIterator::get_patch_set | ( | ) | const [inline] |
void MBMesquite::PatchIterator::reset | ( | ) |
std::vector< PatchSet::PatchHandle >::iterator MBMesquite::PatchIterator::current [private] |
Definition at line 59 of file PatchIterator.hpp.
Referenced by get_next_patch(), and reset().
std::vector< Mesh::ElementHandle > MBMesquite::PatchIterator::elems [private] |
Definition at line 57 of file PatchIterator.hpp.
Referenced by get_next_patch().
std::vector< PatchSet::PatchHandle > MBMesquite::PatchIterator::patches [private] |
Definition at line 56 of file PatchIterator.hpp.
Referenced by get_next_patch(), and reset().
PatchSet* MBMesquite::PatchIterator::patchSet [private] |
Definition at line 54 of file PatchIterator.hpp.
Referenced by get_next_patch(), and get_patch_set().
std::vector< Mesh::VertexHandle > MBMesquite::PatchIterator::verts [private] |
Definition at line 58 of file PatchIterator.hpp.
Referenced by get_next_patch().