MOAB: Mesh Oriented datABase  (version 5.3.0)
iMeshP.h
Go to the documentation of this file.
00001 #ifndef _ITAPS_iMeshP
00002 #define _ITAPS_iMeshP
00003 
00004 #include "iMesh.h"
00005 #include "iMeshP_protos.h"
00006 #include "moab_mpi.h"
00007 
00008 #ifdef __cplusplus
00009 extern "C" {
00010 #endif
00011 
00012 /** Handles needed in iMeshP */
00013 typedef struct iMeshP_PartitionHandle_Private* iMeshP_PartitionHandle;
00014 typedef struct iMeshP_RequestHandle_Private* iMeshP_RequestHandle;
00015 
00016 /* Since we allow overloading of iMesh functions' entity set handles with
00017  * part handles, iMeshP_PartHandle must be defined the same as
00018  * iBase_EntitySetHandle. */
00019 typedef iBase_EntitySetHandle iMeshP_PartHandle;
00020 
00021 typedef unsigned iMeshP_Part;
00022 
00023 /** Types for classifying entities within a part. */
00024 enum iMeshP_EntStatus
00025 {
00026     iMeshP_INTERNAL, /**< An owned entity that is not on a part boundary. */
00027     iMeshP_BOUNDARY, /**< A shared entity on a part boundary. */
00028     iMeshP_GHOST     /**< An entity copy that is not a shared boundary entity. */
00029 };
00030 
00031 /** Part ID number indicating information should be returned about all parts. */
00032 #define iMeshP_ALL_PARTS (-1)
00033 
00034 /** \page imeshp  iMeshP: ITAPS Parallel Mesh Interface
00035 iMeshP.h -- ITAPS Parallel Mesh Interface
00036 
00037 Release 0.1; October 2008
00038 
00039 \section ADM Abstract Data Model
00040 -  The term "mesh" refers to an abstraction in the data model;
00041    it does not imply a serial or parallel distribution.
00042 -  The term "partition" refers to an assignment of a set of entities to
00043    subsets; like a "mesh," it does not imply a serial or parallel
00044    implementation.
00045 -  An application may use one or more meshes.
00046 -  Partitions can create subsets of entities from one or more meshes.
00047 -  Meshes can be subdivided by one or more partitions.
00048 -  Partitions contain parts.  Parts contain the subsets of entities in the
00049    partition.
00050 
00051 \section PAR Parallelism
00052 -  A "process" can be thought of as an MPI process. The
00053    number of processes can be considered to be the result of MPI_Comm_size.
00054    The rank of a process can be thought of as the result of MPI_Comm_rank.
00055    We will think in terms of processes rather than processors.  Initial
00056    implementations of the parallel interface will likely use MPI terminology
00057    directly; future implementations may accommodate other communication
00058    paradigms and libraries.
00059 -  Partitions have communicators associated with them.  These communicators
00060    can be thought of as MPI communicators.
00061 -  "Global" operations are operations performed with respect to a
00062    partition's communicator.
00063 -  "Local" operations are operations performed with respect to a part or
00064    a mesh instance within a process.
00065 -  Part A "neighbors" Part B if Part A has copies of entities owned by Part B
00066    and/or if Part B has copies of entities owned by Part A.
00067 
00068 \section INT Interfaces
00069 -  Each process has one or more "mesh instances."  A mesh instance can be
00070    thought of as a mesh database.  An implementation should support the
00071    existence of more than one mesh instance per process (e.g., it should
00072    always associate mesh data with a mesh instance).  However, we expect
00073    applications would most often use only one mesh instance per process.
00074 -  There is one root set per mesh instance.
00075 -  Each process may have one or more partition handles.
00076 -  A partition assigns entities from one mesh instance to parts.
00077 -  Entities in a mesh instance can be partitioned by one or more partitions.
00078    Mesh instances know which partitions they contain.
00079 -  Parts are uniquely identified globally by part IDs of type iMeshP_Part.
00080    Local parts can also be accessed by part handles that provide more
00081    direct access to a part.
00082    Functions accepting part handles operate correctly on only local
00083    parts (parts on the calling process); they will return an error
00084    for remote (off-process) parts.
00085 -  Generation and management of global IDs for entities
00086    is not included in the iMeshP interface.  It can
00087    be provided as a service above the iMeshP interface.
00088    Uniqueness of global IDs is managed at the partition level.
00089 
00090 \section PRT Using Parts
00091 -  Each part is wholly contained within a process.
00092 -  A process may have zero, one or multiple parts.
00093 -  For each entity that is copied onto remote parts, the owning part knows
00094    both the remote part ID and remote entity handle of all copies.
00095 -  All parts with copies of a boundary entity know the remote part ID
00096    and remote entity handle of all copies of the entity.
00097 -  All parts with copies of any entity know the part ID and
00098    entity handle corresponding to the owner of the entity.
00099 -  Functions that return entity information for a part, set or mesh
00100    instance return the information for all entities (including copies and
00101    ghosts) in that part, set or mesh instance.  Applications can check
00102    whether an entity is owned or a ghost using iMeshP_isEntOwner or
00103    iMeshP_getEntStatus.
00104 -  Many iMesh functions that accept an iBase_EntitySetHandle
00105    are also useful in the context of a iMeshP_PartHandle.
00106    These functions are reinterpreted so that they can accept either an
00107    iBase_EntitySetHandle or an iMeshP_PartHandle.
00108 -  In particular, entities are added to and removed from local parts via
00109    the same functions that are used to manipulate entity sets.
00110    That is, given a mesh instance, an entity handle, and a part handle,
00111    the entity is added to or removed from the part via calls to
00112    the following functions with the part handle passed as the entity set handle:
00113    - Add entity to part --> iMesh_addEntToSet
00114    - Remove entity from part --> iMesh_rmvEntFromSet
00115    - Add array of entities to part --> iMesh_addEntArrToSet
00116    - Remove array of entities from part --> iMesh_rmvEntArrFromSet
00117 
00118 \section CMM Communication
00119 -  Each function description includes its communication requirements.  The
00120    options are described here:
00121    -  COMMUNICATION:  Collective -- the function must be called by all
00122       processes in the partition's communicator.  (These functions have the
00123       suffix "All" to indicate collective communication is done.)
00124    -  COMMUNICATION:  Point-to-Point -- communication is used, but the
00125       communication is from one process to only one other process.  The
00126       receiving process must issue an appropriate receive call to receive
00127       the message.
00128    -  COMMUNICATION:  None -- the function does not use communication; only
00129       local operations are performed.
00130    -  COMMUNICATION:  None++ -- no communication is done; the values
00131       are precomputed by iMeshP_syncPartitionAll or iMeshP_syncMeshAll.
00132 -  Non-blocking calls for off-processor mesh-modification return a request
00133    that indicates whether or not the operation has completed.  The request
00134    is more than an MPI request; it encapsulates both the MPI information and
00135    the mesh operations that were requested.  If non-blocking calls are used,
00136    appropriate calls to iMeshP "wait" or "poll" functions must be used to
00137    handle and satisfy requests.
00138 */
00139 
00140 /*------------------------------------------------------------------------*/
00141 /*------------------------------------------------------------------------*/
00142 /*                          Partition Functionality                       */
00143 /*------------------------------------------------------------------------*/
00144 /*------------------------------------------------------------------------*/
00145 
00146 /** \brief Create a partition; return its handle.
00147  *
00148  *  Given a mesh instance and a communicator,
00149  *  return a partition handle for a new partition within the mesh instance
00150  *  that uses the communicator.
00151  *  In the future, we may have different creation routines for different
00152  *  communication systems; once the partition is created, the application
00153  *  would not have to worry about the communication system again.
00154  *  For now, implementations are MPI based, so MPI communicators are provided.
00155  *  For serial use, the communicator may be MPI_COMM_SELF or communicator may
00156  *  be NULL.
00157  *
00158  *  COMMUNICATION:  Collective.
00159  *
00160  *  \param  instance         (In)  Mesh instance to contain the partition.
00161  *  \param  communicator     (In)  Communicator to be used for parallel
00162  *                                 communication.
00163  *  \param  partition        (Out) The newly created partition.
00164  *  \param  err              (Out) Error code.
00165  */
00166 void iMeshP_createPartitionAll( iMesh_Instance instance, MPI_Comm communicator, iMeshP_PartitionHandle* partition,
00167                                 int* err );
00168 
00169 /**  \brief Destroy a partition.
00170  *
00171  *  Given a partition handle,
00172  *  destroy the partition associated with the handle.
00173  *  Note that the partition handle is not invalidated upon return.
00174  *
00175  *  COMMUNICATION:  Collective.
00176  *
00177  *  \param  instance         (In)  Mesh instance containing the partition.
00178  *  \param  partition        (In)  The partition to be destroyed.
00179  *  \param  err              (Out) Error code.
00180  */
00181 void iMeshP_destroyPartitionAll( iMesh_Instance instance, iMeshP_PartitionHandle partition, int* err );
00182 
00183 /**  \brief Return communicator associated with a partition.
00184  *
00185  *  Given a partition handle, return the communicator associated with
00186  *  it during its creation by iMeshP_createPartitionAll.
00187  *
00188  *  COMMUNICATION:  None
00189  *
00190  *  \param  instance         (In)  Mesh instance containing the partition.
00191  *  \param  partition        (In)  The partition being queried.
00192  *  \param  communicator     (Out) Communicator associated with the partition.
00193  *  \param  err              (Out) Error code.
00194  */
00195 void iMeshP_getPartitionComm( iMesh_Instance instance, iMeshP_PartitionHandle partition, MPI_Comm* communicator,
00196                               int* err );
00197 
00198 /**  \brief Update a partition after parts have been added.
00199  *
00200  *  This function gives the implementation an opportunity to locally store info
00201  *  about the partition so that queries on the partition can be
00202  *  performed without synchronous communication.
00203  *  This function must be called after all parts have been added to the
00204  *  partition and after changes to the partition (e.g., due to load balancing).
00205  *  Values that are precomputed by syncPartitionAll include:
00206  *  -  the total number of parts in a partition;
00207  *  -  the mapping between part IDs and processes; and
00208  *  -  updated remote entity handle information.
00209  *
00210  *  COMMUNICATION:  Collective.
00211  *
00212  *  \param  instance         (In)  Mesh instance containing the partition.
00213  *  \param  partition        (In)  The partition being updated.
00214  *  \param  err              (Out) Error code.
00215  */
00216 void iMeshP_syncPartitionAll( iMesh_Instance instance, iMeshP_PartitionHandle partition, int* err );
00217 
00218 /**  \brief Return the number of partitions associated with a mesh instance.
00219  *
00220  *  Given a mesh instance, return the number of partition handles
00221  *  associated with the mesh instance.
00222  *
00223  *  COMMUNICATION:  None.
00224  *
00225  *  \param  instance         (In)  Mesh instance containing the partitions.
00226  *  \param  num_partitions   (Out) Number of partitions associated with the
00227  *                                 mesh instance.
00228  *  \param  err              (Out) Error code.
00229  */
00230 void iMeshP_getNumPartitions( iMesh_Instance instance, int* num_partitions, int* err );
00231 
00232 /**  \brief Return the partition handles associated with a mesh instance.
00233  *
00234  *  Given a mesh instance, return all partition handles
00235  *  associated with the mesh instance.
00236  *
00237  *  COMMUNICATION:  None.
00238  *
00239  *  \param  instance                    (In)     Mesh instance containing the
00240  *                                               partitions.
00241  *  \param  partitions                  (In/Out) Array of partition handles
00242  *                                               associated with the mesh
00243  *                                               instance.
00244  *  \param  partitions_allocated        (In/Out) Allocated size of
00245  *                                               partitions array.
00246  *  \param  partitions_size             (Out)    Occupied size of
00247  *                                               partitions array.
00248  *  \param  err                         (Out)    Error code.
00249  */
00250 void iMeshP_getPartitions( iMesh_Instance instance, iMeshP_PartitionHandle** partitions, int* partitions_allocated,
00251                            int* partitions_size, int* err );
00252 
00253 /** \brief Return the global number of parts in a partition.
00254  *
00255  *  Given a partition handle, return the total number of parts
00256  *  in the partition across all processes in the partition's communicator.
00257  *
00258  *  COMMUNICATION:  None++.
00259  *
00260  *  \param  instance         (In)  Mesh instance containing the partition.
00261  *  \param  partition        (In)  The partition being queried.
00262  *  \param  num_global_part  (Out) Global number of parts in the partition.
00263  *  \param  err              (Out) Error code.
00264  */
00265 void iMeshP_getNumGlobalParts( iMesh_Instance instance, const iMeshP_PartitionHandle partition, int* num_global_part,
00266                                int* err );
00267 
00268 /** \brief Return the local number of parts in a partition.
00269  *
00270  *  Given a partition handle, return the number of local (on-process) parts
00271  *  in the partition.
00272  *
00273  *  COMMUNICATION:  None.
00274  *
00275  *  \param  instance         (In)  Mesh instance containing the partition.
00276  *  \param  partition        (In)  The partition being queried.
00277  *  \param  num_local_part   (Out) Local (on-process) number of parts in
00278  *                                 the partition.
00279  *  \param  err              (Out) Error code.
00280  */
00281 void iMeshP_getNumLocalParts( iMesh_Instance instance, const iMeshP_PartitionHandle partition, int* num_local_part,
00282                               int* err );
00283 
00284 /** \brief Return the part handles of local parts in a partition.
00285  *
00286  *  Given a partition handle, return the
00287  *  part handles for the local (on-process) parts in the partition.
00288  *
00289  *  COMMUNICATION:  None.
00290  *
00291  *  \param  instance               (In)     Mesh instance containing the
00292  *                                          partition.
00293  *  \param  partition              (In)     The partition being queried.
00294  *  \param  parts                  (In/Out) Array of part handles
00295  *                                          for local parts in the partition.
00296  *  \param  parts_allocated        (In/Out) Allocated size of
00297  *                                          parts array.
00298  *  \param  parts_size             (Out)    Occupied size of
00299  *                                          parts array.
00300  *  \param  err                    (Out)    Error code.
00301  */
00302 void iMeshP_getLocalParts( iMesh_Instance instance, const iMeshP_PartitionHandle partition, iMeshP_PartHandle** parts,
00303                            int* parts_allocated, int* parts_size, int* err );
00304 
00305 /**  \brief Return the process rank of a given part.
00306  *
00307  *  Given a partition handle and a part ID, return the process rank
00308  *  (with respect to the partition's communicator) of the
00309  *  process that owns the part. The part may be local or remote.
00310  *
00311  *  COMMUNICATION:  None++.
00312  *
00313  *  \param  instance         (In)  Mesh instance containing the partition.
00314  *  \param  partition        (In)  The partition being queried.
00315  *  \param  part_id          (In)  Part ID for the part being queried.
00316  *  \param  rank             (Out) Process rank of part_id.
00317  *  \param  err              (Out) Error code.
00318  */
00319 void iMeshP_getRankOfPart( iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_Part part_id,
00320                            int* rank, int* err );
00321 
00322 /**  \brief Return the process ranks of given parts.
00323  *
00324  *  Given a partition handle and an array of part IDs, return the process ranks
00325  *  (with respect to the partition's communicator) of the
00326  *  process that owns each part. The parts may be local or remote.
00327  *
00328  *  COMMUNICATION:  None++.
00329  *
00330  *  \param  instance         (In)     Mesh instance containing the partition.
00331  *  \param  partition        (In)     The partition being queried.
00332  *  \param  part_ids         (In)     Array of Part IDs for the parts being
00333  *                                    queried.
00334  *  \param  part_ids_size    (In)     The number of Part IDs in part_ids.
00335  *  \param  ranks            (In/Out) Array of ranks for the Part Ids in
00336  *                                    part_ids.
00337  *  \param  ranks_allocated  (In/Out) Allocated size of ranks array.
00338  *  \param  ranks_size       (Out)    Occupied size of ranks array.
00339  *  \param  err              (Out)    Error code.
00340  */
00341 void iMeshP_getRankOfPartArr( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
00342                               const iMeshP_Part* part_ids, const int part_ids_size, int** ranks, int* ranks_allocated,
00343                               int* ranks_size, int* err );
00344 
00345 /** \brief  Return the number of entities of a given type in a partition.
00346  *
00347  *  Given a partition handle and an entity set (possibly the root set),
00348  *  return the global number of  entities of a
00349  *  given entity type in the partition and set.  This function may require
00350  *  communication and, thus, must be called by all processes in the partition's
00351  *  communicator.
00352  *
00353  *  COMMUNICATION:  Collective.
00354  *
00355  *  \param  instance          (In)  Mesh instance containing the partition.
00356  *  \param  partition         (In)  The partition being queried.
00357  *  \param  entity_set        (In)  Entity set handle for the entity set
00358  *                                  being queried.
00359  *  \param  entity_type       (In)  Requested entity type;
00360  *                                  may be iBase_ALL_TYPES.
00361  *  \param  num_type          (Out) Number of entities of entity_type in
00362  *                                  the partition and entity set.
00363  *  \param  err               (Out) Error code.
00364  */
00365 void iMeshP_getNumOfTypeAll( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
00366                              const iBase_EntitySetHandle entity_set, int entity_type, int* num_type, int* err );
00367 
00368 /** \brief  Return the number of entities of a given topology in a partition.
00369  *
00370  *  Given a partition handle and an entity set (possibly the root set),
00371  *  return the global number of  entities of a
00372  *  given entity topology in the partition and set.  This function may require
00373  *  communication and, thus, must be called by all processes in the partition's
00374  *  communicator.
00375  *
00376  *  COMMUNICATION:  Collective.
00377  *
00378  *  \param  instance          (In)  Mesh instance containing the partition.
00379  *  \param  partition         (In)  The partition being queried.
00380  *  \param  entity_set        (In)  Entity set handle for the entity set
00381  *                                  being queried; may be the root set.
00382  *  \param  entity_topology   (In)  Requested entity topology;
00383  *                                  may be iMesh_ALL_TOPOLOGIES.
00384  *  \param  num_topo          (Out) Number of entities with entity_topology in
00385  *                                  the partition and entity set.
00386  *  \param  err               (Out) Error code.
00387  */
00388 void iMeshP_getNumOfTopoAll( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
00389                              const iBase_EntitySetHandle entity_set, int entity_topology, int* num_topo, int* err );
00390 
00391 /*------------------------------------------------------------------------*/
00392 /*------------------------------------------------------------------------*/
00393 /*                        Part Functionality                              */
00394 /*------------------------------------------------------------------------*/
00395 /*------------------------------------------------------------------------*/
00396 
00397 /** \brief Create a new part in a partition.
00398  *
00399  *  Given a partition handle, create a new part and add it to the
00400  *  partition on the process invoking the creation.  Return the part handle
00401  *  for the new part.
00402  *
00403  *  COMMUNICATION:  None.
00404  *
00405  *  \param  instance          (In)  Mesh instance containing the partition.
00406  *  \param  partition         (In)  The partition being updated.
00407  *  \param  part              (Out) The newly created part.
00408  *  \param  err               (Out) Error code.
00409  */
00410 void iMeshP_createPart( iMesh_Instance instance, iMeshP_PartitionHandle partition, iMeshP_PartHandle* part, int* err );
00411 
00412 /** \brief  Remove a part from a partition.
00413  *
00414  *  Given a partition handle and a part handle, remove the part
00415  *  from the partition and destroy the part.  Note that the part handle
00416  *  is not invalidated by this function.
00417  *
00418  *  COMMUNICATION:  None.
00419  *
00420  *  \param  instance          (In)  Mesh instance containing the partition.
00421  *  \param  partition         (In)  The partition being updated.
00422  *  \param  part              (In)  The part to be removed.
00423  *  \param  err               (Out) Error code.
00424  */
00425 void iMeshP_destroyPart( iMesh_Instance instance, iMeshP_PartitionHandle partition, iMeshP_PartHandle part, int* err );
00426 
00427 /** \brief Obtain a part ID from a part handle.
00428  *
00429  *  Given a partition handle and a local part handle, return the part ID.
00430  *  If the part handle is not a valid part handle for a local part,
00431  *  an error is returned.
00432  *
00433  *  COMMUNICATION:  None.
00434  *
00435  *  \param  instance          (In)  Mesh instance containing the partition.
00436  *  \param  partition         (In)  The partition being queried.
00437  *  \param  part              (In)  The part being queried.
00438  *  \param  part_id           (Out) Part ID for part.
00439  *  \param  err               (Out) Error code.
00440  */
00441 void iMeshP_getPartIdFromPartHandle( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
00442                                      const iMeshP_PartHandle part, iMeshP_Part* part_id, int* err );
00443 
00444 /** \brief Obtain part IDs from part handles.
00445  *
00446  *  Given a partition handle and an array of local part handles,
00447  *  return the part ID for each part handle.
00448  *  If any part handle is not a valid part handle for a local part,
00449  *  an error is returned.
00450  *
00451  *  COMMUNICATION:  None.
00452  *
00453  *  \param  instance            (In)     Mesh instance containing the partition.
00454  *  \param  partition           (In)     The partition being queried.
00455  *  \param  parts               (In)     Array of part handles for the parts
00456  *                                       being queried.
00457  *  \param  parts_size          (In)     Number of part handles being queried.
00458  *  \param  part_ids            (In/Out) Array of part IDs associated with the
00459  *                                       parts.
00460  *  \param  part_ids_allocated  (In/Out) Allocated size of part_ids array.
00461  *  \param  part_ids_size       (Out)    Occupied size of part_ids array.
00462  *  \param  err                 (Out)    Error code.
00463  */
00464 void iMeshP_getPartIdsFromPartHandlesArr( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
00465                                           const iMeshP_PartHandle* parts, const int parts_size, iMeshP_Part** part_ids,
00466                                           int* part_ids_allocated, int* part_ids_size, int* err );
00467 
00468 /** \brief Obtain a part handle from a part ID.
00469  *
00470  *  Given a partition handle and a part ID, return the part handle
00471  *  associated with the part
00472  *  if the part is local; otherwise, return an error code.
00473  *
00474  *  COMMUNICATION:  None.
00475  *
00476  *  \param  instance          (In)  Mesh instance containing the partition.
00477  *  \param  partition         (In)  The partition being queried.
00478  *  \param  part_id           (In)  Part ID for the part being queried.
00479  *  \param  part              (Out) Part handle associated with part_id.
00480  *  \param  err               (Out) Error code.
00481  */
00482 void iMeshP_getPartHandleFromPartId( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
00483                                      iMeshP_Part part_id, iMeshP_PartHandle* part, int* err );
00484 
00485 /** \brief Obtain part handles from part IDs.
00486  *
00487  *  Given a partition handle and an array of local part IDs,
00488  *  return the part handle for each part ID.
00489  *  If any part ID is not a valid part ID for a local part,
00490  *  an error is returned.
00491  *
00492  *  COMMUNICATION:  None.
00493  *
00494  *  \param  instance                (In)     Mesh instance containing the
00495  *                                           partition.
00496  *  \param  partition               (In)     The partition being queried.
00497  *  \param  part_ids                (In)     Array of part IDs for the parts
00498  *                                           being queried.
00499  *  \param  part_ids_size           (In)     Number of part IDs being queried.
00500  *  \param  parts                   (In/Out) Array of part handles associated
00501  *                                           with the part_ids.
00502  *  \param  parts_allocated         (In/Out) Allocated size of parts
00503  *                                           array.
00504  *  \param  parts_size              (Out)    Occupied size of parts
00505  *                                           array.
00506  *  \param  err                     (Out)    Error code.
00507  */
00508 void iMeshP_getPartHandlesFromPartsIdsArr( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
00509                                            const iMeshP_Part* part_ids, const int part_ids_size,
00510                                            iMeshP_PartHandle** parts, int* parts_allocated, int* parts_size, int* err );
00511 
00512 /*------------------------------------------------------------------------*/
00513 /*                        Part Boundaries                                 */
00514 /*------------------------------------------------------------------------*/
00515 
00516 /** \brief Return the number of parts that neighbor a given part.
00517  *
00518  *  Given a partition handle, a part handle, and an entity type,
00519  *  return the number of parts in the partition that neighbor the given part
00520  *  (i.e., that (1) have copies of entities of the given entity type owned by
00521  *  the given part or (2) own entities of the given entity type that are
00522  *  copied on the given part).
00523  *
00524  *  COMMUNICATION:  None++.
00525  *
00526  *  \param  instance          (In)  Mesh instance containing the partition.
00527  *  \param  partition         (In)  The partition being queried.
00528  *  \param  part              (In)  The part being queried.
00529  *  \param  entity_type       (In)  Entity type of the copied entities;
00530  *                                  may be iBase_ALL_TYPES.
00531  *  \param  num_part_nbors    (Out) Number of parts neighboring the given part.
00532  *  \param  err               (Out) Error code.
00533  */
00534 void iMeshP_getNumPartNbors( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
00535                              const iMeshP_PartHandle part, int entity_type, int* num_part_nbors, int* err );
00536 
00537 /** \brief Return the number of parts that neighbor given parts.
00538  *
00539  *  Given a partition handle, an array of part handles, and an entity type,
00540  *  return the number of parts in the partition that neighbor each of the
00541  *  given parts
00542  *  (i.e., that (1) have copies of entities of the given entity type owned by
00543  *  the given part or (2) own entities of the given entity type that are
00544  *  copied on the given part).
00545  *
00546  *  COMMUNICATION:  None++.
00547  *
00548  *  \param  instance                  (In)     Mesh instance containing the
00549  *                                             partition.
00550  *  \param  partition                 (In)     The partition being queried.
00551  *  \param  parts                     (In)     Array of part handles for the
00552  *                                             parts being queried.
00553  *  \param  parts_size                (In)     Number of part handles in
00554  *                                             parts.
00555  *  \param  entity_type               (In)     Entity type of the copied
00556  *                                             entities;
00557  *                                             may be iBase_ALL_TYPES.
00558  *  \param  num_part_nbors            (In/Out) Array of values specifying the
00559  *                                             number of part neighbors for
00560  *                                             each part in parts.
00561  *  \param  num_part_nbors_allocated  (In/Out) Allocated size of num_part_nbors
00562  *                                             array.
00563  *  \param  num_part_nbors_size       (Out)    Occupied size of num_part_nbors
00564  *                                             array.
00565  *  \param  err                       (Out)    Error code.
00566  */
00567 void iMeshP_getNumPartNborsArr( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
00568                                 const iMeshP_PartHandle* parts, int parts_size, int entity_type, int** num_part_nbors,
00569                                 int* num_part_nbors_allocated, int* num_part_nbors_size, int* err );
00570 
00571 /** \brief Return the parts that neighbor a given part.
00572  *
00573  *  Given a partition handle, a part handle, and an entity type,
00574  *  return the part IDs of parts that neighbor the given part
00575  *  (i.e., that (1) have copies of entities of the given entity type owned by
00576  *  the given part or (2) own entities of the given entity type that are
00577  *  copied on the given part).
00578  *
00579  *  COMMUNICATION:  None++.
00580  *
00581  *  \param  instance                 (In)     Mesh instance containing the
00582  *                                            partition.
00583  *  \param  partition                (In)     The partition being queried.
00584  *  \param  part                     (In)     The part being queried.
00585  *  \param  entity_type              (In)     Entity type of the copied
00586  *                                            entities;
00587  *                                            may be iBase_ALL_TYPES.
00588  *  \param  num_part_nbors           (Out)    Number of parts neighboring
00589  *                                            the given part.
00590  *  \param  nbor_part_ids            (In/Out) Array of part IDs for
00591  *                                            part neighbors of part.
00592  *  \param  nbor_part_ids_allocated  (In/Out) Allocated size of nbor_part_ids
00593  *                                            array.
00594  *  \param  nbor_part_ids_size       (Out)    Occupied size of nbor_part_ids
00595  *                                            array.
00596  *  \param  err                      (Out)    Error code.
00597  */
00598 void iMeshP_getPartNbors( iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_PartHandle part,
00599                           int entity_type, int* num_part_nbors, iMeshP_Part** nbor_part_ids,
00600                           int* nbor_part_ids_allocated, int* nbor_part_ids_size, int* err );
00601 
00602 /** \brief Return the parts that neighbor given parts.
00603  *
00604  *  Given a partition handle, an array of part handles, and an entity type,
00605  *  return the part IDs of parts that neighbor the given parts
00606  *  (i.e., that (1) have copies of entities of the given entity type owned by
00607  *  the given part or (2) own entities of the given entity type that are
00608  *  copied on the given part).
00609  *
00610  *  COMMUNICATION:  None++.
00611  *
00612  *  \param  instance                 (In)     Mesh instance containing the
00613  *                                            partition.
00614  *  \param  partition                (In)     The partition being queried.
00615  *  \param  parts                    (In)     The parts being queried.
00616  *  \param  parts_size               (In)     The number of parts being queried.
00617  *  \param  entity_type              (In)     Entity type of the copied
00618  *                                            entities;
00619  *                                            may be iBase_ALL_TYPES.
00620  *  \param  num_part_nbors           (In/Out) Array of values specifying the
00621  *                                            number of part neighbors for
00622  *                                            each part in parts.
00623  *  \param  num_part_nbors_allocated (In/Out) Allocated size of num_part_nbors
00624  *                                            array.
00625  *  \param  num_part_nbors_size      (Out)    Occupied size of num_part_nbors
00626  *                                            array.
00627  *  \param  nbor_part_ids            (In/Out) Array of part IDs for
00628  *                                            part neighbors of part.
00629  *  \param  nbor_part_ids_allocated  (In/Out) Allocated size of nbor_part_ids
00630  *                                            array.
00631  *  \param  nbor_part_ids_size       (Out)    Occupied size of nbor_part_ids
00632  *                                            array.
00633  *  \param  err                      (Out)    Error code.
00634  */
00635 void iMeshP_getPartNborsArr( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
00636                              const iMeshP_PartHandle* parts, const int parts_size, int entity_type,
00637                              int** num_part_nbors, int* num_part_nbors_allocated, int* num_part_nbors_size,
00638                              iMeshP_Part** nbor_part_ids, int* nbor_part_ids_allocated, int* nbor_part_ids_size,
00639                              int* err );
00640 
00641 /** \brief Return the number of entities on a part boundary.
00642  *
00643  *  Given a partition handle, a part handle, an entity type and topology, and a
00644  *  target part ID, return the number of entities of the given type and/or
00645  *  topology on the part boundary shared with the target part.
00646  *
00647  *  COMMUNICATION:  None.
00648  *
00649  *  \param  instance          (In)  Mesh instance containing the partition.
00650  *  \param  partition         (In)  The partition being queried.
00651  *  \param  part              (In)  The part being queried.
00652  *  \param  entity_type       (In)  Entity type of the boundary entities;
00653  *                                  may be iBase_ALL_TYPES.
00654  *  \param  entity_topology   (In)  Entity topology of the boundary entities;
00655  *                                  may be iMesh_ALL_TOPOLOGIES.
00656  *  \param  target_part_id    (In)  Part ID with which part is sharing
00657  *                                  the boundary entities; may be
00658  *                                  iMeshP_ALL_PARTS.
00659  *  \param  num_entities      (Out) Number of part boundary entities shared
00660  *                                  by part and target_part_id.
00661  *  \param  err               (Out) Error code.
00662  */
00663 void iMeshP_getNumPartBdryEnts( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
00664                                 const iMeshP_PartHandle part, int entity_type, int entity_topology,
00665                                 iMeshP_Part target_part_id, int* num_entities, int* err );
00666 
00667 /** \brief Return the entity handles of entities on a part boundary.
00668  *
00669  *  Given a partition handle, a part handle, an entity type and topology, and a
00670  *  target part ID, return the entity handles of entities of the given type
00671  *  and/or topology on the part boundary shared with the target part.
00672  *
00673  *  COMMUNICATION:  None.
00674  *
00675  *  \param  instance                 (In)     Mesh instance containing the
00676  *                                            partition.
00677  *  \param  partition                (In)     The partition being queried.
00678  *  \param  part                     (In)     The part being queried.
00679  *  \param  entity_type              (In)     Entity type of the boundary
00680  *                                            entities;
00681  *                                            may be iBase_ALL_TYPES.
00682  *  \param  entity_topology          (In)     Entity topology of the boundary
00683  *                                            entities;
00684  *                                            may be iMesh_ALL_TOPOLOGIES.
00685  *  \param  target_part_id           (In)     Part ID with which part
00686  *                                            is sharing the boundary entities;
00687  *                                            may be iMeshP_ALL_PARTS.
00688  *  \param  entities                 (In/Out) Array of entity handles for
00689  *                                            entities on the part boundary
00690  *                                            between part and
00691  *                                            target_part_id.
00692  *  \param  entities_allocated       (In/Out) Allocated size of entities
00693  *                                            array.
00694  *  \param  entities_size            (Out)    Occupied size of entities
00695  *                                            array.
00696  *  \param  err                      (Out)    Error code.
00697  */
00698 void iMeshP_getPartBdryEnts( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
00699                              const iMeshP_PartHandle part, int entity_type, int entity_topology,
00700                              iMeshP_Part target_part_id, iBase_EntityHandle** entities, int* entities_allocated,
00701                              int* entities_size, int* err );
00702 
00703 /** \brief Initialize an iterator over a specified part boundary.
00704  *
00705  *  Given a partition handle, a part handle, and a
00706  *  target part ID, return an iterator over all entities of a given
00707  *  entity type and topology along
00708  *  the part boundary shared with the target part.
00709  *  Iterator functionality for getNext, reset, and end is
00710  *  provided through the regular iMesh iterator functions
00711  *  iMesh_getNextEntIter, iMesh_resetEntIter, and iMesh_endEntIter,
00712  *  respectively.
00713  *
00714  *  COMMUNICATION:  None.
00715  *
00716  *  \param  instance          (In)  Mesh instance containing the partition.
00717  *  \param  partition         (In)  The partition being queried.
00718  *  \param  part              (In)  The part being queried.
00719  *  \param  entity_type       (In)  Entity type of the boundary entities;
00720  *                                  may be iBase_ALL_TYPES.
00721  *  \param  entity_topology   (In)  Entity topology of the boundary entities;
00722  *                                  may be iMesh_ALL_TOPOLOGIES.
00723  *  \param  target_part_id    (In)  Part ID with which part is sharing
00724  *                                  the boundary entities; may be
00725  *                                  iMeshP_ALL_PARTS.
00726  *  \param  entity_iterator   (Out) Iterator returned by the function.
00727  *  \param  err               (Out) Error code.
00728  */
00729 void iMeshP_initPartBdryEntIter( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
00730                                  const iMeshP_PartHandle part, int entity_type, int entity_topology,
00731                                  iMeshP_Part target_part_id, iBase_EntityIterator* entity_iterator, int* err );
00732 
00733 /** \brief Initialize an array iterator over a specified part boundary.
00734  *
00735  *  Given a partition handle, a part handle, and a
00736  *  target part ID, return an array iterator over all entities of a given
00737  *  entity type and topology along
00738  *  the part boundary shared with the target part.
00739  *  Iterator functionality for getNext, reset, and end is
00740  *  provided through the regular iMesh iterator functions
00741  *  iMesh_getNextEntArrIter, iMesh_resetEntArrIter, and iMesh_endEntArrIter,
00742  *  respectively.
00743  *
00744  *  COMMUNICATION:  None.
00745  *
00746  *  \param  instance          (In)  Mesh instance containing the partition.
00747  *  \param  partition         (In)  The partition being queried.
00748  *  \param  part              (In)  The part being queried.
00749  *  \param  entity_type       (In)  Entity type of the boundary entities;
00750  *                                  may be iBase_ALL_TYPES.
00751  *  \param  entity_topology   (In)  Entity topology of the boundary entities;
00752  *                                  may be iMesh_ALL_TOPOLOGIES.
00753  *  \param  array_size        (In)  Size of chunks of handles returned for
00754  *                                  each value of the iterator.
00755  *  \param  target_part_id    (In)  Part ID with which part is sharing
00756  *                                  the boundary entities; may be
00757  *                                  iMeshP_ALL_PARTS.
00758  *  \param  entity_iterator   (Out) Iterator returned by the function.
00759  *  \param  err               (Out) Error code.
00760  */
00761 void iMeshP_initPartBdryEntArrIter( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
00762                                     const iMeshP_PartHandle part, int entity_type, int entity_topology, int array_size,
00763                                     iMeshP_Part target_part_id, iBase_EntityArrIterator* entity_iterator, int* err );
00764 
00765 /*------------------------------------------------------------------------*/
00766 /*                        Parts and Sets                                  */
00767 /*------------------------------------------------------------------------*/
00768 
00769 /**  \brief Return the number of entities of a given type in both a part and an entity set.
00770  *
00771  *  Given a part handle, an entity set handle, and an entity type, return
00772  *  the number of entities of the given type that are in BOTH the given
00773  *  part AND the given entity set.
00774  *  This function is similar to iMesh_getNumOfType, but it also restricts
00775  *  the returned data with respect to its existence in the given part.
00776  *
00777  *  COMMUNICATION:  None.
00778  *
00779  *  \param  instance          (In)  Mesh instance containing the partition.
00780  *  \param  partition         (In)  The partition being queried.
00781  *  \param  part              (In)  The part being queried.
00782  *  \param  entity_set        (In)  Entity set handle for the entity set
00783  *                                  being queried; may be the root set.
00784  *  \param  entity_type       (In)  Entity type of the boundary entities;
00785  *                                  may be iBase_ALL_TYPES.
00786  *  \param  num_type          (Out) Number of entities of entity_type in
00787  *                                  both part and entity_set.
00788  *  \param  err               (Out) Error code.
00789  */
00790 void iMeshP_getNumOfType( iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_PartHandle part,
00791                           const iBase_EntitySetHandle entity_set, int entity_type, int* num_type, int* err );
00792 
00793 /**  \brief Return the number of entities of a given topology in both a part and an entity set.
00794  *
00795  *  Given a part handle, an entity set handle, and an entity topology, return
00796  *  the number of entities of the given topology that are in BOTH the given
00797  *  part AND the given entity set.
00798  *  This function is similar to iMesh_getNumOfTopo, but it also restricts
00799  *  the returned data with respect to its existence in the given part.
00800  *
00801  *  COMMUNICATION:  None.
00802  *
00803  *  \param  instance          (In)  Mesh instance containing the partition.
00804  *  \param  partition         (In)  The partition being queried.
00805  *  \param  part              (In)  The part being queried.
00806  *  \param  entity_set        (In)  Entity set handle for the entity set
00807  *                                  being queried; may be the root set.
00808  *  \param  entity_topology   (In)  Entity topology of the boundary entities;
00809  *                                  may be iMesh_ALL_TOPOLOGIES.
00810  *  \param  num_topo          (Out) Number of entities of entity_topology in
00811  *                                  both part and entity_set.
00812  *  \param  err               (Out) Error code.
00813  */
00814 void iMeshP_getNumOfTopo( iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_PartHandle part,
00815                           const iBase_EntitySetHandle entity_set, int entity_topology, int* num_topo, int* err );
00816 
00817 /**\brief Get indexed representation of mesh or subset of mesh
00818  *
00819  * Given part handle and an entity set and optionally a type or topology,
00820  * for all entities that are in BOTH the part and the entity set, return:
00821  * - The entities in the part and set of the specified type or topology
00822  * - The entities adjacent to those entities with a specified
00823  *    type, as a list of unique handles.
00824  * - For each entity in the first list, the adjacent entities,
00825  *    specified as indices into the second list.
00826  *
00827  *  COMMUNICATION:  None.
00828  *
00829  *\param  instance                (In)     Mesh instance containing the
00830  *                                         partition.
00831  *\param  partition               (In)     The partition being queried.
00832  *\param  part                    (In)     The part being queried.
00833  *\param entity_set_handle        (In)     The set being queried
00834  *\param entity_type_requestor    (In)     If not iBase_ALL_TYPES, act only
00835  *                                         on the subset of entities with
00836  *                                         the specified type.
00837  *\param entity_topology_requestor (In)    If not iMesh_ALL_TOPOLOGIES, act
00838  *                                         only on the subset of entities with
00839  *                                         the specified topology.
00840  *\param entity_type_requested    (In)     The type of the adjacent entities
00841  *                                         to return.
00842  *\param entity_handles           (In/Out) The handles of the (non-strict)
00843  *                                         subset of the union of the part
00844  *                                         and entity set, and the optional
00845  *                                         type and topology filtering
00846  *                                         arguments.
00847  *\param adj_entity_handles       (In/Out) The union of the entities of type
00848  *                                         'requested_entity_type' adjacent
00849  *                                         to each entity in 'entity_handles'.
00850  *\param adj_entity_indices       (In/Out) For each entity in 'entity_handles',
00851  *                                         the adjacent entities of type
00852  *                                         'entity_type_requested', specified as
00853  *                                         indices into 'adj_entity_handles'.
00854  *                                         The indices are concatenated into a
00855  *                                         single array in the order of the
00856  *                                         entity handles in 'entity_handles'.
00857  *\param offset                   (In/Out) For each entity in the
00858  *                                         corresponding position in
00859  *                                         'entity_handles', the position
00860  *                                         in 'adj_entity_indices' at which
00861  *                                         values for that entity are stored.
00862  */
00863 void iMeshP_getAdjEntIndices( iMesh_Instance instance, iMeshP_PartitionHandle partition, iMeshP_PartHandle part,
00864                               iBase_EntitySetHandle entity_set_handle, int entity_type_requestor,
00865                               int entity_topology_requestor, int entity_type_requested,
00866                               iBase_EntityHandle** entity_handles, int* entity_handles_allocated,
00867                               int* entity_handles_size, iBase_EntityHandle** adj_entity_handles,
00868                               int* adj_entity_handles_allocated, int* adj_entity_handles_size, int** adj_entity_indices,
00869                               int* adj_entity_indices_allocated, int* adj_entity_indices_size, int** offset,
00870                               int* offset_allocated, int* offset_size, int* err );
00871 
00872 /** \brief Return entities in a both given part and entity set.
00873  *
00874  *  Given an entity set handle
00875  *  and a part handle, return entity handles for entities
00876  *  that are in both the part and the entity set.
00877  *  This function is similar to iMesh_getEntities, but it also restricts
00878  *  the returned data with respect to its existence in the given part.
00879  *
00880  *  COMMUNICATION:  None.
00881  *
00882  *  \param  instance                 (In)     Mesh instance containing the
00883  *                                            partition.
00884  *  \param  partition                (In)     The partition being queried.
00885  *  \param  part                     (In)     The part being queried.
00886  *  \param  entity_set               (In)     Entity set handle for the
00887  *                                            entity set being queried;
00888  *                                            may be the root set.
00889  *  \param  entity_type              (In)     Entity type of the
00890  *                                            entities;
00891  *                                            may be iBase_ALL_TYPES.
00892  *  \param  entity_topology          (In)     Entity topology of the
00893  *                                            entities;
00894  *                                            may be iMesh_ALL_TOPOLOGIES.
00895  *  \param  entities                 (In/Out) Array of entity handles for
00896  *                                            entities in both part
00897  *                                            and entity_set.
00898  *  \param  entities_allocated       (In/Out) Allocated size of entities.
00899  *  \param  entities_size            (Out)    Occupied size of entities.
00900  *  \param  err                      (Out)    Error code.
00901  */
00902 void iMeshP_getEntities( iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_PartHandle part,
00903                          const iBase_EntitySetHandle entity_set, int entity_type, int entity_topology,
00904                          iBase_EntityHandle** entities, int* entities_allocated, int* entities_size, int* err );
00905 
00906 /** \brief Return entities adjacent to entities in a given part and entity set.
00907  *
00908  *  Given an entity set handle
00909  *  and a part handle, return entities adjacent (with respect to a given
00910  *  entity type and/or topology) to entities
00911  *  that are in both the part and the entity set.
00912  *  This function is similar to iMesh_getAdjEntities, but it also restricts
00913  *  the returned data with respect to its existence in the given part.
00914  *  If a non-root entity set is specified, the function also returns
00915  *  flags indicating whether each adjacent entity
00916  *  is in the entity set; (*in_entity_set)[i]=1 indicates that adjacent entity
00917  *  (*adj_entities)[i] is in the specified entity set.
00918  *  Array entry offset[i] stores the index of first adjacent entity to
00919  *  entity i.
00920  *
00921  *  COMMUNICATION:  None.
00922  *
00923  *  \param  instance                     (In)     Mesh instance containing the
00924  *                                                partition.
00925  *  \param  partition                    (In)     The partition being queried.
00926  *  \param  part                         (In)     The part being queried.
00927  *  \param  entity_set                   (In)     Entity set handle for the
00928  *                                                entity set being queried;
00929  *                                                may be the root set.
00930  *  \param  entity_type_requestor        (In)     Return entities adjacent to
00931  *                                                entities of this type;
00932  *                                                may be iBase_ALL_TYPES.
00933  *  \param  entity_topology_requestor    (In)     Return entities adjacent to
00934  *                                                entities of this topology;
00935  *                                                may be iMesh_ALL_TOPOLOGIES.
00936  *  \param  entity_type_requested        (In)     Return adjacent entities of
00937  *                                                this type;
00938  *                                                may be iBase_ALL_TYPES.
00939  *  \param  adj_entities                 (In/Out) Array of adjacent entity
00940  *                                                handles returned.
00941  *  \param  adj_entities_allocated       (In/Out) Allocated size of
00942  *                                                adj_entities.
00943  *  \param  adj_entities_size            (Out)    Occupied size of
00944  *                                                adj_entities.
00945  *  \param  offset                       (In/Out) Array of offsets returned.
00946  *  \param  offset_allocated             (In/Out) Allocated size of offset.
00947  *  \param  offset_size                  (Out)    Occupied size of offset.
00948  *  \param  in_entity_set                (In/Out) Array of flags returned if
00949  *                                                non-root entity set was input;
00950  *                                                (*in_entity_set)[i]=1
00951  *                                                indicates
00952  *                                                (*adj_entities)[i]
00953  *                                                is in the entity set.
00954  *  \param  in_entity_set_allocated      (In/Out) Allocated size of
00955  *                                                in_entity_set.
00956  *  \param  in_entity_set_size           (Out)    Occupied size of
00957  *                                                in_entity_set.
00958  *  \param  err                          (Out)    Error code.
00959  */
00960 void iMeshP_getAdjEntities( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
00961                             const iMeshP_PartHandle part, const iBase_EntitySetHandle entity_set,
00962                             int entity_type_requestor, int entity_topology_requestor, int entity_type_requested,
00963                             iBase_EntityHandle** adj_entities, int* adj_entities_allocated, int* adj_entities_size,
00964                             int** offset, int* offset_allocated, int* offset_size, int** in_entity_set,
00965                             int* in_entity_set_allocated, int* in_entity_set_size, int* err );
00966 
00967 /** \brief Create an entity iterator for a given part and entity set.
00968 
00969  *  Given a local part and an entity set, return an iterator over the
00970  *  entities of the requested type and topology that are in both the
00971  *  part and the entity set.
00972  *  Iterator functionality for getNext, reset, and end is
00973  *  provided through the regular iMesh iterator functions
00974  *  iMesh_getNextEntIter, iMesh_resetEntIter, and iMesh_endEntIter,
00975  *  respectively.
00976  *
00977  *  COMMUNICATION:  None.
00978  *
00979  *  \param  instance                     (In)  Mesh instance containing the
00980  *                                             partition.
00981  *  \param  partition                    (In)  The partition being queried.
00982  *  \param  part                         (In)  The part being queried.
00983  *  \param  entity_set                   (In)  Entity set handle for the
00984  *                                             entity set being queried.
00985  *  \param  requested_entity_type        (In)  Type of entities to include in
00986  *                                             the iterator.
00987  *  \param  requested_entity_topology    (In)  Topology of entities to include
00988  *                                             in the iterator.
00989  *  \param  entity_iterator              (Out) Iterator returned from function.
00990  *  \param  err                          (Out) Error code.
00991  */
00992 void iMeshP_initEntIter( iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_PartHandle part,
00993                          const iBase_EntitySetHandle entity_set, const int requested_entity_type,
00994                          const int requested_entity_topology, iBase_EntityIterator* entity_iterator, int* err );
00995 
00996 /** \brief Create an entity array iterator for a given part and entity set.
00997 
00998  *  Given a local part and an entity set, return an array iterator over the
00999  *  entities of the requested type and topology that are in both the
01000  *  part and the entity set.
01001  *  Iterator functionality for getNext, reset, and end is
01002  *  provided through the regular iMesh iterator functions
01003  *  iMesh_getNextEntArrIter, iMesh_resetEntArrIter, and iMesh_endEntArrIter,
01004  *  respectively.
01005  *
01006  *  COMMUNICATION:  None.
01007  *
01008  *  \param  instance                     (In)  Mesh instance containing the
01009  *                                             partition.
01010  *  \param  partition                    (In)  The partition being queried.
01011  *  \param  part                         (In)  The part being queried.
01012  *  \param  entity_set                   (In)  Entity set handle for the
01013  *                                             entity set being queried.
01014  *  \param  requested_entity_type        (In)  Type of entities to include in
01015  *                                             the iterator.
01016  *  \param  requested_entity_topology    (In)  Topology of entities to include
01017  *                                             in the iterator.
01018  *  \param  requested_array_size         (In)  The number of handles returned
01019  *                                             in each value of the iterator.
01020  *  \param  entArr_iterator              (Out) Iterator returned from function.
01021  *  \param  err                          (Out) Error code.
01022  */
01023 void iMeshP_initEntArrIter( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
01024                             const iMeshP_PartHandle part, const iBase_EntitySetHandle entity_set,
01025                             const int requested_entity_type, const int requested_entity_topology,
01026                             const int requested_array_size, iBase_EntityArrIterator* entArr_iterator, int* err );
01027 
01028 /*------------------------------------------------------------------------*/
01029 /*------------------------------------------------------------------------*/
01030 /*                           Entity Functionality                         */
01031 /*------------------------------------------------------------------------*/
01032 /*------------------------------------------------------------------------*/
01033 
01034 /** \brief  Return the part ID of the part owning an entity.
01035  *
01036  *  Given an entity handle and a partition handle, return the part ID
01037  *  of the part that owns the entity.
01038  *  Return an error code if an entity is not in the partition.
01039  *
01040  *  COMMUNICATION:  None++.
01041  *
01042  *  \param  instance                     (In)  Mesh instance containing the
01043  *                                             partition.
01044  *  \param  partition                    (In)  The partition being queried.
01045  *  \param  entity                       (In)  Entity whose owning part is to be
01046  *                                             returned.
01047  *  \param  part_id                      (Out) Part ID of the part owning
01048  *                                             the entity.
01049  *  \param  err                          (Out) Error code.
01050  */
01051 void iMeshP_getEntOwnerPart( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
01052                              const iBase_EntityHandle entity, iMeshP_Part* part_id, int* err );
01053 
01054 /** \brief  Return the part IDs of the parts owning the given entities.
01055  *
01056  *  Given an array of entity handles and a partition handle, return for each
01057  *  entity handle the part ID of the part that owns the entity.
01058  *  Return an error code if an entity is not in the partition.
01059  *
01060  *  COMMUNICATION:  None++.
01061  *
01062  *  \param  instance              (In)     Mesh instance containing the
01063  *                                         partition.
01064  *  \param  partition             (In)     The partition being queried.
01065  *  \param  entities              (In)     Entity whose owning part is to be
01066  *                                         returned.
01067  *  \param  entities_size         (In)     Number of entities in
01068  *                                         entities array.
01069  *  \param  part_ids              (Out)    Part IDs of the parts owning
01070  *                                         the entities.
01071  *  \param  part_ids_allocated    (In/Out) Allocated size of part_ids array.
01072  *  \param  part_ids_size         (Out)    Occupied size of part_ids array.
01073  *  \param  err                   (Out)    Error code.
01074  */
01075 void iMeshP_getEntOwnerPartArr( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
01076                                 const iBase_EntityHandle* entities, const int entities_size, iMeshP_Part** part_ids,
01077                                 int* part_ids_allocated, int* part_ids_size, int* err );
01078 
01079 /** \brief Test for entity ownership with respect to a part.
01080  *
01081  *  Given a partition handle, a part handle, and an entity handle, return a
01082  *  flag indicating whether the entity is owned by the part.
01083  *
01084  *  COMMUNICATION:  None.
01085  *
01086  *  \param  instance             (In)  Mesh instance containing the partition.
01087  *  \param  partition            (In)  The partition being queried.
01088  *  \param  part                 (In)  The part being queried.
01089  *  \param  entity               (In)  Entity whose ownership is being tested.
01090  *  \param  is_owner             (Out) Flag indicating whether the given part
01091  *                                     is the owner of the given entity.
01092  *  \param  err                  (Out) Error code.
01093  */
01094 void iMeshP_isEntOwner( iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_PartHandle part,
01095                         const iBase_EntityHandle entity, int* is_owner, int* err );
01096 
01097 /** \brief Test for entity ownership of many entities with respect to a part.
01098  *
01099  *  Given a partition handle, a part handle, and an array of entity handles,
01100  *  return for each entity handle a flag indicating whether the entity
01101  *  is owned by the part.
01102  *
01103  *  COMMUNICATION:  None.
01104  *
01105  *  \param  instance                 (In)     Mesh instance containing the
01106  *                                            partition.
01107  *  \param  partition                (In)     The partition being queried.
01108  *  \param  part                     (In)     The part being queried.
01109  *  \param  entities                 (In)     Entities whose ownership is
01110  *                                            being tested.
01111  *  \param  entities_size            (In)     Number of entity handles in
01112  *                                            entities.
01113  *  \param  is_owner                 (Out)    Flag for each entity indicating
01114  *                                            whether the given part is the
01115  *                                            owner of the given entity.
01116  *  \param  is_owner_allocated       (In/Out) Allocated size of is_owner array.
01117  *  \param  is_owner_size            (Out)    Occupied size of is_owner array.
01118  *  \param  err                      (Out)    Error code.
01119  */
01120 void iMeshP_isEntOwnerArr( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
01121                            const iMeshP_PartHandle part, const iBase_EntityHandle* entities, const int entities_size,
01122                            int** is_owner, int* is_owner_allocated, int* is_owner_size, int* err );
01123 
01124 /** \brief Return entity status (Internal, boundary, ghost).
01125  *
01126  *  Given a partition handle, a part handle, and an entity handle, return a
01127  *  flag indicating whether the entity is strictly internal, is on a
01128  *  part boundary, or is a ghost with respect to the given part.
01129  *  The returned value is a member of the iMeshP_EntStatus enumerated type.
01130  *
01131  *  COMMUNICATION:  None.
01132  *
01133  *  \param  instance             (In)  Mesh instance containing the partition.
01134  *  \param  partition            (In)  The partition being queried.
01135  *  \param  part                 (In)  The part being queried.
01136  *  \param  entity               (In)  Entity whose status is being tested.
01137  *  \param  par_status           (Out) Value indicating the status of the
01138  *                                     is the entity with respect to the part.
01139  *  \param  err                  (Out) Error code.
01140  */
01141 void iMeshP_getEntStatus( iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_PartHandle part,
01142                           const iBase_EntityHandle entity, int* par_status, int* err );
01143 
01144 /** \brief Return entity status (Internal, boundary, ghost).
01145  *
01146  *  Given a partition handle, a part handle, and an array of entity handles,
01147  *  return for each entity handle a flag indicating whether the entity is
01148  *  strictly internal, is on a part boundary, or is a ghost with respect
01149  *  to the given part.
01150  *  The returned value is a member of the iMeshP_EntStatus enumerated type.
01151  *
01152  *  COMMUNICATION:  None.
01153  *
01154  *  \param  instance                (In)     Mesh instance containing the
01155  *                                           partition.
01156  *  \param  partition               (In)     The partition being queried.
01157  *  \param  part                    (In)     The part being queried.
01158  *  \param  entities                (In)     Entities whose status is
01159  *                                           being tested.
01160  *  \param  entities_size           (In)     Number of entity handles in
01161  *                                           entities.
01162  *  \param  par_status              (Out)    Value for each entity indicating
01163  *                                           the status of the entity with
01164  *                                           respect to the part.
01165  *  \param  par_status_allocated    (In/Out) Allocated size of par_status array.
01166  *  \param  par_status_size         (Out)    Occupied size of par_status array.
01167  *  \param  err                     (Out)    Error code.
01168  */
01169 
01170 void iMeshP_getEntStatusArr( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
01171                              const iMeshP_PartHandle part, const iBase_EntityHandle* entities, const int entities_size,
01172                              int** par_status, /* enum iMeshP_EntStatus */
01173                              int* par_status_allocated, int* par_status_size, int* err );
01174 
01175 /** \brief Return the number of copies of an entity that exist in the partition.
01176  *
01177  *  Given a partition handle and an entity handle, return the number
01178  *  of copies of the entity in the partition.
01179  *  If the given entity is an owned entity or boundary entity,
01180  *  the number of copies will be complete.
01181  *  If the given entity is a ghost entity, the number of copies will be two
01182  *  (the ghost and its owner).
01183  *
01184  *  COMMUNICATION:  None++.
01185  *
01186  *  \param  instance             (In)  Mesh instance containing the partition.
01187  *  \param  partition            (In)  The partition being queried.
01188  *  \param  entity               (In)  Entity whose copy info is requested.
01189  *  \param  num_copies_ent       (Out) Number of copies of the entity that
01190  *                                     exist in the partition.
01191  *  \param  err                  (Out) Error code.
01192  */
01193 void iMeshP_getNumCopies( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
01194                           const iBase_EntityHandle entity, int* num_copies_ent, int* err );
01195 
01196 /** \brief Return the part IDs of parts having copies of a given entity.
01197  *
01198  *  Given a partition handle and an entity handle, return the part IDs
01199  *  of copies of the entity in the partition.
01200  *  If the given entity is an owned entity or boundary entity,
01201  *  the number of copies considered will be complete.
01202  *  If the given entity is a ghost entity, the number of copies considered
01203  *  will be two (the ghost and its owner).
01204  *
01205  *  COMMUNICATION:  None++.
01206  *
01207  *  \param  instance                (In)     Mesh instance containing the
01208  *                                           partition.
01209  *  \param  partition               (In)     The partition being queried.
01210  *  \param  entity                  (In)     Entity whose copy info
01211  *                                           is requested.
01212  *  \param  part_ids                (Out)    Part IDs of parts having copies
01213  *                                           of the given entity.
01214  *  \param  part_ids_allocated      (In/Out) Allocated size of part_ids array.
01215  *  \param  part_ids_size           (Out)    Occupied size of part_ids array.
01216  *  \param  err                     (Out)    Error code.
01217  */
01218 void iMeshP_getCopyParts( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
01219                           const iBase_EntityHandle entity, iMeshP_Part** part_ids, int* part_ids_allocated,
01220                           int* part_ids_size, int* err );
01221 
01222 /**  \brief Get (remote) entity handles of copies of a given entity.
01223  *
01224  *  Given a partition handle and an entity handle, return (remote) entity
01225  *  handles and part IDs of all copies of the entity.
01226  *  If the given entity is an owned entity or boundary entity,
01227  *  the number of copies considered will be complete.
01228  *  If the given entity is a ghost entity, the number of copies considered
01229  *  will be two (the ghost and its owner).
01230  *
01231  *  COMMUNICATION:  None++.
01232  *
01233  *  \param  instance                (In)     Mesh instance containing the
01234  *                                           partition.
01235  *  \param  partition               (In)     The partition being queried.
01236  *  \param  entity                  (In)     Entity whose copy info
01237  *                                           is requested.
01238  *  \param  part_ids                (Out)    Part IDs of parts having copies
01239  *                                           of the given entity.
01240  *  \param  part_ids_allocated      (In/Out) Allocated size of part_ids array.
01241  *  \param  part_ids_size           (Out)    Occupied size of part_ids array.
01242  *  \param  copies                  (Out)    (Remote) entity handles of the
01243  *                                           entity copies.
01244  *  \param  copies_allocated        (In/Out) Allocated size of copies.
01245  *  \param  copies_size             (Out)    Occupied size of copies.
01246  *  \param  err                     (Out)    Error code.
01247  */
01248 void iMeshP_getCopies( iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iBase_EntityHandle entity,
01249                        iMeshP_Part** part_ids, int* part_ids_allocated, int* part_ids_size, iBase_EntityHandle** copies,
01250                        int* copies_allocated, int* copies_size, int* err );
01251 
01252 /**  \brief Get the entity handle of a copy of a given entity in a given part.
01253  *
01254  *  Given a partition handle, an entity handle and a part ID,
01255  *  return the (remote) entity handle of the copy of the entity in that part.
01256  *  Return an error if the entity does not exist in the specified part.
01257  *
01258  *  COMMUNICATION:  None++.
01259  *
01260  *  \param  instance                (In)  Mesh instance containing the
01261  *                                        partition.
01262  *  \param  partition               (In)  The partition being queried.
01263  *  \param  entity                  (In)  Entity whose copy info
01264  *                                        is requested.
01265  *  \param  part_id                 (In)  Part ID of part whose copy
01266  *                                        of the given entity is requested.
01267  *  \param  copy_entity             (Out) (Remote) entity handle of the
01268  *                                        entity copy from the given part.
01269  *  \param  err                     (Out) Error code.
01270  */
01271 void iMeshP_getCopyOnPart( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
01272                            const iBase_EntityHandle entity, const iMeshP_Part part_id, iBase_EntityHandle* copy_entity,
01273                            int* err );
01274 
01275 /**  \brief Get the entity handle of a copy of a given entity in its owner part.
01276  *
01277  *  Given a partition handle and an entity handle, return the (remote)
01278  *  entity handle of the copy of the entity in its owner part.
01279  *
01280  *  COMMUNICATION:  None++.
01281  *
01282  *  \param  instance                (In)  Mesh instance containing the
01283  *                                        partition.
01284  *  \param  partition               (In)  The partition being queried.
01285  *  \param  entity                  (In)  Entity whose copy info
01286  *                                        is requested.
01287  *  \param  owner_part_id           (Out) Part ID of the entity's owner part.
01288  *  \param  owner_entity            (Out) (Remote) entity handle of the
01289  *                                        entity copy from the owner part.
01290  *  \param  err                     (Out) Error code.
01291  */
01292 void iMeshP_getOwnerCopy( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
01293                           const iBase_EntityHandle entity, iMeshP_Part* owner_part_id, iBase_EntityHandle* owner_entity,
01294                           int* err );
01295 
01296 /*------------------------------------------------------------------------*/
01297 /*------------------------------------------------------------------------*/
01298 /*-------                         COMMUNICATION                 ----------*/
01299 /*------------------------------------------------------------------------*/
01300 /*------------------------------------------------------------------------*/
01301 
01302 /**\brief  Wait for a specific iMeshP request to complete.
01303  *
01304  *  Given an iMeshP_RequestHandle, wait for the request to complete.
01305  *
01306  *  COMMUNICATION:  Blocking point-to-point.
01307  *
01308  *  \param  instance                (In)  Mesh instance containing the
01309  *                                        partition.
01310  *  \param  partition               (In)  The partition being queried.
01311  *  \param  request                 (In)  iMeshP request for whose completion
01312  *                                        we should wait.
01313  *  \param  err                     (Out) Error code.
01314  */
01315 void iMeshP_waitForRequest( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
01316                             iMeshP_RequestHandle request, int* err );
01317 
01318 /**\brief  Wait for any of the specified iMeshP requests to complete.
01319  *
01320  *  Given an array of iMeshP_RequestHandles, wait for any one of the requests
01321  *  to complete.
01322  *
01323  *  COMMUNICATION:  Blocking point-to-point.
01324  *
01325  *  \param  instance                (In)  Mesh instance containing the
01326  *                                        partition.
01327  *  \param  partition               (In)  The partition being queried.
01328  *  \param  requests                (In)  iMeshP requests for which we wait
01329  *                                        until one request completes.
01330  *  \param  requests_size           (In)  Number of requests in requests.
01331  *  \param  index                   (Out) Index of the request that completed.
01332  *  \param  err                     (Out) Error code.
01333  */
01334 void iMeshP_waitForAnyRequest( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
01335                                iMeshP_RequestHandle* requests, int requests_size, int* index, int* err );
01336 
01337 /**\brief  Wait for all of the specified iMeshP requests to complete.
01338  *
01339  *  Given an array of iMeshP_RequestHandles, wait for all of the requests
01340  *  to complete.
01341  *
01342  *  COMMUNICATION:  Blocking point-to-point.
01343  *
01344  *  \param  instance                (In)  Mesh instance containing the
01345  *                                        partition.
01346  *  \param  partition               (In)  The partition being queried.
01347  *  \param  requests                (In)  iMeshP requests for which we wait
01348  *                                        until completion.
01349  *  \param  requests_size           (In)  Number of requests in requests.
01350  *  \param  err                     (Out) Error code.
01351  */
01352 void iMeshP_waitForAllRequests( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
01353                                 iMeshP_RequestHandle* requests, int requests_size, int* err );
01354 
01355 /**\brief  Wait for a specific request to complete; return entities received.
01356  *
01357  *  Given an iMeshP_RequestHandle, wait for the request to complete.  Return
01358  *  entities for which information was received.
01359  *
01360  *  COMMUNICATION:  Blocking point-to-point.
01361  *
01362  *  \param  instance                (In)     Mesh instance containing the
01363  *                                           partition.
01364  *  \param  partition               (In)     The partition being queried.
01365  *  \param  request                 (In)     iMeshP request for whose completion
01366  *                                           we should wait.
01367  *  \param  out_entities            (Out)    Entities for which information was
01368  *                                           received.
01369  *  \param  out_entities_allocated  (In/Out) Allocated size of out_entities.
01370  *  \param  out_entities_size       (Out)    Occupied size of out_entities.
01371  *  \param  err                     (Out)    Error code.
01372  */
01373 void iMeshP_waitForRequestEnt( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
01374                                iMeshP_RequestHandle request, iBase_EntityHandle** out_entities,
01375                                int* out_entities_allocated, int* out_entities_size, int* err );
01376 
01377 /**\brief  Test whether a specific request has completed.
01378  *
01379  *  Given an iMeshP_RequestHandle, test whether the request has completed.
01380  *  This function will not wait until the request completes; it will only
01381  *  return the completion status (complete = 1 or 0).
01382  *
01383  *  COMMUNICATION:  None.
01384  *
01385  *  \param  instance                (In)  Mesh instance containing the
01386  *                                        partition.
01387  *  \param  partition               (In)  The partition being queried.
01388  *  \param  request                 (In)  iMeshP request for whose completion
01389  *                                        we should test.
01390  *  \param  completed               (Out) Flag indicating whether (1) or
01391  *                                        not (0) the given request has
01392  *                                        completed.
01393  *  \param  err                     (Out) Error code.
01394  */
01395 void iMeshP_testRequest( iMesh_Instance instance, const iMeshP_PartitionHandle partition, iMeshP_RequestHandle request,
01396                          int* completed, int* err );
01397 
01398 /** \brief  Poll for outstanding requests.
01399  *
01400  *  Check for outstanding requests from other parts, handle any requests
01401  *  found, and return an array of requests that have been handled.  If
01402  *  the array has a size allocated already, then the implementation stops
01403  *  working when it has generated that many completed requests, even if there
01404  *  are more requests waiting.
01405  *
01406  *  COMMUNICATION:  non-blocking; point-to-point.
01407  *
01408  *  \param  instance                     (In)     Mesh instance containing the
01409  *                                                partition.
01410  *  \param  partition                    (In)     The partition being queried.
01411  *  \param  requests_completed           (Out)    Requests that were completed.
01412  *  \param  requests_completed_allocated (In/Out) Allocated size of
01413  *                                                requests_completed.
01414  *  \param  requests_completed_size      (Out)    Occupied size of
01415  *                                                requests_completed.
01416  *  \param  err                          (Out)    Error code.
01417  */
01418 void iMeshP_pollForRequests( iMesh_Instance instance, iMeshP_PartitionHandle partition,
01419                              iMeshP_RequestHandle** requests_completed, int* requests_completed_allocated,
01420                              int* requests_completed_size, int* err );
01421 
01422 /*--------------------------------------------------------------------
01423   -------    Requests for off-processor mesh modification      -------
01424   --------------------------------------------------------------------*/
01425 
01426 /** \brief  Add entities to on-process and/or off-process parts.
01427  *
01428  *  Given a partition and a list of entities, add those entities to the
01429  *  target parts.  The entities can be added as copies or migrated entirely
01430  *  (i.e., change ownership of the entities)
01431  *  to the parts.  The entities' downward adjacencies are also copied and/or
01432  *  migrated as appropriate to support the entities.
01433  *  This function is a collective, non-blocking operation
01434  *  to be called by all processes in the partition's communicator.
01435  *  An iMeshP_RequestHandle is returned; any of the
01436  *  iMeshP_wait* functions can be used to block until the request is completed.
01437  *
01438  *  COMMUNICATION:  Collective.  Non-blocking.
01439  *
01440  *  \param  instance          (In)  Mesh instance containing the partition.
01441  *  \param  partition         (In)  Handle for the partition being queried.
01442  *  \param  entities          (In)  Entities to be sent.
01443  *  \param  entities_size     (In)  Number of entities to be sent.
01444  *  \param  target_part_ids   (In)  Array of size entities_size listing
01445  *                                  the parts to which the entities should
01446  *                                  be sent.
01447  *  \param  command_code      (In)  Flag indicating whether to migrate
01448  *                                  the entities or only make copies.
01449  *  \param  update_ghost      (In)  Flag indicating whether (1) or not (0)
01450  *                                  ghost copies of the entities should be
01451  *                                  updated with new owner information.
01452  *  \param  request           (Out) iMeshP RequestHandle returned; can be used
01453  *                                  for blocking until this send is complete.
01454  *  \param  err               (Out) Error code.
01455  */
01456 void iMeshP_exchEntArrToPartsAll( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
01457                                   const iBase_EntityHandle* entities, const int entities_size,
01458                                   const iMeshP_Part* target_part_ids, int command_code, int update_ghost,
01459                                   iMeshP_RequestHandle* request, int* err );
01460 
01461 /** \brief Request in-migration of an entity and its upward adjacencies.
01462  *
01463  *  This function is a "pull" migration, where a part requests to become the
01464  *  owner of an entity that is owned by another part (so that the part has
01465  *  the right to modify the entity).  The requested
01466  *  entity must be on the part boundary and is identified by a local handle
01467  *  (i.e., an entity part-boundary copy).   This operation may require multiple
01468  *  rounds of communication, and at some times, certain entities may be
01469  *  locked (unavailable for local modification) while info about their
01470  *  remote copies is still in question.  Tags and parallel set membership
01471  *  are migrated as well as the appropriate adjacency info.
01472  *  An iMeshP request handle is returned.
01473  *
01474  *  COMMUNICATION:  point-to-point, non-blocking, pull.
01475  *
01476  *  \param  instance          (In)  Mesh instance containing the partition.
01477  *  \param  partition         (In)  The partition being queried.
01478  *  \param  part              (In)  The part to which the entity is migrated.
01479  *  \param  local_entity      (In)  The local entity copy for the entity to be
01480  *                                  migrated.
01481  *  \param  request           (Out) The iMeshP request handle returned.
01482  *  \param  err               (Out) Error code.
01483  */
01484 void iMeshP_migrateEntity( iMesh_Instance instance, const iMeshP_PartitionHandle partition, iMeshP_PartHandle part,
01485                            iBase_EntityHandle local_entity, iMeshP_RequestHandle* request, int* err );
01486 
01487 /** \brief Update vertex coordinates for vertex copies.
01488  *
01489  *  For a given vertex, update its copies with the vertex's coordinates.
01490  *  This function assumes that a local vertex's coordinates were updated
01491  *  through a call to iMesh_setVtxCoords.  This function then updates all
01492  *  copies of the vertex with the updated coordinates.
01493  *  The communication here is push-and-forget; as such,
01494  *  no request handle needs to be returned.
01495  *
01496  *  COMMUNICATION:  point-to-point, non-blocking, push-and-forget.
01497  *
01498  *  \param  instance          (In)  Mesh instance containing the partition.
01499  *  \param  partition         (In)  The partition being queried.
01500  *  \param  local_vertex      (In)  The vertex whose copies should be updated.
01501  *  \param  err               (Out) Error code.
01502  */
01503 void iMeshP_updateVtxCoords( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
01504                              const iBase_EntityHandle local_vertex, int* err );
01505 
01506 /** \brief Replace entities on the part boundary.
01507  *
01508  *  This function performs changes on the part boundary where the
01509  *  calling application can ensure that things are done
01510  *  identically on both sides and that the arguments are passed in an order
01511  *  that can be matched.  (Specifically, matching new entities should appear in
01512  *  the same order in the call array.)  An example is creation of new
01513  *  boundary edges during edge splitting.
01514  *  Communication here could be a
01515  *  two-way push-and-forget, or some variant on push-and-confirm.
01516  *  CHANGES: At Onkar's suggestion, added an offset array (similar to array
01517  *  adjacency requests) so that a single call can easily handle coordination
01518  *  with multiple entities on part-boundary.
01519  *
01520  *  COMMUNICATION:  point-to-point, non-blocking, push-and-forget.
01521  *
01522  *  \param  instance          (In)  Mesh instance containing the partition.
01523  *  \param  partition         (In)  The partition being queried.
01524  *  \param  old_entities      (In)  The entities to be replaced.
01525  *  \param  old_entities_size (In)  The number of entities to be replaced.
01526  *  \param  new_entities      (In)  The entities that replace the old entities.
01527  *  \param  new_entities_size (In)  The number of entities in new_entities.
01528  *  \param  offset            (In)  Index into new_entities; old_entities[i]
01529  *                                  is replaced by new_entities[offset[i]] to
01530  *                                  new_entities[offset[i+1]-1].
01531  *  \param  offset_size       (In)  The number of entries in offset.
01532  *  \param  err               (Out) Error code.
01533  */
01534 void iMeshP_replaceOnPartBdry( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
01535                                const iBase_EntityHandle* old_entities, const int old_entities_size,
01536                                const iBase_EntityHandle* new_entities, const int new_entities_size, const int* offset,
01537                                const int offset_size, int* err );
01538 
01539 /** \brief Push ghost copies of individual entities onto other parts.
01540  *
01541  *  Given an entity and a target part, create a ghost copy of the entity on
01542  *  the target part.
01543  *
01544  *  Communication here is push-and-confirm (so that the original knows remote
01545  *  entity handle of the created ghosts).  The closure of a new ghost is pushed
01546  *  automatically as part of the underlying communication.
01547  *
01548  *  COMMUNICATION:  point-to-point, non-blocking, push.
01549  *
01550  *  \param  instance          (In)  Mesh instance containing the partition.
01551  *  \param  partition         (In)  The partition being queried.
01552  *  \param  target_part_id    (In)  The part to receive the new ghost.
01553  *  \param  entity_to_copy    (In)  The entity to be copied in target_part_id.
01554  *  \param  request           (Out) The iMeshP request handle returned.
01555  *  \param  err               (Out) Error code.
01556  */
01557 void iMeshP_addGhostOf( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
01558                         const iMeshP_Part target_part_id, iBase_EntityHandle entity_to_copy,
01559                         iMeshP_RequestHandle* request, int* err );
01560 
01561 /** \brief Remove ghost copies of individual entities from other parts.
01562  *
01563  *  Given an entity and a target part, remove the ghost copy of the entity on
01564  *  the target part.
01565  *
01566  *  Communication is push-and-forget; as such, no request handle is needed.
01567  *  The remote part will clean up the closure of the removed ghost
01568  *  as appropriate during deletion.
01569  *
01570  *  COMMUNICATION:  point-to-point, non-blocking, push-and-forget.
01571  *
01572  *  \param  instance          (In)  Mesh instance containing the partition.
01573  *  \param  partition         (In)  The partition being queried.
01574  *  \param  target_part_id    (In)  The part to lose the ghost.
01575  *  \param  copy_to_purge     (In)  The entity whose ghost is removed from
01576  *                                  target_part_id.
01577  *  \param  err               (Out) Error code.
01578  */
01579 void iMeshP_rmvGhostOf( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
01580                         const iMeshP_Part target_part_id, iBase_EntityHandle copy_to_purge, int* err );
01581 
01582 /** \brief Indicate completion of mesh modification.
01583  *
01584  *  Calling this function indicates that the user is finished with mesh
01585  *  modification for now.  With mesh modification complete, the implementation
01586  *  can update ghost, partition, boundary, and other information to
01587  *  re-establish a valid distributed mesh.  This function waits for all
01588  *  message traffic to clear and rebuilds ghost information that was
01589  *  allowed to go obsolete during mesh modification.
01590  *
01591  *  COMMUNICATION:  collective.
01592  *
01593  *  \param  instance          (In)  Mesh instance containing the partition.
01594  *  \param  partition         (In)  The partition being queried.
01595  *  \param  err               (Out) Error code.
01596  */
01597 void iMeshP_syncMeshAll( iMesh_Instance instance, iMeshP_PartitionHandle partition, int* err );
01598 
01599 /*--------------------------------------------------------------------------*/
01600 /*         Functions to send Tag data from owning entities to copies.       */
01601 /*--------------------------------------------------------------------------*/
01602 
01603 /**\brief  Synchronously send tag data for given entity types and topologies.
01604  *
01605  *  Send tag information for shared entities of specified type and
01606  *  topology.  The tag data is "pushed" from the owner entities to all copies.
01607  *  This version operates on all shared entities of specified type and topology
01608  *  (or all types/topologies if iBase_ALL_TYPES/iMesh_ALL_TOPOLOGIES are
01609  *  given).  This function assumes tag handles given on various
01610  *  calling parts are consistent; i.e. they have the same name,
01611  *  data type, size, etc.  This call blocks until communication is
01612  *  completed.
01613  *
01614  *  COMMUNICATION:  point-to-point, blocking.
01615  *
01616  *  \param  instance          (In)  Mesh instance containing the partition.
01617  *  \param  partition         (In)  The partition being queried.
01618  *  \param  source_tag        (In)  Tag handle for the sending entities.
01619  *  \param  dest_tag          (In)  Tag handle for the receiving entities.
01620  *  \param  entity_type       (In)  Tag data is exchanged only for this
01621  *                                  entity type.
01622  *  \param  entity_topo       (In)  Tag data is exchanged only for this
01623  *                                  entity topology.
01624  *  \param  err               (Out) Error code.
01625  */
01626 void iMeshP_pushTags( iMesh_Instance instance, const iMeshP_PartitionHandle partition, iBase_TagHandle source_tag,
01627                       iBase_TagHandle dest_tag, int entity_type, int entity_topo, int* err );
01628 
01629 /**\brief  Synchronously send tag data for individual entities.
01630  *
01631  *  Send tag information for the specified entities.
01632  *  The tag data is "pushed" from the owner entities to all copies.
01633  *  This function assumes tag handles given on various
01634  *  calling parts are consistent; i.e. they have the same name,
01635  *  data type, size, etc.  This call blocks until communication is
01636  *  completed.
01637  *
01638  *  COMMUNICATION:  point-to-point, blocking.
01639  *
01640  *  \param  instance        (In)  Mesh instance containing the partition.
01641  *  \param  partition       (In)  The partition being queried.
01642  *  \param  source_tag      (In)  Tag handle for the sending entities.
01643  *  \param  dest_tag        (In)  Tag handle for the receiving entities.
01644  *  \param  entities        (In)  Owned entities for which to send data.
01645  *  \param  entities_size   (In)  The number of entities for which to send data.
01646  *  \param  err             (Out) Error code.
01647  */
01648 void iMeshP_pushTagsEnt( iMesh_Instance instance, const iMeshP_PartitionHandle partition, iBase_TagHandle source_tag,
01649                          iBase_TagHandle dest_tag, const iBase_EntityHandle* entities, int entities_size, int* err );
01650 
01651 /**\brief  Asynchronously send tag data for given entity types and topologies.
01652  *
01653  *  Send tag information for shared entities of specified type and
01654  *  topology.  The tag data is "pushed" from the owner entities to all copies.
01655  *  This version operates on all shared entities of specified type and topology
01656  *  (or all types/topologies if iBase_ALL_TYPES/iMesh_ALL_TOPOLOGIES are
01657  *  given).  This function assumes tag handles given on various
01658  *  calling parts are consistent; i.e. they have the same name,
01659  *  data type, size, etc.
01660  *  This call does not block; applications should call
01661  *  iMeshP_waitForRequest (or a similar wait function)
01662  *  to block until this push is completed.
01663  *
01664  *  COMMUNICATION:  point-to-point, non-blocking.
01665  *
01666  *  \param  instance          (In)  Mesh instance containing the partition.
01667  *  \param  partition         (In)  The partition being queried.
01668  *  \param  source_tag        (In)  Tag handle for the sending entities.
01669  *  \param  dest_tag          (In)  Tag handle for the receiving entities.
01670  *  \param  entity_type       (In)  Tag data is exchanged only for this
01671  *                                  entity type.
01672  *  \param  entity_topo       (In)  Tag data is exchanged only for this
01673  *                                  entity topology.
01674  *  \param  request           (Out) The iMeshP request handle returned.
01675  *  \param  err               (Out) Error code.
01676  */
01677 void iMeshP_iPushTags( iMesh_Instance instance, const iMeshP_PartitionHandle partition, iBase_TagHandle source_tag,
01678                        iBase_TagHandle dest_tag, int entity_type, int entity_topo, iMeshP_RequestHandle* request,
01679                        int* err );
01680 
01681 /**\brief  Asynchronously send tag data for individual entities.
01682  *
01683  *  Send tag information for the specified entities.
01684  *  The tag data is "pushed" from the owner entities to all copies.
01685  *  This function assumes tag handles given on various
01686  *  calling parts are consistent; i.e. they have the same name,
01687  *  data type, size, etc.
01688  *  This call does not block; applications should call
01689  *  iMeshP_waitForRequest (or a similar wait function)
01690  *  to block until this push is completed.
01691  *
01692  *  COMMUNICATION:  point-to-point, non-blocking.
01693  *
01694  *  \param  instance        (In)  Mesh instance containing the partition.
01695  *  \param  partition       (In)  The partition being queried.
01696  *  \param  source_tag      (In)  Tag handle for the sending entities.
01697  *  \param  dest_tag        (In)  Tag handle for the receiving entities.
01698  *  \param  entities        (In)  Owned entities for which to send data.
01699  *  \param  entities_size   (In)  The number of entities for which to send data.
01700  *  \param  request         (Out) The iMeshP request handle returned.
01701  *  \param  err             (Out) Error code.
01702  */
01703 void iMeshP_iPushTagsEnt( iMesh_Instance instance, const iMeshP_PartitionHandle partition, iBase_TagHandle source_tag,
01704                           iBase_TagHandle dest_tag, const iBase_EntityHandle* entities, int entities_size,
01705                           iMeshP_RequestHandle* request, int* err );
01706 
01707 /*------------------------------------------------------------*
01708  *                   GHOSTING                                 *
01709  *------------------------------------------------------------*/
01710 
01711 /* \brief Create ghost entities between parts.
01712  *
01713  *  Ghost entities are specified similar to 2nd-order adjacencies, i.e.,
01714  *  through a "bridge" dimension.  The number of layers is measured from
01715  *  the inter-part interfaces.  For example, to get two layers of region
01716  *  entities in the ghost layer, measured from faces on the interface,
01717  *  use ghost_dim=3, bridge_dim=2, and num_layers=2.
01718  *  The number of layers specified is with respect to the global mesh;
01719  *  that is, ghosting may extend beyond a single neighboring processor if the
01720  *  number of layers is high.
01721  *
01722  *  Ghost information is cached in the partition.
01723  *  The triplet describing a ghosting "rule" (ghost dim, bridge dim, #
01724  *  layers) is stored in the partition; ghosting that became incorrect
01725  *  due to mesh modification or redistribution of mesh entities is
01726  *  re-established using these rules by the end
01727  *  of iMeshP_syncPartitionAll and iMeshP_syncMeshAll.
01728  *  Implementations can choose to keep ghosting consistent throughout
01729  *  mesh modification, but ghosts are not required to be consistent until
01730  *  the end of these two functions.
01731 
01732  *  iMeshP_createGhostEntsAll is cumulative; that is, multiple calls can only
01733  *  add more ghosts, not eliminate previous ghosts.
01734  *
01735  *  COMMUNICATION:  Collective.  Blocking.
01736  *
01737  *  \param  instance          (In)  Mesh instance containing the partition.
01738  *  \param  partition         (In)  The partition in which to create ghosts.
01739  *  \param  ghost_type        (In)  Entity type of entities to be ghosted.
01740  *  \param  bridge_type       (In)  Entity type through which bridge
01741  *                                  adjacencies are found.
01742  *  \param  num_layers        (In)  Number of layers of ghost entities.
01743  *  \param  include_copies    (In)  Flag indicating whether to create ghosts
01744  *                                  of non-owned part boundary entities
01745  *                                  (YES=1, NO=0).
01746  *  \param  err               (Out) Error code.
01747  */
01748 void iMeshP_createGhostEntsAll( iMesh_Instance instance, iMeshP_PartitionHandle partition, int ghost_type,
01749                                 int bridge_type, int num_layers, int include_copies, int* err );
01750 
01751 /* \brief Delete all ghost entities between parts.
01752  *
01753  *  Given a partition, delete all ghost entities in that partition of the mesh.
01754  *
01755  *  COMMUNICATION:  Collective.  Blocking.
01756  *
01757  *  \param  instance          (In)  Mesh instance containing the partition.
01758  *  \param  partition         (In)  The partition from which to delete ghosts.
01759  *  \param  err               (Out) Error code.
01760  *
01761  */
01762 void iMeshP_deleteGhostEntsAll( iMesh_Instance instance, iMeshP_PartitionHandle partition, int* err );
01763 
01764 /** \brief Return information about all ghosting on a partition.
01765  *
01766  *  Return the ghosting rules established through calls to
01767  *  iMeshP_createGhostEntsAll.
01768  *
01769  *  COMMUNICATION:  None.
01770  *
01771  *  \param  instance               (In)     Mesh instance containing the
01772  *                                          partition.
01773  *  \param  partition              (In)     The partition to be queried.
01774  *  \param  ghost_rules_allocated  (In/Out) Allocated size of ghost_type,
01775  *                                          bridge_type and num_layers.
01776  *  \param  ghost_rules_size       (Out)    Occupied size of ghost_type,
01777  *                                          bridge_type and num_layers;
01778  *                                          equal to the number of ghosting
01779  *                                          rules currently registered in
01780  *                                          the partition.
01781  *  \param  ghost_type             (Out)    Entity type of ghost entities
01782  *                                          for each rule.
01783  *  \param  bridge_type            (Out)    Entity type of bridge entities
01784  *                                          for each rule.
01785  *  \param  num_layers             (Out)    Number of layers of ghosts in each
01786  *                                          rule.
01787  *  \param  err                    (Out)    Error code.
01788  */
01789 void iMeshP_ghostEntInfo( const iMesh_Instance instance, const iMeshP_PartitionHandle partition,
01790                           int* ghost_rules_allocated, int* ghost_rules_size, int** ghost_type, int** bridge_type,
01791                           int** num_layers, int* err );
01792 
01793 /*--------------------------------------------------------------------------
01794             FILE I/O
01795  --------------------------------------------------------------------------*/
01796 /* iMeshP file I/O closely aligns with iMesh file I/O.  The major
01797  * change is the addition of a iMeshP_PartitionHandle argument to both
01798  * iMeshP_loadAll and iMeshP_saveAll, enabling I/O from parallel processes.
01799  * For now, individual implementations will support different sets of
01800  * options; Tim and Ken will work to unify the options by SC08.
01801  */
01802 
01803 /** \brief Populate a mesh instance and a partition by reading data from files.
01804  *
01805  *  Before calling iMeshP_loadAll, the application creates both a mesh
01806  *  instance and a partition handle.  iMeshP_loadAll then reads the
01807  *  specified file, inserts entities into the mesh instance, constructs
01808  *  parts within the partition, and inserts entities into the parts.
01809  *  Options allow n>=1 files on p processes.
01810  *  Optional capabilities of iMeshP_loadAll include computing an initial
01811  *  partition (e.g., if a serial mesh file without part assignments is read)
01812  *  and creating ghost entities as requested by the application; the
01813  *  availability of these options is implementation dependent.
01814  *
01815  *  COMMUNICATION:  Collective.
01816  *
01817  *  \param  instance            (In)  Mesh instance to contain the data.
01818  *  \param  partition           (In)  The newly populated partition.
01819  *  \param  entity_set          (In)  Set to which the mesh will be added.
01820  *  \param  name                (in)  File name from which mesh data is read.
01821  *  \param  options             (In)  Implementation-specific options string.
01822  *  \param  err                 (Out) Error code.
01823  *  \param  name_len            (In)  Length of the file name character string.
01824  *  \param  options_len         (In)  Length of the options character string.
01825  */
01826 void iMeshP_loadAll( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
01827                      const iBase_EntitySetHandle entity_set, const char* name, const char* options, int* err,
01828                      int name_len, int options_len );
01829 
01830 /** \brief Write data from a mesh instance and a partition to files.
01831  *
01832  *  iMeshP_saveAll writes mesh and partition data to the specified file.
01833  *  Options allow n>=1 files on p processes.
01834  *
01835  *  COMMUNICATION:  Collective.
01836  *
01837  *  \param  instance            (In)  Mesh instance containing the partition.
01838  *  \param  partition           (In)  The partition being saved.
01839  *  \param  entity_set          (In)  Set from which data will be saved.
01840  *  \param  name                (in)  File name to which mesh data is written.
01841  *  \param  options             (In)  Implementation-specific options string.
01842  *  \param  err                 (Out) Error code.
01843  *  \param  name_len            (In)  Length of the file name character string.
01844  *  \param  options_len         (In)  Length of the options character string.
01845  */
01846 void iMeshP_saveAll( iMesh_Instance instance, const iMeshP_PartitionHandle partition,
01847                      const iBase_EntitySetHandle entity_set, const char* name, const char* options, int* err,
01848                      const int name_len, int options_len );
01849 
01850 /*
01851 ------------------------------------------------
01852 Major Items left to do:
01853 -  Support for multiple partitions.
01854    We discussed designating a given partition as
01855    the "active" partition; i.e., the partition that is actually used in
01856    the distribution of mesh data in distributed memory.  We were concerned
01857    that when multiple partitions were used, multiple copies of mesh
01858    entities would be needed to fully support multiple partitions at the
01859    same time.  Designating one partition as "active" would store data
01860    with respect to only one partition.
01861 -  File I/O support.
01862    Need common set of options to allow interoperability.
01863    Support single files, N << P files on P processes, and P files.
01864    Support reading and writing partition information.
01865    Support initial parallel partitioning of serial file data.
01866    Support storing mapping of parts to processes in files.
01867 
01868 ------------------------------------------------
01869 Minor Items left to do:
01870 -  Determine which capabilities need both "getNumX" and "getX" functions.
01871    That is, when would an application need "getNumX" to allocate memory
01872    for "getX" or separately from "getX".  When could we use only "getX"
01873    and return numX as a byproduct.
01874 
01875 -  Determine with functions need "Ent" and "EntArr" versions, or whether
01876    we should adopt only the more general "EntArr" version.
01877 
01878 -  Determine whether to revise iMeshP_createPartition to make it less MPI
01879    specific.  We don't want to require applications to link with MPI if the
01880    implementation doesn't require it.  We may define an ITAPS_Comm name
01881    typedef'ed appropriately.
01882 
01883 -  iMeshP_getOwnerCopy could be achieved by calling iMeshP_getOwnerPart
01884    followed by iMeshP_getCopyOnPart.  Do we want to keep iMeshP_getOwnerCopy?
01885 
01886 -  Need function to receive tag data from part-boundary entities in owner.
01887    Possible options:  return the tag data values received directly, or
01888    include a mathematical operation (similar to MPI_SUM). 9/15/08
01889 
01890 ------------------------------------------------
01891 Comments and resolved questions:
01892 
01893 - Applications will build partitions by (1) creating a partition handle
01894   on each process to be included in the partition; (2) adding parts to
01895   the partition handle within the process; (3) populating the parts with
01896   entities, and (4) calling iMeshP_syncPartitionAll to allow the
01897   implementation to compute global data for the partition.
01898 
01899 - For now, we will not include an iterator over local (to a
01900   process) parts within a partition.  If it is needed, it can be added
01901   later.
01902 
01903 - We will not provide capability to move entire parts to new
01904   processes;  instead, the new process must create the part in its
01905   partition handle and then receive (perhaps in bulk) the entities to
01906   populate the part.  In other words, parts can be added to only a local
01907   partition handle.
01908 
01909 - Currently, iMesh doesn't have the functionality to get entities or
01910   entity sets by type and tag in serial.  Should it?
01911   Many people said it would be useful; others said it could be costly
01912   (in parallel) or numerically difficult (for floating point values).
01913   This issue is an iMesh issue, not a parallel interface issue, so
01914   for this document, the issue is resolved.  The resolution:  If
01915   iMesh adopts this capability, we will add it to the
01916   parallel interface.
01917 
01918 - We will not include functions that return all entities with
01919   given characteristics within a partition; the memory use of these
01920   functions can be large.  Instead, we will return entity information
01921   with respect to parts and/or mesh instances.  If the user wants such
01922   info, he should go through the mechanics of gathering it himself so
01923   that he is painfully aware of how much memory he is allocating.
01924   Removed the following global queries:
01925   + All tag names over the partition;
01926   + All entities in this partition having a given type, tag and/or
01927     tag name.
01928   + All entity sets in this partition having a given
01929     type, tag and/or tag name.
01930 
01931 - We will not include functions that return information about each
01932   part and/or process in a partition.  Such functions limit memory
01933   scalability for large numbers of parts.  If the user wants such
01934   info, he should go through the mechanics of gathering it himself so
01935   that he is painfully aware of how much memory he is allocating.
01936   Removed the following global queries:
01937   + The number of entities in each part of the partition;
01938   + The number of entity sets in each part of the partition;
01939   + The number of entities with given type, tag, and/or
01940     tag name in each part of the partition;
01941   + The number of entity sets with given type, tag,
01942     and/or tag name in each part of the partition;
01943   + All tag names in each part of the partition;
01944 
01945 - For functions that replace a set handle with a part handle, return
01946   all appropriate entities in a part, whether they are owned or are
01947   copies.  The application can test for ownership if needed.
01948 
01949 - Part assignments computed with respect to a set of
01950   entities induce part assignments to adjacent entities in an
01951   implementation-dependent fashion.  That is, if a partition is computed
01952   with respect to regions, queries about ownership of faces and vertices
01953   are valid.
01954 
01955 ------------------------------------------------
01956 Discussed but unresolved questions:
01957 
01958 - We discussed adding functions that give
01959   hints to an implementation about which data mappings the application
01960   will use, allowing the implementation to pre-compute them if it chooses
01961   to.  The example discussed was mapping between entities and parts, but
01962   other examples in iMesh may also exist.
01963 
01964 - We discussed adding an iterator over entities
01965   with given type/topology in a set or part.  We have non-iterator
01966   functionality, but not an iterator.
01967   KDD:  Is this true?  What is iMesh_initEntIter (and its analogous
01968   KDD:  iMeshP_initEntIter)?
01969 
01970 - We discussed storing in a partition
01971   information about which "objects" were used in computing the partition.
01972   These objects can be single entities or groups of entities.
01973   KDD:  Perhaps this capability should be part of the load-balancing service.
01974 
01975 - We discussed designating a given partition as
01976   the "active" partition; i.e., the partition that is actually used in
01977   the distribution of mesh data in distributed memory.  We were concerned
01978   that when multiple partitions were used, multiple copies of mesh
01979   entities would be needed to fully support multiple partitions at the
01980   same time.  Designating one partition as "active" would store data
01981   with respect to only one partition.
01982 
01983 ------------------------------------------------
01984 Not-yet-discussed, unresolved questions
01985 
01986 Entity questions:
01987 - From Carl:  "getTag*Operate: Again, we haven't got this in serial.  Does
01988   the existence of such operations imply that we expect to implement
01989   fields as tags? (Because that wasn't what I was assuming about field
01990   implementations at all, personally...)  Note that I'm not opposed to
01991   this sort of global reduction operation, I just wonder whether it'll see
01992   use outside of field-like situations.  If not, then it should be in
01993   parallel fields, not parallel mesh, and usage for
01994   fields-implemented-as-tags should be handled there."
01995 */
01996 
01997 /*--------------------------------*/
01998 /* NOTES FROM BOOTCAMP MARCH 2008 */
01999 /*--------------------------------*/
02000 /*
02001 -  Changed getPartRank to getRankOfPart.  (Carl)
02002 -  Made sure iMeshP_getNumOfTypeAll and iMeshP_getNumOfTopoAll were
02003 documented as collective operations.  (Carl)
02004 -  Changed suffix "Par" to "All".  (Lori)
02005 -  Added iMeshP_testPart() to test status of part handle, returning
02006 LOCAL, REMOTE, or INVALID.  (Mark M, Lori).
02007 6/25/08:  Removed this function since part handles can no longer be remote.
02008 If an application wants to test the validity of a part handle, it can try
02009 to compute its Part ID.
02010 -  Changed iMeshP_addCopyOf and iMeshP_rmvCopyOf back to
02011 iMeshP_addGhostOf and iMeshP_rmvGhostOf.  If we wanted to use these
02012 functions for adding boundary copies, we'd have to include a list of
02013 already existing remote copies in the arguments, as well as
02014 communicate with parts already owning copies to let them know a ghost
02015 copy has been made.  Actually, this raises an interesting question:
02016 does a boundary copy need to know about all ghost copies of it?
02017 -  Change getEntParStatus to getEntStatus.  (Lori)
02018 -  Changed sendEntArrToPartsPar to exchEntArrToPartsAll.  (Lori,Tim)
02019 
02020 
02021 Parts and Processes:
02022 -  Martin argued for consecutive unique Part IDs in addition to or
02023 instead of Part handles.  He will send use cases.   If we decide to
02024 add them back to the interface, we could compute them in
02025 iMeshP_syncPartitionAll rather than in iMeshP_createPart.  That is, an
02026 application couldn't access them until after iMeshP_syncPartitionAll.
02027 6/25/08:  On follow-up, Martin couldn't recall why having consecutive
02028 PartIDs was necessary.  While we all agree they are conceptually nice,
02029 they are difficult to implement and not really necessary.  Part IDs will
02030 be globally unique but not necessarily consecutive.
02031 -  Are part handles globally unique?  They probably need to be
02032 globally unique in order for them to be useful as remote part
02033 handles.  Also, does the process rank need to be encoded in the part
02034 handle in order to map from parts to processes for communication?
02035 6/25/08:  DECIDED:  We will have globally unique part IDs.  Part handles
02036 will be valid for only local parts.  Accessing remote parts must be done
02037 via Part IDs.
02038 -  If in iMeshP_syncPartitionAll, we computed a mapping from part
02039 handles to integers 0,..., k-1, we could store only ranges of
02040 integers to achieve the part-to-process and process-to-parts mappings;
02041 this would require O(P) storage per process for P processes.
02042 6/5/08:  DECIDED:  Do not need getPartOnRank or getNumPartOnRank.  These
02043 functions were troublesome due to their storage or communication requirements.
02044 We decided to remove them.
02045 -  Alternatively, the mapping of all parts to processes can be stored
02046 in O(k) total memory, distributed across processors (e.g., a
02047 distributed data directory) but interrogating the directory requires
02048 communication.
02049 6/5/08:  See note above.
02050 -  iMeshP_getPartsOnRank created discussion and needs to be resolved.
02051 IMeshP_getPartsOnRank would likely require either O(k) storage per
02052 process for k parts or communication.  For other points, please see
02053 Mark M's 3/12/08 email.
02054 6/5/08:  See note above.
02055 
02056 CreateEnt:
02057 -  Carl asked if we should have a version of createEnt that accepts a
02058 part handle.  Should this function be used only for creating owned
02059 entities?   How do you envision creating part boundary entities when a
02060 parallel mesh is initially loaded?
02061 
02062 Ghost entities:
02063 -  We currently have a mechanism only for pushing ghosts onto other
02064 parts.  Will we want a mechanism for pulling them, too?  (E.g., a
02065 part says, "I want ghosts for this entity.")
02066 
02067 PartNbor functions:
02068 -  Did we agree to remove the entity type from these functions?  That
02069 is, do we want to return the part IDs for all parts that have
02070 any copies?  The entity type was intended to allow us to get the part
02071 IDs for all parts that have copies of a given type (perhaps
02072 ALL_TYPES).
02073 
02074 Functions handling both Parts and Entity Sets:
02075 -  Tim said these function names (e.g., iMeshP_getNumOfType,
02076 iMeshP_getAllVtxCoord) are too close to existing iMesh function
02077 names, even though the argument lists would be different.  He agreed
02078 to email suggestions for better names.
02079 
02080 Copies:
02081 -  Functions getNumCopies, getCopies, getCopyParts, and getCopyOnPart
02082 have different behavior for ghost and part-boundary copies.  Ghosts
02083 will return only itself and its owner in getCopies; part-boundary
02084 entities will return copies on other parts as well.
02085 -  Tim envisions applications (e.g., FETI methods) updating tag data
02086 in their copies that they would like to accumulate back to the
02087 owner.  Xiaolin said that he writes in his ghosts, but doesn't send
02088 those values back to the owner.  Currently, we have the ability
02089 to send tag data only from owners to ghosts.  Tim will look at this issue
02090 and propose a solution.
02091 
02092 Communication:
02093 -  Although we should think in terms of parts, communication really
02094 occurs with respect to processes.  We need to make sure all our
02095 communication routines make sense with respect to both processes and
02096 parts, and perhaps, revise their descriptions.  Also, if we send to
02097 parts, the implementation really does need the mapping of parts to
02098 processes.
02099 
02100 Entity Owner/Status Queries:
02101 -  Should we combine functions getEntOwnerPart and getEntStatus into
02102 one function?  Or should we combine functions getOwnerCopy and
02103 getEntOwner into one function?  Or should we remove getOwnerCopy and
02104 make applications call getOwnerPart followed by getCopyOnPart?
02105 
02106 Reducing storage:
02107 -  Mark Miller proposed allowing the user to specify the amount of
02108 copying done by the implementation, depending on applications' needs.
02109 For example, for a static viz application, every boundary entity may not
02110 need to know where all its copies are, so the implementation would not
02111 have to store them.  Can the implementations accept a flag advising them how
02112 much copying is needed?  If so, the implementations could choose to
02113 optimize storage or ignore the flag.
02114 */
02115 
02116 /*--------------------------------------------------------------------
02117  * SVN File Information
02118  *
02119  *   $SVN:Author$
02120  *   $SVN:Date$
02121  *   $SVN:Revision$
02122  *--------------------------------------------------------------------
02123  */
02124 
02125 #ifdef __cplusplus
02126 } /*  extern "C"  */
02127 #endif
02128 
02129 #endif /* !defined(_ITAPS_iMeshP) */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines