[MOAB-dev] Range contiguity method

Vijay S. Mahadevan vijay.m at gmail.com
Wed Aug 9 20:35:00 CDT 2017


> Perhaps a quicker way would be to check that there is no more than one pair
> in the Range rather than iterating over them all,

Yes, you can check for psize==1 and do something optimized since the
sequences are always contiguous. If psize>1, you can use the iterator
and not worry about traversing the Range object, immaterial of how
segmented the data may be.

> but there probably aren't
> many pairs in Ranges in practice. Is that right?

This entirely depends on how you queried your data and populated the
Range object. The mesh that you load in parallel matters too. In
general, if the entities are well ordered, in serial you would have
one sequence only. In parallel, you could have 2 or more, depending on
the number of ghost entities. However, since Range is a general
object, if you were to insert just random series of entities, it will
result in a pretty segmented data underneath. You might as well be
well off using a std::vector in such a case, since you are not saving
much on memory.

Vijay

On Wed, Aug 9, 2017 at 7:52 PM, Patrick Shriwise <shriwise at wisc.edu> wrote:
> Hi Vijay,
>
> After some exploring, I saw the psize method. That would do the trick.
>
> Perhaps a quicker way would be to check that there is no more than one pair
> in the Range rather than iterating over them all, but there probably aren't
> many pairs in Ranges in practice. Is that right?
>
> Cheers,
>
> Patrick C. Shriwise
> Research Fellow
> University of Wisconsin - Madison
> Engineering Research Building - Rm. 428
> 1500 Engineering Drive
> Madison, WI 53706
> (608) 446-8173
>
>
> On 8/9/17 5:38 PM, Vijay S. Mahadevan wrote:
>>
>> Patrick, you are looking for something like Range::psize() [1], which
>> returns the number of non-contiguous sequences in the object. Does
>> that help ? If this is not what you are asking, them I'm unclear what
>> you mean by "rapidly check that a Range object contains a set of
>> contiguous values".
>>
>> Vijay
>>
>> [1]
>> ftp://ftp.mcs.anl.gov/pub/fathom/moab-docs/classmoab_1_1Range.html#a04d1b55838117d5ef4ba3c4dfb4d2df0
>>
>> On Tue, Aug 8, 2017 at 11:30 PM, Patrick Shriwise <shriwise at wisc.edu>
>> wrote:
>>>
>>> Hi all,
>>>
>>>
>>> I'm wondering if there is a way to rapidly check that a Range object
>>> contains a set of contiguous values.
>>>
>>>
>>> Naively, it seems that this can be done by checking that it is made up of
>>> only one pair_node by looking at the  mNext & mPrev pointers to verify
>>> this
>>> is the case.
>>>
>>>
>>> This would allow some MOAB interfaces (such as the GeomTopoTool) to
>>> rapidly
>>> determine if they are working only with contiguous EntitySets and take
>>> advantage of this fact.
>>>
>>>
>>> Cheers,
>>>
>>>
>>>
>>> Patrick
>
>


More information about the moab-dev mailing list