Entity sets - containment and parent-child

Carl Ollivier-Gooch cfog at mech.ubc.ca
Tue Nov 17 10:34:38 CST 2009


Mark Beall wrote:

> I did read the emails between you and Carl. I take it that issues 
> related to entity sets when the mesh is modified are still undefined.

Yes, they aren't.  IMO, sets used for classification (or equivalent) 
yield a simple, sensible collection of rules for modification, but other 
sets do not.  And we haven't discussed what to do when an entity being 
deleted is a tag -value-, either (this is something that implementations 
will have to handle under the hood if it's going to be efficient, and it 
may not be efficient even then).

> To start with a really simple question related to that, what is the 
> behavior for an iterator created by iMesh_initEntIter if the mesh is 
> modified while iterating over it? If, for example, I'm writing a routine 
> that will, say, iterate over all the regions in a mesh and do some 
> modification to some of them. That modification may delete and create 
> other regions in the mesh. What is the defined behavior of the iterator 
> with respect to the deleted and newly created regions?

The spec says that the iterator must never return an entity that has 
been deleted and is not required to iterate over new entities. 
Nevertheless, an iterator -can- iterate over some or all new entities if 
it chooses to.  The rules for new entities are the way they are because 
some iterator implementations can't handle new entities at all, while 
others are iterating through an entity container in which empty space is 
re-used.

Corner cases that are particularly challenging are things like deleting 
the last entity while the iterator is pointing to the second-last.  This 
one is the reason the iterator dereference function makes no promises 
about future data, only present data.

Carl

-- 
------------------------------------------------------------------------
Dr. Carl Ollivier-Gooch, P.Eng.                   Voice: +1-604-822-1854
Associate Professor                                 Fax: +1-604-822-2403
Department of Mechanical Engineering             email: cfog at mech.ubc.ca
University of British Columbia              http://www.mech.ubc.ca/~cfog
Vancouver, BC  V6T 1Z4                  http://tetra.mech.ubc.ca/ANSLab/
------------------------------------------------------------------------


More information about the tstt-interface mailing list