[MOAB-dev] r4828 - MOAB/trunk/src
iulian at mcs.anl.gov
iulian at mcs.anl.gov
Sat May 14 00:12:00 CDT 2011
Author: iulian
Date: 2011-05-14 00:11:58 -0500 (Sat, 14 May 2011)
New Revision: 4828
Modified:
MOAB/trunk/src/FBEngine.cpp
Log:
replace ranges in flood filling with std::set
performance is better, but still not very good.
maybe a tag/marker will be faster.
Modified: MOAB/trunk/src/FBEngine.cpp
===================================================================
--- MOAB/trunk/src/FBEngine.cpp 2011-05-13 21:46:32 UTC (rev 4827)
+++ MOAB/trunk/src/FBEngine.cpp 2011-05-14 05:11:58 UTC (rev 4828)
@@ -1466,6 +1466,8 @@
// get a positive triangle adjacent to mesh_edge[0]
// add to first triangles to the left, second triangles to the right of the mesh_edges ;
+ std::set<EntityHandle> firstSet;
+ std::set<EntityHandle> secondSet;
for (Range::iterator it = mesh_edges.begin(); it!=mesh_edges.end(); it++)
{
EntityHandle meshEdge = *it;
@@ -1481,28 +1483,16 @@
rval = _mbImpl->side_number(tr, meshEdge, num1, sense, offset);
MBERRORR(rval, "edge not adjacent");
if (sense==1)
- first.insert(tr);
+ firstSet.insert(tr);
else
- second.insert(tr);
+ secondSet.insert(tr);
}
}
- Range edges_of_new_triangles;
- rval = _mbImpl->get_adjacencies(new_triangles,
- 1, true, edges_of_new_triangles, Interface::UNION);
- MBERRORR(rval, "can't get new edges");
-
// get the first new triangle: will be part of first set;
// flood fill first set, the rest will be in second set
//first.insert(new_triangles[0]);
// the edges from new_geo_edge will not be crossed
- Range splittingEdges;
- rval = _mbImpl->get_entities_by_type(new_geo_edge, MBEDGE, splittingEdges);
- MBERRORR(rval, "can't get new polyline edges");
- //
- Range iniTriangles;
- rval = _mbImpl -> get_entities_by_type(face, MBTRI, iniTriangles);
- MBERRORR(rval, "can't get tri from initial face");
// get edges of face (adjacencies)
// also get the old boundary edges, from face; they will be edges to not cross
@@ -1521,17 +1511,17 @@
Range doNotCrossEdges = unite(initialBoundaryEdges, mesh_edges);// add the splitting edges !
std::queue<EntityHandle> firstQueue;
- for (Range::iterator it3 = first.begin(); it3!=first.end(); it3++)
+ for (std::set<EntityHandle>::iterator it3 = firstSet.begin(); it3!=firstSet.end(); it3++)
{
More information about the moab-dev
mailing list