ug4
|
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, AElemIndex > | m_aaElemIndex |
Grid::AttachmentAccessor< TConnectingObj, AElemIndices > | m_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 |
MultiGrid * | m_pMG |
pcl::ProcessCommunicator | m_procCom |
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.
|
private |
|
private |
typedef std::vector<TGeomBaseObj*>::iterator ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::element_iterator_t |
ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::ParallelDualGraph | ( | MultiGrid * | pmg = NULL | ) |
ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::~ParallelDualGraph |
TIndexType * ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::adjacency_map |
Access to the graph which was generated during the last call to generate_graph.
References UG_ASSERT.
TIndexType * ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::adjacency_map_structure |
Access to the graph which was generated during the last call to generate_graph.
References UG_ASSERT.
|
private |
|
private |
|
inline |
returns the begin-iterator to the elements corresponding to graph vertices*/
References ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::m_elems.
|
inline |
returns the begin-iterator to the elements corresponding to graph vertices*/
References ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::m_elems.
void ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::generate_graph | ( | int | level, |
pcl::ProcessCommunicator | procCom = pcl::ProcessCommunicator(pcl::PCD_WORLD) |
||
) |
generates the graph for the given level.
Use adjacency_map_structure, adjacency_map, parallel_offset_map and num_graph_vertices to access the generated graph.
References ug::Grid::associated_elements(), ug::MultiGrid::begin(), ug::GridLayoutMap::clear(), pcl::InterfaceCommunicator< TLayout >::communicate(), pcl::ProcessCommunicator::create_sub_communicator(), dim, ug::Grid::distributed_grid_manager(), ug::MultiGrid::end(), GDIST_PROFILE_FUNC, ug::GridLayoutMap::get_layout(), ug::DistributedGridManager::grid_layout_map(), ug::GridLayoutMap::has_layout(), ug::INT_H_MASTER, ug::INT_H_SLAVE, ug::DistributedGridManager::is_ghost(), ug::LIB_GRID, PCL_DT_INT, pcl::InterfaceCommunicator< TLayout >::receive_data(), pcl::InterfaceCommunicator< TLayout >::send_data(), ug::PointerConstArray< TPtr >::size(), UG_ASSERT, UG_DLOG, and UG_THROW.
|
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.
|
inline |
returns the graph-vertex for the given index
References ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::m_elems.
|
inline |
returns the graph-vertex index of the given element
References ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::m_aaElemIndex.
TIndexType ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::num_graph_edges |
Access to the graph which was generated during the last call to generate_graph.
TIndexType ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::num_graph_vertices |
Access to the graph which was generated during the last call to generate_graph.
TIndexType * ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::parallel_offset_map |
Access to the graph which was generated during the last call to generate_graph.
References UG_ASSERT.
|
inline |
returns a process communicator which only contains processes which contain an element.
References ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::m_procCom.
void ug::ParallelDualGraph< TGeomBaseObj, TIndexType, TConnectingObj >::set_grid | ( | MultiGrid * | pmg | ) |
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.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |