MOAB: Mesh Oriented datABase  (version 5.5.0)
iMeshP.h File Reference
#include "iMesh.h"
#include "iMeshP_protos.h"
#include "moab_mpi.h"
+ Include dependency graph for iMeshP.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define iMeshP_ALL_PARTS   ( -1 )
 

Typedefs

typedef struct iMeshP_PartitionHandle_Private * iMeshP_PartitionHandle
 
typedef struct iMeshP_RequestHandle_Private * iMeshP_RequestHandle
 
typedef iBase_EntitySetHandle iMeshP_PartHandle
 
typedef unsigned iMeshP_Part
 

Enumerations

enum  iMeshP_EntStatus { iMeshP_INTERNAL , iMeshP_BOUNDARY , iMeshP_GHOST }
 

Functions

void iMeshP_createPartitionAll (iMesh_Instance instance, MPI_Comm communicator, iMeshP_PartitionHandle *partition, int *err)
 Create a partition; return its handle. More...
 
void iMeshP_destroyPartitionAll (iMesh_Instance instance, iMeshP_PartitionHandle partition, int *err)
 Destroy a partition. More...
 
void iMeshP_getPartitionComm (iMesh_Instance instance, iMeshP_PartitionHandle partition, MPI_Comm *communicator, int *err)
 Return communicator associated with a partition. More...
 
void iMeshP_syncPartitionAll (iMesh_Instance instance, iMeshP_PartitionHandle partition, int *err)
 Update a partition after parts have been added. More...
 
void iMeshP_getNumPartitions (iMesh_Instance instance, int *num_partitions, int *err)
 Return the number of partitions associated with a mesh instance. More...
 
void iMeshP_getPartitions (iMesh_Instance instance, iMeshP_PartitionHandle **partitions, int *partitions_allocated, int *partitions_size, int *err)
 Return the partition handles associated with a mesh instance. More...
 
void iMeshP_getNumGlobalParts (iMesh_Instance instance, const iMeshP_PartitionHandle partition, int *num_global_part, int *err)
 Return the global number of parts in a partition. More...
 
void iMeshP_getNumLocalParts (iMesh_Instance instance, const iMeshP_PartitionHandle partition, int *num_local_part, int *err)
 Return the local number of parts in a partition. More...
 
void iMeshP_getLocalParts (iMesh_Instance instance, const iMeshP_PartitionHandle partition, iMeshP_PartHandle **parts, int *parts_allocated, int *parts_size, int *err)
 Return the part handles of local parts in a partition. More...
 
void iMeshP_getRankOfPart (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_Part part_id, int *rank, int *err)
 Return the process rank of a given part. More...
 
void iMeshP_getRankOfPartArr (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_Part *part_ids, const int part_ids_size, int **ranks, int *ranks_allocated, int *ranks_size, int *err)
 Return the process ranks of given parts. More...
 
void iMeshP_getNumOfTypeAll (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iBase_EntitySetHandle entity_set, int entity_type, int *num_type, int *err)
 Return the number of entities of a given type in a partition. More...
 
void iMeshP_getNumOfTopoAll (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iBase_EntitySetHandle entity_set, int entity_topology, int *num_topo, int *err)
 Return the number of entities of a given topology in a partition. More...
 
void iMeshP_createPart (iMesh_Instance instance, iMeshP_PartitionHandle partition, iMeshP_PartHandle *part, int *err)
 Create a new part in a partition. More...
 
void iMeshP_destroyPart (iMesh_Instance instance, iMeshP_PartitionHandle partition, iMeshP_PartHandle part, int *err)
 Remove a part from a partition. More...
 
void iMeshP_getPartIdFromPartHandle (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_PartHandle part, iMeshP_Part *part_id, int *err)
 Obtain a part ID from a part handle. More...
 
void iMeshP_getPartIdsFromPartHandlesArr (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_PartHandle *parts, const int parts_size, iMeshP_Part **part_ids, int *part_ids_allocated, int *part_ids_size, int *err)
 Obtain part IDs from part handles. More...
 
void iMeshP_getPartHandleFromPartId (iMesh_Instance instance, const iMeshP_PartitionHandle partition, iMeshP_Part part_id, iMeshP_PartHandle *part, int *err)
 Obtain a part handle from a part ID. More...
 
void iMeshP_getPartHandlesFromPartsIdsArr (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_Part *part_ids, const int part_ids_size, iMeshP_PartHandle **parts, int *parts_allocated, int *parts_size, int *err)
 Obtain part handles from part IDs. More...
 
void iMeshP_getNumPartNbors (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_PartHandle part, int entity_type, int *num_part_nbors, int *err)
 Return the number of parts that neighbor a given part. More...
 
void iMeshP_getNumPartNborsArr (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_PartHandle *parts, int parts_size, int entity_type, int **num_part_nbors, int *num_part_nbors_allocated, int *num_part_nbors_size, int *err)
 Return the number of parts that neighbor given parts. More...
 
void iMeshP_getPartNbors (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_PartHandle part, int entity_type, int *num_part_nbors, iMeshP_Part **nbor_part_ids, int *nbor_part_ids_allocated, int *nbor_part_ids_size, int *err)
 Return the parts that neighbor a given part. More...
 
void iMeshP_getPartNborsArr (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_PartHandle *parts, const int parts_size, int entity_type, int **num_part_nbors, int *num_part_nbors_allocated, int *num_part_nbors_size, iMeshP_Part **nbor_part_ids, int *nbor_part_ids_allocated, int *nbor_part_ids_size, int *err)
 Return the parts that neighbor given parts. More...
 
void iMeshP_getNumPartBdryEnts (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_PartHandle part, int entity_type, int entity_topology, iMeshP_Part target_part_id, int *num_entities, int *err)
 Return the number of entities on a part boundary. More...
 
void iMeshP_getPartBdryEnts (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_PartHandle part, int entity_type, int entity_topology, iMeshP_Part target_part_id, iBase_EntityHandle **entities, int *entities_allocated, int *entities_size, int *err)
 Return the entity handles of entities on a part boundary. More...
 
void iMeshP_initPartBdryEntIter (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_PartHandle part, int entity_type, int entity_topology, iMeshP_Part target_part_id, iBase_EntityIterator *entity_iterator, int *err)
 Initialize an iterator over a specified part boundary. More...
 
void iMeshP_initPartBdryEntArrIter (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_PartHandle part, int entity_type, int entity_topology, int array_size, iMeshP_Part target_part_id, iBase_EntityArrIterator *entity_iterator, int *err)
 Initialize an array iterator over a specified part boundary. More...
 
void iMeshP_getNumOfType (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_PartHandle part, const iBase_EntitySetHandle entity_set, int entity_type, int *num_type, int *err)
 Return the number of entities of a given type in both a part and an entity set. More...
 
void iMeshP_getNumOfTopo (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_PartHandle part, const iBase_EntitySetHandle entity_set, int entity_topology, int *num_topo, int *err)
 Return the number of entities of a given topology in both a part and an entity set. More...
 
void iMeshP_getAdjEntIndices (iMesh_Instance instance, iMeshP_PartitionHandle partition, iMeshP_PartHandle part, iBase_EntitySetHandle entity_set_handle, int entity_type_requestor, int entity_topology_requestor, int entity_type_requested, iBase_EntityHandle **entity_handles, int *entity_handles_allocated, int *entity_handles_size, iBase_EntityHandle **adj_entity_handles, int *adj_entity_handles_allocated, int *adj_entity_handles_size, int **adj_entity_indices, int *adj_entity_indices_allocated, int *adj_entity_indices_size, int **offset, int *offset_allocated, int *offset_size, int *err)
 Get indexed representation of mesh or subset of mesh. More...
 
void iMeshP_getEntities (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_PartHandle part, const iBase_EntitySetHandle entity_set, int entity_type, int entity_topology, iBase_EntityHandle **entities, int *entities_allocated, int *entities_size, int *err)
 Return entities in a both given part and entity set. More...
 
void iMeshP_getAdjEntities (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_PartHandle part, const iBase_EntitySetHandle entity_set, int entity_type_requestor, int entity_topology_requestor, int entity_type_requested, iBase_EntityHandle **adj_entities, int *adj_entities_allocated, int *adj_entities_size, int **offset, int *offset_allocated, int *offset_size, int **in_entity_set, int *in_entity_set_allocated, int *in_entity_set_size, int *err)
 Return entities adjacent to entities in a given part and entity set. More...
 
void iMeshP_initEntIter (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_PartHandle part, const iBase_EntitySetHandle entity_set, const int requested_entity_type, const int requested_entity_topology, iBase_EntityIterator *entity_iterator, int *err)
 Create an entity iterator for a given part and entity set. More...
 
void iMeshP_initEntArrIter (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_PartHandle part, const iBase_EntitySetHandle entity_set, const int requested_entity_type, const int requested_entity_topology, const int requested_array_size, iBase_EntityArrIterator *entArr_iterator, int *err)
 Create an entity array iterator for a given part and entity set. More...
 
void iMeshP_getEntOwnerPart (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iBase_EntityHandle entity, iMeshP_Part *part_id, int *err)
 Return the part ID of the part owning an entity. More...
 
void iMeshP_getEntOwnerPartArr (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iBase_EntityHandle *entities, const int entities_size, iMeshP_Part **part_ids, int *part_ids_allocated, int *part_ids_size, int *err)
 Return the part IDs of the parts owning the given entities. More...
 
void iMeshP_isEntOwner (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_PartHandle part, const iBase_EntityHandle entity, int *is_owner, int *err)
 Test for entity ownership with respect to a part. More...
 
void iMeshP_isEntOwnerArr (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_PartHandle part, const iBase_EntityHandle *entities, const int entities_size, int **is_owner, int *is_owner_allocated, int *is_owner_size, int *err)
 Test for entity ownership of many entities with respect to a part. More...
 
void iMeshP_getEntStatus (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_PartHandle part, const iBase_EntityHandle entity, int *par_status, int *err)
 Return entity status (Internal, boundary, ghost). More...
 
void iMeshP_getEntStatusArr (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_PartHandle part, const iBase_EntityHandle *entities, const int entities_size, int **par_status, int *par_status_allocated, int *par_status_size, int *err)
 Return entity status (Internal, boundary, ghost). More...
 
void iMeshP_getNumCopies (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iBase_EntityHandle entity, int *num_copies_ent, int *err)
 Return the number of copies of an entity that exist in the partition. More...
 
void iMeshP_getCopyParts (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iBase_EntityHandle entity, iMeshP_Part **part_ids, int *part_ids_allocated, int *part_ids_size, int *err)
 Return the part IDs of parts having copies of a given entity. More...
 
void iMeshP_getCopies (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iBase_EntityHandle entity, iMeshP_Part **part_ids, int *part_ids_allocated, int *part_ids_size, iBase_EntityHandle **copies, int *copies_allocated, int *copies_size, int *err)
 Get (remote) entity handles of copies of a given entity. More...
 
void iMeshP_getCopyOnPart (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iBase_EntityHandle entity, const iMeshP_Part part_id, iBase_EntityHandle *copy_entity, int *err)
 Get the entity handle of a copy of a given entity in a given part. More...
 
void iMeshP_getOwnerCopy (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iBase_EntityHandle entity, iMeshP_Part *owner_part_id, iBase_EntityHandle *owner_entity, int *err)
 Get the entity handle of a copy of a given entity in its owner part. More...
 
void iMeshP_waitForRequest (iMesh_Instance instance, const iMeshP_PartitionHandle partition, iMeshP_RequestHandle request, int *err)
 Wait for a specific iMeshP request to complete. More...
 
void iMeshP_waitForAnyRequest (iMesh_Instance instance, const iMeshP_PartitionHandle partition, iMeshP_RequestHandle *requests, int requests_size, int *index, int *err)
 Wait for any of the specified iMeshP requests to complete. More...
 
void iMeshP_waitForAllRequests (iMesh_Instance instance, const iMeshP_PartitionHandle partition, iMeshP_RequestHandle *requests, int requests_size, int *err)
 Wait for all of the specified iMeshP requests to complete. More...
 
void iMeshP_waitForRequestEnt (iMesh_Instance instance, const iMeshP_PartitionHandle partition, iMeshP_RequestHandle request, iBase_EntityHandle **out_entities, int *out_entities_allocated, int *out_entities_size, int *err)
 Wait for a specific request to complete; return entities received. More...
 
void iMeshP_testRequest (iMesh_Instance instance, const iMeshP_PartitionHandle partition, iMeshP_RequestHandle request, int *completed, int *err)
 Test whether a specific request has completed. More...
 
void iMeshP_pollForRequests (iMesh_Instance instance, iMeshP_PartitionHandle partition, iMeshP_RequestHandle **requests_completed, int *requests_completed_allocated, int *requests_completed_size, int *err)
 Poll for outstanding requests. More...
 
void iMeshP_exchEntArrToPartsAll (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iBase_EntityHandle *entities, const int entities_size, const iMeshP_Part *target_part_ids, int command_code, int update_ghost, iMeshP_RequestHandle *request, int *err)
 Add entities to on-process and/or off-process parts. More...
 
void iMeshP_migrateEntity (iMesh_Instance instance, const iMeshP_PartitionHandle partition, iMeshP_PartHandle part, iBase_EntityHandle local_entity, iMeshP_RequestHandle *request, int *err)
 Request in-migration of an entity and its upward adjacencies. More...
 
void iMeshP_updateVtxCoords (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iBase_EntityHandle local_vertex, int *err)
 Update vertex coordinates for vertex copies. More...
 
void iMeshP_replaceOnPartBdry (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iBase_EntityHandle *old_entities, const int old_entities_size, const iBase_EntityHandle *new_entities, const int new_entities_size, const int *offset, const int offset_size, int *err)
 Replace entities on the part boundary. More...
 
void iMeshP_addGhostOf (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_Part target_part_id, iBase_EntityHandle entity_to_copy, iMeshP_RequestHandle *request, int *err)
 Push ghost copies of individual entities onto other parts. More...
 
void iMeshP_rmvGhostOf (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iMeshP_Part target_part_id, iBase_EntityHandle copy_to_purge, int *err)
 Remove ghost copies of individual entities from other parts. More...
 
void iMeshP_syncMeshAll (iMesh_Instance instance, iMeshP_PartitionHandle partition, int *err)
 Indicate completion of mesh modification. More...
 
void iMeshP_pushTags (iMesh_Instance instance, const iMeshP_PartitionHandle partition, iBase_TagHandle source_tag, iBase_TagHandle dest_tag, int entity_type, int entity_topo, int *err)
 Synchronously send tag data for given entity types and topologies. More...
 
void iMeshP_pushTagsEnt (iMesh_Instance instance, const iMeshP_PartitionHandle partition, iBase_TagHandle source_tag, iBase_TagHandle dest_tag, const iBase_EntityHandle *entities, int entities_size, int *err)
 Synchronously send tag data for individual entities. More...
 
void iMeshP_iPushTags (iMesh_Instance instance, const iMeshP_PartitionHandle partition, iBase_TagHandle source_tag, iBase_TagHandle dest_tag, int entity_type, int entity_topo, iMeshP_RequestHandle *request, int *err)
 Asynchronously send tag data for given entity types and topologies. More...
 
void iMeshP_iPushTagsEnt (iMesh_Instance instance, const iMeshP_PartitionHandle partition, iBase_TagHandle source_tag, iBase_TagHandle dest_tag, const iBase_EntityHandle *entities, int entities_size, iMeshP_RequestHandle *request, int *err)
 Asynchronously send tag data for individual entities. More...
 
void iMeshP_createGhostEntsAll (iMesh_Instance instance, iMeshP_PartitionHandle partition, int ghost_type, int bridge_type, int num_layers, int include_copies, int *err)
 
void iMeshP_deleteGhostEntsAll (iMesh_Instance instance, iMeshP_PartitionHandle partition, int *err)
 
void iMeshP_ghostEntInfo (const iMesh_Instance instance, const iMeshP_PartitionHandle partition, int *ghost_rules_allocated, int *ghost_rules_size, int **ghost_type, int **bridge_type, int **num_layers, int *err)
 Return information about all ghosting on a partition. More...
 
void iMeshP_loadAll (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iBase_EntitySetHandle entity_set, const char *name, const char *options, int *err, int name_len, int options_len)
 Populate a mesh instance and a partition by reading data from files. More...
 
void iMeshP_saveAll (iMesh_Instance instance, const iMeshP_PartitionHandle partition, const iBase_EntitySetHandle entity_set, const char *name, const char *options, int *err, const int name_len, int options_len)
 Write data from a mesh instance and a partition to files. More...
 

Macro Definition Documentation

◆ iMeshP_ALL_PARTS

#define iMeshP_ALL_PARTS   ( -1 )

Part ID number indicating information should be returned about all parts.

Definition at line 32 of file iMeshP.h.

Typedef Documentation

◆ iMeshP_Part

typedef unsigned iMeshP_Part

Definition at line 21 of file iMeshP.h.

◆ iMeshP_PartHandle

Definition at line 19 of file iMeshP.h.

◆ iMeshP_PartitionHandle

typedef struct iMeshP_PartitionHandle_Private* iMeshP_PartitionHandle

Handles needed in iMeshP

Definition at line 13 of file iMeshP.h.

◆ iMeshP_RequestHandle

typedef struct iMeshP_RequestHandle_Private* iMeshP_RequestHandle

Definition at line 14 of file iMeshP.h.

Enumeration Type Documentation

◆ iMeshP_EntStatus

Types for classifying entities within a part.

Enumerator
iMeshP_INTERNAL 

An owned entity that is not on a part boundary.

iMeshP_BOUNDARY 

A shared entity on a part boundary.

iMeshP_GHOST 

An entity copy that is not a shared boundary entity.

Definition at line 24 of file iMeshP.h.

25 {
26  iMeshP_INTERNAL, /**< An owned entity that is not on a part boundary. */
27  iMeshP_BOUNDARY, /**< A shared entity on a part boundary. */
28  iMeshP_GHOST /**< An entity copy that is not a shared boundary entity. */
29 };

Function Documentation

◆ iMeshP_addGhostOf()

void iMeshP_addGhostOf ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iMeshP_Part  target_part_id,
iBase_EntityHandle  entity_to_copy,
iMeshP_RequestHandle request,
int *  err 
)

Push ghost copies of individual entities onto other parts.

Given an entity and a target part, create a ghost copy of the entity on the target part.

Communication here is push-and-confirm (so that the original knows remote entity handle of the created ghosts). The closure of a new ghost is pushed automatically as part of the underlying communication.

COMMUNICATION: point-to-point, non-blocking, push.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
target_part_id(In) The part to receive the new ghost.
entity_to_copy(In) The entity to be copied in target_part_id.
request(Out) The iMeshP request handle returned.
err(Out) Error code.

Definition at line 1488 of file iMeshP_MOAB.cpp.

1494 {
1495  FIXME;
1497 }

References FIXME, iBase_NOT_SUPPORTED, and RETURN.

◆ iMeshP_createGhostEntsAll()

void iMeshP_createGhostEntsAll ( iMesh_Instance  instance,
iMeshP_PartitionHandle  partition,
int  ghost_type,
int  bridge_type,
int  num_layers,
int  include_copies,
int *  err 
)

Definition at line 1598 of file iMeshP_MOAB.cpp.

1605 {
1606  if( include_copies )
1607  {
1608  FIXME;
1610  }
1611 
1612  ParallelComm* pcomm = PCOMM;
1613  ErrorCode rval;
1614  if( iBase_ALL_TYPES == ghost_dim ) ghost_dim = -1;
1615  rval = pcomm->exchange_ghost_cells( ghost_dim, bridge_dim, num_layers, 0, true );CHKERR( rval, "ghost exchange failed" );
1616  RETURN( iBase_SUCCESS );
1617 }

References CHKERR, ErrorCode, moab::ParallelComm::exchange_ghost_cells(), FIXME, iBase_ALL_TYPES, iBase_NOT_SUPPORTED, iBase_SUCCESS, PCOMM, and RETURN.

◆ iMeshP_createPart()

void iMeshP_createPart ( iMesh_Instance  instance,
iMeshP_PartitionHandle  partition,
iMeshP_PartHandle part,
int *  err 
)

Create a new part in a partition.

Given a partition handle, create a new part and add it to the partition on the process invoking the creation. Return the part handle for the new part.

COMMUNICATION: None.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being updated.
part(Out) The newly created part.
err(Out) Error code.

Definition at line 632 of file iMeshP_MOAB.cpp.

636 {
637  ParallelComm* pcomm = PCOMM;
638  if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
639 
640  EntityHandle h;
641  ErrorCode rval = pcomm->create_part( h );CHKERR( rval, "Part creation failed" );
642  *part_handle = itaps_cast< iMeshP_PartHandle >( h );
644 }

References CHKERR, moab::ParallelComm::create_part(), ERROR, ErrorCode, iBase_FAILURE, iBase_SUCCESS, PCOMM, and RETURN.

◆ iMeshP_createPartitionAll()

void iMeshP_createPartitionAll ( iMesh_Instance  instance,
MPI_Comm  communicator,
iMeshP_PartitionHandle partition,
int *  err 
)

Create a partition; return its handle.

Given a mesh instance and a communicator, return a partition handle for a new partition within the mesh instance that uses the communicator. In the future, we may have different creation routines for different communication systems; once the partition is created, the application would not have to worry about the communication system again. For now, implementations are MPI based, so MPI communicators are provided. For serial use, the communicator may be MPI_COMM_SELF or communicator may be NULL.

COMMUNICATION: Collective.

Parameters
instance(In) Mesh instance to contain the partition.
communicator(In) Communicator to be used for parallel communication.
partition(Out) The newly created partition.
err(Out) Error code.

Definition at line 354 of file iMeshP_MOAB.cpp.

358 {
359  *partition_handle = 0;
360 
361  Tag prtn_tag;
362  ErrorCode rval = MOABI->tag_get_handle( PARALLEL_PARTITIONING_TAG_NAME, 1, MB_TYPE_INTEGER, prtn_tag,
363  MB_TAG_SPARSE | MB_TAG_CREAT );CHKERR( rval, "tag creation failed" );
364 
365  EntityHandle handle;
366  rval = MOABI->create_meshset( MESHSET_SET, handle );CHKERR( rval, "set creation failed" );
367  ParallelComm* pcomm = ParallelComm::get_pcomm( MOABI, handle, &communicator );
368  if( !pcomm )
369  {
370  MOABI->delete_entities( &handle, 1 );
372  }
373 
374  // set the value of pcomm id, to the partitioning tag, although this is not used
375  // we just need the tag to be set
376  int pid = pcomm->get_id();
377  rval = MOABI->tag_set_data( prtn_tag, &handle, 1, &pid );CHKERR( rval, "tag creation failed" );
378 
379  *partition_handle = itaps_cast< iMeshP_PartitionHandle >( handle );
381 }

References CHKERR, ErrorCode, moab::ParallelComm::get_id(), moab::ParallelComm::get_pcomm(), iBase_FAILURE, iBase_SUCCESS, MB_TAG_CREAT, MB_TAG_SPARSE, MB_TYPE_INTEGER, MESHSET_SET, MOABI, PARALLEL_PARTITIONING_TAG_NAME, and RETURN.

◆ iMeshP_deleteGhostEntsAll()

void iMeshP_deleteGhostEntsAll ( iMesh_Instance  instance,
iMeshP_PartitionHandle  partition,
int *  err 
)

Definition at line 1619 of file iMeshP_MOAB.cpp.

1620 {
1621  FIXME;
1623 }

References FIXME, iBase_NOT_SUPPORTED, and RETURN.

◆ iMeshP_destroyPart()

void iMeshP_destroyPart ( iMesh_Instance  instance,
iMeshP_PartitionHandle  partition,
iMeshP_PartHandle  part,
int *  err 
)

Remove a part from a partition.

Given a partition handle and a part handle, remove the part from the partition and destroy the part. Note that the part handle is not invalidated by this function.

COMMUNICATION: None.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being updated.
part(In) The part to be removed.
err(Out) Error code.

Definition at line 646 of file iMeshP_MOAB.cpp.

650 {
651  ParallelComm* pcomm = PCOMM;
652  if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
653 
654  ErrorCode rval = pcomm->destroy_part( itaps_cast< EntityHandle >( part_handle ) );CHKERR( rval, "Part destruction failed" );
656 }

References CHKERR, moab::ParallelComm::destroy_part(), ERROR, ErrorCode, iBase_FAILURE, iBase_SUCCESS, PCOMM, and RETURN.

◆ iMeshP_destroyPartitionAll()

void iMeshP_destroyPartitionAll ( iMesh_Instance  instance,
iMeshP_PartitionHandle  partition,
int *  err 
)

Destroy a partition.

Given a partition handle, destroy the partition associated with the handle. Note that the partition handle is not invalidated upon return.

COMMUNICATION: Collective.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition to be destroyed.
err(Out) Error code.

Definition at line 383 of file iMeshP_MOAB.cpp.

384 {
385  ParallelComm* pcomm = PCOMM;
386  if( pcomm ) delete pcomm;
387  EntityHandle handle = itaps_cast< EntityHandle >( partition_handle );
388  ErrorCode rval = MOABI->delete_entities( &handle, 1 );CHKERR( rval, "entity deletion failed" );
390 }

References CHKERR, ErrorCode, iBase_SUCCESS, MOABI, PCOMM, and RETURN.

◆ iMeshP_exchEntArrToPartsAll()

void iMeshP_exchEntArrToPartsAll ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iBase_EntityHandle entities,
const int  entities_size,
const iMeshP_Part target_part_ids,
int  command_code,
int  update_ghost,
iMeshP_RequestHandle request,
int *  err 
)

Add entities to on-process and/or off-process parts.

Given a partition and a list of entities, add those entities to the target parts. The entities can be added as copies or migrated entirely (i.e., change ownership of the entities) to the parts. The entities' downward adjacencies are also copied and/or migrated as appropriate to support the entities. This function is a collective, non-blocking operation to be called by all processes in the partition's communicator. An iMeshP_RequestHandle is returned; any of the iMeshP_wait* functions can be used to block until the request is completed.

COMMUNICATION: Collective. Non-blocking.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) Handle for the partition being queried.
entities(In) Entities to be sent.
entities_size(In) Number of entities to be sent.
target_part_ids(In) Array of size entities_size listing the parts to which the entities should be sent.
command_code(In) Flag indicating whether to migrate the entities or only make copies.
update_ghost(In) Flag indicating whether (1) or not (0) ghost copies of the entities should be updated with new owner information.
request(Out) iMeshP RequestHandle returned; can be used for blocking until this send is complete.
err(Out) Error code.

Definition at line 1398 of file iMeshP_MOAB.cpp.

1407 {
1408  if( command_code == 1 )
1409  {
1410  std::cerr << "Entity migration option is not supported." << std::endl;
1412  }
1413 
1414  if( update_ghost == 1 )
1415  {
1416  std::cerr << "Gost update option is not supported." << std::endl;
1418  }
1419 
1420  // make exchange entity and processor list
1421  ErrorCode rval;
1422  ParallelComm* pcomm = PCOMM;
1423  std::vector< unsigned int > exchange_procs;
1424  std::vector< Range* > exchange_ents;
1425 
1426  for( int i = 0; i < entity_handles_size; i++ )
1427  {
1428  int ind = -1;
1429  // iMeshP_Part target_p = target_part_ids[i];
1430  int target_p;
1431  rval = pcomm->get_part_owner( target_part_ids[i], target_p );CHKERR( rval, "ParallelComm::get_part_owner failed" );
1432 
1433  std::vector< unsigned int >::iterator vit = std::find( exchange_procs.begin(), exchange_procs.end(), target_p );
1434  if( vit == exchange_procs.end() )
1435  {
1436  ind = exchange_procs.size();
1437  exchange_procs.push_back( target_p );
1438  exchange_ents.push_back( new Range );
1439  }
1440  else
1441  ind = vit - exchange_procs.begin();
1442 
1443  exchange_ents[ind]->insert( itaps_cast< EntityHandle >( entity_handles[i] ) );
1444  }
1445 
1446  std::vector< MPI_Request > recv_ent_reqs, recv_remoteh_reqs;
1447  rval = pcomm->exchange_owned_meshs( exchange_procs, exchange_ents, recv_ent_reqs, recv_remoteh_reqs, true );CHKERR( rval, "ParallelComm::exchange_owned_meshs failed" );
1448 
1449  // delete exchange list
1450  std::vector< Range* >::iterator vit;
1451  for( vit = exchange_ents.begin(); vit != exchange_ents.end(); ++vit )
1452  delete( *vit );
1453 
1454  RETURN( iBase_SUCCESS );
1455 }

References CHKERR, ErrorCode, moab::ParallelComm::exchange_owned_meshs(), moab::ParallelComm::get_part_owner(), iBase_NOT_SUPPORTED, iBase_SUCCESS, PCOMM, and RETURN.

◆ iMeshP_getAdjEntIndices()

void iMeshP_getAdjEntIndices ( iMesh_Instance  instance,
iMeshP_PartitionHandle  partition,
iMeshP_PartHandle  part,
iBase_EntitySetHandle  entity_set_handle,
int  entity_type_requestor,
int  entity_topology_requestor,
int  entity_type_requested,
iBase_EntityHandle **  entity_handles,
int *  entity_handles_allocated,
int *  entity_handles_size,
iBase_EntityHandle **  adj_entity_handles,
int *  adj_entity_handles_allocated,
int *  adj_entity_handles_size,
int **  adj_entity_indices,
int *  adj_entity_indices_allocated,
int *  adj_entity_indices_size,
int **  offset,
int *  offset_allocated,
int *  offset_size,
int *  err 
)

Get indexed representation of mesh or subset of mesh.

Given part handle and an entity set and optionally a type or topology, for all entities that are in BOTH the part and the entity set, return:

  • The entities in the part and set of the specified type or topology
  • The entities adjacent to those entities with a specified type, as a list of unique handles.
  • For each entity in the first list, the adjacent entities, specified as indices into the second list.

    COMMUNICATION: None.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
part(In) The part being queried.
entity_set_handle(In) The set being queried
entity_type_requestor(In) If not iBase_ALL_TYPES, act only on the subset of entities with the specified type.
entity_topology_requestor(In) If not iMesh_ALL_TOPOLOGIES, act only on the subset of entities with the specified topology.
entity_type_requested(In) The type of the adjacent entities to return.
entity_handles(In/Out) The handles of the (non-strict) subset of the union of the part and entity set, and the optional type and topology filtering arguments.
adj_entity_handles(In/Out) The union of the entities of type 'requested_entity_type' adjacent to each entity in 'entity_handles'.
adj_entity_indices(In/Out) For each entity in 'entity_handles', the adjacent entities of type 'entity_type_requested', specified as indices into 'adj_entity_handles'. The indices are concatenated into a single array in the order of the entity handles in 'entity_handles'.
offset(In/Out) For each entity in the corresponding position in 'entity_handles', the position in 'adj_entity_indices' at which values for that entity are stored.

Definition at line 840 of file iMeshP_MOAB.cpp.

860 {
861  const int allocated_entity_handles = ( *entity_handles_allocated == 0 );
862  const int allocated_indices = ( *adj_entity_indices_allocated == 0 );
863  const int allocated_offset = ( *offset_allocated == 0 );
864 
865  // get source entities
866  iMeshP_getEntities( instance, partition, part, entity_set_handle, entity_type_requestor, entity_topology_requestor,
867  entity_handles, entity_handles_allocated, entity_handles_size, err );
868  if( iBase_SUCCESS != *err ) return;
869 
870  // get adjacencies
871  iBase_EntityHandle* all_adj_handles = 0;
872  int size = 0, alloc = 0;
873  iMesh_getEntArrAdj( instance, *entity_handles, *entity_handles_size, entity_type_requested, &all_adj_handles,
874  &alloc, &size, offset, offset_allocated, offset_size, err );
875  if( *err != iBase_SUCCESS )
876  {
877  if( allocated_entity_handles )
878  {
879  free( *entity_handles );
880  *entity_handles = 0;
881  *entity_handles_allocated = 0;
882  }
883  return;
884  }
885 
886  // allocate or check size of adj_entity_indices
887  *adj_entity_indices_size = size;
888  if( allocated_indices )
889  {
890  *adj_entity_indices = (int*)malloc( sizeof( iBase_EntityHandle ) * size );
891  if( !*adj_entity_indices )
893  else
894  *adj_entity_indices_allocated = size;
895  }
896  else if( *adj_entity_indices_allocated < size )
897  {
899  }
900  if( iBase_SUCCESS != *err )
901  {
902  free( all_adj_handles );
903  if( allocated_entity_handles )
904  {
905  free( *entity_handles );
906  *entity_handles = 0;
907  *entity_handles_allocated = 0;
908  }
909  if( allocated_offset )
910  {
911  free( *offset );
912  *offset = 0;
913  *offset_allocated = 0;
914  }
915  return;
916  }
917 
918  // Now create an array of unique sorted handles from all_adj_handles.
919  // We need to create a copy because we still need all_adj_handles. We
920  // will eventually need to copy the resulting unique list into
921  // adj_entity_handles, so if adj_entity_handles is already allocated and
922  // of sufficient size, use it rather than allocating another temporary.
923  iBase_EntityHandle* unique_adj = 0;
924  if( *adj_entity_handles_allocated >= size )
925  {
926  unique_adj = *adj_entity_handles;
927  }
928  else
929  {
930  unique_adj = (iBase_EntityHandle*)malloc( sizeof( iBase_EntityHandle ) * size );
931  }
932  std::copy( all_adj_handles, all_adj_handles + size, unique_adj );
933  std::sort( unique_adj, unique_adj + size );
934  *adj_entity_handles_size = std::unique( unique_adj, unique_adj + size ) - unique_adj;
935 
936  // If we created a temporary array for unique_adj rather than using
937  // already allocated space in adj_entity_handles, allocate adj_entity_handles
938  // and copy the unique handle list into it
939  if( *adj_entity_handles != unique_adj )
940  {
941  if( !*adj_entity_handles_allocated )
942  {
943  *adj_entity_handles =
944  (iBase_EntityHandle*)malloc( sizeof( iBase_EntityHandle ) * *adj_entity_handles_size );
945  if( !*adj_entity_handles )
947  else
948  *adj_entity_handles_allocated = *adj_entity_handles_size;
949  }
950  else if( *adj_entity_handles_allocated < *adj_entity_handles_size )
952  if( iBase_SUCCESS != *err )
953  {
954  free( unique_adj );
955  free( all_adj_handles );
956  if( allocated_entity_handles )
957  {
958  free( *entity_handles );
959  *entity_handles = 0;
960  *entity_handles_allocated = 0;
961  }
962  if( allocated_offset )
963  {
964  free( *offset );
965  *offset = 0;
966  *offset_allocated = 0;
967  }
968  if( allocated_indices )
969  {
970  free( *adj_entity_indices );
971  *adj_entity_indices = 0;
972  *adj_entity_indices_allocated = 0;
973  }
974  return;
975  }
976 
977  std::copy( unique_adj, unique_adj + *adj_entity_handles_size, *adj_entity_handles );
978  free( unique_adj );
979  unique_adj = *adj_entity_handles;
980  }
981 
982  // convert from adjacency list to indices into unique_adj
983  for( int i = 0; i < *adj_entity_indices_size; ++i )
984  ( *adj_entity_indices )[i] =
985  std::lower_bound( unique_adj, unique_adj + *adj_entity_handles_size, all_adj_handles[i] ) - unique_adj;
986  free( all_adj_handles );
987 }

References iBase_BAD_ARRAY_DIMENSION, iBase_MEMORY_ALLOCATION_FAILED, iBase_SUCCESS, iMesh_getEntArrAdj, iMeshP_getEntities(), and size.

◆ iMeshP_getAdjEntities()

void iMeshP_getAdjEntities ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iMeshP_PartHandle  part,
const iBase_EntitySetHandle  entity_set,
int  entity_type_requestor,
int  entity_topology_requestor,
int  entity_type_requested,
iBase_EntityHandle **  adj_entities,
int *  adj_entities_allocated,
int *  adj_entities_size,
int **  offset,
int *  offset_allocated,
int *  offset_size,
int **  in_entity_set,
int *  in_entity_set_allocated,
int *  in_entity_set_size,
int *  err 
)

Return entities adjacent to entities in a given part and entity set.

Given an entity set handle and a part handle, return entities adjacent (with respect to a given entity type and/or topology) to entities that are in both the part and the entity set. This function is similar to iMesh_getAdjEntities, but it also restricts the returned data with respect to its existence in the given part. If a non-root entity set is specified, the function also returns flags indicating whether each adjacent entity is in the entity set; (*in_entity_set)[i]=1 indicates that adjacent entity (*adj_entities)[i] is in the specified entity set. Array entry offset[i] stores the index of first adjacent entity to entity i.

COMMUNICATION: None.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
part(In) The part being queried.
entity_set(In) Entity set handle for the entity set being queried; may be the root set.
entity_type_requestor(In) Return entities adjacent to entities of this type; may be iBase_ALL_TYPES.
entity_topology_requestor(In) Return entities adjacent to entities of this topology; may be iMesh_ALL_TOPOLOGIES.
entity_type_requested(In) Return adjacent entities of this type; may be iBase_ALL_TYPES.
adj_entities(In/Out) Array of adjacent entity handles returned.
adj_entities_allocated(In/Out) Allocated size of adj_entities.
adj_entities_size(Out) Occupied size of adj_entities.
offset(In/Out) Array of offsets returned.
offset_allocated(In/Out) Allocated size of offset.
offset_size(Out) Occupied size of offset.
in_entity_set(In/Out) Array of flags returned if non-root entity set was input; (*in_entity_set)[i]=1 indicates (*adj_entities)[i] is in the entity set.
in_entity_set_allocated(In/Out) Allocated size of in_entity_set.
in_entity_set_size(Out) Occupied size of in_entity_set.
err(Out) Error code.

Definition at line 1008 of file iMeshP_MOAB.cpp.

1025 {
1026  ErrorCode rval;
1027  Range r;
1028  set_intersection_query( instance, part_handle, entity_set_handle, entity_type_requestor, entity_topology_requestor,
1029  r, err );
1030  if( iBase_SUCCESS != *err ) return;
1031 
1032  // count adjacencies
1033  std::vector< EntityHandle > tmp_storage;
1034  int num_adj = 0;
1035  int num_conn;
1036  const EntityHandle* conn_ptr;
1037  for( Range::iterator i = r.begin(); i != r.end(); ++i )
1038  {
1039  if( entity_type_requested || TYPE_FROM_HANDLE( *i ) == MBPOLYHEDRON )
1040  {
1041  tmp_storage.clear();
1042  rval = MOABI->get_adjacencies( &*i, 1, entity_type_requested, false, tmp_storage );CHKERR( rval, "get_adjacencies failed" );
1043  num_adj += tmp_storage.size();
1044  }
1045  else
1046  {
1047  rval = MOABI->get_connectivity( *i, conn_ptr, num_conn, false, &tmp_storage );CHKERR( rval, "get_connectivity failed" );
1048  num_adj += num_conn;
1049  }
1050  }
1051 
1052  // get adjacencies
1053  ALLOC_CHECK_ARRAY( adj_entity_handles, num_adj );
1054  ALLOC_CHECK_ARRAY( offset, r.size() );
1055  int arr_pos = 0;
1056  int* offset_iter = *offset;
1057  for( Range::iterator i = r.begin(); i != r.end(); ++i )
1058  {
1059  *offset_iter = arr_pos;
1060  ++offset_iter;
1061 
1062  tmp_storage.clear();
1063  rval = MOABI->get_adjacencies( &*i, 1, entity_type_requested, false, tmp_storage );CHKERR( rval, "get_adjacencies failed" );
1064  for( std::vector< EntityHandle >::iterator j = tmp_storage.begin(); j != tmp_storage.end(); ++j )
1065  {
1066  ( *adj_entity_handles )[arr_pos] = itaps_cast< iBase_EntityHandle >( *j );
1067  ++arr_pos;
1068  }
1069  }
1070 
1071  // get in_entity_set
1072  iMesh_isEntArrContained( instance, entity_set_handle, *adj_entity_handles, *adj_entity_handles_size, in_entity_set,
1073  in_entity_set_allocated, in_entity_set_size, err );
1074 
1075  if( iBase_SUCCESS == *err )
1076  {
1077  KEEP_ARRAY( adj_entity_handles );
1078  KEEP_ARRAY( offset );
1079  }
1080 }

References ALLOC_CHECK_ARRAY, moab::Range::begin(), CHKERR, moab::Range::end(), ErrorCode, iBase_SUCCESS, iMesh_isEntArrContained, KEEP_ARRAY, MBPOLYHEDRON, MOABI, set_intersection_query(), moab::Range::size(), and moab::TYPE_FROM_HANDLE().

◆ iMeshP_getCopies()

void iMeshP_getCopies ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iBase_EntityHandle  entity,
iMeshP_Part **  part_ids,
int *  part_ids_allocated,
int *  part_ids_size,
iBase_EntityHandle **  copies,
int *  copies_allocated,
int *  copies_size,
int *  err 
)

Get (remote) entity handles of copies of a given entity.

Given a partition handle and an entity handle, return (remote) entity handles and part IDs of all copies of the entity. If the given entity is an owned entity or boundary entity, the number of copies considered will be complete. If the given entity is a ghost entity, the number of copies considered will be two (the ghost and its owner).

COMMUNICATION: None++.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
entity(In) Entity whose copy info is requested.
part_ids(Out) Part IDs of parts having copies of the given entity.
part_ids_allocated(In/Out) Allocated size of part_ids array.
part_ids_size(Out) Occupied size of part_ids array.
copies(Out) (Remote) entity handles of the entity copies.
copies_allocated(In/Out) Allocated size of copies.
copies_size(Out) Occupied size of copies.
err(Out) Error code.

Definition at line 1287 of file iMeshP_MOAB.cpp.

1297 {
1298  ParallelComm* pcomm = PCOMM;
1299  if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
1300 
1301  int ids[MAX_SHARING_PROCS], num_ids;
1303  ErrorCode rval = pcomm->get_sharing_parts( itaps_cast< EntityHandle >( entity_handle ), ids, num_ids, handles );CHKERR( rval, "ParallelComm::get_sharing_parts failed" );
1304  ALLOC_CHECK_ARRAY_NOFAIL( part_ids, num_ids );
1305  ALLOC_CHECK_ARRAY_NOFAIL( copies_entity_handles, num_ids );
1306  for( int i = 0; i < num_ids; ++i )
1307  {
1308  ( *part_ids )[i] = ids[i];
1309  ( *copies_entity_handles )[i] = itaps_cast< iBase_EntityHandle >( handles[i] );
1310  }
1311  RETURN( iBase_SUCCESS );
1312 }

References ALLOC_CHECK_ARRAY_NOFAIL, CHKERR, ERROR, ErrorCode, moab::ParallelComm::get_sharing_parts(), iBase_FAILURE, iBase_SUCCESS, MAX_SHARING_PROCS, PCOMM, and RETURN.

◆ iMeshP_getCopyOnPart()

void iMeshP_getCopyOnPart ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iBase_EntityHandle  entity,
const iMeshP_Part  part_id,
iBase_EntityHandle copy_entity,
int *  err 
)

Get the entity handle of a copy of a given entity in a given part.

Given a partition handle, an entity handle and a part ID, return the (remote) entity handle of the copy of the entity in that part. Return an error if the entity does not exist in the specified part.

COMMUNICATION: None++.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
entity(In) Entity whose copy info is requested.
part_id(In) Part ID of part whose copy of the given entity is requested.
copy_entity(Out) (Remote) entity handle of the entity copy from the given part.
err(Out) Error code.

Definition at line 1314 of file iMeshP_MOAB.cpp.

1320 {
1321  ParallelComm* pcomm = PCOMM;
1322  if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
1323 
1324  int ids[MAX_SHARING_PROCS], num_ids;
1326  ErrorCode rval = pcomm->get_sharing_parts( itaps_cast< EntityHandle >( entity_handle ), ids, num_ids, handles );CHKERR( rval, "ParallelComm::get_sharing_parts failed" );
1327  int idx = std::find( ids, ids + num_ids, part_id ) - ids;
1328  if( idx == num_ids ) RETURN( iBase_FAILURE );
1329 
1330  *copy_entity_handle = itaps_cast< iBase_EntityHandle >( handles[idx] );
1331  RETURN( iBase_SUCCESS );
1332 }

References CHKERR, ERROR, ErrorCode, moab::ParallelComm::get_sharing_parts(), iBase_FAILURE, iBase_SUCCESS, MAX_SHARING_PROCS, PCOMM, and RETURN.

◆ iMeshP_getCopyParts()

