LifeV
GhostHandler< MeshType > Class Template Reference

GhostHandler. More...

#include <GhostHandler.hpp>

+ Collaboration diagram for GhostHandler< MeshType >:

Public Types

typedef MeshType mesh_Type
 
typedef std::shared_ptr< mesh_TypemeshPtr_Type
 
typedef Epetra_Comm comm_Type
 
typedef std::shared_ptr< comm_TypecommPtr_Type
 
typedef MapEpetra map_Type
 
typedef std::shared_ptr< map_TypemapPtr_Type
 
typedef std::vector< IntidList_Type
 
typedef std::shared_ptr< idList_TypeidListPtr_Type
 
typedef std::vector< idList_Typegraph_Type
 
typedef std::shared_ptr< graph_TypegraphPtr_Type
 
typedef std::vector< idListPtr_TypevertexPartition_Type
 
typedef std::shared_ptr< vertexPartition_TypevertexPartitionPtr_Type
 
typedef std::vector< markerID_TypemarkerIDList_Type
 
typedef std::vector< int > markerIDListSigned_Type
 

Constructors & Destructors

 GhostHandler (commPtr_Type const &comm)
 Constructor. More...
 
 GhostHandler (meshPtr_Type fullMesh, commPtr_Type const &comm)
 Constructor. More...
 
 GhostHandler (meshPtr_Type fullMesh, meshPtr_Type localMesh, mapPtr_Type map, commPtr_Type const &comm)
 Constructor. More...
 
 ~GhostHandler ()
 Destructor. More...
 

Get Methods

mesh_Type const & fullMesh ()
 Full mesh getter. More...
 
mesh_Type const & localMesh ()
 Local mesh getter. More...
 
map_Type const & map ()
 Standard map getter. More...
 
neighborList_Type const & pointPointNeighborsList ()
 List of point neighbors to a point (identified by the global ID) More...
 
neighborList_Type const & pointEdgeNeighborsList ()
 List of edge neighbors to a point (identified by the global ID) More...
 
neighborList_Type const & pointElementNeighborsList ()
 List of element neighbors to a point (identified by the global ID) More...
 

Set Methods

void setVerbose (const bool &verbose)
 Set verbosity. More...
 

General Methods

void setUpNeighbors (NeighborType const neighborType=ALL_NEIGHBORS)
 Initialize neighbors list. More...
 
void release ()
 Release pointers to full and local mesh. More...
 
void clean (NeighborType const neighborType=ALL_NEIGHBORS)
 Clean up neighbor lists. More...
 
void exportToHDF5 (std::string const &fileName="ghostmap", bool const &truncate=true)
 Export neighbor lists to an hdf5 file. More...
 
void importFromHDF5 (std::string const &fileName="ghostmap")
 Import neighbor lists to an hdf5 file. More...
 
void createPointNeighbors ()
 Create point neighbors to points and store them in the NeighborMarker. More...
 
void createPointPointNeighborsList ()
 Create the list of point neighbors to points. More...
 
void createPointPointNeighborsList (markerIDListSigned_Type const &flags)
 Create the list of point neighbors to points that are in the given list of MarkerIDs. More...
 
neighbors_Type circleNeighbors (UInt globalID, UInt nCircles=1)
 Create neighbors to a given point, with a specified number of generations. More...
 
neighbors_Type neighborsWithinRadius (UInt globalID, Real radius)
 Create neighbors to a given point within a specified radius. More...
 
void createPointEdgeNeighborsList ()
 Create the list of edge neighbors to the points. More...
 
void createPointElementNeighborsList ()
 Create the list of element neighbors to the points. More...
 
map_TypeghostMapOnPoints ()
 Create an overlapped map on points. More...
 
map_TypeghostMapOnPoints (UInt overlap)
 Create an overlapped map on points. More...
 
map_TypeghostMapOnEdges (UInt overlap)
 Create an overlapped map on edges. More...
 
map_TypeghostMapOnElementsFV ()
 Create an overlapped map on elements for Finite Volumes. More...
 
map_TypeghostMapOnElementsFE (UInt overlap)
 Create an overlapped map on elements for Finite Elements. More...
 
void extendGraphFE (graphPtr_Type elemGraph, idList_Type const &pointPID, UInt overlap)
 Extend the subdomains graph of the given overlap. More...
 
void extendGraphFE (const vertexPartitionPtr_Type &elemGraph, idList_Type const &pointPID, UInt overlap, UInt partIndex)
 Extend the subdomains graph of the given overlap. More...
 
void showMe (bool const verbose=false, std::ostream &out=std::cout)
 showMe method More...
 

