Mesh Oriented datABase  (version 5.4.1)
Array-based unstructured mesh datastructure
iMesh_extensions.h
Go to the documentation of this file.
00001 #ifndef IMESH_REC_CBIND_H__
00002 #define IMESH_REC_CBIND_H__
00003 
00004 #include "moab/MOABConfig.h"
00005 #include "iMesh.h"
00006 #include "iMesh_protos.h"
00007 #ifdef MOAB_HAVE_MPI
00008 #include "iMeshP.h"
00009 #include "moab_mpi.h"
00010 #endif
00011 
00012 #ifdef __cplusplus
00013 extern "C" {
00014 #endif
00015 
00016 /**\brief  Get entities of specific type and/or topology in set or instance, recursive
00017  *
00018  * Get entities of specific type and/or topology in set or instance.  If recursive
00019  * is passed in non-zero, includes entities in owned sets.  All
00020  * entities of a given type or topology are requested by specifying
00021  * iBase_ALL_TOPOLOGIES or iBase_ALL_TYPES, respectively.  Specified type
00022  * or topology must be a value in the iBase_EntityType or iMesh_EntityTopology
00023  * enumeration, respectively.
00024  * \param instance iMesh instance handle
00025  * \param entity_set_handle Entity set being queried
00026  * \param entity_type Type of entities being requested
00027  * \param entity_topology Topology of entities being requested
00028  * \param recursive If non-zero, gets entities in owned sets too
00029  * \param *entity_handles Pointer to array of entity handles returned
00030  *        from function
00031  * \param *entity_handles_allocated Pointer to allocated size of
00032  *        entity_handles array
00033  * \param *entity_handles_size Pointer to occupied size of entity_handles array
00034  * \param *err Pointer to error type returned from function
00035  */
00036 void iMesh_getEntitiesRec( iMesh_Instance instance,
00037                            /*in*/ const iBase_EntitySetHandle entity_set_handle,
00038                            /*in*/ const int entity_type,
00039                            /*in*/ const int entity_topology,
00040                            /*in*/ const int recursive,
00041                            /*out*/ iBase_EntityHandle** entity_handles,
00042                            /*out*/ int* entity_handles_allocated,
00043                            /*out*/ int* entity_handles_size,
00044                            /*out*/ int* err );
00045 
00046 /**\brief  Get the number of entities with the specified type in the instance or set, recursive
00047  *
00048  * Get the number of entities with the specified type in the instance
00049  * or set.  If recursive is passed in non-zero, includes entities in owned sets.
00050  * If entity set handle is zero, return information for instance,
00051  * otherwise for set.  Value of entity type must be from the
00052  * iBase_EntityType enumeration.  If iBase_ALL_TYPES is specified,
00053  * total number of entities (excluding entity sets) is returned.
00054  * \param instance iMesh instance handle
00055  * \param entity_set_handle Entity set being queried
00056  * \param entity_type Type of entity requested
00057  * \param recursive If non-zero, includes entities in owned sets too
00058  * \param num_type Pointer to number of entities, returned from function
00059  * \param *err Pointer to error type returned from function
00060  */
00061 void iMesh_getNumOfTypeRec( iMesh_Instance instance,
00062                             /*in*/ const iBase_EntitySetHandle entity_set_handle,
00063                             /*in*/ const int entity_type,
00064                             /*in*/ const int recursive,
00065                             /*out*/ int* num_type,
00066                             /*out*/ int* err );
00067 
00068 /**\brief  Get the number of entities with the specified topology in the instance or set
00069  *
00070  * Get the number of entities with the specified topology in the instance
00071  * or set.  If recursive is passed in non-zero, includes entities in owned sets.
00072  * If entity set handle is zero, return information for instance,
00073  * otherwise for set.  Value of entity topology must be from the
00074  * iMesh_EntityTopology enumeration.  If iMesh_ALL_TOPOLOGIES is specified,
00075  * total number of entities (excluding entity sets) is returned.
00076  * \param instance iMesh instance handle
00077  * \param entity_set_handle Entity set being queried
00078  * \param entity_topology Topology of entity requested
00079  * \param recursive If non-zero, includes entities in owned sets too
00080  * \param num_topo Pointer to number of entities, returned from function
00081  * \param *err Pointer to error type returned from function
00082  */
00083 void iMesh_getNumOfTopoRec( iMesh_Instance instance,
00084                             /*in*/ const iBase_EntitySetHandle entity_set_handle,
00085                             /*in*/ const int entity_topology,
00086                             /*in*/ const int recursive,
00087                             /*out*/ int* num_topo,
00088                             /*out*/ int* err );
00089 
00090 /**\brief  Get entities with specified type, topology, tag(s) and (optionally) tag value(s)
00091  *
00092  * Get entities with the specified type, topology, tag(s), and optionally tag value(s).
00093  * If tag values pointer is input as zero, entities with specified tag(s) are returned,
00094  * regardless of their value.
00095  * \param instance iMesh instance handle
00096  * \param entity_set_handle Entity set being queried
00097  * \param entity_type Type of entities being requested
00098  * \param entity_topology Topology of entities being requested
00099  * \param tag_handles Array of tag handles
00100  * \param tag_vals Array of tag values (zero if values not requested)
00101  * \param num_tags_vals Number of tags and optionally values
00102  * \param recursive If non-zero, gets entities in owned sets too
00103  * \param *entity_handles Pointer to array of entity handles returned
00104  *        from function
00105  * \param *entity_handles_allocated Pointer to allocated size of
00106  *        entity_handles array
00107  * \param *entity_handles_size Pointer to occupied size of entity_handles array
00108  * \param *err Pointer to error type returned from function
00109  */
00110 void iMesh_getEntsByTagsRec( iMesh_Instance instance,
00111                              /*in*/ const iBase_EntitySetHandle entity_set_handle,
00112                              /*in*/ const int entity_type,
00113                              /*in*/ const int entity_topology,
00114                              /*in*/ const iBase_TagHandle* tag_handles,
00115                              /*in*/ const char* const* tag_vals,
00116                              /*in*/ const int num_tags_vals,
00117                              /*in*/ const int recursive,
00118                              /*out*/ iBase_EntityHandle** entity_handles,
00119                              /*out*/ int* entity_handles_allocated,
00120                              /*out*/ int* entity_handles_size,
00121                              /*out*/ int* err );
00122 
00123 /**\brief  Get entity sets with specified tag(s) and (optionally) tag value(s)
00124  *
00125  * Get entity sets with the specified tag(s) and optionally tag value(s).
00126  * If tag values pointer is input as zero, entities with specified tag(s) are returned,
00127  * regardless of their value.
00128  * \param instance iMesh instance handle
00129  * \param entity_set_handle Entity set being queried
00130  * \param tag_handles Array of tag handles
00131  * \param tag_vals Array of tag values (zero if values not requested)
00132  * \param num_tags_vals Number of tags and optionally values
00133  * \param recursive If non-zero, gets entities in owned sets too
00134  * \param *set_handles Pointer to array of entity handles returned
00135  *        from function
00136  * \param *set_handles_allocated Pointer to allocated size of
00137  *        set_handles array
00138  * \param *set_handles_size Pointer to occupied size of entity_handles array
00139  * \param *err Pointer to error type returned from function
00140  */
00141 void iMesh_getEntSetsByTagsRec( iMesh_Instance instance,
00142                                 /*in*/ const iBase_EntitySetHandle entity_set_handle,
00143                                 /*in*/ const iBase_TagHandle* tag_handles,
00144                                 /*in*/ const char* const* tag_vals,
00145                                 /*in*/ const int num_tags_vals,
00146                                 /*in*/ const int recursive,
00147                                 /*out*/ iBase_EntitySetHandle** set_handles,
00148                                 /*out*/ int* set_handles_allocated,
00149                                 /*out*/ int* set_handles_size,
00150                                 /*out*/ int* err );
00151 
00152 /**\brief Get MBCN type corresponding to iMesh topology value
00153  *
00154  * Get MBCN type corresponding to iMesh topology value.  Required for input
00155  * to MBCN canonical numbering functions, which are written in terms of
00156  * MBCN entity types.  Returns -1 for type if entity topology is out of
00157  * bounds, or MBMAXTYPE if no corresponding MBCN type exists.
00158  * \param imesh_entity_topology iMesh_EntityTopology value
00159  * \param mbcn_type MBEntityType corresponding to entity topology
00160  */
00161 void iMesh_MBCNType( /*in*/ const int imesh_entity_topology,
00162                      /*out*/ int* mbcn_type );
00163 
00164 /**\brief Access tag data via direct pointer into contiguous blocks
00165  *
00166  * Iteratively obtain direct access to contiguous blocks of tag
00167  * storage.  This function cannot be used with bit tags because
00168  * of the compressed bit storage.  This function cannot be used
00169  * with variable length tags because it does not provide a mechanism
00170  * to determine the length of the value for each entity.  This
00171  * function may be used with sparse tags, but if it is used, it
00172  * will return data for a single entity at a time.
00173  *
00174  *\Note If this function is called for entities for which no tag value
00175  *      has been set, but for which a default value exists, it will
00176  *      force the allocation of explicit storage for each such entity
00177  *      even though MOAB would normally not explicitly store tag values
00178  *      for such entities.
00179  *
00180  *\Example:
00181  *\code
00182  *\endcode
00183  */
00184 void iMesh_tagIterate( iMesh_Instance instance,
00185                        /**< [in] iMesh instance */
00186                        const iBase_TagHandle tag_handle,
00187                        /**< [in] Tag being queried */
00188                        iBase_EntityArrIterator entArr_iterator,
00189                        /**< [in] Iterator being queried */
00190                        void* tag_value,
00191                        /**< [out] Pointer to pointer that will be set to tag data memory */
00192                        int* count,
00193                        /**< [out] Number of contiguous entities in this subrange */
00194                        int* err
00195                        /**< [out] Returned Error status (see iBase_ErrorType) */
00196 );
00197 
00198 /**\brief Access connectivity data via direct pointer into contiguous blocks
00199  *
00200  * Iteratively obtain direct access to contiguous blocks of connectivity
00201  * storage.
00202  *
00203  */
00204 void iMesh_connectIterate( iMesh_Instance instance,
00205                            /**< [in] iMesh instance */
00206                            iBase_EntityArrIterator entArr_iterator,
00207                            /**< [in] Iterator being queried */
00208                            iBase_EntityHandle** connect,
00209                            /**< [out] Pointer to pointer that will be set to connectivity data memory */
00210                            int* verts_per_entity,
00211                            /**< [out] Number of vertices per entity in this subrange */
00212                            int* count,
00213                            /**< [out] Number of contiguous entities in this subrange */
00214                            int* err
00215                            /**< [out] Returned Error status (see iBase_ErrorType) */
00216 );
00217 
00218 /**\brief Access coordinates data via direct pointer into contiguous blocks
00219  *
00220  * Iteratively obtain direct access to contiguous blocks of coordinate
00221  * storage.
00222  *
00223  */
00224 void iMesh_coordsIterate( iMesh_Instance instance,
00225                           /**< [in] iMesh instance */
00226                           iBase_EntityArrIterator entArr_iterator,
00227                           /**< [in] Iterator being queried */
00228                           double** coordsx,
00229                           /**< [out] Pointer to pointer x coordinates */
00230                           double** coordsy,
00231                           /**< [out] Pointer to pointer y coordinates */
00232                           double** coordsz,
00233                           /**< [out] Pointer to pointer z coordinates */
00234                           int* count,
00235                           /**< [out] Number of contiguous entities in this subrange */
00236                           int* err
00237                           /**< [out] Returned Error status (see iBase_ErrorType) */
00238 );
00239 
00240 /***************************************************************************/ /**
00241                                                                                * \ingroup
00242                                                                                *EntityIterators
00243                                                                                * \brief  Step the
00244                                                                                *iterator a specified
00245                                                                                *number of entities
00246                                                                                *
00247                                                                                * Step the iterator a
00248                                                                                *specified number of
00249                                                                                *entities.  If this
00250                                                                                *number is greater
00251                                                                                * than the number of
00252                                                                                *entities left in the
00253                                                                                *iterator, the
00254                                                                                *iterator is placed
00255                                                                                * at the end and
00256                                                                                *at_end is returned
00257                                                                                *non-zero; otherwise
00258                                                                                *at_end is returned
00259                                                                                *zero.
00260                                                                                ******************************************************************************/
00261 
00262 void iMesh_stepEntIter( iMesh_Instance instance,
00263                         /**< [in] iMesh instance handle */
00264                         iBase_EntityIterator ent_iterator,
00265                         /**< [in] Iterator being queried */
00266                         int step_length,
00267                         /**< [in] Number of entities to step the iterator */
00268                         int* at_end,
00269                         /**< [out] Non-zero if iterator is at the end of the iteration */
00270                         int* err
00271                         /**< [out] Returned Error status (see iBase_ErrorType) */
00272 );
00273 
00274 void iMesh_stepEntArrIter( iMesh_Instance instance,
00275                            /**< [in] iMesh instance handle */
00276                            iBase_EntityArrIterator entArr_iterator,
00277                            /**< [in] Iterator being queried */
00278                            int step_length,
00279                            /**< [in] Number of entities to step the iterator */
00280                            int* at_end,
00281                            /**< [out] Non-zero if iterator is at the end of the iteration */
00282                            int* err
00283                            /**< [out] Returned Error status (see iBase_ErrorType) */
00284 );
00285 
00286 /***************************************************************************/ /**
00287                                                                                * \ingroup
00288                                                                                *EntityIterators
00289                                                                                * \brief  Initialize
00290                                                                                *an array iterator
00291                                                                                *over specified
00292                                                                                *entity type,
00293                                                                                *topology, and size,
00294                                                                                *with an optional
00295                                                                                *recursive flag.
00296                                                                                *
00297                                                                                * Initialize an array
00298                                                                                *iterator over
00299                                                                                *specified entity
00300                                                                                *type, topology, and
00301                                                                                * size, for a
00302                                                                                *specified set or
00303                                                                                *instance.  Iterator
00304                                                                                *returned can be used
00305                                                                                * as input to
00306                                                                                *functions returning
00307                                                                                *entities for the
00308                                                                                *iterator.  If all
00309                                                                                * entities of a
00310                                                                                *specified type
00311                                                                                *and/or topology are
00312                                                                                *to be iterated,
00313                                                                                * specify
00314                                                                                *iBase_ALL_TYPES or
00315                                                                                *iMesh_ALL_TOPOLOGIES,
00316                                                                                *respectively.
00317                                                                                * Specified type or
00318                                                                                *topology must be a
00319                                                                                *value in the
00320                                                                                *iBase_EntityType or
00321                                                                                * iMesh_EntityTopology
00322                                                                                *enumerations,
00323                                                                                *respectively.  If
00324                                                                                *recursive is true,
00325                                                                                * entities are
00326                                                                                *retrieved
00327                                                                                *recursively through
00328                                                                                *contained (but not
00329                                                                                *child) sets.
00330                                                                                ******************************************************************************/
00331 
00332 void iMesh_initEntArrIterRec( iMesh_Instance instance,
00333                               /**< [in] iMesh instance handle */
00334                               const iBase_EntitySetHandle entity_set_handle,
00335                               /**< [in] Entity set being iterated */
00336                               const int requested_entity_type,
00337                               /**< [in] Type of entity to iterate */
00338                               const int requested_entity_topology,
00339                               /**< [in] Topology of entity to iterate */
00340                               const int requested_array_size,
00341                               /**< [in] Size of chunks of handles returned for each value of the
00342                                    iterator */
00343                               const int resilient,
00344                               /**< [in] If zero, return a non-resilient iterator.
00345                                         Otherwise, a resilient iterator (\ref resilient) */
00346                               const int recursive,
00347                               /**< [in] If non-zero, entities retrieved recursively */
00348                               iBase_EntityArrIterator* entArr_iterator,
00349                               /**< [out] Pointer to iterator returned from function */
00350                               int* err
00351                               /**< [out] Returned Error status (see iBase_ErrorType) */
00352 );
00353 
00354 /***************************************************************************/ /**
00355                                                                                * \ingroup  Tags
00356                                                                                * \brief  Get all the
00357                                                                                *tags associated with
00358                                                                                *the entire interface
00359                                                                                *
00360                                                                                * Get all the tags
00361                                                                                *associated with the
00362                                                                                *entire interface
00363                                                                                ******************************************************************************/
00364 
00365 void iMesh_getAllIfaceTags( iMesh_Instance instance,
00366                             /*inout*/ iBase_TagHandle** tag_handles,
00367                             /*inout*/ int* tag_handles_allocated,
00368                             /*out*/ int* tag_handles_size,
00369                             /*out*/ int* err );
00370 
00371 /***************************************************************************/ /**
00372                                                                                * \ingroup  Tags
00373                                                                                * \brief  Create a
00374                                                                                *tag with options
00375                                                                                *
00376                                                                                * Create a tag with
00377                                                                                *options; allows
00378                                                                                *creation of Dense
00379                                                                                *and Bit tags through
00380                                                                                *iMesh Allowable
00381                                                                                *options are:
00382                                                                                * TAG_STORAGE_TYPE={DENSE
00383                                                                                *| SPARSE | BIT |
00384                                                                                *MESH}
00385                                                                                * TAG_DEFAULT_VALUE=<value>
00386                                                                                *(data type of value
00387                                                                                *should match tag
00388                                                                                *data type)
00389                                                                                ******************************************************************************/
00390 
00391 void iMesh_createTagWithOptions( iMesh_Instance instance,
00392                                  /**< [in] iMesh instance handle */
00393                                  /*in*/ const char* tag_name,
00394                                  /**< [in] tag name*/
00395                                  /*in*/ const char* tmp_tag_options,
00396                                  /**< [in] options string */
00397                                  /*in*/ const int tag_size,
00398                                  /**< [in] tag size, in number of values */
00399                                  /*in*/ const int tag_type,
00400                                  /**< [in] tag data type (int, double, etc.) */
00401                                  /*out*/ iBase_TagHandle* tag_handle,
00402                                  /**< [out] handle of new tag */
00403                                  /*out*/ int* err,
00404                                  /**< [out] error */
00405                                  /*in*/ const int tag_name_len,
00406                                  /**< [in] length of tag name string */
00407                                  /*in*/ const int tag_options_len );
00408 /**< [in] length of options string */
00409 
00410 /***************************************************************************/ /**
00411                                                                                * \ingroup  ScdMesh
00412                                                                                * \brief  Create a
00413                                                                                *structured mesh
00414                                                                                *
00415                                                                                * Create a structured
00416                                                                                *mesh, with local and
00417                                                                                *(optionally) global
00418                                                                                *ijk parameters and
00419                                                                                * optional physical
00420                                                                                *positions.  If
00421                                                                                *running in parallel,
00422                                                                                *can request shared
00423                                                                                *vertex resolution
00424                                                                                * and optional number
00425                                                                                *and type of ghost
00426                                                                                *layers of elements.
00427                                                                                *Global parameters
00428                                                                                *are used to compute
00429                                                                                * global ids, which
00430                                                                                *are used in shared
00431                                                                                *vertex resolution.
00432                                                                                ******************************************************************************/
00433 
00434 void iMesh_createStructuredMesh(
00435     iMesh_Instance instance,
00436     /**< [in] iMesh instance handle */
00437     int* local_dims,
00438     /**< [in] Min/max corners of local ijk parameters, -1 for unused dimensions; specified as
00439               ilo, jlo, klo, ihi, jhi, khi. */
00440     int* global_dims,
00441     /**< [in] Min/max corners of global ijk parameters, -1 for unused dimensions; NULL if running in
00442        serial. Order similar to local_dims. */
00443     double* i_vals,
00444     /**< [in] Physical positions of i values, NULL if not placed in physical space. */
00445     double* j_vals,
00446     /**< [in] Physical positions of j values, NULL if not placed in physical space. */
00447     double* k_vals,
00448     /**< [in] Physical positions of k values, NULL if not placed in physical space. */
00449     int resolve_shared,
00450     /**< [in] Non-zero if running in parallel and resolution of shared vertices is desired, zero
00451        otherwise. */
00452     int ghost_dim,
00453     /**< [in] Dimension of entities to ghost, -1 if none desired. */
00454     int bridge_dim,
00455     /**< [in] Dimension of bridge entities used to compute ghosts, -1 if no ghosts desired. */
00456     int num_layers,
00457     /**< [in] Number of layers of ghosts desired, -1 if no ghosts desired. */
00458     int addl_ents,
00459     /**< [in] Dimension of addition entities adjacent to ghosts to exchange. */
00460     int vert_gids,
00461     /**< [in] If non-zero, assigns global ids to vertices, according to global parameterization. */
00462     int elem_gids,
00463     /**< [in] If non-zero, assigns global ids to elements, according to global parameterization. */
00464     iBase_EntitySetHandle* set_handle,
00465     /**< [inout] A set to which the underlying ScdBox set will be added.  NULL if not desired.
00466      *           If *NULL, will be set directly to the underlying ScdBox's set. */
00467     int* err
00468     /**< [out] Error flag. */
00469 );
00470 /***************************************************************************/ /**
00471                                                                                * \brief  Free memory
00472                                                                                *allocated with
00473                                                                                *malloc
00474                                                                                *
00475                                                                                ******************************************************************************/
00476 
00477 void iMesh_freeMemory( iMesh_Instance instance,
00478                        /**< [in] iMesh instance handle */
00479                        void** ptrToMem );
00480 
00481 /***************************************************************************/ /**
00482                                                                                * \defgroup ScdMesh
00483                                                                                *Structured Mesh
00484                                                                                * \ingroup
00485                                                                                *iMeshExtensions
00486                                                                                ******************************************************************************/
00487 
00488 /***************************************************************************/ /**
00489                                                                                * \defgroup
00490                                                                                *iMeshExtensions
00491                                                                                *iMesh Extensions
00492                                                                                * \ingroup iMesh
00493                                                                                ******************************************************************************/
00494 
00495 #ifdef __cplusplus
00496 }
00497 #endif
00498 
00499 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines