[MOAB-dev] iMesh_stepIter

Steve Jackson stjackson at wisc.edu
Wed Feb 22 15:56:01 CST 2012


On Feb 22, 2012, at 15:45 , James Porter wrote:

> On Wed, 2012-02-22 at 15:38 -0600, Tim Tautges wrote:
>> What's the difference between that and getNextEntIter?  If you're likely to want to step over multiple items, wouldn't 
>> you already be using an ArrIter?
> 
> I'll let Steve chime in on this, but this is part of working with
> structured meshes. I think Steve wants to get one element at a time, but
> sometimes he needs to skip ahead to get to the elements he cares about.
> Since doing that with getNextEntIter is an O(N) operation, it's not as
> good as using stepIter, which is O(1), at least for list-type sets.

Jim's correct: what I'm after is a fast way to jump to a given element (i,j,k) in a structured mesh, knowing only the structured mesh's dimensions, and the order in which vertices and elements are stored (i.e. fortran-order, with the x dimension changing fastest).  iMesh offers no way to walk over the elements of a set except iterators; in this case, I want the N'th item an iterator will give me, but I don't want to step it N times.  

In C-level iMesh I could cheat and do math on EntityHandles (by assuming that a structured mesh has contiguous and ordered handles), but PyTAPS doesn't allow mathematics on handles.  Even if it did, I'd rather be able to access structured mesh elements without having to go behind the library's back by manipulating its (theoretically opaque) handles mathematically.
~S


More information about the moab-dev mailing list