[MOAB-dev] r1480 - MOAB/trunk
tautges at mcs.anl.gov
tautges at mcs.anl.gov
Wed Dec 19 14:41:47 CST 2007
Author: tautges
Date: 2007-12-19 14:41:46 -0600 (Wed, 19 Dec 2007)
New Revision: 1480
Modified:
MOAB/trunk/MBMeshSet.cpp
Log:
Change implementation of range-based entity removal from range-based sets, to use range booleans instead of individual element removal from ranges. This speeds up one of my applications by an order of magnitude.
Passes make check.
Modified: MOAB/trunk/MBMeshSet.cpp
===================================================================
--- MOAB/trunk/MBMeshSet.cpp 2007-12-19 20:38:26 UTC (rev 1479)
+++ MOAB/trunk/MBMeshSet.cpp 2007-12-19 20:41:46 UTC (rev 1480)
@@ -347,20 +347,18 @@
MBEntityHandle mEntityHandle,
AEntityFactory* mAdjFact )
{
- MBRange::const_iterator iter = entities.begin();
- for(; iter != entities.end(); ++iter)
- {
- MBRange::iterator found = mRange.find(*iter);
- if(found != mRange.end())
- {
- mRange.erase(found);
- if(tracking() && mAdjFact)
- mAdjFact->remove_adjacency(*iter, mEntityHandle);
+ MBRange common_ents = mRange.intersect(entities);
+ MBRange tmp_range = mRange.subtract(common_ents);
+ mRange.swap(tmp_range);
+
+ if(tracking() && mAdjFact) {
+ for(MBRange::const_iterator iter = common_ents.begin();
+ iter != common_ents.end(); iter++) {
+ mAdjFact->remove_adjacency(*iter, mEntityHandle);
}
}
return MB_SUCCESS;
-
}
MBErrorCode MBMeshSet_MBRange::remove_entities( const MBEntityHandle *entities,
More information about the moab-dev
mailing list