Nektar++
|
#include <MeshPartition.h>
Classes | |
struct | GraphEdgeProperties |
struct | GraphVertexProperties |
struct | MeshComposite |
struct | MeshCurved |
struct | MeshElement |
struct | MeshEntity |
struct | MeshFace |
Public Member Functions | |
MeshPartition (const SessionReaderSharedPtr &pSession) | |
virtual | ~MeshPartition () |
void | PartitionMesh (int nParts, bool shared=false, bool overlapping=false) |
void | WriteLocalPartition (SessionReaderSharedPtr &pSession) |
void | WriteAllPartitions (SessionReaderSharedPtr &pSession) |
void | PrintPartInfo (std::ostream &out) |
void | GetCompositeOrdering (CompositeOrdering &composites) |
void | GetBndRegionOrdering (BndRegionOrdering &composites) |
void | GetElementIDs (const int procid, std::vector< unsigned int > &tmp) |
Private Types | |
typedef std::pair< std::string, int > | MeshCurvedKey |
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::subgraph < BoostGraph > | BoostSubGraph |
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 |
Private Member Functions | |
void | ReadExpansions (const SessionReaderSharedPtr &pSession) |
void | ReadGeometry (const SessionReaderSharedPtr &pSession) |
void | ReadConditions (const SessionReaderSharedPtr &pSession) |
void | WeightElements () |
void | CreateGraph (BoostSubGraph &pGraph) |
void | PartitionGraph (BoostSubGraph &pGraph, int nParts, std::vector< BoostSubGraph > &pLocalPartition, 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 | OutputPartition (SessionReaderSharedPtr &pSession, BoostSubGraph &pGraph, TiXmlElement *pGeometry) |
void | CheckPartitions (int nParts, Array< OneD, int > &pPart) |
int | CalculateElementWeight (char elmtType, bool bndWeight, int na, int nb, int nc) |
int | CalculateEdgeWeight (char elmtType, int na, int nb, int nc) |
Private Attributes | |
bool | m_isCompressed |
int | m_dim |
int | m_numFields |
std::map< int, MeshVertex > | m_meshVertices |
std::map< int, MeshEntity > | m_meshEdges |
std::map< int, MeshEntity > | m_meshFaces |
std::map< int, MeshEntity > | m_meshElements |
std::map< MeshCurvedKey, MeshCurved > | m_meshCurved |
std::map< int, MeshCurvedPts > | m_meshCurvedPts |
std::map< int, MeshEntity > | m_meshComposites |
std::vector< unsigned int > | m_domain |
std::map< std::string, std::string > | m_vertexAttributes |
std::map< int, NummodesPerField > | m_expansions |
std::map< int, char > | 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 |
BndRegionOrdering | m_bndRegOrder |
BoostSubGraph | m_mesh |
std::vector< BoostSubGraph > | m_localPartition |
CommSharedPtr | m_comm |
bool | m_weightingRequired |
bool | m_weightBnd |
bool | m_weightDofs |
bool | m_shared |
Definition at line 62 of file MeshPartition.h.
|
private |
Definition at line 176 of file MeshPartition.h.
|
private |
Definition at line 167 of file MeshPartition.h.
|
private |
Definition at line 170 of file MeshPartition.h.
|
private |
Definition at line 157 of file MeshPartition.h.
|
private |
Definition at line 160 of file MeshPartition.h.
|
private |
Definition at line 164 of file MeshPartition.h.
|
private |
Definition at line 173 of file MeshPartition.h.
|
private |
Definition at line 125 of file MeshPartition.h.
|
private |
Definition at line 126 of file MeshPartition.h.
|
private |
Definition at line 178 of file MeshPartition.h.
|
private |
Definition at line 179 of file MeshPartition.h.
Nektar::LibUtilities::MeshPartition::MeshPartition | ( | const SessionReaderSharedPtr & | pSession | ) |
Definition at line 79 of file MeshPartition.cpp.
References ReadConditions(), ReadExpansions(), and ReadGeometry().
|
virtual |
Definition at line 93 of file MeshPartition.cpp.
|
private |
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 2378 of file MeshPartition.cpp.
References Nektar::LibUtilities::StdTriData::getNumberOfCoefficients(), and Nektar::LibUtilities::StdQuadData::getNumberOfCoefficients().
Referenced by WeightElements().
|
private |
Definition at line 2316 of file MeshPartition.cpp.
References 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().
|
private |
|
private |
Definition at line 1232 of file MeshPartition.cpp.
References Nektar::iterator, m_edgeWeights, m_meshElements, m_vertBndWeights, m_vertWeights, and m_weightingRequired.
Referenced by PartitionMesh().
void Nektar::LibUtilities::MeshPartition::GetBndRegionOrdering | ( | BndRegionOrdering & | composites | ) |
Definition at line 186 of file MeshPartition.cpp.
References m_bndRegOrder.
void Nektar::LibUtilities::MeshPartition::GetCompositeOrdering | ( | CompositeOrdering & | composites | ) |
Definition at line 176 of file MeshPartition.cpp.
References Nektar::iterator, and m_meshComposites.
void Nektar::LibUtilities::MeshPartition::GetElementIDs | ( | const int | procid, |
std::vector< unsigned int > & | tmp | ||
) |
Definition at line 2301 of file MeshPartition.cpp.
References ASSERTL0, m_localPartition, and m_meshElements.
|
private |
Definition at line 1474 of file MeshPartition.cpp.
References ASSERTL0, Nektar::LibUtilities::MeshPartition::MeshCurved::data, Nektar::LibUtilities::MeshTri::e, Nektar::LibUtilities::MeshQuad::e, Nektar::LibUtilities::MeshCurvedInfo::entityid, Nektar::LibUtilities::MeshPartition::MeshCurved::entityid, Nektar::LibUtilities::MeshPartition::MeshCurved::entitytype, Nektar::LibUtilities::MeshTet::f, Nektar::LibUtilities::MeshPyr::f, Nektar::LibUtilities::MeshPrism::f, Nektar::LibUtilities::MeshHex::f, Nektar::ParseUtils::GenerateSeqString(), Nektar::ParseUtils::GenerateSeqVector(), Nektar::LibUtilities::CompressData::GetBitSizeStr(), Nektar::LibUtilities::CompressData::GetCompressString(), Nektar::LibUtilities::MeshVertex::id, Nektar::LibUtilities::MeshEdge::id, Nektar::LibUtilities::MeshTri::id, Nektar::LibUtilities::MeshQuad::id, Nektar::LibUtilities::MeshTet::id, Nektar::LibUtilities::MeshPyr::id, Nektar::LibUtilities::MeshPrism::id, Nektar::LibUtilities::MeshHex::id, Nektar::LibUtilities::MeshPartition::MeshCurved::id, Nektar::LibUtilities::MeshCurvedInfo::id, Nektar::LibUtilities::MeshCurvedPts::id, Nektar::LibUtilities::MeshCurvedPts::index, Nektar::iterator, Nektar::LibUtilities::kPointsTypeStr, m_bndRegOrder, m_dim, m_domain, m_isCompressed, m_meshComposites, m_meshCurved, m_meshCurvedPts, m_meshEdges, m_meshElements, m_meshFaces, m_meshVertices, m_vertexAttributes, Nektar::LibUtilities::MeshCurvedInfo::npoints, Nektar::LibUtilities::MeshPartition::MeshCurved::npoints, CellMLToNektar.cellml_metadata::p, Nektar::LibUtilities::MeshCurvedInfo::ptid, Nektar::LibUtilities::MeshPartition::MeshCurved::ptid, Nektar::LibUtilities::MeshCurvedInfo::ptoffset, Nektar::LibUtilities::MeshPartition::MeshCurved::ptoffset, Nektar::LibUtilities::MeshCurvedPts::pts, Nektar::LibUtilities::MeshCurvedInfo::ptype, Nektar::LibUtilities::SIZE_PointsType, Nektar::LibUtilities::MeshPartition::MeshCurved::type, Nektar::LibUtilities::MeshEdge::v0, Nektar::LibUtilities::MeshEdge::v1, Nektar::LibUtilities::MeshVertex::x, Nektar::LibUtilities::MeshVertex::y, Nektar::LibUtilities::MeshVertex::z, and Nektar::LibUtilities::CompressData::ZlibEncodeToBase64Str().
Referenced by WriteAllPartitions(), and WriteLocalPartition().
|
private |
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).
pGraph | Graph to be partitioned. |
nParts | Number of partitions. |
pLocalPartition | Vector of sub-graphs representing each partition. |
overlapping | True if resulting partitions should overlap. |
Definition at line 1291 of file MeshPartition.cpp.
References CheckPartitions(), ErrorUtil::efatal, m_comm, m_shared, m_weightBnd, m_weightDofs, m_weightingRequired, NEKERROR, and PartitionGraphImpl().
Referenced by PartitionMesh().
|
privatepure virtual |
Implemented in Nektar::LibUtilities::MeshPartitionScotch, and Nektar::LibUtilities::MeshPartitionMetis.
Referenced by PartitionGraph().
void Nektar::LibUtilities::MeshPartition::PartitionMesh | ( | int | nParts, |
bool | shared = false , |
||
bool | overlapping = false |
||
) |
Definition at line 98 of file MeshPartition.cpp.
References ASSERTL0, CreateGraph(), m_localPartition, m_mesh, m_meshElements, m_shared, m_weightingRequired, PartitionGraph(), and WeightElements().
void Nektar::LibUtilities::MeshPartition::PrintPartInfo | ( | std::ostream & | out | ) |
Definition at line 1031 of file MeshPartition.cpp.
References ASSERTL0, CalculateElementWeight(), Nektar::iterator, m_dim, m_expansions, m_localPartition, m_mesh, and m_shape.
|
private |
Definition at line 1099 of file MeshPartition.cpp.
References ASSERTL0, m_weightBnd, m_weightDofs, and m_weightingRequired.
Referenced by MeshPartition().
|
private |
Expansiontypes will contain plenty of data, where relevant at this stage are composite ID(s) that this expansion type describes, nummodes and a list of fields that this expansion relates to. If this does not exist the variable is only set to "DefaultVar".
Definition at line 192 of file MeshPartition.cpp.
References ASSERTL0, Nektar::LibUtilities::NekFactory< tKey, tBase, >::CreateInstance(), Nektar::LibUtilities::eHexahedron, Nektar::LibUtilities::ePrism, Nektar::LibUtilities::ePyramid, Nektar::LibUtilities::eQuadrilateral, Nektar::LibUtilities::eSegment, Nektar::LibUtilities::eTetrahedron, Nektar::LibUtilities::eTriangle, Nektar::ParseUtils::GenerateOrderedStringVector(), Nektar::ParseUtils::GenerateOrderedVector(), Nektar::ParseUtils::GenerateSeqVector(), Nektar::LibUtilities::GetCommFactory(), Nektar::LibUtilities::GetFieldIOFactory(), Nektar::LibUtilities::FieldIO::GetFileType(), m_dim, m_expansions, m_fieldNameToId, m_meshComposites, m_numFields, and m_shape.
Referenced by MeshPartition().
|
private |
Definition at line 407 of file MeshPartition.cpp.
References ASSERTL0, Nektar::LibUtilities::MeshPartition::MeshCurved::data, Nektar::LibUtilities::MeshPartition::MeshCurved::entityid, Nektar::LibUtilities::MeshPartition::MeshCurved::entitytype, Nektar::ParseUtils::GenerateSeqVector(), Nektar::LibUtilities::CompressData::GetCompressString(), Nektar::LibUtilities::MeshVertex::id, Nektar::LibUtilities::MeshPartition::MeshEntity::id, Nektar::LibUtilities::MeshPartition::MeshCurved::id, Nektar::LibUtilities::MeshCurvedPts::id, Nektar::LibUtilities::MeshCurvedPts::index, Nektar::LibUtilities::kPointsTypeStr, Nektar::LibUtilities::MeshPartition::MeshEntity::list, m_dim, m_domain, m_isCompressed, m_meshComposites, m_meshCurved, m_meshCurvedPts, m_meshEdges, m_meshElements, m_meshFaces, m_meshVertices, m_vertexAttributes, Nektar::LibUtilities::MeshPartition::MeshCurved::npoints, Nektar::LibUtilities::MeshPartition::MeshCurved::ptid, Nektar::LibUtilities::MeshPartition::MeshCurved::ptoffset, Nektar::LibUtilities::MeshCurvedPts::pts, Nektar::LibUtilities::MeshPartition::MeshEntity::type, Nektar::LibUtilities::MeshPartition::MeshCurved::type, Nektar::LibUtilities::MeshVertex::x, Nektar::LibUtilities::MeshVertex::y, Nektar::LibUtilities::MeshVertex::z, and Nektar::LibUtilities::CompressData::ZlibDecodeFromBase64Str().
Referenced by MeshPartition().
|
private |
Definition at line 1180 of file MeshPartition.cpp.
References ASSERTL0, CalculateEdgeWeight(), CalculateElementWeight(), Nektar::iterator, m_dim, m_edgeWeights, m_expansions, m_fieldNameToId, m_meshElements, m_numFields, m_shape, m_vertBndWeights, and m_vertWeights.
Referenced by PartitionMesh().
void Nektar::LibUtilities::MeshPartition::WriteAllPartitions | ( | LibUtilities::SessionReaderSharedPtr & | pSession | ) |
Definition at line 143 of file MeshPartition.cpp.
References CellMLToNektar.pycml::format, m_localPartition, OutputPartition(), and Nektar::LibUtilities::PortablePath().
void Nektar::LibUtilities::MeshPartition::WriteLocalPartition | ( | LibUtilities::SessionReaderSharedPtr & | pSession | ) |
Definition at line 113 of file MeshPartition.cpp.
References CellMLToNektar.pycml::format, m_comm, m_localPartition, OutputPartition(), and Nektar::LibUtilities::PortablePath().
|
private |
Definition at line 206 of file MeshPartition.h.
Referenced by GetBndRegionOrdering(), and OutputPartition().
|
private |
Definition at line 211 of file MeshPartition.h.
Referenced by PartitionGraph(), and WriteLocalPartition().
|
private |
Definition at line 181 of file MeshPartition.h.
Referenced by OutputPartition(), PrintPartInfo(), ReadExpansions(), ReadGeometry(), and WeightElements().
|
private |
Definition at line 191 of file MeshPartition.h.
Referenced by OutputPartition(), and ReadGeometry().
|
private |
Definition at line 204 of file MeshPartition.h.
Referenced by CreateGraph(), and WeightElements().
|
private |
Definition at line 196 of file MeshPartition.h.
Referenced by PrintPartInfo(), ReadExpansions(), and WeightElements().
|
private |
Definition at line 201 of file MeshPartition.h.
Referenced by ReadExpansions(), and WeightElements().
|
private |
Definition at line 124 of file MeshPartition.h.
Referenced by OutputPartition(), and ReadGeometry().
|
private |
Definition at line 209 of file MeshPartition.h.
Referenced by GetElementIDs(), PartitionMesh(), PrintPartInfo(), WriteAllPartitions(), and WriteLocalPartition().
|
private |
Definition at line 208 of file MeshPartition.h.
Referenced by PartitionMesh(), and PrintPartInfo().
|
private |
Definition at line 190 of file MeshPartition.h.
Referenced by GetCompositeOrdering(), OutputPartition(), ReadExpansions(), and ReadGeometry().
|
private |
Definition at line 188 of file MeshPartition.h.
Referenced by OutputPartition(), and ReadGeometry().
|
private |
Definition at line 189 of file MeshPartition.h.
Referenced by OutputPartition(), and ReadGeometry().
|
private |
Definition at line 185 of file MeshPartition.h.
Referenced by OutputPartition(), and ReadGeometry().
|
private |
Definition at line 187 of file MeshPartition.h.
Referenced by CreateGraph(), GetElementIDs(), OutputPartition(), PartitionMesh(), ReadGeometry(), and WeightElements().
|
private |
Definition at line 186 of file MeshPartition.h.
Referenced by OutputPartition(), and ReadGeometry().
|
private |
Definition at line 184 of file MeshPartition.h.
Referenced by OutputPartition(), and ReadGeometry().
|
private |
Definition at line 182 of file MeshPartition.h.
Referenced by ReadExpansions(), and WeightElements().
|
private |
Definition at line 199 of file MeshPartition.h.
Referenced by PrintPartInfo(), ReadExpansions(), and WeightElements().
|
private |
Definition at line 216 of file MeshPartition.h.
Referenced by PartitionGraph(), and PartitionMesh().
|
private |
Definition at line 203 of file MeshPartition.h.
Referenced by CreateGraph(), and WeightElements().
|
private |
Definition at line 192 of file MeshPartition.h.
Referenced by OutputPartition(), and ReadGeometry().
|
private |
Definition at line 202 of file MeshPartition.h.
Referenced by CreateGraph(), and WeightElements().
|
private |
Definition at line 214 of file MeshPartition.h.
Referenced by PartitionGraph(), and ReadConditions().
|
private |
Definition at line 215 of file MeshPartition.h.
Referenced by PartitionGraph(), and ReadConditions().
|
private |
Definition at line 213 of file MeshPartition.h.
Referenced by CreateGraph(), PartitionGraph(), PartitionMesh(), and ReadConditions().