[MOAB-dev] r5223 - MOAB/trunk/itaps/imesh
iulian at mcs.anl.gov
iulian at mcs.anl.gov
Tue Nov 22 16:56:17 CST 2011
Author: iulian
Date: 2011-11-22 16:56:17 -0600 (Tue, 22 Nov 2011)
New Revision: 5223
Added:
MOAB/trunk/itaps/imesh/FindAdjacencyF90.F90
Modified:
MOAB/trunk/itaps/imesh/Makefile.am
Log:
more examples with fortran calls: create set, add entities to set,
retrieve vertex coordinates, adjacencies
Added: MOAB/trunk/itaps/imesh/FindAdjacencyF90.F90
===================================================================
--- MOAB/trunk/itaps/imesh/FindAdjacencyF90.F90 (rev 0)
+++ MOAB/trunk/itaps/imesh/FindAdjacencyF90.F90 2011-11-22 22:56:17 UTC (rev 5223)
@@ -0,0 +1,125 @@
+! FindAdjacency: Interacting with iMesh
+!
+! This program shows how to get more information about a mesh, by
+! getting connectivity two different ways (as connectivity and as
+! adjacent 0-dimensional entities).
+
+! Usage: FindAdjacency
+#define CHECK(a) \
+ if (ierr .ne. 0) print *, a
+
+program findadjacency
+ implicit none
+#include "iMesh_f.h"
+
+ ! declarations
+ iMesh_Instance mesh
+ IBASE_HANDLE_T rpents, rpverts, rpallverts, ipoffsets
+ integer ioffsets
+ IBASE_HANDLE_T ents, verts, allverts, verths
+ pointer (rpents, ents(0:*))
+ pointer (rpverts, verts(0:*))
+ pointer (rpallverts, allverts(0:*))
+ pointer (ipoffsets, ioffsets(0:*))
+! for all vertices in one call
+ iBase_EntityHandle verth
+ pointer (verths, verth(0:*))
+ integer ierr, ents_alloc, ents_size
+ integer iverts_alloc, iverts_size
+ integer allverts_alloc, allverts_size
+ integer offsets_alloc, offsets_size, coords_alloc, coords_size
+ iBase_EntitySetHandle root_set
+ integer vert_uses, i, num_ents
+ real*8 coords
+ pointer (pcoord, coords(0:*))
+!
+ iBase_EntitySetHandle :: sethand
+
+ ! create the Mesh instance
+ call iMesh_newMesh("", mesh, ierr)
+ CHECK("Problems instantiating interface.")
+
+ ! load the mesh
+ call iMesh_getRootSet(%VAL(mesh), root_set, ierr)
+ CHECK("Problems getting root set")
+
+ call iMesh_load(%VAL(mesh), %VAL(root_set), &
More information about the moab-dev
mailing list