Ghost Maps

mapPtr_Type M_ghostMapOnPoints
 
mapPtr_Type M_ghostMapOnEdges
 
mapPtr_Type M_ghostMapOnElementsFV
 
mapPtr_Type M_ghostMapOnElementsFE
 

Protected Members

meshPtr_Type M_fullMesh
 
meshPtr_Type M_localMesh
 
mapPtr_Type const M_map
 
commPtr_Type const M_comm
 
UInt const M_me
 
neighborList_Type M_pointPointNeighborsList
 
neighborList_Type M_pointEdgeNeighborsList
 
neighborList_Type M_pointElementNeighborsList
 
bool M_verbose
 

Detailed Description

template<typename MeshType>
class LifeV::GhostHandler< MeshType >

GhostHandler.

This class manages neighborhood information across processes. The aim is to have the possibility to build overlapping maps in order to ease the retrieving of ghosted values. The class offers also the possibility to build phisically overlapped meshes that do not require communication to retrieve mesh information from adjacent elements.

Definition at line 75 of file GhostHandler.hpp.

Member Typedef Documentation

◆ mesh_Type

Definition at line 82 of file GhostHandler.hpp.

◆ meshPtr_Type

typedef std::shared_ptr<mesh_Type> meshPtr_Type

Definition at line 83 of file GhostHandler.hpp.

◆ comm_Type

typedef Epetra_Comm comm_Type

Definition at line 84 of file GhostHandler.hpp.

◆ commPtr_Type

typedef std::shared_ptr<comm_Type> commPtr_Type

Definition at line 85 of file GhostHandler.hpp.

◆ map_Type

Definition at line 86 of file GhostHandler.hpp.

◆ mapPtr_Type

typedef std::shared_ptr<map_Type> mapPtr_Type

Definition at line 87 of file GhostHandler.hpp.

◆ idList_Type

typedef std::vector<Int> idList_Type

Definition at line 88 of file GhostHandler.hpp.

◆ idListPtr_Type

typedef std::shared_ptr<idList_Type> idListPtr_Type

Definition at line 89 of file GhostHandler.hpp.

◆ graph_Type

typedef std::vector<idList_Type> graph_Type

Definition at line 90 of file GhostHandler.hpp.

◆ graphPtr_Type

typedef std::shared_ptr<graph_Type> graphPtr_Type

Definition at line 91 of file GhostHandler.hpp.

◆ vertexPartition_Type

typedef std::vector<idListPtr_Type> vertexPartition_Type

Definition at line 92 of file GhostHandler.hpp.

◆ vertexPartitionPtr_Type

Definition at line 93 of file GhostHandler.hpp.

◆ markerIDList_Type

typedef std::vector<markerID_Type> markerIDList_Type

Definition at line 94 of file GhostHandler.hpp.

◆ markerIDListSigned_Type

typedef std::vector<int> markerIDListSigned_Type

Definition at line 95 of file GhostHandler.hpp.

Constructor & Destructor Documentation

◆ GhostHandler() [1/3]

GhostHandler ( commPtr_Type const &  comm)
explicit

Constructor.

Parameters
comm.Communicator

Definition at line 351 of file GhostHandler.hpp.

+ Here is the caller graph for this function:

◆ GhostHandler() [2/3]

GhostHandler ( meshPtr_Type  fullMesh,
commPtr_Type const &  comm 
)

Constructor.

Parameters
fullMesh.Original mesh, before partitioning
comm.Communicator

Definition at line 388 of file GhostHandler.hpp.

+ Here is the caller graph for this function:

◆ GhostHandler() [3/3]

GhostHandler ( meshPtr_Type  fullMesh,
meshPtr_Type  localMesh,
mapPtr_Type  map,
commPtr_Type const &  comm 
)

Constructor.

Parameters
fullMesh.Original mesh, before partitioning
localMesh.Local mesh of the current proc
map.Original map without overlapping
comm.Communicator

Definition at line 368 of file GhostHandler.hpp.

+ Here is the caller graph for this function:

◆ ~GhostHandler()

~GhostHandler ( )
inline

Destructor.

Definition at line 127 of file GhostHandler.hpp.

Member Function Documentation

◆ fullMesh()

mesh_Type const& fullMesh ( )
inline

Full mesh getter.

Definition at line 135 of file GhostHandler.hpp.

◆ localMesh()

mesh_Type const& localMesh ( )
inline

Local mesh getter.

Definition at line 141 of file GhostHandler.hpp.

◆ map()

map_Type const& map ( )
inline

