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

James Porter jvporter at wisc.edu
Tue Jun 1 18:53:38 CDT 2010


I'm just going on what the iMesh.h documentation says:

* Create an entity set, either ordered (isList=1) or unordered
* (isList=0).  Unordered entity sets can contain a given entity or
* set only once.
...
* \param isList If non-zero, an ordered list is created, otherwise an
*        unordered set is created.

It was my impression that "ordered" here meant "the order in which you add entities is preserved", NOT "retrieving entities will retrieve them in order". That is, when isList is true, it looks like an std::list and when isList is false, it looks like an std::set. If this is wrong, we should probably update the documentation (maybe we should anyway, since "ordered" can be ambiguous).

Anyway, to remove any ambiguity, what I mean is that I have an std::set-like entity set, and after adding a bunch of entities to it, I try to get them back, but the result looks like this: { vertices, edges, faces, more vertices }. The behavior doesn't seem to match either type of entity set, since the order in which I add stuff is edges+faces first and then vertices.

- Jim

On 06/01/10, Tim Tautges  <tautges at mcs.anl.gov> wrote:

> Um, if isList=false, the set should be ordered.  If it is unordered, isList should be true, which means it is NOT stored in order.  Basically, an iMesh set is either a set or a list.
> 
> - tim
> 
> On 06/01/2010 06:05 PM, James Porter wrote:
> >Hey all,
> >
> >I was under the impression that unordered entity sets (isList=false) in
> >MOAB store their entities in sorted order, which means that they're also
> >sorted by dimension. However, I'm seeing vertices stored *after* edges
> >and faces in some code from MeshKit. If this is a bug, I'll see if I can
> >come up with a minimal test-case that fails, but I wanted to make sure
> >I'm not going crazy first.
> >
> >- Jim
> >
> >
> 
> -- 
> ================================================================
> "You will keep in perfect peace him whose mind is
>   steadfast, because he trusts in you."               Isaiah 26:3
> 
>              Tim Tautges            Argonne National Laboratory
>          (tautges at mcs.anl.gov)      (telecommuting from UW-Madison)
>          phone: (608) 263-8485      1500 Engineering Dr.
>            fax: (608) 263-4499      Madison, WI 53706


More information about the moab-dev mailing list