Nektar++
|
#include <MeshPartition.h>
Classes | |
struct | GraphEdgeProperties |
struct | GraphVertexProperties |
Public Member Functions | |
MeshPartition (const LibUtilities::SessionReaderSharedPtr session, LibUtilities::CommSharedPtr comm, int meshDim, std::map< int, MeshEntity > element, CompositeDescriptor compMap) | |
virtual | ~MeshPartition () |
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 | |
void | ReadExpansions () |
void | ReadConditions () |
void | WeightElements () |
void | CreateGraph () |
void | PartitionGraph (int nParts, bool overlapping=false) |
Partition the graph. More... | |
virtual void | 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 |
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) |
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 67 of file MeshPartition.h.
|
protected |
Definition at line 123 of file MeshPartition.h.
|
protected |
Definition at line 118 of file MeshPartition.h.
|
protected |
Definition at line 119 of file MeshPartition.h.
|
protected |
Definition at line 115 of file MeshPartition.h.
|
protected |
Definition at line 117 of file MeshPartition.h.
|
protected |
Definition at line 121 of file MeshPartition.h.
|
protected |
Definition at line 91 of file MeshPartition.h.
|
protected |
Definition at line 125 of file MeshPartition.h.
|
protected |
Definition at line 126 of file MeshPartition.h.
Nektar::SpatialDomains::MeshPartition::MeshPartition | ( | const LibUtilities::SessionReaderSharedPtr | session, |
LibUtilities::CommSharedPtr | comm, | ||
int | meshDim, | ||
std::map< int, MeshEntity > | element, | ||
CompositeDescriptor | compMap | ||
) |
Definition at line 76 of file MeshPartition.cpp.
References m_elements, m_ghostElmts, ReadConditions(), and ReadExpansions().
|
virtual |
Definition at line 104 of file MeshPartition.cpp.
|
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 918 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 844 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 |
|
protected |
Definition at line 508 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 832 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 588 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, PartitionGraphImpl(), and Vmath::Vsum().
Referenced by PartitionMesh().
|
protectedpure virtual |
Implemented in Nektar::SpatialDomains::MeshPartitionScotch, Nektar::SpatialDomains::MeshPartitionPtScotch, and Nektar::SpatialDomains::MeshPartitionMetis.
Referenced by PartitionGraph().
void Nektar::SpatialDomains::MeshPartition::PartitionMesh | ( | int | nParts, |
bool | shared = false , |
||
bool | overlapping = false , |
||
int | nLocal = 0 |
||
) |
Definition at line 108 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 308 of file MeshPartition.cpp.
References ASSERTL0, CalculateElementWeight(), m_dim, m_expansions, m_graph, m_localPartition, and m_shape.
|
protected |
Definition at line 377 of file MeshPartition.cpp.
References ASSERTL0, m_session, m_weightBnd, m_weightDofs, and m_weightingRequired.
Referenced by MeshPartition().
|
protected |
Definition at line 129 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(), m_compMap, m_dim, m_expansions, m_fieldNameToId, m_numFields, m_session, and m_shape.
Referenced by MeshPartition().
|
protected |
Definition at line 452 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 129 of file MeshPartition.h.
Referenced by PartitionGraph(), and Nektar::SpatialDomains::MeshPartitionPtScotch::PartitionGraphImpl().
|
protected |
Definition at line 136 of file MeshPartition.h.
Referenced by ReadExpansions().
|
protected |
Definition at line 131 of file MeshPartition.h.
Referenced by PrintPartInfo(), ReadExpansions(), and WeightElements().
|
protected |
Definition at line 148 of file MeshPartition.h.
Referenced by CreateGraph(), and WeightElements().
|
protected |
Definition at line 134 of file MeshPartition.h.
Referenced by CreateGraph(), MeshPartition(), PartitionMesh(), and WeightElements().
|
protected |
Definition at line 140 of file MeshPartition.h.
Referenced by PrintPartInfo(), ReadExpansions(), and WeightElements().
|
protected |
Definition at line 145 of file MeshPartition.h.
Referenced by ReadExpansions(), and WeightElements().
|
protected |
Definition at line 135 of file MeshPartition.h.
Referenced by CreateGraph(), MeshPartition(), and PartitionGraph().
|
protected |
Definition at line 150 of file MeshPartition.h.
Referenced by CreateGraph(), PartitionGraph(), and PrintPartInfo().
|
protected |
Definition at line 151 of file MeshPartition.h.
Referenced by GetElementIDs(), PartitionGraph(), and PrintPartInfo().
|
protected |
Definition at line 132 of file MeshPartition.h.
Referenced by ReadExpansions(), and WeightElements().
|
protected |
Definition at line 157 of file MeshPartition.h.
Referenced by Nektar::SpatialDomains::MeshPartitionPtScotch::MeshPartitionPtScotch(), PartitionGraph(), and PartitionMesh().
|
protected |
Definition at line 128 of file MeshPartition.h.
Referenced by ReadConditions(), and ReadExpansions().
|
protected |
Definition at line 143 of file MeshPartition.h.
Referenced by PrintPartInfo(), ReadExpansions(), and WeightElements().
|
protected |
Definition at line 156 of file MeshPartition.h.
Referenced by PartitionGraph(), and PartitionMesh().
|
protected |
Definition at line 147 of file MeshPartition.h.
Referenced by CreateGraph(), and WeightElements().
|
protected |
Definition at line 146 of file MeshPartition.h.
Referenced by CreateGraph(), and WeightElements().
|
protected |
Definition at line 154 of file MeshPartition.h.
Referenced by PartitionGraph(), and ReadConditions().
|
protected |
Definition at line 155 of file MeshPartition.h.
Referenced by PartitionGraph(), and ReadConditions().
|
protected |
Definition at line 153 of file MeshPartition.h.
Referenced by CreateGraph(), PartitionGraph(), PartitionMesh(), and ReadConditions().