[MOAB-dev] Questions about Tags and Topology
James Porter
jvporter at wisc.edu
Thu Feb 16 14:35:55 CST 2012
On Thu, 2012-02-16 at 15:20 -0500, Christopher Mueller wrote:
> Ahh – ok. I almost had it – I tried setting adjTable using a whole
> 4x4 numpy.array - but I neglected to try using a whole 4x4 python
> array.
That should work:
>>> mesh = iMesh.Mesh()
>>> adj = mesh.adjTable
>>> adj
array([[7, 4, 4, 1],
[1, 0, 5, 5],
[1, 5, 0, 5],
[1, 5, 5, 7]], dtype=int32)
>>> adj[1,1] = 1
>>> mesh.adjTable = adj
>>> mesh.adjTable
array([[7, 4, 4, 1],
[1, 7, 5, 5],
[1, 5, 0, 5],
[1, 5, 5, 7]], dtype=int32)
However, note that when you set the adjTable, you won't necessarily get
the same thing back. The table is modified to use whatever works best
for MOAB while still meeting your requirements, if possible.
Also, you can use the enum values in iBase to refer to these, e.g.
iBase.AdjCost.unavailable.
- Jim
More information about the moab-dev
mailing list