itaps-parallel [Fwd: **** iMesh.h and iBase.h changes ****]

Lori A. Diachin diachin2 at llnl.gov
Mon Jan 5 12:54:20 CST 2009


Hi All,

I'd like to check in on the status of everyone's changes wrt to the 
iMesh.h and iBase.h files that Jason sent out back in October.  We 
decided to defer these until after SC08 and gave ourselves an internal 
deadline of Dec 15... so, are we done yet? :-)

Seriously - it was my understanding that folks had agreed in principle 
to all of these changes; the one exception was what to do about item #6 
below.   It may very well be that we need a quick telecon to discuss 
this as well as get an update on status.  Carl is planning to send out 
the iMesh paper by Jan 23, so we may want to touch base before then.. 
when are folks available for a telecon?  To narrow it down a bit, please 
send me the times you are not available on Monday/Tuesday Jan 12th and 
13th, or Tues/Wed the 20th and 21st.

Thanks,
Lori

-------- Original Message --------
Subject: 	**** iMesh.h and iBase.h changes ****
Date: 	Fri, 24 Oct 2008 18:13:11 -0500
From: 	Jason Kraftcheck <kraftche at cae.wisc.edu>
To: 	TSTT Interface <tstt-interface at mcs.anl.gov>



Here is the list of proposed changes to iMesh.h (yes, not just iMeshP.h)
that were a) agreed upon during the latest telecon and b) may need to be
completed by all implementations by SC'08.  If you object to any of this,
please speak out soon.  I've attached copies of the interface definitions,
updated as described below.


1) Version defines:  Beginning with version 0.8 of iMesh.h, we will add the
following C preprocessor macros.  This will allow, going forward,
applications to be compatible with more than one version of the interface*.
  #define IMESH_MAJOR_VERSION 0
  #define IMESH_MINOR_VERSION 7

2) Zero set handle:  All mention of passing 'zero' for a set handle in all
iMesh.h documention should be replaced with the root set handle*.
Implementations for which a) the root set handle is not zero and b) that
actually followed the documentation in that they check for zero rather than
the root set will need to be updated.

3) Handle types*:  The current handle definitions:
  typedef void* iBase_Instance;
  typedef void* iBase_EntityHandle;
  typedef void* iBase_EntitySetHandle;
  typedef void* iBase_TagHandle;

  typedef void* iMesh_Instance;
  typedef void* iMesh_EntityIterator;
  typedef void* iMesh_EntityArrIterator;
will be replaced with:
  typedef struct iBase_Instance_Private* iBase_Instance;
  typedef struct iBase_EntityHandle_Private* iBase_EntityHandle;
  typedef struct iBase_EntitySetHandle_Private* iBase_EntitySetHandle;
  typedef struct iBase_TagHandle_Private* iBase_TagHandle;

  typedef struct iMesh_Instance_Private* iMesh_Instance;
  typedef struct iMesh_EntityIterator_Private* iMesh_EntityIterator;
  typedef struct iMesh_EntityArrIterator_Private* iMesh_EntityArrIterator;


4) New Function:
   /**\brief Set geometric dimension of vertex coordinates
    *
    * Set the geometric dimension of the mesh.  Notes:  An application
    * should not expect this function to succeed unless the mesh database
    * is empty (no vertices created, no files read, etc.)
    *\param instance Mesh database from which to request change.
    *\param geom_dim Requested geometric dimension.
    */
   void iMesh_setGeometricDimension( iMesh_Intance instance,
                                     /*in*/ int geom_dim,
                                     /*out*/ int* err );


5) Changed Functions:  There are several functions for which an entity set
   handle is treated as 'inout' where it should be 'in'*.  These include:
     iMesh_addEntToSet
     iMesh_rmvEntFromSet
     iMesh_addEntArrToSet
     iMesh_rmvEntArrFromSet
     iMesh_addEntSet
     iMesh_rmvEntSet
     iMesh_addPrntChld
     iMesh_rmvPrntChld
   The argument shoudl be 'in' because the argument (the value of the
   handle) is not changed.
   NOTE:  The changes described in 3) will ensure that this change results
   in compile-time errors.  Without the changes in 3), changing the real
   type from void** to void* for the arguments would still compile,
   which could be disastrous.

6) The following two functions:
    iMesh_getAllVtxCoords
    iMesh_getVtxCoordIndex
   will be replaced with the new function below.
   NOTE:  This is slightly different than what was discussed during
   the telecon.  I a) noticed a deficiency in the usage (added
   the 'entity_handles' output list) and b) dropped the in_entity_set
   argument, for which no agreement was reached during the telecon.

   /**\brief Get indexed representation of mesh or subset of mesh
    *
    * Given an entity set and optionally a type or topology, return:
    * - The entities in the set of the specified type or topology
    * - The entities adjacent to those entities with a specified
    *    type, as a list of unique handles.
    * - For each entity in the first list, the adjacent entities,
    *    specified as indices into the second list.
    *
    *\param entity_set_handle     The set of entities from which to query
    *\param entity_type_requestor If not iBase_ALL_TYPES, act only on
    *                             the subset of 'entity_set_handle' of the
    *                             specified type.
    *\param entity_topology_requestor If not iMesh_ALL_TOPOLOGIES, act only
    *                             on the subset of 'entity_set_handle' with
    *                             the specified topology.
    *\param entity_type_requested The type of the adjacent entities to
    *                             return.
    *\param entity_handles        The handles of the (non-struct) subset of
    *                             the entity set indicated by
    *                             'entity_set_handle' and the optional type
    *                             and topology filtering arguments.
    *\param adj_entity_handles    The union of the entities of type
    *                             'requested_entity_type' adjacent to each
    *                             entity in 'entity_handles'.
    *\param adj_entity_indices    For each entity in 'entity_handles', the
    *                             adjacent entities of type
    *                             'entity_type_requested', specified as
    *                             indices into 'adj_entity_handles'.  The
    *                             values are concatenated into a single
    *                             array in the order of the entity handles
    *                             in 'entity_handles'.
    *\param offset                For each entity in the corresponding
    *                             position in 'entity_handles', the position
    *                             in 'adj_entity_indices' at which values
    *                             for that entity are stored.
    */
   void iMesh_getAdjEntIndices(iMesh_Instance instance,
                       /*in*/    const iBase_EntityHandle entity_set_handle,
                       /*in*/    const int entity_type_requestor,
                       /*in*/    const int entity_topology_requestor,
                       /*in*/    const int entity_type_requested,
                       /*inout*/ iBase_EntityHandle** entity_handles,
                       /*inout*/ int* entity_handles_allocated,
                       /*out*/   int* entity_handles_size,
                       /*inout*/ iBase_EntityHandle** adj_entity_handles,
                       /*inout*/ int* adj_entity_handles_allocated,
                       /*out*/   int* adj_entity_handles_size,
                       /*inout*/ iBsae_EntityHandle** adj_entity_indices,
                       /*inout*/ int* adj_entity_indices_allocated,
                       /*out*/   int* adj_entity_indices_size,
                       /*inout*/ int** offset,
                       /*inout*/ int* offset_allocated,
                       /*out*/   int* offset_size,
                       /*out*/   int *err);

The code below uses the old interface to retrieve a copy of a hexahedral
mesh in a simple array form:
   MBEntityHandle *vertices = 0, *hexes = 0;
   int *hex_vertex_indices = 0, *hex_vertex_offsets = 0;
   double* coords;
   int num_vertices, num_hexes, junk, junk2, junk3, err, order;
   int *junk_array;
   junk = 0;
   iMesh_getEntities( instance, root_set,
                      iBase_ALL_TYPES,
                      iMesh_HEXAHEDRON,
                      &hexes, &junk, &num_hexes, &err );
   junk = 0;
   iMesh_getEntities( instance, root_set,
                      iBase_VERTEX,
                      iMesh_ALL_TOPOLOGIES,
                      &vertices, &junk, &num_vertices, &err );
   junk = junk2 = 0;
   junk_array = NULL;
   order = iBase_INTERLEAVED;
   iMesh_getAllVtxCoords( instance, root_set,
                          &coords, &junk, &junk,
                          &junk_array, &junk2, &junk2,
                          &order, &err);
   free(junk_array);
   junk = junk2 = junk3 = 0;
   junk_array = NULL;
   iMesh_getVtxCoordIndex( instance, root_set,
                           iBase_ALL_TYPES, iMesh_HEXAHEDRON,
                           iBase_VERTEX,
                           &hex_vertex_offsets, &junk, &junk,
                           &hex_vertex_indices, &junk2, &junk2,
                           &junk_array, &junk3, &junk3,
                           &err );
   free( junk_array );

The same code in the new API will be:
   MBEntityHandle *vertices = 0, *hexes = 0;
   int *hex_vertex_indices = 0, *hex_vertex_offsets = 0;
   double* coords;
   int num_vertices, num_hexes, junk, junk2, junk3, junk4, err;
   int order;
   junk = junk2 = junk3 = junk4 = 0;
   iMesh_getAdjEntIndices( instance, root_set,
                           iBase_ALL_TYPES, iMesh_HEXAHEDRON,
                           iBase_VERTEX,
                           &hexes, &junk, &num_hexes,
                           &vertices, &junk2, &num_vertices,
                           &hex_vertex_indices, &junk3, &junk3,
                           &hex_vertex_offsets, &junk4, &junk4 );
   junk = 0;
   order = iBase_INTERLEAVED;
   iMesh_getVtxArrCoords( instance,
                          vertices, num_vertex,
                          &order,
                          &coords, &junk, &junk,
                          &err );

7) New Function:  Array form of iMesh_isEntContained to replace
   containment flags no longer returned from iMesh_getVtxCoordIndex
   (and hopefully some day all the other functions with a similar
   argument).

   void iMesh_isEntArrContained( iMesh_Instance instance,
                          /*in*/ iBase_EntitySetHandle containing_set,
                          /*in*/ const iBase_EntityHandle* entity_handles,
                          /*in*/ int num_entity_handles,
                       /*inout*/ int** is_contained,
                       /*inout*/ int* is_contained_allocated,
                         /*out*/ int* is_contained_size,
                         /*out*/ int* err );


8) Replace some iBase_EntityHandle with iBase_EntitySetHandle where
appropriate*:
   iMesh_getAdjEntIndices
   iMesh_getAdjEntities

- jason


* Similar changes should probably be made to iGeom.h, iMeshP.h, and iRel.h,
but that was not discussed during the telecon.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: iBase.h
Type: text/x-chdr
Size: 3862 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/itaps-parallel/attachments/20090105/f477e2a8/attachment.h>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: iBase.sidl
URL: <http://lists.mcs.anl.gov/pipermail/itaps-parallel/attachments/20090105/f477e2a8/attachment.diff>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: iMesh.sidl
URL: <http://lists.mcs.anl.gov/pipermail/itaps-parallel/attachments/20090105/f477e2a8/attachment-0001.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iMesh.h
Type: text/x-chdr
Size: 100741 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/itaps-parallel/attachments/20090105/f477e2a8/attachment-0001.h>


More information about the itaps-parallel mailing list