[MOAB-dev] Fortran interface to iMesh_CreateEntSet

Robert Jacob jacob at mcs.anl.gov
Mon Nov 21 12:55:57 CST 2011


Correction, its only when I add a write statement for the value of ier 
after the call to addEntArrToSet that it crashes.  And the debugger 
points me back to the createVtxArr call!  The full code is below again.

Rob

--------------------------------------------------------------------------------
program meshtry


   implicit none

! declarations
#include "iMesh_f.h"
   integer,parameter :: mysize=20

   iBase_EntityHandle :: entarry
   iMesh_Instance ::  mesh
   iBase_EntitySetHandle :: sethand

   IBASE_HANDLE_T :: rpcoor,rpents

   real*8 coor_data(3*mysize)

   pointer(rpents,entarry(0:*))
   pointer (rpcoor, coor_data)

   integer ::  nhands,sizehand,ier,i
   integer :: geom_dim,settype


   call iMesh_newMesh("MOAB", mesh, ier)


! try an imesh query function
   call iMesh_getGeometricDimension(%VAL(mesh), geom_dim, ier)
   write(0,*) "geom_dim", geom_dim,ier


! create vertices
   call iMesh_createVtxArr(%VAL(mesh), %VAL(mysize), 
%VAL(iBase_INTERLEAVED), &
     %VAL(rpcoor),%VAL(3*mysize),rpents,nhands,sizehand,ier)
   write(0,*) "handles",nhands,sizehand,ier

   settype=1
   call iMesh_createEntSet(%VAL(mesh), %VAL(settype), &
         sethand,ier)
   write(0,*) "createset",ier

   call iMesh_addEntArrToSet(%VAL(mesh),%VAL(rpents),%VAL(nhands), &
       %VAL(sethand),ier)
   write(0,*) "add Ent Arr to Set",ier
end

On 11/21/11 12:20 PM, Robert Jacob wrote:
>
> Yes putting %VAL() around rpcoor fixed the problem.
>
> But I added the next line:
> call iMesh_addEntArrToSet(%VAL(mesh),%VAL(rpents),%VAL(nhands), &
> %VAL(sethand),ier)
>
> To the code I sent out yesterday and that's crashing.
>
> Rob
>
>
> On 11/21/11 11:55 AM, Tim Tautges wrote:
>> The literal constant is fine; it's passing rpcoor by reference that's
>> the problem here, it should be passed by value.
>>
>> I'll look at the code to see what's going on.
>>
>> - tim
>>
>> On 11/21/2011 08:53 AM, Paul Wilson wrote:
>>> Hi all,
>>>
>>> I'm not an expert on the calling interface, but any change it doesn't
>>> like you using the %VAL() construct on literal
>>> constant?
>>>
>>> On 11/21/2011 08:49 AM, Iulian Grindeanu wrote:
>>>> call iMesh_createEntSet(%VAL(mesh), %VAL(1), &
>>>> sethand,ier)
>>> What about:
>>>
>>> *myVariable = 1*
>>> call iMesh_createEntSet(%VAL(mesh), %VAL(*myVariable*), &
>>> sethand,ier)
>>>
>>> I'm just guessing!!!
>>>
>>> Paul
>>>
>>> --
>>> -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ --
>>> Paul Wilson ~ UW-Madison ~ 608-263-0807 ~ cal:http://bit.ly/pphw-cal
>>> Associate Professor, Engineering Physics. ~http://cnerg.engr.wisc.edu
>>> Chair, Energy Analysis& Policy Program ~http://nelson.wisc.edu/eap
>>>
>>
>


More information about the moab-dev mailing list