[MOAB-dev] Order of entities in unordered entity sets?

James Porter jvporter at wisc.edu
Tue Jun 1 20:44:57 CDT 2010


On 06/01/10, Tim Tautges  <tautges at mcs.anl.gov> wrote:
> Groan; I won't even bother to explain the convoluted thinking behind my last answer.
> 
> The description below should be what you see; isList=true should give you a vector, which preserves order and allows duplicates; =false should return ordered entities.
> 
> The only thing I can think of is if you're asking for entities recursively and there are contained sets.  Is that the case?

As far as I know, I'm not. The basic structure of the code is like this (unless something really mysterious is happening):

1) Get an std::vector of edges and faces (should be sorted by handle thanks to STL algorithms)
2) Pass these entities to CopyMesh
3) CopyMesh puts these in an unordered set
4) iterate over non-vertex dimensions (edge, face, region)
   a) for each dimension, get all entities from the set
   b) get the adjacent verts of these entities and add them to the set

Once this gets done, it appears that the entities are not sorted, but CopyMesh later assumes that they are and it subsequently fails. Trying to work around this, it also seemed like the number of vertices was also wrong, but that might just be fallout from all this.

Steps 3 and 4 (the important bits, probably) can be seen here: <http://trac.mcs.anl.gov/projects/fathom/browser/MeshKit/trunk/algs/CopyMesh.cpp#L220>. Note however that there is a bug in the for loop. It should start at iBase_EDGE. This may be my fault when I moved stuff around in there.

- Jim


More information about the moab-dev mailing list