Nektar++
|
#include <MeshPartition.h>
Classes | |
struct | GraphEdgeProperties |
struct | GraphVertexProperties |
Public Member Functions | |
void | PartitionMesh (int nParts, bool shared=false, bool overlapping=false, int nLocal=0) |
void | PrintPartInfo (std::ostream &out) |
void | GetElementIDs (const int procid, std::vector< unsigned int > &tmp) |
Protected Types | |
typedef std::vector< unsigned int > | MultiWeight |
typedef boost::adjacency_list< boost::setS, boost::vecS, boost::undirectedS, GraphVertexProperties, boost::property< boost::edge_index_t, unsigned int, GraphEdgeProperties > > | BoostGraph |
typedef boost::graph_traits< BoostGraph >::vertex_descriptor | BoostVertex |
typedef boost::graph_traits< BoostGraph >::edge_descriptor | BoostEdge |
typedef boost::graph_traits< BoostGraph >::edge_iterator | BoostEdgeIterator |
typedef boost::graph_traits< BoostGraph >::vertex_iterator | BoostVertexIterator |
typedef boost::graph_traits< BoostGraph >::adjacency_iterator | BoostAdjacencyIterator |
typedef std::vector< unsigned int > | NumModes |
typedef std::map< std::string, NumModes > | NummodesPerField |
Protected Member Functions | |
MeshPartition (const LibUtilities::SessionReaderSharedPtr session, LibUtilities::CommSharedPtr comm, int meshDim, std::map< int, MeshEntity > element, CompositeDescriptor compMap) | |
virtual | ~MeshPartition ()=default |
void | ReadExpansions () |
void | ReadConditions () |
void | WeightElements () |
void | CreateGraph () |
void | PartitionGraph (int nParts, bool overlapping=false) |
Partition the graph. More... | |
void | CheckPartitions (int nParts, Array< OneD, int > &pPart) |
int | CalculateElementWeight (LibUtilities::ShapeType elmtType, bool bndWeight, int na, int nb, int nc) |
int | CalculateEdgeWeight (LibUtilities::ShapeType elmtType, int na, int nb, int nc) |
virtual void | v_PartitionGraphImpl (int &nVerts, int &nVertConds, Nektar::Array< Nektar::OneD, int > &xadj, Nektar::Array< Nektar::OneD, int > &adjcy, Nektar::Array< Nektar::OneD, int > &vertWgt, Nektar::Array< Nektar::OneD, int > &vertSize, Nektar::Array< Nektar::OneD, int > &edgeWgt, int &nparts, int &volume, Nektar::Array< Nektar::OneD, int > &part)=0 |
Protected Attributes | |
LibUtilities::SessionReaderSharedPtr | m_session |
LibUtilities::CommSharedPtr | m_comm |
int | m_dim |
int | m_numFields |
std::map< int, MeshEntity > | m_elements |
std::map< int, MeshEntity > | m_ghostElmts |
CompositeDescriptor | m_compMap |
std::map< int, NummodesPerField > | m_expansions |
std::map< int, LibUtilities::ShapeType > | m_shape |
std::map< std::string, int > | m_fieldNameToId |
std::map< int, MultiWeight > | m_vertWeights |
std::map< int, MultiWeight > | m_vertBndWeights |
std::map< int, MultiWeight > | m_edgeWeights |
BoostGraph | m_graph |
std::map< int, std::vector< unsigned int > > | m_localPartition |
bool | m_weightingRequired |
bool | m_weightBnd |
bool | m_weightDofs |
bool | m_shared |
bool | m_parallel |
Definition at line 65 of file MeshPartition.h.
|
protected |
Definition at line 111 of file MeshPartition.h.
|
protected |
Definition at line 106 of file MeshPartition.h.
|
protected |
Definition at line 107 of file MeshPartition.h.
|
protected |
Definition at line 103 of file MeshPartition.h.
|
protected |
Definition at line 105 of file MeshPartition.h.
|
protected |
Definition at line 109 of file MeshPartition.h.
|
protected |
Definition at line 79 of file MeshPartition.h.
|
protected |
Definition at line 113 of file MeshPartition.h.
|
protected |
Definition at line 114 of file MeshPartition.h.
|
protected |
Definition at line 72 of file MeshPartition.cpp.
References m_elements, m_ghostElmts, ReadConditions(), and ReadExpansions().
|
protectedvirtualdefault |
|
protected |
Calculate the number of modes needed for communication when in partition boundary, to be used as weighting for edges. Since we do not know exactly which face this refers to, assume the max order and quad face (for prisms) as arbitrary choices
Definition at line 920 of file MeshPartition.cpp.
References Nektar::LibUtilities::eHexahedron, Nektar::LibUtilities::ePrism, Nektar::LibUtilities::ePyramid, Nektar::LibUtilities::eQuadrilateral, Nektar::LibUtilities::eSegment, Nektar::LibUtilities::eTetrahedron, Nektar::LibUtilities::eTriangle, Nektar::LibUtilities::StdTriData::getNumberOfCoefficients(), and Nektar::LibUtilities::StdQuadData::getNumberOfCoefficients().
Referenced by WeightElements().
|
protected |
Definition at line 846 of file MeshPartition.cpp.
References Nektar::LibUtilities::eHexahedron, Nektar::LibUtilities::ePoint, Nektar::LibUtilities::ePrism, Nektar::LibUtilities::ePyramid, Nektar::LibUtilities::eQuadrilateral, Nektar::LibUtilities::eSegment, Nektar::LibUtilities::eTetrahedron, Nektar::LibUtilities::eTriangle, Nektar::LibUtilities::StdSegData::getNumberOfBndCoefficients(), Nektar::LibUtilities::StdTriData::getNumberOfBndCoefficients(), Nektar::LibUtilities::StdQuadData::getNumberOfBndCoefficients(), Nektar::LibUtilities::StdHexData::getNumberOfBndCoefficients(), Nektar::LibUtilities::StdTetData::getNumberOfBndCoefficients(), Nektar::LibUtilities::StdPyrData::getNumberOfBndCoefficients(), Nektar::LibUtilities::StdPrismData::getNumberOfBndCoefficients(), Nektar::LibUtilities::StdSegData::getNumberOfCoefficients(), Nektar::LibUtilities::StdTriData::getNumberOfCoefficients(), Nektar::LibUtilities::StdQuadData::getNumberOfCoefficients(), Nektar::LibUtilities::StdHexData::getNumberOfCoefficients(), Nektar::LibUtilities::StdTetData::getNumberOfCoefficients(), Nektar::LibUtilities::StdPyrData::getNumberOfCoefficients(), and Nektar::LibUtilities::StdPrismData::getNumberOfCoefficients().
Referenced by PrintPartInfo(), and WeightElements().
|
protected |
Definition at line 804 of file MeshPartition.cpp.
Referenced by PartitionGraph().
|
protected |
Definition at line 502 of file MeshPartition.cpp.
References m_edgeWeights, m_elements, m_ghostElmts, m_graph, m_vertBndWeights, m_vertWeights, and m_weightingRequired.
Referenced by PartitionMesh().
void Nektar::SpatialDomains::MeshPartition::GetElementIDs | ( | const int | procid, |
std::vector< unsigned int > & | tmp | ||
) |
Definition at line 834 of file MeshPartition.cpp.
References ASSERTL0, and m_localPartition.
|
protected |
Partition the graph.
This routine partitions the graph pGraph
into nParts
, producing subgraphs that are populated in pLocalPartition
. If the overlapping
option is set (which is used for post-processing purposes), the resulting partitions are extended to cover neighbouring elements by additional vertex on the dual graph, which produces overlapping partitions (i.e. the intersection of two connected partitions is non-empty).
nParts | Number of partitions. |
pLocalPartition | Vector of sub-graphs representing each |
overlapping | True if resulting partitions should overlap. |
Definition at line 590 of file MeshPartition.cpp.
References ASSERTL0, CheckPartitions(), Nektar::ErrorUtil::efatal, m_comm, m_ghostElmts, m_graph, m_localPartition, m_parallel, m_shared, m_weightBnd, m_weightDofs, m_weightingRequired, NEKERROR, v_PartitionGraphImpl(), and Vmath::Vsum().
Referenced by PartitionMesh().
void Nektar::SpatialDomains::MeshPartition::PartitionMesh | ( | int | nParts, |
bool | shared = false , |
||
bool | overlapping = false , |
||
int | nLocal = 0 |
||
) |
Definition at line 99 of file MeshPartition.cpp.
References ASSERTL0, CreateGraph(), m_elements, m_parallel, m_shared, m_weightingRequired, PartitionGraph(), and WeightElements().
void Nektar::SpatialDomains::MeshPartition::PrintPartInfo | ( | std::ostream & | out | ) |
Definition at line 303 of file MeshPartition.cpp.
References ASSERTL0, CalculateElementWeight(), m_dim, m_expansions, m_graph, m_localPartition, and m_shape.
|
protected |
Definition at line 370 of file MeshPartition.cpp.
References ASSERTL0, Nektar::LibUtilities::SessionReader::GetXMLElementTimeLevel(), m_session, m_weightBnd, m_weightDofs, and m_weightingRequired.
Referenced by MeshPartition().
|
protected |
Definition at line 118 of file MeshPartition.cpp.
References ASSERTL0, Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::CreateInstance(), Nektar::ParseUtils::GenerateSeqVector(), Nektar::ParseUtils::GenerateVector(), Nektar::LibUtilities::GetCommFactory(), Nektar::LibUtilities::GetFieldIOFactory(), Nektar::LibUtilities::FieldIO::GetFileType(), Nektar::LibUtilities::SessionReader::GetXMLElementTimeLevel(), m_compMap, m_dim, m_expansions, m_fieldNameToId, m_numFields, m_session, and m_shape.
Referenced by MeshPartition().
|
protectedpure virtual |
Implemented in Nektar::SpatialDomains::MeshPartitionMetis, Nektar::SpatialDomains::MeshPartitionPtScotch, and Nektar::SpatialDomains::MeshPartitionScotch.
Referenced by PartitionGraph().
|
protected |
Definition at line 448 of file MeshPartition.cpp.
References ASSERTL0, CalculateEdgeWeight(), CalculateElementWeight(), m_dim, m_edgeWeights, m_elements, m_expansions, m_fieldNameToId, m_numFields, m_shape, m_vertBndWeights, and m_vertWeights.
Referenced by PartitionMesh().
|
protected |
Definition at line 117 of file MeshPartition.h.
Referenced by PartitionGraph(), and Nektar::SpatialDomains::MeshPartitionPtScotch::v_PartitionGraphImpl().
|
protected |
Definition at line 124 of file MeshPartition.h.
Referenced by ReadExpansions().
|
protected |
Definition at line 119 of file MeshPartition.h.
Referenced by PrintPartInfo(), ReadExpansions(), and WeightElements().
|
protected |
Definition at line 136 of file MeshPartition.h.
Referenced by CreateGraph(), and WeightElements().
|
protected |
Definition at line 122 of file MeshPartition.h.
Referenced by CreateGraph(), MeshPartition(), PartitionMesh(), and WeightElements().
|
protected |
Definition at line 128 of file MeshPartition.h.
Referenced by PrintPartInfo(), ReadExpansions(), and WeightElements().
|
protected |
Definition at line 133 of file MeshPartition.h.
Referenced by ReadExpansions(), and WeightElements().
|
protected |
Definition at line 123 of file MeshPartition.h.
Referenced by CreateGraph(), MeshPartition(), and PartitionGraph().
|
protected |
Definition at line 138 of file MeshPartition.h.
Referenced by CreateGraph(), PartitionGraph(), and PrintPartInfo().
|
protected |
Definition at line 139 of file MeshPartition.h.
Referenced by GetElementIDs(), PartitionGraph(), and PrintPartInfo().
|
protected |
Definition at line 120 of file MeshPartition.h.
Referenced by ReadExpansions(), and WeightElements().
|
protected |
Definition at line 145 of file MeshPartition.h.
Referenced by Nektar::SpatialDomains::MeshPartitionPtScotch::MeshPartitionPtScotch(), PartitionGraph(), and PartitionMesh().
|
protected |
Definition at line 116 of file MeshPartition.h.
Referenced by ReadConditions(), and ReadExpansions().
|
protected |
Definition at line 131 of file MeshPartition.h.
Referenced by PrintPartInfo(), ReadExpansions(), and WeightElements().
|
protected |
Definition at line 144 of file MeshPartition.h.
Referenced by PartitionGraph(), and PartitionMesh().
|
protected |
Definition at line 135 of file MeshPartition.h.
Referenced by CreateGraph(), and WeightElements().
|
protected |
Definition at line 134 of file MeshPartition.h.
Referenced by CreateGraph(), and WeightElements().
|
protected |
Definition at line 142 of file MeshPartition.h.
Referenced by PartitionGraph(), and ReadConditions().
|
protected |
Definition at line 143 of file MeshPartition.h.
Referenced by PartitionGraph(), and ReadConditions().
|
protected |
Definition at line 141 of file MeshPartition.h.
Referenced by CreateGraph(), PartitionGraph(), PartitionMesh(), and ReadConditions().