[MOAB-dev] Questions about Tags and Topology

Christopher Mueller cmueller at asascience.com
Thu Feb 16 11:42:59 CST 2012


Tim, Iulian,

Thank you for the very quick replies on this – the modification worked perfectly!

Best,
Chris

From: Iulian Grindeanu <iulian at mcs.anl.gov<mailto:iulian at mcs.anl.gov>>
Date: Thu, 16 Feb 2012 12:30:30 -0500
To: Tim Tautges <tautges at mcs.anl.gov<mailto:tautges at mcs.anl.gov>>
Cc: David Stuebe <DStuebe at asascience.com<mailto:DStuebe at asascience.com>>, Guy De Wardener <gdewardener at asascience.com<mailto:gdewardener at asascience.com>>, don brittain <don.brittain at instanteffects.com<mailto:don.brittain at instanteffects.com>>, "moab-dev at mcs.anl.gov<mailto:moab-dev at mcs.anl.gov>" <moab-dev at mcs.anl.gov<mailto:moab-dev at mcs.anl.gov>>, Christopher Mueller <cmueller at asascience.com<mailto:cmueller at asascience.com>>
Subject: Re: [MOAB-dev] Questions about Tags and Topology

I think that until we will have a way to modify adjTable directly in pytaps, you need to modify this in
itaps/imesh/MBiMesh.hpp

iBase_AdjacencyCost tmp_table[] = {
      iBase_ALL_ORDER_1, iBase_SOME_ORDER_1,    iBase_SOME_ORDER_1,    iBase_ALL_ORDER_1,
      iBase_ALL_ORDER_1, iBase_UNAVAILABLE,     iBase_SOME_ORDER_LOGN, iBase_SOME_ORDER_LOGN,
      iBase_ALL_ORDER_1, iBase_SOME_ORDER_LOGN, iBase_UNAVAILABLE,     iBase_SOME_ORDER_LOGN,
      iBase_ALL_ORDER_1, iBase_SOME_ORDER_LOGN, iBase_SOME_ORDER_LOGN, iBase_ALL_ORDER_1
  };
  memcpy(AdjTable, tmp_table, 16*sizeof(iBase_AdjacencyCost));

with something like

iBase_AdjacencyCost tmp_table[] = {
      iBase_ALL_ORDER_1, iBase_SOME_ORDER_1,    iBase_SOME_ORDER_1,    iBase_ALL_ORDER_1,
      iBase_ALL_ORDER_1, iBase_ALL_ORDER_1,     iBase_SOME_ORDER_LOGN, iBase_SOME_ORDER_LOGN,
      iBase_ALL_ORDER_1, iBase_SOME_ORDER_LOGN, iBase_ALL_ORDER_1,     iBase_SOME_ORDER_LOGN,
      iBase_ALL_ORDER_1, iBase_SOME_ORDER_LOGN, iBase_SOME_ORDER_LOGN, iBase_ALL_ORDER_1
  };
  memcpy(AdjTable, tmp_table, 16*sizeof(iBase_AdjacencyCost));

I did not test it, but it "should" work.

Iulian

________________________________


On 02/16/2012 11:13 AM, Christopher Mueller wrote:
>
>

>     This has likely not been reflected in the pytaps implementation. Jim?
>
>
> Ultimately, it would be great to be able to do this on a case-by-case basis (via PyTAPS). In the interim, is there any
> way of changing the AdjTable 'statically' (i.e. from a config file or even directly modifying a file) so that the table
> defaults to create all missing entities? At this point, it would be nice to always have all entities as opposed to only
> having the ones explicitly created (and vertices).
>

see itaps/imesh/MBiMesh.hpp, line 59.  Alternatively, if you can call into MOAB directly from somewhere, get all the
entities, then ask for all adj edges/faces with create_if_missing flag = true.

- tim

> Thanks,
> Chris
>
>
>     - tim
>
>
>         In [1]: from itaps import iMesh
>         In [2]: mesh=iMesh.Mesh()
>         In [3]: mesh.adjTable
>         Out[3]:
>         array([[7, 4, 4, 1],
>         [1, 0, 5, 5],
>         [1, 5, 0, 5],
>         [1, 5, 5, 7]], dtype=int32)
>         In [4]: mesh.adjTable[1,1]
>         Out[4]: 0
>         In [5]: mesh.adjTable[1,1]=1
>         In [6]: mesh.adjTable[1,1]
>         Out[6]: 0
>         In [7]: import numpy
>         In [8]: mesh.adjTable=numpy.array([[7,4,4,1],[1,1,5,5],[1,5,0,5],[1,5,5,7]],dtype='int32')
>         ---------------------------------------------------------------------------
>         AttributeError Traceback (most recent call last)
>         /Users/cmueller/Development/OOI/Dev/datamodel/prototypes/<ipython-input-8-5671b50e588e> in <module>()
>         ----> 1 mesh.adjTable=numpy.array([[7,4,4,1],[1,1,5,5],[1,5,0,5],[1,5,5,7]],dtype='int32')
>
>         AttributeError: attribute 'adjTable' of 'itaps.iMesh.Mesh' objects is not writable
>
>
>
>
>
>
>         - tim
>
>         >
>         >
>         >  Thanks in advance,
>         >  Chris
>         >
>         >  Hope this helps,
>         >  Iulian
>         >
>         >
>         >  Thanks,
>         >  Chris
>
>         --
>         ================================================================
>         "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<mailto:tautges at mcs.anl.gov> <mailto:tautges at mcs.anl.gov> <mailto:tautges at mcs.anl.gov> <mailto:tautges at mcs.anl.gov>>)
>         (telecommuting from UW-Madison)
>         phone (gvoice): (608) 354-1459 1500 Engineering Dr.
>         fax: (608) 263-4499 Madison, WI 53706
>
>
>
>     --
>     ================================================================
>     "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<mailto:tautges at mcs.anl.gov> <mailto:tautges at mcs.anl.gov>) (telecommuting from UW-Madison)
>     phone (gvoice): (608) 354-1459 1500 Engineering Dr.
>     fax: (608) 263-4499 Madison, WI 53706
>
>

--
================================================================
"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<mailto:tautges at mcs.anl.gov>)      (telecommuting from UW-Madison)
  phone (gvoice): (608) 354-1459      1500 Engineering Dr.
             fax: (608) 263-4499      Madison, WI 53706


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/moab-dev/attachments/20120216/931da6f5/attachment.htm>


More information about the moab-dev mailing list