void iMeshP_getCopyParts ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iBase_EntityHandle  entity,
iMeshP_Part **  part_ids,
int *  part_ids_allocated,
int *  part_ids_size,
int *  err 
)

Return the part IDs of parts having copies of a given entity.

Given a partition handle and an entity handle, return the part IDs of copies of the entity in the partition. If the given entity is an owned entity or boundary entity, the number of copies considered will be complete. If the given entity is a ghost entity, the number of copies considered will be two (the ghost and its owner).

COMMUNICATION: None++.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
entity(In) Entity whose copy info is requested.
part_ids(Out) Part IDs of parts having copies of the given entity.
part_ids_allocated(In/Out) Allocated size of part_ids array.
part_ids_size(Out) Occupied size of part_ids array.
err(Out) Error code.

Definition at line 1269 of file iMeshP_MOAB.cpp.

1276 {
1277  ParallelComm* pcomm = PCOMM;
1278  if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
1279 
1280  int ids[MAX_SHARING_PROCS], num_ids;
1281  ErrorCode rval = pcomm->get_sharing_parts( itaps_cast< EntityHandle >( entity_handle ), ids, num_ids );CHKERR( rval, "ParallelComm::get_sharing_parts failed" );
1282  ALLOC_CHECK_ARRAY_NOFAIL( part_ids, num_ids );
1283  std::copy( ids, ids + num_ids, *part_ids );
1284  RETURN( iBase_SUCCESS );
1285 }

References ALLOC_CHECK_ARRAY_NOFAIL, CHKERR, ERROR, ErrorCode, moab::ParallelComm::get_sharing_parts(), iBase_FAILURE, iBase_SUCCESS, MAX_SHARING_PROCS, PCOMM, and RETURN.

◆ iMeshP_getEntities()

void iMeshP_getEntities ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iMeshP_PartHandle  part,
const iBase_EntitySetHandle  entity_set,
int  entity_type,
int  entity_topology,
iBase_EntityHandle **  entities,
int *  entities_allocated,
int *  entities_size,
int *  err 
)

Return entities in a both given part and entity set.

Given an entity set handle and a part handle, return entity handles for entities that are in both the part and the entity set. This function is similar to iMesh_getEntities, but it also restricts the returned data with respect to its existence in the given part.

COMMUNICATION: None.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
part(In) The part being queried.
entity_set(In) Entity set handle for the entity set being queried; may be the root set.
entity_type(In) Entity type of the entities; may be iBase_ALL_TYPES.
entity_topology(In) Entity topology of the entities; may be iMesh_ALL_TOPOLOGIES.
entities(In/Out) Array of entity handles for entities in both part and entity_set.
entities_allocated(In/Out) Allocated size of entities.
entities_size(Out) Occupied size of entities.
err(Out) Error code.

Definition at line 989 of file iMeshP_MOAB.cpp.

999 {
1000  Range r;
1001  set_intersection_query( instance, part_handle, entity_set_handle, entity_type, entity_topology, r, err );
1002  if( iBase_SUCCESS != *err ) return;
1003 
1004  RANGE_TO_ITAPS_ARRAY( r, entity_handles );
1005  RETURN( iBase_SUCCESS );
1006 }

References iBase_SUCCESS, RANGE_TO_ITAPS_ARRAY, RETURN, and set_intersection_query().

Referenced by iMeshP_getAdjEntIndices().

◆ iMeshP_getEntOwnerPart()

void iMeshP_getEntOwnerPart ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iBase_EntityHandle  entity,
iMeshP_Part part_id,
int *  err 
)

Return the part ID of the part owning an entity.

Given an entity handle and a partition handle, return the part ID of the part that owns the entity. Return an error code if an entity is not in the partition.

COMMUNICATION: None++.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
entity(In) Entity whose owning part is to be returned.
part_id(Out) Part ID of the part owning the entity.
err(Out) Error code.

Definition at line 1134 of file iMeshP_MOAB.cpp.

1139 {
1140  int junk1 = 1, junk2 = 1;
1141  iMeshP_getEntOwnerPartArr( instance, partition_handle, &entity_handle, 1, &part_id, &junk1, &junk2, err );
1142 }

References iMeshP_getEntOwnerPartArr().

◆ iMeshP_getEntOwnerPartArr()

void iMeshP_getEntOwnerPartArr ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iBase_EntityHandle entities,
const int  entities_size,
iMeshP_Part **  part_ids,
int *  part_ids_allocated,
int *  part_ids_size,
int *  err 
)

Return the part IDs of the parts owning the given entities.

Given an array of entity handles and a partition handle, return for each entity handle the part ID of the part that owns the entity. Return an error code if an entity is not in the partition.

COMMUNICATION: None++.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
entities(In) Entity whose owning part is to be returned.
entities_size(In) Number of entities in entities array.
part_ids(Out) Part IDs of the parts owning the entities.
part_ids_allocated(In/Out) Allocated size of part_ids array.
part_ids_size(Out) Occupied size of part_ids array.
err(Out) Error code.

Definition at line 1144 of file iMeshP_MOAB.cpp.

1152 {
1153  ParallelComm* pcomm = PCOMM;
1154  if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
1155 
1156  int id;
1157  ALLOC_CHECK_ARRAY( part_ids, entity_handles_size );
1158  ErrorCode rval = MB_SUCCESS;
1159  for( int i = 0; i < entity_handles_size; ++i )
1160  {
1161  EntityHandle h = itaps_cast< EntityHandle >( entity_handles[i] );
1162  rval = pcomm->get_owning_part( h, id );
1163  ( *part_ids )[i] = id;CHKERR( rval, "Failet get part owner" );
1164  }
1165  KEEP_ARRAY( part_ids );
1166  RETURN( iBase_SUCCESS );
1167 }

References ALLOC_CHECK_ARRAY, CHKERR, ERROR, ErrorCode, moab::ParallelComm::get_owning_part(), iBase_FAILURE, iBase_SUCCESS, KEEP_ARRAY, MB_SUCCESS, PCOMM, and RETURN.

Referenced by iMeshP_getEntOwnerPart().

◆ iMeshP_getEntStatus()

void iMeshP_getEntStatus ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iMeshP_PartHandle  part,
const iBase_EntityHandle  entity,
int *  par_status,
int *  err 
)

Return entity status (Internal, boundary, ghost).

Given a partition handle, a part handle, and an entity handle, return a flag indicating whether the entity is strictly internal, is on a part boundary, or is a ghost with respect to the given part. The returned value is a member of the iMeshP_EntStatus enumerated type.

COMMUNICATION: None.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
part(In) The part being queried.
entity(In) Entity whose status is being tested.
par_status(Out) Value indicating the status of the is the entity with respect to the part.
err(Out) Error code.

Definition at line 1211 of file iMeshP_MOAB.cpp.

1217 {
1218  int junk1 = 1, junk2 = 1;
1219  iMeshP_getEntStatusArr( instance, partition_handle, part_handle, &entity_handle, 1, &par_status, &junk1, &junk2,
1220  err );
1221 }

References iMeshP_getEntStatusArr().

◆ iMeshP_getEntStatusArr()

void iMeshP_getEntStatusArr ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iMeshP_PartHandle  part,
const iBase_EntityHandle entities,
const int  entities_size,
int **  par_status,
int *  par_status_allocated,
int *  par_status_size,
int *  err 
)

Return entity status (Internal, boundary, ghost).

Given a partition handle, a part handle, and an array of entity handles, return for each entity handle a flag indicating whether the entity is strictly internal, is on a part boundary, or is a ghost with respect to the given part. The returned value is a member of the iMeshP_EntStatus enumerated type.

COMMUNICATION: None.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
part(In) The part being queried.
entities(In) Entities whose status is being tested.
entities_size(In) Number of entity handles in entities.
par_status(Out) Value for each entity indicating the status of the entity with respect to the part.
par_status_allocated(In/Out) Allocated size of par_status array.
par_status_size(Out) Occupied size of par_status array.
err(Out) Error code.

Definition at line 1223 of file iMeshP_MOAB.cpp.

1232 {
1233  ParallelComm* pcomm = PCOMM;
1234  if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
1235 
1236  std::vector< unsigned char > pstatus( entity_handles_size );
1237  ErrorCode result = MOABI->tag_get_data( pcomm->pstatus_tag(), itaps_cast< const EntityHandle* >( entity_handles ),
1238  entity_handles_size, &pstatus[0] );CHKERR( result, "error getting pstatus_tag" );
1239 
1240  ALLOC_CHECK_ARRAY( par_status, entity_handles_size );
1241  for( int i = 0; i < entity_handles_size; i++ )
1242  {
1243  if( !pstatus[i] )
1244  ( *par_status )[i] = iMeshP_INTERNAL;
1245  else if( pstatus[i] & PSTATUS_GHOST )
1246  ( *par_status )[i] = iMeshP_GHOST;
1247  else if( pstatus[i] & PSTATUS_INTERFACE )
1248  ( *par_status )[i] = iMeshP_BOUNDARY;
1249  }
1250 
1251  KEEP_ARRAY( par_status );
1252  RETURN( iBase_SUCCESS );
1253 }

References ALLOC_CHECK_ARRAY, CHKERR, ERROR, ErrorCode, iBase_FAILURE, iBase_SUCCESS, iMeshP_BOUNDARY, iMeshP_GHOST, iMeshP_INTERNAL, KEEP_ARRAY, MOABI, PCOMM, PSTATUS_GHOST, PSTATUS_INTERFACE, moab::ParallelComm::pstatus_tag(), and RETURN.

Referenced by iMeshP_getEntStatus().

◆ iMeshP_getLocalParts()

void iMeshP_getLocalParts ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
iMeshP_PartHandle **  parts,
int *  parts_allocated,
int *  parts_size,
int *  err 
)

Return the part handles of local parts in a partition.

Given a partition handle, return the part handles for the local (on-process) parts in the partition.

COMMUNICATION: None.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
parts(In/Out) Array of part handles for local parts in the partition.
parts_allocated(In/Out) Allocated size of parts array.
parts_size(Out) Occupied size of parts array.
err(Out) Error code.

Definition at line 536 of file iMeshP_MOAB.cpp.

542 {
543  ParallelComm* pcomm = PCOMM;
544  if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
545 
546  RANGE_TO_ITAPS_ARRAY( pcomm->partition_sets(), part_handles );
548 }

References ERROR, iBase_FAILURE, iBase_SUCCESS, moab::ParallelComm::partition_sets(), PCOMM, RANGE_TO_ITAPS_ARRAY, and RETURN.

◆ iMeshP_getNumCopies()

void iMeshP_getNumCopies ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iBase_EntityHandle  entity,
int *  num_copies_ent,
int *  err 
)

Return the number of copies of an entity that exist in the partition.

Given a partition handle and an entity handle, return the number of copies of the entity in the partition. If the given entity is an owned entity or boundary entity, the number of copies will be complete. If the given entity is a ghost entity, the number of copies will be two (the ghost and its owner).

COMMUNICATION: None++.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
entity(In) Entity whose copy info is requested.
num_copies_ent(Out) Number of copies of the entity that exist in the partition.
err(Out) Error code.

Definition at line 1255 of file iMeshP_MOAB.cpp.

1260 {
1261  ParallelComm* pcomm = PCOMM;
1262  if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
1263 
1264  int ids[MAX_SHARING_PROCS];
1265  ErrorCode rval = pcomm->get_sharing_parts( itaps_cast< EntityHandle >( entity_handle ), ids, *num_copies_ent );CHKERR( rval, "ParallelComm::get_sharing_parts failed" );
1266  RETURN( iBase_SUCCESS );
1267 }

References CHKERR, ERROR, ErrorCode, moab::ParallelComm::get_sharing_parts(), iBase_FAILURE, iBase_SUCCESS, MAX_SHARING_PROCS, PCOMM, and RETURN.

◆ iMeshP_getNumGlobalParts()

void iMeshP_getNumGlobalParts ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
int *  num_global_part,
int *  err 
)

Return the global number of parts in a partition.

Given a partition handle, return the total number of parts in the partition across all processes in the partition's communicator.

COMMUNICATION: None++.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
num_global_part(Out) Global number of parts in the partition.
err(Out) Error code.

Definition at line 512 of file iMeshP_MOAB.cpp.

516 {
517  ParallelComm* pcomm = PCOMM;
518  if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
519 
520  ErrorCode rval = pcomm->get_global_part_count( *num_global_part );CHKERR( rval, "PComm::get_global_part_count failed" );
522 }

References CHKERR, ERROR, ErrorCode, moab::ParallelComm::get_global_part_count(), iBase_FAILURE, iBase_SUCCESS, PCOMM, and RETURN.

◆ iMeshP_getNumLocalParts()

void iMeshP_getNumLocalParts ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
int *  num_local_part,
int *  err 
)

Return the local number of parts in a partition.

Given a partition handle, return the number of local (on-process) parts in the partition.

COMMUNICATION: None.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
num_local_part(Out) Local (on-process) number of parts in the partition.
err(Out) Error code.

Definition at line 524 of file iMeshP_MOAB.cpp.

528 {
529  ParallelComm* pcomm = PCOMM;
530  if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
531 
532  *num_local_part = pcomm->partition_sets().size();
534 }

References ERROR, iBase_FAILURE, iBase_SUCCESS, moab::ParallelComm::partition_sets(), PCOMM, RETURN, and moab::Range::size().

◆ iMeshP_getNumOfTopo()

void iMeshP_getNumOfTopo ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iMeshP_PartHandle  part,
const iBase_EntitySetHandle  entity_set,
int  entity_topology,
int *  num_topo,
int *  err 
)

Return the number of entities of a given topology in both a part and an entity set.

Given a part handle, an entity set handle, and an entity topology, return the number of entities of the given topology that are in BOTH the given part AND the given entity set. This function is similar to iMesh_getNumOfTopo, but it also restricts the returned data with respect to its existence in the given part.

COMMUNICATION: None.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
part(In) The part being queried.
entity_set(In) Entity set handle for the entity set being queried; may be the root set.
entity_topology(In) Entity topology of the boundary entities; may be iMesh_ALL_TOPOLOGIES.
num_topo(Out) Number of entities of entity_topology in both part and entity_set.
err(Out) Error code.

Definition at line 827 of file iMeshP_MOAB.cpp.

834 {
835  Range r;
836  set_intersection_query( instance, part_handle, entity_set_handle, iBase_ALL_TYPES, entity_topology, r, err );
837  *num_topo = r.size();
838 }

References iBase_ALL_TYPES, set_intersection_query(), and moab::Range::size().

◆ iMeshP_getNumOfTopoAll()

void iMeshP_getNumOfTopoAll ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iBase_EntitySetHandle  entity_set,
int  entity_topology,
int *  num_topo,
int *  err 
)

Return the number of entities of a given topology in a partition.

Given a partition handle and an entity set (possibly the root set), return the global number of entities of a given entity topology in the partition and set. This function may require communication and, thus, must be called by all processes in the partition's communicator.

COMMUNICATION: Collective.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
entity_set(In) Entity set handle for the entity set being queried; may be the root set.
entity_topology(In) Requested entity topology; may be iMesh_ALL_TOPOLOGIES.
num_topo(Out) Number of entities with entity_topology in the partition and entity set.
err(Out) Error code.

Definition at line 607 of file iMeshP_MOAB.cpp.

613 {
614  ParallelComm* pcomm = PCOMM;
615  if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
616 
617  Range entities;
618  ErrorCode rval = get_entities( MOABI, itaps_cast< EntityHandle >( entity_set_handle ), iBase_ALL_TYPES,
619  entity_topology, entities );
620  int count = 0;
621  if( MB_SUCCESS == rval ) rval = count_owned( pcomm, entities, count );
622 
623  int vals[2] = { count, rval }, sums[2];
624  int ierr = MPI_Allreduce( vals, sums, 2, MPI_INT, MPI_SUM, pcomm->proc_config().proc_comm() );
625  assert( iBase_SUCCESS == 0 );
626  if( ierr || sums[1] ) RETURN( iBase_FAILURE );
627 
628  *num_topo = sums[0];
630 }

References count_owned(), entities, ERROR, ErrorCode, get_entities(), iBase_ALL_TYPES, iBase_FAILURE, iBase_SUCCESS, ierr, MB_SUCCESS, MOABI, PCOMM, moab::ProcConfig::proc_comm(), moab::ParallelComm::proc_config(), and RETURN.

◆ iMeshP_getNumOfType()

void iMeshP_getNumOfType ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iMeshP_PartHandle  part,
const iBase_EntitySetHandle  entity_set,
int  entity_type,
int *  num_type,
int *  err 
)

Return the number of entities of a given type in both a part and an entity set.

Given a part handle, an entity set handle, and an entity type, return the number of entities of the given type that are in BOTH the given part AND the given entity set. This function is similar to iMesh_getNumOfType, but it also restricts the returned data with respect to its existence in the given part.

COMMUNICATION: None.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
part(In) The part being queried.
entity_set(In) Entity set handle for the entity set being queried; may be the root set.
entity_type(In) Entity type of the boundary entities; may be iBase_ALL_TYPES.
num_type(Out) Number of entities of entity_type in both part and entity_set.
err(Out) Error code.

Definition at line 814 of file iMeshP_MOAB.cpp.

821 {
822  Range r;
823  set_intersection_query( instance, part_handle, entity_set_handle, entity_type, iMesh_ALL_TOPOLOGIES, r, err );
824  *num_type = r.size();
825 }

References iMesh_ALL_TOPOLOGIES, set_intersection_query(), and moab::Range::size().

◆ iMeshP_getNumOfTypeAll()

void iMeshP_getNumOfTypeAll ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iBase_EntitySetHandle  entity_set,
int  entity_type,
int *  num_type,
int *  err 
)

Return the number of entities of a given type in a partition.

Given a partition handle and an entity set (possibly the root set), return the global number of entities of a given entity type in the partition and set. This function may require communication and, thus, must be called by all processes in the partition's communicator.

COMMUNICATION: Collective.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
entity_set(In) Entity set handle for the entity set being queried.
entity_type(In) Requested entity type; may be iBase_ALL_TYPES.
num_type(Out) Number of entities of entity_type in the partition and entity set.
err(Out) Error code.

Definition at line 582 of file iMeshP_MOAB.cpp.

588 {
589  ParallelComm* pcomm = PCOMM;
590  if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
591 
592  Range entities;
593  ErrorCode rval = get_entities( MOABI, itaps_cast< EntityHandle >( entity_set_handle ), entity_type,
595  int count = 0;
596  if( MB_SUCCESS == rval ) rval = count_owned( pcomm, entities, count );
597 
598  int vals[2] = { count, rval }, sums[2];
599  int ierr = MPI_Allreduce( vals, sums, 2, MPI_INT, MPI_SUM, pcomm->proc_config().proc_comm() );
600  assert( iBase_SUCCESS == 0 );
601  if( ierr || sums[1] ) RETURN( iBase_FAILURE );
602 
603  *num_type = sums[0];
605 }

References count_owned(), entities, ERROR, ErrorCode, get_entities(), iBase_FAILURE, iBase_SUCCESS, ierr, iMesh_ALL_TOPOLOGIES, MB_SUCCESS, MOABI, PCOMM, moab::ProcConfig::proc_comm(), moab::ParallelComm::proc_config(), and RETURN.

◆ iMeshP_getNumPartBdryEnts()

void iMeshP_getNumPartBdryEnts ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iMeshP_PartHandle  part,
int  entity_type,
int  entity_topology,
iMeshP_Part  target_part_id,
int *  num_entities,
int *  err 
)

Return the number of entities on a part boundary.

Given a partition handle, a part handle, an entity type and topology, and a target part ID, return the number of entities of the given type and/or topology on the part boundary shared with the target part.

COMMUNICATION: None.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
part(In) The part being queried.
entity_type(In) Entity type of the boundary entities; may be iBase_ALL_TYPES.
entity_topology(In) Entity topology of the boundary entities; may be iMesh_ALL_TOPOLOGIES.
target_part_id(In) Part ID with which part is sharing the boundary entities; may be iMeshP_ALL_PARTS.
num_entities(Out) Number of part boundary entities shared by part and target_part_id.
err(Out) Error code.

Definition at line 749 of file iMeshP_MOAB.cpp.

757 {
758  Range entities;
759  ErrorCode rval = get_boundary_entities( PCOMM, itaps_cast< EntityHandle >( part_handle ), entity_type,
760  entity_topology, target_part_id, entities );CHKERR( rval, "failed to get boundary entities" );
761  *num_entities = entities.size();
763 }

References CHKERR, entities, ErrorCode, get_boundary_entities(), iBase_SUCCESS, PCOMM, and RETURN.

◆ iMeshP_getNumPartitions()

void iMeshP_getNumPartitions ( iMesh_Instance  instance,
int *  num_partitions,
int *  err 
)

Return the number of partitions associated with a mesh instance.

Given a mesh instance, return the number of partition handles associated with the mesh instance.

COMMUNICATION: None.

Parameters
instance(In) Mesh instance containing the partitions.
num_partitions(Out) Number of partitions associated with the mesh instance.
err(Out) Error code.

Definition at line 475 of file iMeshP_MOAB.cpp.

476 {
477  std::vector< ParallelComm* > pcomms;
478  ErrorCode rval = ParallelComm::get_all_pcomm( MOABI, pcomms );CHKERR( rval, "Internal error retreiving PComms" );
479 
480  std::vector< ParallelComm* >::iterator i;
481  *num_partitions_out = 0;
482  for( i = pcomms.begin(); i != pcomms.end(); ++i )
483  if( ( *i )->get_partitioning() ) ( *num_partitions_out )++;
484 
486 }

References CHKERR, ErrorCode, moab::ParallelComm::get_all_pcomm(), iBase_SUCCESS, MOABI, and RETURN.

◆ iMeshP_getNumPartNbors()

void iMeshP_getNumPartNbors ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iMeshP_PartHandle  part,
int  entity_type,
int *  num_part_nbors,
int *  err 
)

Return the number of parts that neighbor a given part.

Given a partition handle, a part handle, and an entity type, return the number of parts in the partition that neighbor the given part (i.e., that (1) have copies of entities of the given entity type owned by the given part or (2) own entities of the given entity type that are copied on the given part).

COMMUNICATION: None++.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
part(In) The part being queried.
entity_type(In) Entity type of the copied entities; may be iBase_ALL_TYPES.
num_part_nbors(Out) Number of parts neighboring the given part.
err(Out) Error code.

Definition at line 658 of file iMeshP_MOAB.cpp.

664 {
665  int junk1 = 1, junk2 = 1;
666  iMeshP_getNumPartNborsArr( instance, partition_handle, &part_handle, 1, entity_type, &num_part_nbors, &junk1,
667  &junk2, err );
668 }

References iMeshP_getNumPartNborsArr().

◆ iMeshP_getNumPartNborsArr()

void iMeshP_getNumPartNborsArr ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iMeshP_PartHandle parts,
int  parts_size,
int  entity_type,
int **  num_part_nbors,
int *  num_part_nbors_allocated,
int *  num_part_nbors_size,
int *  err 
)

Return the number of parts that neighbor given parts.

Given a partition handle, an array of part handles, and an entity type, return the number of parts in the partition that neighbor each of the given parts (i.e., that (1) have copies of entities of the given entity type owned by the given part or (2) own entities of the given entity type that are copied on the given part).

COMMUNICATION: None++.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
parts(In) Array of part handles for the parts being queried.
parts_size(In) Number of part handles in parts.
entity_type(In) Entity type of the copied entities; may be iBase_ALL_TYPES.
num_part_nbors(In/Out) Array of values specifying the number of part neighbors for each part in parts.
num_part_nbors_allocated(In/Out) Allocated size of num_part_nbors array.
num_part_nbors_size(Out) Occupied size of num_part_nbors array.
err(Out) Error code.

Definition at line 670 of file iMeshP_MOAB.cpp.

679 {
680  ParallelComm* pcomm = PCOMM;
681  if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
682 
683  ALLOC_CHECK_ARRAY( num_part_nbors, part_handles_size );
684 
686  ErrorCode rval;
687  for( int i = 0; i < part_handles_size; ++i )
688  {
689  EntityHandle h = itaps_cast< EntityHandle >( part_handles[i] );
690  rval = pcomm->get_part_neighbor_ids( h, neighbors, n );CHKERR( rval, "error getting neighbor ids" );
691  ( *num_part_nbors )[i] = n;
692  }
693 
694  KEEP_ARRAY( num_part_nbors );
696 }

References ALLOC_CHECK_ARRAY, CHKERR, ERROR, ErrorCode, moab::ParallelComm::get_part_neighbor_ids(), iBase_FAILURE, iBase_SUCCESS, KEEP_ARRAY, MAX_SHARING_PROCS, neighbors(), PCOMM, and RETURN.

Referenced by iMeshP_getNumPartNbors().

◆ iMeshP_getOwnerCopy()

void iMeshP_getOwnerCopy ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iBase_EntityHandle  entity,
iMeshP_Part owner_part_id,
iBase_EntityHandle owner_entity,
int *  err 
)

Get the entity handle of a copy of a given entity in its owner part.

Given a partition handle and an entity handle, return the (remote) entity handle of the copy of the entity in its owner part.

COMMUNICATION: None++.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
entity(In) Entity whose copy info is requested.
owner_part_id(Out) Part ID of the entity's owner part.
owner_entity(Out) (Remote) entity handle of the entity copy from the owner part.
err(Out) Error code.

Definition at line 1334 of file iMeshP_MOAB.cpp.

1340 {
1341  ParallelComm* pcomm = PCOMM;
1342  if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
1343 
1344  int id;
1345  EntityHandle h;
1346  ErrorCode rval = pcomm->get_owning_part( itaps_cast< EntityHandle >( entity_handle ), id, &h );CHKERR( rval, "Failed to get owner" );
1347  *owner_part_id = id;
1348  *owner_entity_handle = itaps_cast< iBase_EntityHandle >( h );
1349  RETURN( iBase_SUCCESS );
1350 }

References CHKERR, ERROR, ErrorCode, moab::ParallelComm::get_owning_part(), iBase_FAILURE, iBase_SUCCESS, PCOMM, and RETURN.

◆ iMeshP_getPartBdryEnts()

void iMeshP_getPartBdryEnts ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iMeshP_PartHandle  part,
int  entity_type,
int  entity_topology,
iMeshP_Part  target_part_id,
iBase_EntityHandle **  entities,
int *  entities_allocated,
int *  entities_size,
int *  err 
)

Return the entity handles of entities on a part boundary.

Given a partition handle, a part handle, an entity type and topology, and a target part ID, return the entity handles of entities of the given type and/or topology on the part boundary shared with the target part.

COMMUNICATION: None.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
part(In) The part being queried.
entity_type(In) Entity type of the boundary entities; may be iBase_ALL_TYPES.
entity_topology(In) Entity topology of the boundary entities; may be iMesh_ALL_TOPOLOGIES.
target_part_id(In) Part ID with which part is sharing the boundary entities; may be iMeshP_ALL_PARTS.
entities(In/Out) Array of entity handles for entities on the part boundary between part and target_part_id.
entities_allocated(In/Out) Allocated size of entities array.
entities_size(Out) Occupied size of entities array.
err(Out) Error code.

Definition at line 765 of file iMeshP_MOAB.cpp.

775 {
776  Range entities;
777  ErrorCode rval = get_boundary_entities( PCOMM, itaps_cast< EntityHandle >( part_handle ), entity_type,
778  entity_topology, target_part_id, entities );CHKERR( rval, "failed to get boundary entities" );
779  RANGE_TO_ITAPS_ARRAY( entities, entity_handles );
781 }

References CHKERR, entities, ErrorCode, get_boundary_entities(), iBase_SUCCESS, PCOMM, RANGE_TO_ITAPS_ARRAY, and RETURN.

◆ iMeshP_getPartHandleFromPartId()

void iMeshP_getPartHandleFromPartId ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
iMeshP_Part  part_id,
iMeshP_PartHandle part,
int *  err 
)

Obtain a part handle from a part ID.

Given a partition handle and a part ID, return the part handle associated with the part if the part is local; otherwise, return an error code.

COMMUNICATION: None.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
part_id(In) Part ID for the part being queried.
part(Out) Part handle associated with part_id.
err(Out) Error code.

Definition at line 402 of file iMeshP_MOAB.cpp.

407 {
408  int junk1 = 1, junk2;
409  iMeshP_getPartHandlesFromPartsIdsArr( instance, partition_handle, &part_id, 1, &part_handle, &junk1, &junk2, err );
410 }

References iMeshP_getPartHandlesFromPartsIdsArr().

◆ iMeshP_getPartHandlesFromPartsIdsArr()

void iMeshP_getPartHandlesFromPartsIdsArr ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iMeshP_Part part_ids,
const int  part_ids_size,
iMeshP_PartHandle **  parts,
int *  parts_allocated,
int *  parts_size,
int *  err 
)

Obtain part handles from part IDs.

Given a partition handle and an array of local part IDs, return the part handle for each part ID. If any part ID is not a valid part ID for a local part, an error is returned.

COMMUNICATION: None.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
part_ids(In) Array of part IDs for the parts being queried.
part_ids_size(In) Number of part IDs being queried.
parts(In/Out) Array of part handles associated with the part_ids.
parts_allocated(In/Out) Allocated size of parts array.
parts_size(Out) Occupied size of parts array.
err(Out) Error code.

Definition at line 434 of file iMeshP_MOAB.cpp.

442 {
443  ErrorCode rval;
444  ParallelComm* pcomm = PCOMM;
445  ALLOC_CHECK_ARRAY( part_handles, part_ids_size );
446  for( int i = 0; i < part_ids_size; ++i )
447  {
448  EntityHandle handle;
449  rval = pcomm->get_part_handle( part_ids[i], handle );CHKERR( rval, "error getting part handle" );
450  ( *part_handles )[i] = itaps_cast< iMeshP_PartHandle >( handle );
451  }
452  KEEP_ARRAY( part_handles );
454 }

References ALLOC_CHECK_ARRAY, CHKERR, ErrorCode, moab::ParallelComm::get_part_handle(), iBase_SUCCESS, KEEP_ARRAY, PCOMM, and RETURN.

Referenced by iMeshP_getPartHandleFromPartId().

◆ iMeshP_getPartIdFromPartHandle()

void iMeshP_getPartIdFromPartHandle ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iMeshP_PartHandle  part,
iMeshP_Part part_id,
int *  err 
)

Obtain a part ID from a part handle.

Given a partition handle and a local part handle, return the part ID. If the part handle is not a valid part handle for a local part, an error is returned.

COMMUNICATION: None.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
part(In) The part being queried.
part_id(Out) Part ID for part.
err(Out) Error code.

Definition at line 392 of file iMeshP_MOAB.cpp.

397 {
398  int junk1 = 1, junk2;
399  iMeshP_getPartIdsFromPartHandlesArr( instance, partition_handle, &part_handle, 1, &part_id, &junk1, &junk2, err );
400 }

References iMeshP_getPartIdsFromPartHandlesArr().

◆ iMeshP_getPartIdsFromPartHandlesArr()

void iMeshP_getPartIdsFromPartHandlesArr ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iMeshP_PartHandle parts,
const int  parts_size,
iMeshP_Part **  part_ids,
int *  part_ids_allocated,
int *  part_ids_size,
int *  err 
)

Obtain part IDs from part handles.

Given a partition handle and an array of local part handles, return the part ID for each part handle. If any part handle is not a valid part handle for a local part, an error is returned.

COMMUNICATION: None.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
parts(In) Array of part handles for the parts being queried.
parts_size(In) Number of part handles being queried.
part_ids(In/Out) Array of part IDs associated with the parts.
part_ids_allocated(In/Out) Allocated size of part_ids array.
part_ids_size(Out) Occupied size of part_ids array.
err(Out) Error code.

Definition at line 412 of file iMeshP_MOAB.cpp.

420 {
421  ErrorCode rval;
422  ParallelComm* pcomm = PCOMM;
423  ALLOC_CHECK_ARRAY( part_ids, part_handles_size );
424  for( int i = 0; i < part_handles_size; ++i )
425  {
426  int id;
427  rval = pcomm->get_part_id( itaps_cast< EntityHandle >( part_handles[i] ), id );
428  ( *part_ids )[i] = id;CHKERR( rval, "error getting part id" );
429  }
430  KEEP_ARRAY( part_ids );
432 }

References ALLOC_CHECK_ARRAY, CHKERR, ErrorCode, moab::ParallelComm::get_part_id(), iBase_SUCCESS, KEEP_ARRAY, PCOMM, and RETURN.

Referenced by iMeshP_getPartIdFromPartHandle().

◆ iMeshP_getPartitionComm()

void iMeshP_getPartitionComm ( iMesh_Instance  instance,
iMeshP_PartitionHandle  partition,
MPI_Comm *  communicator,
int *  err 
)

Return communicator associated with a partition.

Given a partition handle, return the communicator associated with it during its creation by iMeshP_createPartitionAll.

COMMUNICATION: None

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
communicator(Out) Communicator associated with the partition.
err(Out) Error code.

Definition at line 456 of file iMeshP_MOAB.cpp.

460 {
461  ParallelComm* pcomm = PCOMM;
462  if( !pcomm ) RETURN( iBase_FAILURE );
463  *communicator_out = pcomm->proc_config().proc_comm();
465 }

References iBase_FAILURE, iBase_SUCCESS, PCOMM, moab::ProcConfig::proc_comm(), moab::ParallelComm::proc_config(), and RETURN.

◆ iMeshP_getPartitions()

void iMeshP_getPartitions ( iMesh_Instance  instance,
iMeshP_PartitionHandle **  partitions,
int *  partitions_allocated,
int *  partitions_size,
int *  err 
)

Return the partition handles associated with a mesh instance.

Given a mesh instance, return all partition handles associated with the mesh instance.

COMMUNICATION: None.

Parameters
instance(In) Mesh instance containing the partitions.
partitions(In/Out) Array of partition handles associated with the mesh instance.
partitions_allocated(In/Out) Allocated size of partitions array.
partitions_size(Out) Occupied size of partitions array.
err(Out) Error code.

Definition at line 488 of file iMeshP_MOAB.cpp.

493 {
494  std::vector< ParallelComm* > pcomms;
495  ErrorCode rval = ParallelComm::get_all_pcomm( MOABI, pcomms );CHKERR( rval, "Internal error retreiving PComms" );
496 
497  std::vector< ParallelComm* >::iterator i;
498  int count = 0;
499  for( i = pcomms.begin(); i != pcomms.end(); ++i )
500  if( ( *i )->get_partitioning() ) ++count;
501  ALLOC_CHECK_ARRAY_NOFAIL( partition_handle, count );
502 
503  *partition_handle_size = 0;
504  for( i = pcomms.begin(); i != pcomms.end(); ++i )
505  if( ( *i )->get_partitioning() )
506  ( *partition_handle )[( *partition_handle_size )++] =
507  itaps_cast< iMeshP_PartitionHandle >( ( *i )->get_partitioning() );
508 
510 }

References ALLOC_CHECK_ARRAY_NOFAIL, CHKERR, ErrorCode, moab::ParallelComm::get_all_pcomm(), iBase_SUCCESS, MOABI, and RETURN.

◆ iMeshP_getPartNbors()

void iMeshP_getPartNbors ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iMeshP_PartHandle  part,
int  entity_type,
int *  num_part_nbors,
iMeshP_Part **  nbor_part_ids,
int *  nbor_part_ids_allocated,
int *  nbor_part_ids_size,
int *  err 
)

Return the parts that neighbor a given part.

Given a partition handle, a part handle, and an entity type, return the part IDs of parts that neighbor the given part (i.e., that (1) have copies of entities of the given entity type owned by the given part or (2) own entities of the given entity type that are copied on the given part).

COMMUNICATION: None++.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
part(In) The part being queried.
entity_type(In) Entity type of the copied entities; may be iBase_ALL_TYPES.
num_part_nbors(Out) Number of parts neighboring the given part.
nbor_part_ids(In/Out) Array of part IDs for part neighbors of part.
nbor_part_ids_allocated(In/Out) Allocated size of nbor_part_ids array.
nbor_part_ids_size(Out) Occupied size of nbor_part_ids array.
err(Out) Error code.

Definition at line 698 of file iMeshP_MOAB.cpp.

707 {
708  int junk1 = 1, junk2 = 1;
709  iMeshP_getPartNborsArr( instance, partition_handle, &part_handle, 1, entity_type, &num_part_nbors, &junk1, &junk2,
710  nbor_part_ids, nbor_part_ids_allocated, nbor_part_ids_size, err );
711 }

References iMeshP_getPartNborsArr().

◆ iMeshP_getPartNborsArr()

void iMeshP_getPartNborsArr ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iMeshP_PartHandle parts,
const int  parts_size,
int  entity_type,
int **  num_part_nbors,
int *  num_part_nbors_allocated,
int *  num_part_nbors_size,
iMeshP_Part **  nbor_part_ids,
int *  nbor_part_ids_allocated,
int *  nbor_part_ids_size,
int *  err 
)

Return the parts that neighbor given parts.

Given a partition handle, an array of part handles, and an entity type, return the part IDs of parts that neighbor the given parts (i.e., that (1) have copies of entities of the given entity type owned by the given part or (2) own entities of the given entity type that are copied on the given part).

COMMUNICATION: None++.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
parts(In) The parts being queried.
parts_size(In) The number of parts being queried.
entity_type(In) Entity type of the copied entities; may be iBase_ALL_TYPES.
num_part_nbors(In/Out) Array of values specifying the number of part neighbors for each part in parts.
num_part_nbors_allocated(In/Out) Allocated size of num_part_nbors array.
num_part_nbors_size(Out) Occupied size of num_part_nbors array.
nbor_part_ids(In/Out) Array of part IDs for part neighbors of part.
nbor_part_ids_allocated(In/Out) Allocated size of nbor_part_ids array.
nbor_part_ids_size(Out) Occupied size of nbor_part_ids array.
err(Out) Error code.

Definition at line 713 of file iMeshP_MOAB.cpp.

725 {
726  ParallelComm* pcomm = PCOMM;
727  if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
728 
729  ALLOC_CHECK_ARRAY( num_part_nbors, part_handles_size );
730 
731  std::vector< int > all_neighbors;
732  int n, pnbor[MAX_SHARING_PROCS];
733  ErrorCode rval;
734  for( int i = 0; i < part_handles_size; ++i )
735  {
736  EntityHandle h = itaps_cast< EntityHandle >( part_handles[i] );
737  rval = pcomm->get_part_neighbor_ids( h, pnbor, n );CHKERR( rval, "error getting neighbor ids" );
738  ( *num_part_nbors )[i] = n;
739  std::copy( pnbor, pnbor + n, std::back_inserter( all_neighbors ) );
740  }
741 
742  ALLOC_CHECK_ARRAY_NOFAIL( nbor_part_ids, all_neighbors.size() );
743  memcpy( *nbor_part_ids, &all_neighbors[0], sizeof( int ) * all_neighbors.size() );
744 
745  KEEP_ARRAY( num_part_nbors );
747 }

References ALLOC_CHECK_ARRAY, ALLOC_CHECK_ARRAY_NOFAIL, CHKERR, ERROR, ErrorCode, moab::ParallelComm::get_part_neighbor_ids(), iBase_FAILURE, iBase_SUCCESS, KEEP_ARRAY, MAX_SHARING_PROCS, PCOMM, and RETURN.

Referenced by iMeshP_getPartNbors().

◆ iMeshP_getRankOfPart()

void iMeshP_getRankOfPart ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iMeshP_Part  part_id,
int *  rank,
int *  err 
)

Return the process rank of a given part.

Given a partition handle and a part ID, return the process rank (with respect to the partition's communicator) of the process that owns the part. The part may be local or remote.

COMMUNICATION: None++.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
part_id(In) Part ID for the part being queried.
rank(Out) Process rank of part_id.
err(Out) Error code.

Definition at line 550 of file iMeshP_MOAB.cpp.

555 {
556  int junk1 = 1, junk2 = 1;
557  iMeshP_getRankOfPartArr( instance, partition_handle, &part_id, 1, &rank, &junk1, &junk2, err );
558 }

References iMeshP_getRankOfPartArr(), and rank.

◆ iMeshP_getRankOfPartArr()

void iMeshP_getRankOfPartArr ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iMeshP_Part part_ids,
const int  part_ids_size,
int **  ranks,
int *  ranks_allocated,
int *  ranks_size,
int *  err 
)

Return the process ranks of given parts.

Given a partition handle and an array of part IDs, return the process ranks (with respect to the partition's communicator) of the process that owns each part. The parts may be local or remote.

COMMUNICATION: None++.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
part_ids(In) Array of Part IDs for the parts being queried.
part_ids_size(In) The number of Part IDs in part_ids.
ranks(In/Out) Array of ranks for the Part Ids in part_ids.
ranks_allocated(In/Out) Allocated size of ranks array.
ranks_size(Out) Occupied size of ranks array.
err(Out) Error code.

Definition at line 560 of file iMeshP_MOAB.cpp.

568 {
569  ParallelComm* pcomm = PCOMM;
570  if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
571 
572  ALLOC_CHECK_ARRAY( rank, part_ids_size );
573  ErrorCode rval = MB_SUCCESS;
574  for( int i = 0; i < part_ids_size; ++i )
575  {
576  rval = pcomm->get_part_owner( part_ids[i], ( *rank )[i] );CHKERR( rval, "PComm::get_part_owner failed" );
577  }
578  KEEP_ARRAY( rank );
580 }

References ALLOC_CHECK_ARRAY, CHKERR, ERROR, ErrorCode, moab::ParallelComm::get_part_owner(), iBase_FAILURE, iBase_SUCCESS, KEEP_ARRAY, MB_SUCCESS, PCOMM, rank, and RETURN.

Referenced by iMeshP_getRankOfPart().

◆ iMeshP_ghostEntInfo()

void iMeshP_ghostEntInfo ( const iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
int *  ghost_rules_allocated,
int *  ghost_rules_size,
int **  ghost_type,
int **  bridge_type,
int **  num_layers,
int *  err 
)

Return information about all ghosting on a partition.

Return the ghosting rules established through calls to iMeshP_createGhostEntsAll.

COMMUNICATION: None.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition to be queried.
ghost_rules_allocated(In/Out) Allocated size of ghost_type, bridge_type and num_layers.
ghost_rules_size(Out) Occupied size of ghost_type, bridge_type and num_layers; equal to the number of ghosting rules currently registered in the partition.
ghost_type(Out) Entity type of ghost entities for each rule.
bridge_type(Out) Entity type of bridge entities for each rule.
num_layers(Out) Number of layers of ghosts in each rule.
err(Out) Error code.

Definition at line 1625 of file iMeshP_MOAB.cpp.

1633 {
1634  FIXME;
1636 }

References FIXME, iBase_NOT_SUPPORTED, and RETURN.

◆ iMeshP_initEntArrIter()

void iMeshP_initEntArrIter ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iMeshP_PartHandle  part,
const iBase_EntitySetHandle  entity_set,
const int  requested_entity_type,
const int  requested_entity_topology,
const int  requested_array_size,
iBase_EntityArrIterator entArr_iterator,
int *  err 
)

Create an entity array iterator for a given part and entity set.

Given a local part and an entity set, return an array iterator over the entities of the requested type and topology that are in both the part and the entity set. Iterator functionality for getNext, reset, and end is provided through the regular iMesh iterator functions iMesh_getNextEntArrIter, iMesh_resetEntArrIter, and iMesh_endEntArrIter, respectively.

COMMUNICATION: None.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
part(In) The part being queried.
entity_set(In) Entity set handle for the entity set being queried.
requested_entity_type(In) Type of entities to include in the iterator.
requested_entity_topology(In) Topology of entities to include in the iterator.
requested_array_size(In) The number of handles returned in each value of the iterator.
entArr_iterator(Out) Iterator returned from function.
err(Out) Error code.

Definition at line 1096 of file iMeshP_MOAB.cpp.

1105 {
1106  if( !entity_set_handle || entity_set_handle == part_handle )
1107  {
1108  iMesh_initEntArrIter( instance, part_handle, requested_entity_type, requested_entity_topology,
1109  requested_array_size,
1110  0, // TODO: update this function for "resilient" arg
1111  entArr_iterator, err );
1112  }
1113  else
1114  {
1115  unsigned flags;
1116  ErrorCode result = MOABI->get_meshset_options( itaps_cast< EntityHandle >( entity_set_handle ), flags );CHKERR( result, "Invalid entity set handle" );
1117  if( flags & MESHSET_ORDERED )
1118  *entArr_iterator = new SetIntersectIter< std::vector< EntityHandle > >(
1119  (iBase_EntityType)requested_entity_type, (iMesh_EntityTopology)requested_entity_topology,
1120  itaps_cast< EntityHandle >( entity_set_handle ), itaps_cast< EntityHandle >( part_handle ),
1121  requested_array_size );
1122  else
1123  *entArr_iterator =
1124  new SetIntersectIter< Range >( (iBase_EntityType)requested_entity_type,
1125  (iMesh_EntityTopology)requested_entity_topology,
1126  itaps_cast< EntityHandle >( entity_set_handle ),
1127  itaps_cast< EntityHandle >( part_handle ), requested_array_size );
1128  result = ( *entArr_iterator )->reset( MOABI );
1129  if( MB_SUCCESS != result ) delete *entArr_iterator;CHKERR( result, "iMesh_initEntArrIter: ERROR getting entities of proper type or topology." );
1130  RETURN( iBase_SUCCESS );
1131  }
1132 }

References CHKERR, ErrorCode, iBase_SUCCESS, iMesh_initEntArrIter, MB_SUCCESS, MOABI, and RETURN.

Referenced by iMeshP_initEntIter().

◆ iMeshP_initEntIter()

void iMeshP_initEntIter ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iMeshP_PartHandle  part,
const iBase_EntitySetHandle  entity_set,
const int  requested_entity_type,
const int  requested_entity_topology,
iBase_EntityIterator entity_iterator,
int *  err 
)

Create an entity iterator for a given part and entity set.

Given a local part and an entity set, return an iterator over the entities of the requested type and topology that are in both the part and the entity set. Iterator functionality for getNext, reset, and end is provided through the regular iMesh iterator functions iMesh_getNextEntIter, iMesh_resetEntIter, and iMesh_endEntIter, respectively.

COMMUNICATION: None.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
part(In) The part being queried.
entity_set(In) Entity set handle for the entity set being queried.
requested_entity_type(In) Type of entities to include in the iterator.
requested_entity_topology(In) Topology of entities to include in the iterator.
entity_iterator(Out) Iterator returned from function.
err(Out) Error code.

Definition at line 1082 of file iMeshP_MOAB.cpp.

1090 {
1091  iMeshP_initEntArrIter( instance, partition_handle, part_handle, entity_set_handle, requested_entity_type,
1092  requested_entity_topology, 1,
1093  reinterpret_cast< iBase_EntityArrIterator* >( entity_iterator ), err );
1094 }

References iMeshP_initEntArrIter().

◆ iMeshP_initPartBdryEntArrIter()

void iMeshP_initPartBdryEntArrIter ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iMeshP_PartHandle  part,
int  entity_type,
int  entity_topology,
int  array_size,
iMeshP_Part  target_part_id,
iBase_EntityArrIterator entity_iterator,
int *  err 
)

Initialize an array iterator over a specified part boundary.

Given a partition handle, a part handle, and a target part ID, return an array iterator over all entities of a given entity type and topology along the part boundary shared with the target part. Iterator functionality for getNext, reset, and end is provided through the regular iMesh iterator functions iMesh_getNextEntArrIter, iMesh_resetEntArrIter, and iMesh_endEntArrIter, respectively.

COMMUNICATION: None.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
part(In) The part being queried.
entity_type(In) Entity type of the boundary entities; may be iBase_ALL_TYPES.
entity_topology(In) Entity topology of the boundary entities; may be iMesh_ALL_TOPOLOGIES.
array_size(In) Size of chunks of handles returned for each value of the iterator.
target_part_id(In) Part ID with which part is sharing the boundary entities; may be iMeshP_ALL_PARTS.
entity_iterator(Out) Iterator returned by the function.
err(Out) Error code.

Definition at line 796 of file iMeshP_MOAB.cpp.

805 {
806  *entity_iterator =
807  new PartBoundaryIter( PCOMM, itaps_cast< EntityHandle >( part_handle ), (iBase_EntityType)entity_type,
808  (iMesh_EntityTopology)entity_topology, nbor_part_id, array_size );
809  ErrorCode result = ( *entity_iterator )->reset( MOABI );
810  if( MB_SUCCESS != result ) delete *entity_iterator;CHKERR( result, "iMesh_initEntArrIter: ERROR getting entities of proper type or topology." );
812 }

References CHKERR, ErrorCode, iBase_SUCCESS, MB_SUCCESS, MOABI, PCOMM, and RETURN.

Referenced by iMeshP_initPartBdryEntIter().

◆ iMeshP_initPartBdryEntIter()

void iMeshP_initPartBdryEntIter ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iMeshP_PartHandle  part,
int  entity_type,
int  entity_topology,
iMeshP_Part  target_part_id,
iBase_EntityIterator entity_iterator,
int *  err 
)

Initialize an iterator over a specified part boundary.

Given a partition handle, a part handle, and a target part ID, return an iterator over all entities of a given entity type and topology along the part boundary shared with the target part. Iterator functionality for getNext, reset, and end is provided through the regular iMesh iterator functions iMesh_getNextEntIter, iMesh_resetEntIter, and iMesh_endEntIter, respectively.

COMMUNICATION: None.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
part(In) The part being queried.
entity_type(In) Entity type of the boundary entities; may be iBase_ALL_TYPES.
entity_topology(In) Entity topology of the boundary entities; may be iMesh_ALL_TOPOLOGIES.
target_part_id(In) Part ID with which part is sharing the boundary entities; may be iMeshP_ALL_PARTS.
entity_iterator(Out) Iterator returned by the function.
err(Out) Error code.

Definition at line 783 of file iMeshP_MOAB.cpp.

791 {
792  iMeshP_initPartBdryEntArrIter( instance, partition_handle, part_handle, entity_type, entity_topology, 1,
793  nbor_part_id, reinterpret_cast< iBase_EntityArrIterator* >( entity_iterator ), err );
794 }

References iMeshP_initPartBdryEntArrIter().

◆ iMeshP_iPushTags()

void iMeshP_iPushTags ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
iBase_TagHandle  source_tag,
iBase_TagHandle  dest_tag,
int  entity_type,
int  entity_topo,
iMeshP_RequestHandle request,
int *  err 
)

Asynchronously send tag data for given entity types and topologies.

Send tag information for shared entities of specified type and topology. The tag data is "pushed" from the owner entities to all copies. This version operates on all shared entities of specified type and topology (or all types/topologies if iBase_ALL_TYPES/iMesh_ALL_TOPOLOGIES are given). This function assumes tag handles given on various calling parts are consistent; i.e. they have the same name, data type, size, etc. This call does not block; applications should call iMeshP_waitForRequest (or a similar wait function) to block until this push is completed.

COMMUNICATION: point-to-point, non-blocking.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
source_tag(In) Tag handle for the sending entities.
dest_tag(In) Tag handle for the receiving entities.
entity_type(In) Tag data is exchanged only for this entity type.
entity_topo(In) Tag data is exchanged only for this entity topology.
request(Out) The iMeshP request handle returned.
err(Out) Error code.

Definition at line 1572 of file iMeshP_MOAB.cpp.

1580 {
1581  FIXME;
1583 }

References FIXME, iBase_NOT_SUPPORTED, and RETURN.

◆ iMeshP_iPushTagsEnt()

void iMeshP_iPushTagsEnt ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
iBase_TagHandle  source_tag,
iBase_TagHandle  dest_tag,
const iBase_EntityHandle entities,
int  entities_size,
iMeshP_RequestHandle request,
int *  err 
)

Asynchronously send tag data for individual entities.

Send tag information for the specified entities. The tag data is "pushed" from the owner entities to all copies. This function assumes tag handles given on various calling parts are consistent; i.e. they have the same name, data type, size, etc. This call does not block; applications should call iMeshP_waitForRequest (or a similar wait function) to block until this push is completed.

COMMUNICATION: point-to-point, non-blocking.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
source_tag(In) Tag handle for the sending entities.
dest_tag(In) Tag handle for the receiving entities.
entities(In) Owned entities for which to send data.
entities_size(In) The number of entities for which to send data.
request(Out) The iMeshP request handle returned.
err(Out) Error code.

Definition at line 1585 of file iMeshP_MOAB.cpp.

1593 {
1594  FIXME;
1596 }

References FIXME, iBase_NOT_SUPPORTED, and RETURN.

◆ iMeshP_isEntOwner()

void iMeshP_isEntOwner ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iMeshP_PartHandle  part,
const iBase_EntityHandle  entity,
int *  is_owner,
int *  err 
)

Test for entity ownership with respect to a part.

Given a partition handle, a part handle, and an entity handle, return a flag indicating whether the entity is owned by the part.

COMMUNICATION: None.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
part(In) The part being queried.
entity(In) Entity whose ownership is being tested.
is_owner(Out) Flag indicating whether the given part is the owner of the given entity.
err(Out) Error code.

Definition at line 1169 of file iMeshP_MOAB.cpp.

1175 {
1176  int junk1 = 1, junk2 = 1;
1177  iMeshP_isEntOwnerArr( instance, partition_handle, part_handle, &entity_handle, 1, &is_owner, &junk1, &junk2, err );
1178 }

References iMeshP_isEntOwnerArr().

◆ iMeshP_isEntOwnerArr()

void iMeshP_isEntOwnerArr ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iMeshP_PartHandle  part,
const iBase_EntityHandle entities,
const int  entities_size,
int **  is_owner,
int *  is_owner_allocated,
int *  is_owner_size,
int *  err 
)

Test for entity ownership of many entities with respect to a part.

Given a partition handle, a part handle, and an array of entity handles, return for each entity handle a flag indicating whether the entity is owned by the part.

COMMUNICATION: None.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
part(In) The part being queried.
entities(In) Entities whose ownership is being tested.
entities_size(In) Number of entity handles in entities.
is_owner(Out) Flag for each entity indicating whether the given part is the owner of the given entity.
is_owner_allocated(In/Out) Allocated size of is_owner array.
is_owner_size(Out) Occupied size of is_owner array.
err(Out) Error code.

Definition at line 1180 of file iMeshP_MOAB.cpp.

1189 {
1190  ErrorCode rval;
1191  ParallelComm* pcomm = PCOMM;
1192  if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
1193 
1194  int id;
1195  rval = pcomm->get_part_id( itaps_cast< EntityHandle >( part_handle ), id );CHKERR( rval, "error getting part id" );
1196 
1197  ALLOC_CHECK_ARRAY( is_owner, entity_handles_size );
1198  *is_owner_size = entity_handles_size;
1199 
1200  int owner;
1201  for( int i = 0; i < entity_handles_size; ++i )
1202  {
1203  rval = pcomm->get_owner( itaps_cast< EntityHandle >( entity_handles[i] ), owner );CHKERR( rval, "error getting owner" );
1204  ( *is_owner )[i] = ( owner == id );
1205  }
1206 
1207  KEEP_ARRAY( is_owner );
1208  RETURN( iBase_SUCCESS );
1209 }

References ALLOC_CHECK_ARRAY, CHKERR, ERROR, ErrorCode, moab::ParallelComm::get_owner(), moab::ParallelComm::get_part_id(), iBase_FAILURE, iBase_SUCCESS, KEEP_ARRAY, PCOMM, and RETURN.

Referenced by iMeshP_isEntOwner().

◆ iMeshP_loadAll()

void iMeshP_loadAll ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iBase_EntitySetHandle  entity_set,
const char *  name,
const char *  options,
int *  err,
int  name_len,
int  options_len 
)

Populate a mesh instance and a partition by reading data from files.

Before calling iMeshP_loadAll, the application creates both a mesh instance and a partition handle. iMeshP_loadAll then reads the specified file, inserts entities into the mesh instance, constructs parts within the partition, and inserts entities into the parts. Options allow n>=1 files on p processes. Optional capabilities of iMeshP_loadAll include computing an initial partition (e.g., if a serial mesh file without part assignments is read) and creating ghost entities as requested by the application; the availability of these options is implementation dependent.

COMMUNICATION: Collective.

Parameters
instance(In) Mesh instance to contain the data.
partition(In) The newly populated partition.
entity_set(In) Set to which the mesh will be added.
name(in) File name from which mesh data is read.
options(In) Implementation-specific options string.
err(Out) Error code.
name_len(In) Length of the file name character string.
options_len(In) Length of the options character string.

Definition at line 1677 of file iMeshP_MOAB.cpp.

1685 {
1686  ErrorCode rval;
1687 
1688  // create partition set if user didn't give us one.
1689  EntityHandle partitioning;
1690  if( partition )
1691  {
1692  partitioning = itaps_cast< EntityHandle >( partition );
1693  }
1694  else
1695  {
1696  rval = MOABI->create_meshset( MESHSET_SET, partitioning );CHKERR( rval, "failed to create meshset" );
1697  }
1698 
1699  // get ParallelComm for partition
1700  MPI_Comm default_comm = MPI_COMM_WORLD;
1701  ParallelComm* pcomm = ParallelComm::get_pcomm( MOABI, partitioning, &default_comm );
1702  if( !pcomm )
1703  {
1704  RETURN( iBase_FAILURE );
1705  }
1706 
1707  // add necessary values to options string
1708  std::string opt = std::string( options, options + options_len );
1709 
1710  if( append_option( opt, "moab:PARALLEL" ) )
1711  {
1712  // only append these other ones if the parallel option wasn't there originally
1713  append_option( opt, "moab:PARTITION_DISTRIBUTE" );
1714  append_option( opt, "moab:PARALLEL_RESOLVE_SHARED_ENTS" );
1715  std::ostringstream id;
1716  id << pcomm->get_id();
1717  append_option( opt, "moab:PCOMM", id.str().c_str() );
1718  }
1719 
1720  // load the file
1721  iMesh_load( instance, entity_set_handle, name, opt.c_str(), err, name_len, opt.length() );
1722  if( *err ) return;
1723 
1724  rval = pcomm->collective_sync_partition();CHKERR( rval, "collective sync failed" );
1725  RETURN( iBase_SUCCESS );
1726 }

References append_option(), CHKERR, moab::ParallelComm::collective_sync_partition(), ErrorCode, moab::ParallelComm::get_id(), moab::ParallelComm::get_pcomm(), iBase_FAILURE, iBase_SUCCESS, iMesh_load, MESHSET_SET, MOABI, MPI_COMM_WORLD, and RETURN.

◆ iMeshP_migrateEntity()

void iMeshP_migrateEntity ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
iMeshP_PartHandle  part,
iBase_EntityHandle  local_entity,
iMeshP_RequestHandle request,
int *  err 
)

Request in-migration of an entity and its upward adjacencies.

This function is a "pull" migration, where a part requests to become the owner of an entity that is owned by another part (so that the part has the right to modify the entity). The requested entity must be on the part boundary and is identified by a local handle (i.e., an entity part-boundary copy). This operation may require multiple rounds of communication, and at some times, certain entities may be locked (unavailable for local modification) while info about their remote copies is still in question. Tags and parallel set membership are migrated as well as the appropriate adjacency info. An iMeshP request handle is returned.

COMMUNICATION: point-to-point, non-blocking, pull.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
part(In) The part to which the entity is migrated.
local_entity(In) The local entity copy for the entity to be migrated.
request(Out) The iMeshP request handle returned.
err(Out) Error code.

Definition at line 1457 of file iMeshP_MOAB.cpp.

1463 {
1464  FIXME;
1466 }

References FIXME, iBase_NOT_SUPPORTED, and RETURN.

◆ iMeshP_pollForRequests()

void iMeshP_pollForRequests ( iMesh_Instance  instance,
iMeshP_PartitionHandle  partition,
iMeshP_RequestHandle **  requests_completed,
int *  requests_completed_allocated,
int *  requests_completed_size,
int *  err 
)

Poll for outstanding requests.

Check for outstanding requests from other parts, handle any requests found, and return an array of requests that have been handled. If the array has a size allocated already, then the implementation stops working when it has generated that many completed requests, even if there are more requests waiting.

COMMUNICATION: non-blocking; point-to-point.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
requests_completed(Out) Requests that were completed.
requests_completed_allocated(In/Out) Allocated size of requests_completed.
requests_completed_size(Out) Occupied size of requests_completed.
err(Out) Error code.

Definition at line 1387 of file iMeshP_MOAB.cpp.

1393 {
1394  FIXME;
1396 }

References FIXME, iBase_NOT_SUPPORTED, and RETURN.

◆ iMeshP_pushTags()

void iMeshP_pushTags ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
iBase_TagHandle  source_tag,
iBase_TagHandle  dest_tag,
int  entity_type,
int  entity_topo,
int *  err 
)

Synchronously send tag data for given entity types and topologies.

Send tag information for shared entities of specified type and topology. The tag data is "pushed" from the owner entities to all copies. This version operates on all shared entities of specified type and topology (or all types/topologies if iBase_ALL_TYPES/iMesh_ALL_TOPOLOGIES are given). This function assumes tag handles given on various calling parts are consistent; i.e. they have the same name, data type, size, etc. This call blocks until communication is completed.

COMMUNICATION: point-to-point, blocking.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
source_tag(In) Tag handle for the sending entities.
dest_tag(In) Tag handle for the receiving entities.
entity_type(In) Tag data is exchanged only for this entity type.
entity_topo(In) Tag data is exchanged only for this entity topology.
err(Out) Error code.

Definition at line 1516 of file iMeshP_MOAB.cpp.

1523 {
1524  ParallelComm* pcomm = PCOMM;
1525  DimensionPair types;
1526  if( entity_topo != iMesh_ALL_TOPOLOGIES )
1527  types.first = types.second = mb_topology_table[entity_topo];
1528  else if( entity_type != iBase_ALL_TYPES )
1529  // types = CN::TypeDimensionMap[entity_type];
1530  types = CN::getDimPair( entity_type );
1531  else
1532  {
1533  types.first = MBVERTEX;
1534  types.second = MBENTITYSET;
1535  --types.second;
1536  }
1537 
1538  std::vector< Tag > src_tags( 1, itaps_cast< Tag >( source_tag ) );
1539  std::vector< Tag > dst_tags( 1, itaps_cast< Tag >( dest_tag ) );
1540 
1541  ErrorCode rval;
1542  Range entities;
1543  for( EntityType t = types.first; t <= types.second; ++t )
1544  {
1545  rval = MOABI->get_entities_by_type_and_tag( 0, t, &src_tags[0], 0, 1, entities, Interface::UNION );CHKERR( rval, "error getting entities to push" );
1546  }
1547 
1548  rval = pcomm->exchange_tags( src_tags, dst_tags, entities );CHKERR( rval, "tag data communication failed" );
1549  RETURN( iBase_SUCCESS );
1550 }

References CHKERR, entities, ErrorCode, moab::ParallelComm::exchange_tags(), moab::CN::getDimPair(), iBase_ALL_TYPES, iBase_SUCCESS, iMesh_ALL_TOPOLOGIES, mb_topology_table, MBENTITYSET, MBVERTEX, MOABI, PCOMM, RETURN, t, and moab::Interface::UNION.

◆ iMeshP_pushTagsEnt()

void iMeshP_pushTagsEnt ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
iBase_TagHandle  source_tag,
iBase_TagHandle  dest_tag,
const iBase_EntityHandle entities,
int  entities_size,
int *  err 
)

Synchronously send tag data for individual entities.

Send tag information for the specified entities. The tag data is "pushed" from the owner entities to all copies. This function assumes tag handles given on various calling parts are consistent; i.e. they have the same name, data type, size, etc. This call blocks until communication is completed.

COMMUNICATION: point-to-point, blocking.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
source_tag(In) Tag handle for the sending entities.
dest_tag(In) Tag handle for the receiving entities.
entities(In) Owned entities for which to send data.
entities_size(In) The number of entities for which to send data.
err(Out) Error code.

Definition at line 1552 of file iMeshP_MOAB.cpp.

1559 {
1560 
1561  Range range;
1562  const EntityHandle* ents = itaps_cast< const EntityHandle* >( entities );
1563  std::copy( ents, ents + entities_size, range_inserter( range ) );
1564 
1565  std::vector< Tag > src_tags( 1, itaps_cast< Tag >( source_tag ) );
1566  std::vector< Tag > dst_tags( 1, itaps_cast< Tag >( dest_tag ) );
1567  ParallelComm* pcomm = PCOMM;
1568  ErrorCode rval = pcomm->exchange_tags( src_tags, dst_tags, range );CHKERR( rval, "tag data communication failed" );
1569  RETURN( iBase_SUCCESS );
1570 }

References CHKERR, entities, ErrorCode, moab::ParallelComm::exchange_tags(), iBase_SUCCESS, PCOMM, and RETURN.

◆ iMeshP_replaceOnPartBdry()

void iMeshP_replaceOnPartBdry ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iBase_EntityHandle old_entities,
const int  old_entities_size,
const iBase_EntityHandle new_entities,
const int  new_entities_size,
const int *  offset,
const int  offset_size,
int *  err 
)

Replace entities on the part boundary.

This function performs changes on the part boundary where the calling application can ensure that things are done identically on both sides and that the arguments are passed in an order that can be matched. (Specifically, matching new entities should appear in the same order in the call array.) An example is creation of new boundary edges during edge splitting. Communication here could be a two-way push-and-forget, or some variant on push-and-confirm. CHANGES: At Onkar's suggestion, added an offset array (similar to array adjacency requests) so that a single call can easily handle coordination with multiple entities on part-boundary.

COMMUNICATION: point-to-point, non-blocking, push-and-forget.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
old_entities(In) The entities to be replaced.
old_entities_size(In) The number of entities to be replaced.
new_entities(In) The entities that replace the old entities.
new_entities_size(In) The number of entities in new_entities.
offset(In) Index into new_entities; old_entities[i] is replaced by new_entities[offset[i]] to new_entities[offset[i+1]-1].
offset_size(In) The number of entries in offset.
err(Out) Error code.

Definition at line 1474 of file iMeshP_MOAB.cpp.

1483 {
1484  FIXME;
1486 }

References FIXME, iBase_NOT_SUPPORTED, and RETURN.

◆ iMeshP_rmvGhostOf()

void iMeshP_rmvGhostOf ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iMeshP_Part  target_part_id,
iBase_EntityHandle  copy_to_purge,
int *  err 
)

Remove ghost copies of individual entities from other parts.

Given an entity and a target part, remove the ghost copy of the entity on the target part.

Communication is push-and-forget; as such, no request handle is needed. The remote part will clean up the closure of the removed ghost as appropriate during deletion.

COMMUNICATION: point-to-point, non-blocking, push-and-forget.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
target_part_id(In) The part to lose the ghost.
copy_to_purge(In) The entity whose ghost is removed from target_part_id.
err(Out) Error code.

Definition at line 1499 of file iMeshP_MOAB.cpp.

1504 {
1505  FIXME;
1507 }

References FIXME, iBase_NOT_SUPPORTED, and RETURN.

◆ iMeshP_saveAll()

void iMeshP_saveAll ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iBase_EntitySetHandle  entity_set,
const char *  name,
const char *  options,
int *  err,
const int  name_len,
int  options_len 
)

Write data from a mesh instance and a partition to files.

iMeshP_saveAll writes mesh and partition data to the specified file. Options allow n>=1 files on p processes.

COMMUNICATION: Collective.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being saved.
entity_set(In) Set from which data will be saved.
name(in) File name to which mesh data is written.
options(In) Implementation-specific options string.
err(Out) Error code.
name_len(In) Length of the file name character string.
options_len(In) Length of the options character string.

Definition at line 1728 of file iMeshP_MOAB.cpp.

1736 {
1737  EntityHandle set;
1738  set = entity_set_handle ? itaps_cast< EntityHandle >( entity_set_handle ) : itaps_cast< EntityHandle >( partition );
1739  iMesh_save( instance, itaps_cast< iBase_EntitySetHandle >( set ), name, options, err, name_len, options_len );
1740 }

References iMesh_save.

◆ iMeshP_syncMeshAll()

void iMeshP_syncMeshAll ( iMesh_Instance  instance,
iMeshP_PartitionHandle  partition,
int *  err 
)

Indicate completion of mesh modification.

Calling this function indicates that the user is finished with mesh modification for now. With mesh modification complete, the implementation can update ghost, partition, boundary, and other information to re-establish a valid distributed mesh. This function waits for all message traffic to clear and rebuilds ghost information that was allowed to go obsolete during mesh modification.

COMMUNICATION: collective.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
err(Out) Error code.

Definition at line 1509 of file iMeshP_MOAB.cpp.

1510 {
1511  ParallelComm* pcomm = PCOMM;
1512  ErrorCode rval = pcomm->resolve_shared_ents( itaps_cast< EntityHandle >( partition_handle ), -1, -1 );CHKERR( rval, "update failed" );
1513  RETURN( iBase_SUCCESS );
1514 }

References CHKERR, ErrorCode, iBase_SUCCESS, PCOMM, moab::ParallelComm::resolve_shared_ents(), and RETURN.

◆ iMeshP_syncPartitionAll()

void iMeshP_syncPartitionAll ( iMesh_Instance  instance,
iMeshP_PartitionHandle  partition,
int *  err 
)

Update a partition after parts have been added.

This function gives the implementation an opportunity to locally store info about the partition so that queries on the partition can be performed without synchronous communication. This function must be called after all parts have been added to the partition and after changes to the partition (e.g., due to load balancing). Values that are precomputed by syncPartitionAll include:

  • the total number of parts in a partition;
  • the mapping between part IDs and processes; and
  • updated remote entity handle information.

COMMUNICATION: Collective.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being updated.
err(Out) Error code.

Definition at line 467 of file iMeshP_MOAB.cpp.

468 {
469  ParallelComm* pcomm = PCOMM;
470  if( !pcomm ) ERROR( iBase_FAILURE, "No PComm" );
471  ErrorCode rval = pcomm->collective_sync_partition();CHKERR( rval, "collective sync failed" );
473 }

References CHKERR, moab::ParallelComm::collective_sync_partition(), ERROR, ErrorCode, iBase_FAILURE, iBase_SUCCESS, PCOMM, and RETURN.

◆ iMeshP_testRequest()

void iMeshP_testRequest ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
iMeshP_RequestHandle  request,
int *  completed,
int *  err 
)

Test whether a specific request has completed.

Given an iMeshP_RequestHandle, test whether the request has completed. This function will not wait until the request completes; it will only return the completion status (complete = 1 or 0).

COMMUNICATION: None.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
request(In) iMeshP request for whose completion we should test.
completed(Out) Flag indicating whether (1) or not (0) the given request has completed.
err(Out) Error code.

Definition at line 1381 of file iMeshP_MOAB.cpp.

1382 {
1383  FIXME;
1385 }

References FIXME, iBase_NOT_SUPPORTED, and RETURN.

◆ iMeshP_updateVtxCoords()

void iMeshP_updateVtxCoords ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
const iBase_EntityHandle  local_vertex,
int *  err 
)

Update vertex coordinates for vertex copies.

For a given vertex, update its copies with the vertex's coordinates. This function assumes that a local vertex's coordinates were updated through a call to iMesh_setVtxCoords. This function then updates all copies of the vertex with the updated coordinates. The communication here is push-and-forget; as such, no request handle needs to be returned.

COMMUNICATION: point-to-point, non-blocking, push-and-forget.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
local_vertex(In) The vertex whose copies should be updated.
err(Out) Error code.

Definition at line 1468 of file iMeshP_MOAB.cpp.

1469 {
1470  FIXME;
1472 }

References FIXME, iBase_NOT_SUPPORTED, and RETURN.

◆ iMeshP_waitForAllRequests()

void iMeshP_waitForAllRequests ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
iMeshP_RequestHandle requests,
int  requests_size,
int *  err 
)

Wait for all of the specified iMeshP requests to complete.

Given an array of iMeshP_RequestHandles, wait for all of the requests to complete.

COMMUNICATION: Blocking point-to-point.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
requests(In) iMeshP requests for which we wait until completion.
requests_size(In) Number of requests in requests.
err(Out) Error code.

Definition at line 1363 of file iMeshP_MOAB.cpp.

1364 {
1365  FIXME;
1367 }

References FIXME, iBase_NOT_SUPPORTED, and RETURN.

◆ iMeshP_waitForAnyRequest()

void iMeshP_waitForAnyRequest ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
iMeshP_RequestHandle requests,
int  requests_size,
int *  index,
int *  err 
)

Wait for any of the specified iMeshP requests to complete.

Given an array of iMeshP_RequestHandles, wait for any one of the requests to complete.

COMMUNICATION: Blocking point-to-point.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
requests(In) iMeshP requests for which we wait until one request completes.
requests_size(In) Number of requests in requests.
index(Out) Index of the request that completed.
err(Out) Error code.

Definition at line 1352 of file iMeshP_MOAB.cpp.

1358 {
1359  FIXME;
1361 }

References FIXME, iBase_NOT_SUPPORTED, and RETURN.

◆ iMeshP_waitForRequest()

void iMeshP_waitForRequest ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
iMeshP_RequestHandle  request,
int *  err 
)

Wait for a specific iMeshP request to complete.

Given an iMeshP_RequestHandle, wait for the request to complete.

COMMUNICATION: Blocking point-to-point.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
request(In) iMeshP request for whose completion we should wait.
err(Out) Error code.

◆ iMeshP_waitForRequestEnt()

void iMeshP_waitForRequestEnt ( iMesh_Instance  instance,
const iMeshP_PartitionHandle  partition,
iMeshP_RequestHandle  request,
iBase_EntityHandle **  out_entities,
int *  out_entities_allocated,
int *  out_entities_size,
int *  err 
)

Wait for a specific request to complete; return entities received.

Given an iMeshP_RequestHandle, wait for the request to complete. Return entities for which information was received.

COMMUNICATION: Blocking point-to-point.

Parameters
instance(In) Mesh instance containing the partition.
partition(In) The partition being queried.
request(In) iMeshP request for whose completion we should wait.
out_entities(Out) Entities for which information was received.
out_entities_allocated(In/Out) Allocated size of out_entities.
out_entities_size(Out) Occupied size of out_entities.
err(Out) Error code.

Definition at line 1369 of file iMeshP_MOAB.cpp.

1376 {
1377  FIXME;
1379 }

References FIXME, iBase_NOT_SUPPORTED, and RETURN.