MOAB: Mesh Oriented datABase  (version 5.4.1)
MBMesquite::MsqIMeshP Class Reference

Mesquite iMesh Adapter. More...

#include <MsqIMeshP.hpp>

+ Inheritance diagram for MBMesquite::MsqIMeshP:
+ Collaboration diagram for MBMesquite::MsqIMeshP:

Public Member Functions

 MsqIMeshP ()
virtual ~MsqIMeshP ()
 MsqIMeshP (iMesh_Instance imesh, iMeshP_PartitionHandle partition, iBase_EntitySetHandle meshset, iBase_EntityType element_dimension, MsqError &err, const iBase_TagHandle *fixed_tag=0, const iBase_TagHandle *slaved_tag=0)
 MsqIMeshP (iMesh_Instance imesh, iMeshP_PartitionHandle partition, iBase_EntityType element_dimension, MsqError &err, const iBase_TagHandle *fixed_tag=0, const iBase_TagHandle *slaved_tag=0)
virtual void vertices_get_global_id (const VertexHandle vert_array[], size_t gid[], size_t num_vtx, MsqError &err)
virtual void vertices_get_processor_id (const VertexHandle vert_array[], int pid[], size_t num_vtx, MsqError &err)

Protected Attributes

iMeshP_PartitionHandle partitionInstance

Detailed Description

Mesquite iMesh Adapter.

Adpater for interfacing parallel Mesquite with an application that provides the ITAPS iMeshP interface for interacting with mesh data.

Definition at line 50 of file MsqIMeshP.hpp.


Constructor & Destructor Documentation

Definition at line 72 of file MsqIMeshP.cpp.

{}
MBMesquite::MsqIMeshP::MsqIMeshP ( iMesh_Instance  imesh,
iMeshP_PartitionHandle  partition,
iBase_EntitySetHandle  meshset,
iBase_EntityType  element_dimension,
MsqError err,
const iBase_TagHandle fixed_tag = 0,
const iBase_TagHandle slaved_tag = 0 
)

Definition at line 51 of file MsqIMeshP.cpp.

    : MsqIMesh( mesh, meshset, type, err, fixed_tag, slaved_tag ), partitionInstance( partition )
{
}
MBMesquite::MsqIMeshP::MsqIMeshP ( iMesh_Instance  imesh,
iMeshP_PartitionHandle  partition,
iBase_EntityType  element_dimension,
MsqError err,
const iBase_TagHandle fixed_tag = 0,
const iBase_TagHandle slaved_tag = 0 
)

Definition at line 62 of file MsqIMeshP.cpp.

    : MsqIMesh( mesh, element_dimension, err, fixed_tag, slaved_tag ), partitionInstance( partition )
{
}

Member Function Documentation

void MBMesquite::MsqIMeshP::vertices_get_global_id ( const VertexHandle  vert_array[],
size_t  gid[],
size_t  num_vtx,
MsqError err 
) [virtual]

Get global ids for given vertices.

Implements MBMesquite::ParallelMesh.

Definition at line 76 of file MsqIMeshP.cpp.

References iMeshP_getEntOwnerPart, iMeshP_getLocalParts, iMeshP_getOwnerCopy, iMeshP_getPartIdFromPartHandle, iMeshP_getRankOfPart, MBMesquite::MsqIMesh::meshInstance, partitionInstance, and rank.

{
    int itaps_err;
    // get a local part id
    iMeshP_PartHandle* parts = 0;
    int parts_allocated      = 0;
    int parts_size           = 0;
    iMeshP_getLocalParts( meshInstance, partitionInstance, &parts, &parts_allocated, &parts_size, &itaps_err );
    iMeshP_Part part_id;
    iMeshP_getPartIdFromPartHandle( meshInstance, partitionInstance, parts[0], &part_id, &itaps_err );
    if( parts_allocated ) free( parts );
    // get rank of local part
    int rank;
    iMeshP_getRankOfPart( meshInstance, partitionInstance, part_id, &rank, &itaps_err );
    // get global ids for all vertex handles
    for( unsigned i = 0; i < num_vtx; i++ )
    {
        iMeshP_getEntOwnerPart( meshInstance, partitionInstance, (iBase_EntityHandle)( vert_array[i] ), &part_id,
                                &itaps_err );
        int part_rank;
        iMeshP_getRankOfPart( meshInstance, partitionInstance, part_id, &part_rank, &itaps_err );
        if( part_rank == rank )
        {
            gid[i] = (size_t)( vert_array[i] );
        }
        else
        {
            iBase_EntityHandle handle;
            iMeshP_getOwnerCopy( meshInstance, partitionInstance, (iBase_EntityHandle)( vert_array[i] ), &part_id,
                                 &handle, &itaps_err );
            gid[i] = (size_t)handle;
        }
    }
}
void MBMesquite::MsqIMeshP::vertices_get_processor_id ( const VertexHandle  vert_array[],
int  pid[],
size_t  num_vtx,
MsqError err 
) [virtual]

Get processor ids for given vertices.

Implements MBMesquite::ParallelMesh.

Definition at line 114 of file MsqIMeshP.cpp.

References iMeshP_getEntOwnerPart, iMeshP_getRankOfPart, MBMesquite::MsqIMesh::meshInstance, and partitionInstance.

{
    int itaps_err;
    for( unsigned i = 0; i < num_vtx; i++ )
    {
        iMeshP_Part part_id;
        iMeshP_getEntOwnerPart( meshInstance, partitionInstance, (iBase_EntityHandle)( vert_array[i] ), &part_id,
                                &itaps_err );
        iMeshP_getRankOfPart( meshInstance, partitionInstance, part_id, &( pid[i] ), &itaps_err );
    }
}

Member Data Documentation

List of all members.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines