mesh::ParallelTetMesh Class Reference

#include <paralleltetmesh.h>

Inheritance diagram for mesh::ParallelTetMesh:

Inheritance graph
[legend]
Collaboration diagram for mesh::ParallelTetMesh:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ParallelTetMesh (MPI_Comm _comm)
virtual ~ParallelTetMesh ()
void initPoint (int nofPoint)
void insertPoint (int id, double x, double y, double z)
void initTet (int nofTet)
void insertTet (id_t global_id, id_t id0, id_t id1, id_t id2, id_t id3, id_t material)
id_t lookupFace (id_t node0, id_t node1, id_t node2)
void fix_edge_orientation ()
void finalize_mesh (int nofSym)
id_t point_gid (id_t lid) const
id_t face_gid (id_t lid) const
id_t edge_gid (id_t lid) const
MPI_Comm get_comm ()
id_t get_dof_removed_offset (id_t my_offset)
id_t get_dof_removed_offset ()
id_t get_num_global_points () const
id_t get_num_global_edges () const
id_t get_num_global_faces () const
id_t get_num_global_tets ()
bool is_owned_point (id_t gid) const
bool is_owned_edge (id_t gid) const
bool is_owned_face (id_t gid) const
const std::vector< id_t > & get_edge_gids () const
const std::vector< id_t > & get_node_gids () const

Private Member Functions

void synchronize ()
void set_face_gids ()
void set_edge_gids ()
void set_point_ownership ()
utility::triple< id_t, id_t,
id_t
get_face_corner_gids (const Face &face) const
std::pair< id_t, id_tget_edge_corner_gids (const Edge &edge) const

Private Attributes

std::vector< bool > _point_owned_by_me
MPI_Comm _comm
int _mpi_size
int _mpi_rank
int _tet_counter
int _point_counter
int _num_global_points
id_t _num_global_edges
id_t _num_global_faces
std::vector< id_t_face_gids
std::vector< id_t_edge_gids
std::vector< id_t_point_gids
std::map< int, int > _point_local_id
id_t _my_edges [4]
id_t _my_faces [4]

Detailed Description

Definition at line 26 of file paralleltetmesh.h.


Constructor & Destructor Documentation

mesh::ParallelTetMesh::ParallelTetMesh ( MPI_Comm  _comm  ) 

Default constructor

Definition at line 22 of file paralleltetmesh.cpp.

References _comm, _mpi_rank, _mpi_size, _point_counter, and _tet_counter.

mesh::ParallelTetMesh::~ParallelTetMesh (  )  [virtual]

Destructor

Definition at line 33 of file paralleltetmesh.cpp.


Member Function Documentation

id_t mesh::ParallelTetMesh::edge_gid ( id_t  lid  )  const

Return global ID of local edge.

Parameters:
lid local ID of edge

Definition at line 453 of file paralleltetmesh.cpp.

References _edge_gids.

Referenced by NedelecMesh::gdof(), LagrangeMesh::gdof(), NedelecMesh::generate_sorted_AM(), set_edge_gids(), and NedelecMesh::set_map().

id_t mesh::ParallelTetMesh::face_gid ( id_t  lid  )  const

Return global ID of local face.

Parameters:
lid local ID of face

Definition at line 449 of file paralleltetmesh.cpp.

References _face_gids.

Referenced by NedelecMesh::gdof(), and set_face_gids().

void mesh::ParallelTetMesh::finalize_mesh ( int  nofSym  )  [virtual]

Finalize and validate the mesh data structures. Call synchronize method to get a coherent global numbering of faces and edges.

Parameters:
nofSym number of symmetry planes in the mesh

Reimplemented from mesh::TetMesh.

Definition at line 102 of file paralleltetmesh.cpp.

References mesh::TetMesh::finalize_mesh(), and synchronize().

Here is the call graph for this function:

void mesh::ParallelTetMesh::fix_edge_orientation (  ) 

Make edge orientation consisten across all processors using point gids.

Definition at line 85 of file paralleltetmesh.cpp.

References point_gid(), rWarningAll, mesh::TetMesh::tet_begin(), and mesh::TetMesh::tet_end().

Referenced by synchronize().

Here is the call graph for this function:

MPI_Comm mesh::ParallelTetMesh::get_comm (  ) 

Return MPI Communicator

Definition at line 499 of file paralleltetmesh.cpp.

References _comm.

Referenced by NedelecMesh::generate_sorted_AM(), NedelecMesh::set_map(), and LagrangeMesh::set_map().

id_t mesh::ParallelTetMesh::get_dof_removed_offset (  ) 

Return number of A matrix rows removed due to linear dependencies.

Exceptions:
std::runtime_error if dof_removed_offset has not yet been calculated.

id_t mesh::ParallelTetMesh::get_dof_removed_offset ( id_t  my_offset  ) 

Calculate and return number of A matrix rows removed due to linear dependencies.

Parameters:
my_offset number of removed matrix rows locally.
Exceptions:
std::runtime_error if dof_removed_offset has already been calculated.

std::pair< id_t, id_t > mesh::ParallelTetMesh::get_edge_corner_gids ( const Edge edge  )  const [private]

Get global corner ids of an edge.

Parameters:
face Reference to edge.
Returns:
Pair of global corner ids of edge (in ascending order).

Definition at line 135 of file paralleltetmesh.cpp.

References mesh::Edge::get_end_id(), mesh::Edge::get_start_id(), and point_gid().

Referenced by set_edge_gids().

Here is the call graph for this function:

const std::vector<id_t>& mesh::ParallelTetMesh::get_edge_gids (  )  const [inline]

Definition at line 148 of file paralleltetmesh.h.

References _edge_gids.

Referenced by NedelecMesh::set_map().

utility::triple< id_t, id_t, id_t > mesh::ParallelTetMesh::get_face_corner_gids ( const Face face  )  const [private]

Get global corner ids of a face.

Parameters:
face Reference to face.
Returns:
Triple of global corner ids of a face (in ascending order).

Definition at line 122 of file paralleltetmesh.cpp.

References mesh::Face::get_corner_id(), and point_gid().

Referenced by set_face_gids().

Here is the call graph for this function:

const std::vector<id_t>& mesh::ParallelTetMesh::get_node_gids (  )  const [inline]

Definition at line 152 of file paralleltetmesh.h.

References _point_gids.

Referenced by LagrangeMesh::set_map().

id_t mesh::ParallelTetMesh::get_num_global_edges (  )  const [inline]

Return number of global edges.

Definition at line 118 of file paralleltetmesh.h.

References _num_global_edges.

Referenced by LagrangeMesh::LagrangeMesh(), and NedelecMesh::NedelecMesh().

id_t mesh::ParallelTetMesh::get_num_global_faces (  )  const [inline]

Return number of global faces.

Definition at line 125 of file paralleltetmesh.h.

References _num_global_faces.

Referenced by NedelecMesh::NedelecMesh().

id_t mesh::ParallelTetMesh::get_num_global_points (  )  const [inline]

Return number of global nodes.

Definition at line 111 of file paralleltetmesh.h.

References _num_global_points.

Referenced by LagrangeMesh::gdof(), h5_write_eigenpoint(), and LagrangeMesh::LagrangeMesh().

id_t mesh::ParallelTetMesh::get_num_global_tets (  ) 

Return number of global tets; this is equivalen to get_nof_tets in the serial case, i.e. when there is only one single process operating on the mesh.

standard loop indices

local number of tetrahdra

global number of tetrahedra

Carry out an MPI reduce operation to compute the global number of tetrahedra employed in the mesh based on the sum of the process local number of tetrahedra.

Definition at line 463 of file paralleltetmesh.cpp.

References _comm, and mesh::TetMesh::get_nof_tets().

Referenced by h5_write_eigenfield(), and h5_write_eigenmesh().

Here is the call graph for this function:

void mesh::ParallelTetMesh::initPoint ( int  nofPoint  )  [virtual]

Reserve space for nofPoint points and initialize lookup table array

Reimplemented from mesh::TetMesh.

Definition at line 36 of file paralleltetmesh.cpp.

References _point_counter, _point_gids, and mesh::TetMesh::initPoint().

Here is the call graph for this function:

void mesh::ParallelTetMesh::initTet ( int  nofTet  )  [virtual]

Reserve space for nofTet tets and initialize tet lookup table array

Reimplemented from mesh::TetMesh.

Definition at line 42 of file paralleltetmesh.cpp.

References _tet_counter, and mesh::TetMesh::initTet().

Here is the call graph for this function:

void mesh::ParallelTetMesh::insertPoint ( int  id,
double  x,
double  y,
double  z 
) [virtual]

Add a new point node to the mesh

Parameters:
id global ID of node
x x coordinate of node
y y coordinate of node
z z coordinate of node

Reimplemented from mesh::TetMesh.

Definition at line 51 of file paralleltetmesh.cpp.

References _point_counter, _point_gids, _point_local_id, and mesh::TetMesh::insertPoint().

Here is the call graph for this function:

void mesh::ParallelTetMesh::insertTet ( id_t  global_id,
id_t  id0,
id_t  id1,
id_t  id2,
id_t  id3,
id_t  material 
) [virtual]

Inserts a new Tet into the TetMesh. Tet ids are assigned in consecutive order. Global ID's are stored in lookup table array

Parameters:
global_id global id of Tet
id0 id of the corner 0
id1 id of the corner 1
id2 id of the corner 2
id3 id of the corner 3

Reimplemented from mesh::TetMesh.

Definition at line 60 of file paralleltetmesh.cpp.

References _point_local_id, _tet_counter, and mesh::TetMesh::insertTet().

Here is the call graph for this function:

bool mesh::ParallelTetMesh::is_owned_edge ( id_t  gid  )  const

Return true if global edge gid is owned by calling processor.

Definition at line 489 of file paralleltetmesh.cpp.

References _my_edges.

Referenced by NedelecMesh::generate_sorted_AM(), NedelecMesh::is_owned_gdof(), and LagrangeMesh::is_owned_gdof().

bool mesh::ParallelTetMesh::is_owned_face ( id_t  gid  )  const

Return true if global face gid is owned by calling processor.

Definition at line 494 of file paralleltetmesh.cpp.

References _my_faces.

Referenced by NedelecMesh::is_owned_gdof().

bool mesh::ParallelTetMesh::is_owned_point ( id_t  gid  )  const

Return true if global point gid is owned by calling processor.

Definition at line 481 of file paralleltetmesh.cpp.

References _point_local_id, and _point_owned_by_me.

Referenced by LagrangeMesh::is_owned_gdof(), and set_edge_gids().

id_t mesh::ParallelTetMesh::lookupFace ( id_t  node0,
id_t  node1,
id_t  node2 
) [virtual]

Return local ID of face connecting by node0, node1 and node2. A runtime_error is thrown if the face does not exist.

This function is called from TetmeshBuilder::set_bc().

Parameters:
node0 global ID of node 0
node1 global ID of node 1
node2 global ID of node 2

Reimplemented from mesh::TetMesh.

Definition at line 67 of file paralleltetmesh.cpp.

References _point_local_id, and mesh::TetMesh::lookupFace().

Here is the call graph for this function:

id_t mesh::ParallelTetMesh::point_gid ( id_t  lid  )  const

Return global ID of local node.

Parameters:
lid local ID of node

Definition at line 457 of file paralleltetmesh.cpp.

References _point_gids.

Referenced by fix_edge_orientation(), LagrangeMesh::gdof(), NedelecMesh::generate_sorted_AM(), get_edge_corner_gids(), get_face_corner_gids(), h5_write_eigenmesh(), h5_write_eigenpoint(), NedelecMesh::set_map(), LagrangeMesh::set_map(), and set_point_ownership().

void mesh::ParallelTetMesh::set_edge_gids (  )  [private]

Assign global ids to faces.

Definition at line 233 of file paralleltetmesh.cpp.

References _comm, _edge_gids, _mpi_rank, _my_edges, _num_global_edges, parallel::assign_gids(), parallel::compute_mgid_map(), mesh::TetMesh::edge_begin(), mesh::TetMesh::edge_end(), edge_gid(), mesh::TetMesh::face_begin(), mesh::TetMesh::face_end(), get_edge_corner_gids(), mesh::TetMesh::get_nof_edges(), mesh::ID_NONE, is_owned_point(), rDebugAll, rInfoAll, rWarningAll, and parallel::set_counts_displs().

Referenced by synchronize().

Here is the call graph for this function:

void mesh::ParallelTetMesh::set_face_gids (  )  [private]

Assign global ids to faces.

Definition at line 143 of file paralleltetmesh.cpp.

References _comm, _face_gids, _mpi_rank, _my_faces, _num_global_faces, parallel::assign_gids(), parallel::compute_mgid_map(), mesh::TetMesh::face_begin(), mesh::TetMesh::face_end(), face_gid(), get_face_corner_gids(), mesh::TetMesh::get_nof_faces(), mesh::ID_NONE, rInfoAll, and parallel::set_counts_displs().

Referenced by synchronize().

Here is the call graph for this function:

void mesh::ParallelTetMesh::set_point_ownership (  )  [private]

Determine ownership of point gids.

Definition at line 373 of file paralleltetmesh.cpp.

References _comm, _num_global_points, _point_owned_by_me, mesh::TetMesh::face_begin(), mesh::TetMesh::face_end(), mesh::TetMesh::get_nof_points(), mesh::ID_NONE, mesh::TetMesh::point_begin(), mesh::TetMesh::point_end(), point_gid(), rDebugAll, and parallel::set_ownership().

Referenced by synchronize().

Here is the call graph for this function:

void mesh::ParallelTetMesh::synchronize (  )  [private]

Change global ID of faces and edges so that they are uniform and consecutive among all processors

Definition at line 107 of file paralleltetmesh.cpp.

References fix_edge_orientation(), set_edge_gids(), set_face_gids(), and set_point_ownership().

Referenced by finalize_mesh().

Here is the call graph for this function:


Member Data Documentation

MPI_Comm mesh::ParallelTetMesh::_comm [private]

MPI communicator

Definition at line 195 of file paralleltetmesh.h.

Referenced by get_comm(), get_num_global_tets(), ParallelTetMesh(), set_edge_gids(), set_face_gids(), and set_point_ownership().

std::vector<id_t> mesh::ParallelTetMesh::_edge_gids [private]

Vector containing global ID's of local edges

Definition at line 228 of file paralleltetmesh.h.

Referenced by edge_gid(), get_edge_gids(), and set_edge_gids().

std::vector<id_t> mesh::ParallelTetMesh::_face_gids [private]

Vector containing global ID's of local faces

Definition at line 225 of file paralleltetmesh.h.

Referenced by face_gid(), and set_face_gids().

int mesh::ParallelTetMesh::_mpi_rank [private]

ID number of this processor

Definition at line 201 of file paralleltetmesh.h.

Referenced by ParallelTetMesh(), set_edge_gids(), and set_face_gids().

int mesh::ParallelTetMesh::_mpi_size [private]

Number of processors

Definition at line 198 of file paralleltetmesh.h.

Referenced by ParallelTetMesh().

id_t mesh::ParallelTetMesh::_my_edges[4] [private]

Array (a, b, c, d) of 4 id_t's. Describes the set of global ID's of processor-local edges in this fashion [a,b) U [c,d)

Definition at line 239 of file paralleltetmesh.h.

Referenced by is_owned_edge(), and set_edge_gids().

id_t mesh::ParallelTetMesh::_my_faces[4] [private]

Array (a, b, c, d) of 4 id_t's. Describes the set of gids of processor-local faces in this fashion [a,b) U [c,d)

Definition at line 243 of file paralleltetmesh.h.

Referenced by is_owned_face(), and set_face_gids().

id_t mesh::ParallelTetMesh::_num_global_edges [private]

Number of global edges.

Definition at line 217 of file paralleltetmesh.h.

Referenced by get_num_global_edges(), and set_edge_gids().

id_t mesh::ParallelTetMesh::_num_global_faces [private]

Number of global faces.

Definition at line 222 of file paralleltetmesh.h.

Referenced by get_num_global_faces(), and set_face_gids().

int mesh::ParallelTetMesh::_num_global_points [private]

Number of global points.

Definition at line 212 of file paralleltetmesh.h.

Referenced by get_num_global_points(), and set_point_ownership().

int mesh::ParallelTetMesh::_point_counter [private]

Array containing current number of nodes inserted into mesh

Definition at line 207 of file paralleltetmesh.h.

Referenced by initPoint(), insertPoint(), and ParallelTetMesh().

std::vector<id_t> mesh::ParallelTetMesh::_point_gids [private]

Vector containing global ID's of local faces

Definition at line 231 of file paralleltetmesh.h.

Referenced by get_node_gids(), initPoint(), insertPoint(), and point_gid().

std::map<int,int> mesh::ParallelTetMesh::_point_local_id [private]

Map containing local ID's of points stored locally, with global ID's as the keys. For reverse lookup possibility

Definition at line 235 of file paralleltetmesh.h.

Referenced by insertPoint(), insertTet(), is_owned_point(), and lookupFace().

std::vector<bool> mesh::ParallelTetMesh::_point_owned_by_me [private]

Vector determining if point is owned by me. Indexed by lid.

Definition at line 178 of file paralleltetmesh.h.

Referenced by is_owned_point(), and set_point_ownership().

int mesh::ParallelTetMesh::_tet_counter [private]

Array containing current number of tetrahedra inserted into mesh

Definition at line 204 of file paralleltetmesh.h.

Referenced by initTet(), insertTet(), and ParallelTetMesh().


The documentation for this class was generated from the following files:
Generated on Fri Oct 26 13:35:17 2007 for FEMAXX (Finite Element Maxwell Eigensolver) by  doxygen 1.4.7