Standard map getter.

Definition at line 147 of file GhostHandler.hpp.

◆ pointPointNeighborsList()

neighborList_Type const& pointPointNeighborsList ( )
inline

List of point neighbors to a point (identified by the global ID)

Definition at line 153 of file GhostHandler.hpp.

◆ pointEdgeNeighborsList()

neighborList_Type const& pointEdgeNeighborsList ( )
inline

List of edge neighbors to a point (identified by the global ID)

Definition at line 160 of file GhostHandler.hpp.

◆ pointElementNeighborsList()

neighborList_Type const& pointElementNeighborsList ( )
inline

List of element neighbors to a point (identified by the global ID)

Definition at line 167 of file GhostHandler.hpp.

◆ setVerbose()

void setVerbose ( const bool &  verbose)
inline

Set verbosity.

Parameters
verbose

Definition at line 182 of file GhostHandler.hpp.

◆ setUpNeighbors()

void setUpNeighbors ( NeighborType const  neighborType = ALL_NEIGHBORS)

Initialize neighbors list.

Definition at line 404 of file GhostHandler.hpp.

◆ release()

void release ( )

Release pointers to full and local mesh.

Definition at line 421 of file GhostHandler.hpp.

◆ clean()

void clean ( NeighborType const  neighborType = ALL_NEIGHBORS)

Clean up neighbor lists.

Definition at line 428 of file GhostHandler.hpp.

◆ exportToHDF5()

void exportToHDF5 ( std::string const &  fileName = "ghostmap",
bool const &  truncate = true 
)

Export neighbor lists to an hdf5 file.

Parameters
fileName.Name of the file to write
truncate.Must be true when the file already exists on disk

Definition at line 525 of file GhostHandler.hpp.

◆ importFromHDF5()

void importFromHDF5 ( std::string const &  fileName = "ghostmap")

Import neighbor lists to an hdf5 file.

Parameters
fileName.Name of the file to write

Definition at line 556 of file GhostHandler.hpp.

+ Here is the caller graph for this function:

◆ createPointNeighbors()

void createPointNeighbors ( )

Create point neighbors to points and store them in the NeighborMarker.

this routine generates point neighbors for the given mesh

the routine assumes that the mesh is not yet partitioned or reordered (i.e. the local id and the global id are the same). if this is not true the method should be changed to use a more expensive STL find on the mesh points to get the correct point that has the given global id or construct a globalToLocal map beforehand.

Definition at line 588 of file GhostHandler.hpp.

◆ createPointPointNeighborsList() [1/2]

void createPointPointNeighborsList ( )

Create the list of point neighbors to points.

Definition at line 616 of file GhostHandler.hpp.

◆ createPointPointNeighborsList() [2/2]

void createPointPointNeighborsList ( markerIDListSigned_Type const &  flags)

Create the list of point neighbors to points that are in the given list of MarkerIDs.

Parameters
flags.The list of MarkerIDs to restrict to.

Definition at line 664 of file GhostHandler.hpp.

◆ circleNeighbors()

neighbors_Type circleNeighbors ( UInt  globalID,
UInt  nCircles = 1 
)

Create neighbors to a given point, with a specified number of generations.

Parameters
globalID.ID of the point to be examined.
nCircles.Number of circles (generations) to consider.
Returns
the set of neighbors global IDs

Definition at line 696 of file GhostHandler.hpp.

◆ neighborsWithinRadius()

neighbors_Type neighborsWithinRadius ( UInt  globalID,
Real  radius 
)

Create neighbors to a given point within a specified radius.

Parameters
globalID.ID of the point to be examined.
radius.The value of the circle radius within which neighbors are included
Returns
the set of neighbors global IDs

Definition at line 726 of file GhostHandler.hpp.

◆ createPointEdgeNeighborsList()

void createPointEdgeNeighborsList ( )

Create the list of edge neighbors to the points.

Definition at line 773 of file GhostHandler.hpp.

◆ createPointElementNeighborsList()

void createPointElementNeighborsList ( )

Create the list of element neighbors to the points.

Definition at line 806 of file GhostHandler.hpp.

◆ ghostMapOnPoints() [1/2]

GhostHandler< MeshType >::map_Type & ghostMapOnPoints ( )

Create an overlapped map on points.

Create a map based on points, expanding it across suddomain interfaces with overlap 1, using NeighborMarker.

Definition at line 824 of file GhostHandler.hpp.

◆ ghostMapOnPoints() [2/2]

GhostHandler< MeshType >::map_Type & ghostMapOnPoints ( UInt  overlap)

Create an overlapped map on points.

Create a map based on points, expanding it across suddomain interfaces with generic overlap.

Parameters
overlap.Level of overlap between subdomains
Returns
the overlapped map

Definition at line 880 of file GhostHandler.hpp.

◆ ghostMapOnEdges()

GhostHandler< MeshType >::map_Type & ghostMapOnEdges ( UInt  overlap)

Create an overlapped map on edges.

Create a map based on edges, expanding it across suddomain interfaces with generic overlap.

Parameters
overlap.Level of overlap between subdomains
Returns
the overlapped map

Definition at line 951 of file GhostHandler.hpp.

◆ ghostMapOnElementsFV()

GhostHandler< MeshType >::map_Type & ghostMapOnElementsFV ( )

Create an overlapped map on elements for Finite Volumes.

Create a map based on elements, expanding it across suddomain interfaces. The elements added are only those that share a facet with the current subdomain. This type of map is typically used for Finite Volumes.

Returns
the overlapped map

Definition at line 1051 of file GhostHandler.hpp.

◆ ghostMapOnElementsFE()

GhostHandler< MeshType >::map_Type & ghostMapOnElementsFE ( UInt  overlap)

Create an overlapped map on elements for Finite Elements.

Create a map based on elements, expanding it across suddomain interfaces. The elements added are all those that share a point with the current subdomain. This type of map is typically used for Finite Elements.

Parameters
overlap.Level of overlap between subdomains

Definition at line 1104 of file GhostHandler.hpp.

◆ extendGraphFE() [1/2]

void extendGraphFE ( graphPtr_Type  elemGraph,
idList_Type const &  pointPID,
UInt  overlap 
)

Extend the subdomains graph of the given overlap.

This method enriches each subdomain with the closest elements such that the partitions have the required overlap.

Parameters
elemGraph.The list of subdomain elements
entityPID.Info about proc ownership of each mesh entity.
overlap.Level of overlap between partitions.

Definition at line 1197 of file GhostHandler.hpp.

◆ extendGraphFE() [2/2]

void extendGraphFE ( const vertexPartitionPtr_Type elemGraph,
idList_Type const &  pointPID,
UInt  overlap,
UInt  partIndex 
)

Extend the subdomains graph of the given overlap.

This method enriches each subdomain with the closest elements such that the partitions have the required overlap.

Parameters
elemGraph.The list of subdomain elements
entityPID.Info about proc ownership of each mesh entity.
overlap.Level of overlap between partitions.

Definition at line 1413 of file GhostHandler.hpp.

◆ showMe()

void showMe ( bool const  verbose = false,
std::ostream &  out = std::cout 
)

showMe method

Definition at line 1634 of file GhostHandler.hpp.

Field Documentation

◆ M_ghostMapOnPoints

mapPtr_Type M_ghostMapOnPoints
protected

Definition at line 323 of file GhostHandler.hpp.

◆ M_ghostMapOnEdges

mapPtr_Type M_ghostMapOnEdges
protected

Definition at line 324 of file GhostHandler.hpp.

◆ M_ghostMapOnElementsFV

mapPtr_Type M_ghostMapOnElementsFV
protected

Definition at line 325 of file GhostHandler.hpp.

◆ M_ghostMapOnElementsFE

mapPtr_Type M_ghostMapOnElementsFE
protected

Definition at line 326 of file GhostHandler.hpp.

◆ M_fullMesh

meshPtr_Type M_fullMesh
protected

Definition at line 333 of file GhostHandler.hpp.

◆ M_localMesh

meshPtr_Type M_localMesh
protected

Definition at line 334 of file GhostHandler.hpp.

◆ M_map

mapPtr_Type const M_map
protected

Definition at line 335 of file GhostHandler.hpp.

◆ M_comm

commPtr_Type const M_comm
protected

Definition at line 336 of file GhostHandler.hpp.

◆ M_me

UInt const M_me
protected

Definition at line 337 of file GhostHandler.hpp.

◆ M_pointPointNeighborsList

neighborList_Type M_pointPointNeighborsList
protected

Definition at line 339 of file GhostHandler.hpp.

◆ M_pointEdgeNeighborsList

neighborList_Type M_pointEdgeNeighborsList
protected

Definition at line 340 of file GhostHandler.hpp.

◆ M_pointElementNeighborsList

neighborList_Type M_pointElementNeighborsList
protected

Definition at line 341 of file GhostHandler.hpp.

◆ M_verbose

bool M_verbose
protected

Definition at line 343 of file GhostHandler.hpp.


The documentation for this class was generated from the following file: