ug4
ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj > Class Template Reference

Generates the parralel dual graph of a MultiGrid as, e.g., required by Parmetis. More...

#include <parallel_dual_graph.h>

Public Types

typedef std::vector< TGeomBaseObj * >::iterator element_iterator_t
 

Public Member Functions

element_iterator_t elements_begin ()
 returns the begin-iterator to the elements corresponding to graph vertices*‍/ More...
 
element_iterator_t elements_end ()
 returns the begin-iterator to the elements corresponding to graph vertices*‍/ More...
 
void generate_graph (int level, pcl::ProcessCommunicator procCom=pcl::ProcessCommunicator(pcl::PCD_WORLD))
 generates the graph for the given level. More...
 
TConnectingObj * get_connection (size_t connIndex)
 returns the graph-edge for the given index More...
 
TGeomBaseObj * get_element (size_t gvrtIndex)
 returns the graph-vertex for the given index More...
 
TIndexType get_index (TGeomBaseObj *elem)
 returns the graph-vertex index of the given element More...
 
 ParallelDualGraph (MultiGrid *pmg=NULL)
 
pcl::ProcessCommunicator process_communicator () const
 returns a process communicator which only contains processes which contain an element. More...
 
void set_grid (MultiGrid *pmg)
 
bool was_considered (TGeomBaseObj *o)
 Some vertices are not considered for the dual graph (e.g. ghosts). More...
 
 ~ParallelDualGraph ()
 
TIndexType num_graph_vertices ()
 Access to the graph which was generated during the last call to generate_graph. More...
 
TIndexType num_graph_edges ()
 Access to the graph which was generated during the last call to generate_graph. More...
 
TIndexType * adjacency_map_structure ()
 Access to the graph which was generated during the last call to generate_graph. More...
 
TIndexType * adjacency_map ()
 Access to the graph which was generated during the last call to generate_graph. More...
 
TIndexType * parallel_offset_map ()
 Access to the graph which was generated during the last call to generate_graph. More...
 

Private Types

typedef Attachment< int > AElemIndex
 
typedef Attachment< std::vector< int > > AElemIndices
 

Private Member Functions

void attach_data ()
 
void detach_data ()
 

Private Attributes

Grid::AttachmentAccessor< TGeomBaseObj, AElemIndexm_aaElemIndex
 
Grid::AttachmentAccessor< TConnectingObj, AElemIndicesm_aaElemIndices
 
std::vector< TIndexType > m_adjacencyMap
 
std::vector< TIndexType > m_adjacencyMapStructure
 
AElemIndex m_aElemIndex
 
AElemIndices m_aElemIndices
 
std::vector< TConnectingObj * > m_connections
 
std::vector< TGeomBaseObj * > m_elems
 
std::vector< TIndexType > m_nodeOffsetMap
 
MultiGridm_pMG
 
pcl::ProcessCommunicator m_procCom
 

Detailed Description

template<class TGeomBaseObj, class TIndexType, class TConnectingObj = typename TGeomBaseObj::side>
class ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >

Generates the parralel dual graph of a MultiGrid as, e.g., required by Parmetis.

Indices on elements of TGeomBaseObj are distributed in the order in which one iterates over those elements in the associated mg starting at level 0. Note that only elements which were considered are associated with a index.

Todo:
The current implementation has support for MultiGrids only. Support for flat grids should be added.

Member Typedef Documentation

◆ AElemIndex

template<class TGeomBaseObj , class TIndexType , class TConnectingObj = typename TGeomBaseObj::side>
typedef Attachment<int> ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::AElemIndex
private

◆ AElemIndices

template<class TGeomBaseObj , class TIndexType , class TConnectingObj = typename TGeomBaseObj::side>
typedef Attachment<std::vector<int> > ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::AElemIndices
private

◆ element_iterator_t

template<class TGeomBaseObj , class TIndexType , class TConnectingObj = typename TGeomBaseObj::side>
typedef std::vector<TGeomBaseObj*>::iterator ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::element_iterator_t

Constructor & Destructor Documentation

◆ ParallelDualGraph()

template<class TGeomBaseObj , class TIndexType , class TConnectingObj >
ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::ParallelDualGraph ( MultiGrid pmg = NULL)

◆ ~ParallelDualGraph()

template<class TGeomBaseObj , class TIndexType , class TConnectingObj >
ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::~ParallelDualGraph

Member Function Documentation

◆ adjacency_map()

template<class TGeomBaseObj , class TIndexType , class TConnectingObj >
TIndexType * ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::adjacency_map

Access to the graph which was generated during the last call to generate_graph.

See also
num_graph_vertices, num_graph_edges, adjacency_map_structure, adjacency_map, parallel_offset_map

References UG_ASSERT.

◆ adjacency_map_structure()

template<class TGeomBaseObj , class TIndexType , class TConnectingObj >
TIndexType * ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::adjacency_map_structure

Access to the graph which was generated during the last call to generate_graph.

See also
num_graph_vertices, num_graph_edges, adjacency_map_structure, adjacency_map, parallel_offset_map

References UG_ASSERT.

◆ attach_data()

template<class TGeomBaseObj , class TIndexType , class TConnectingObj >
void ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::attach_data
private

◆ detach_data()

template<class TGeomBaseObj , class TIndexType , class TConnectingObj >
void ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::detach_data
private

◆ elements_begin()

template<class TGeomBaseObj , class TIndexType , class TConnectingObj = typename TGeomBaseObj::side>
element_iterator_t ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::elements_begin ( )
inline

returns the begin-iterator to the elements corresponding to graph vertices*‍/

References ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::m_elems.

◆ elements_end()

template<class TGeomBaseObj , class TIndexType , class TConnectingObj = typename TGeomBaseObj::side>
element_iterator_t ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::elements_end ( )
inline

returns the begin-iterator to the elements corresponding to graph vertices*‍/

References ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::m_elems.

◆ generate_graph()

◆ get_connection()

template<class TGeomBaseObj , class TIndexType , class TConnectingObj = typename TGeomBaseObj::side>
TConnectingObj* ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::get_connection ( size_t  connIndex)
inline

returns the graph-edge for the given index

The i-th connection is the side_t element of the grid that represents the i-th connection stored in m_adjacencyMap.

References ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::m_connections.

◆ get_element()

template<class TGeomBaseObj , class TIndexType , class TConnectingObj = typename TGeomBaseObj::side>
TGeomBaseObj* ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::get_element ( size_t  gvrtIndex)
inline

returns the graph-vertex for the given index

References ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::m_elems.

◆ get_index()

template<class TGeomBaseObj , class TIndexType , class TConnectingObj = typename TGeomBaseObj::side>
TIndexType ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::get_index ( TGeomBaseObj *  elem)
inline

returns the graph-vertex index of the given element

References ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::m_aaElemIndex.

◆ num_graph_edges()

template<class TGeomBaseObj , class TIndexType , class TConnectingObj >
TIndexType ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::num_graph_edges

Access to the graph which was generated during the last call to generate_graph.

See also
num_graph_vertices, num_graph_edges, adjacency_map_structure, adjacency_map, parallel_offset_map

◆ num_graph_vertices()

template<class TGeomBaseObj , class TIndexType , class TConnectingObj >
TIndexType ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::num_graph_vertices

Access to the graph which was generated during the last call to generate_graph.

See also
num_graph_vertices, num_graph_edges, adjacency_map_structure, adjacency_map, parallel_offset_map

◆ parallel_offset_map()

template<class TGeomBaseObj , class TIndexType , class TConnectingObj >
TIndexType * ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::parallel_offset_map

Access to the graph which was generated during the last call to generate_graph.

See also
num_graph_vertices, num_graph_edges, adjacency_map_structure, adjacency_map, parallel_offset_map

References UG_ASSERT.

◆ process_communicator()

template<class TGeomBaseObj , class TIndexType , class TConnectingObj = typename TGeomBaseObj::side>
pcl::ProcessCommunicator ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::process_communicator ( ) const
inline

returns a process communicator which only contains processes which contain an element.

Note
the parallel-offset-map is built with respect to this process-communicator.
this process communicator does not necessarily resemble the communicator specified in generate_graph.

References ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::m_procCom.

◆ set_grid()

template<class TGeomBaseObj , class TIndexType , class TConnectingObj >
void ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::set_grid ( MultiGrid pmg)

◆ was_considered()

template<class TGeomBaseObj , class TIndexType , class TConnectingObj >
bool ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::was_considered ( TGeomBaseObj *  o)

Some vertices are not considered for the dual graph (e.g. ghosts).

Note that this method only works while the underlying grid has not been changed since the last call to generate_graph.

References UG_ASSERT.

Member Data Documentation

◆ m_aaElemIndex

template<class TGeomBaseObj , class TIndexType , class TConnectingObj = typename TGeomBaseObj::side>
Grid::AttachmentAccessor<TGeomBaseObj, AElemIndex> ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::m_aaElemIndex
private

◆ m_aaElemIndices

template<class TGeomBaseObj , class TIndexType , class TConnectingObj = typename TGeomBaseObj::side>
Grid::AttachmentAccessor<TConnectingObj, AElemIndices> ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::m_aaElemIndices
private

◆ m_adjacencyMap

template<class TGeomBaseObj , class TIndexType , class TConnectingObj = typename TGeomBaseObj::side>
std::vector<TIndexType> ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::m_adjacencyMap
private

◆ m_adjacencyMapStructure

template<class TGeomBaseObj , class TIndexType , class TConnectingObj = typename TGeomBaseObj::side>
std::vector<TIndexType> ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::m_adjacencyMapStructure
private

◆ m_aElemIndex

template<class TGeomBaseObj , class TIndexType , class TConnectingObj = typename TGeomBaseObj::side>
AElemIndex ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::m_aElemIndex
private

◆ m_aElemIndices

template<class TGeomBaseObj , class TIndexType , class TConnectingObj = typename TGeomBaseObj::side>
AElemIndices ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::m_aElemIndices
private

◆ m_connections

template<class TGeomBaseObj , class TIndexType , class TConnectingObj = typename TGeomBaseObj::side>
std::vector<TConnectingObj*> ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::m_connections
private

◆ m_elems

template<class TGeomBaseObj , class TIndexType , class TConnectingObj = typename TGeomBaseObj::side>
std::vector<TGeomBaseObj*> ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::m_elems
private

◆ m_nodeOffsetMap

template<class TGeomBaseObj , class TIndexType , class TConnectingObj = typename TGeomBaseObj::side>
std::vector<TIndexType> ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::m_nodeOffsetMap
private

◆ m_pMG

template<class TGeomBaseObj , class TIndexType , class TConnectingObj = typename TGeomBaseObj::side>
MultiGrid* ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::m_pMG
private

◆ m_procCom

template<class TGeomBaseObj , class TIndexType , class TConnectingObj = typename TGeomBaseObj::side>
pcl::ProcessCommunicator ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::m_procCom
private

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