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, 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) |
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< std::string, int > | m_fieldNameToId |
std::map< int, MultiWeight > | m_vertWeights |
BndRegionOrdering | m_bndRegOrder |
BoostSubGraph | m_mesh |
std::vector< BoostSubGraph > | m_localPartition |
CommSharedPtr | m_comm |
bool | m_weightingRequired |
bool | m_shared |
Definition at line 62 of file MeshPartition.h.
|
private |
Definition at line 174 of file MeshPartition.h.
|
private |
Definition at line 165 of file MeshPartition.h.
|
private |
Definition at line 168 of file MeshPartition.h.
|
private |
Definition at line 155 of file MeshPartition.h.
|
private |
Definition at line 158 of file MeshPartition.h.
|
private |
Definition at line 162 of file MeshPartition.h.
|
private |
Definition at line 171 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 176 of file MeshPartition.h.
|
private |
Definition at line 177 of file MeshPartition.h.
Nektar::LibUtilities::MeshPartition::MeshPartition | ( | const SessionReaderSharedPtr & | pSession | ) |
Definition at line 78 of file MeshPartition.cpp.
References ReadConditions(), ReadExpansions(), and ReadGeometry().
|
virtual |
Definition at line 90 of file MeshPartition.cpp.
|
private |
Definition at line 2171 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 1103 of file MeshPartition.cpp.
References Nektar::iterator, m_meshElements, m_vertWeights, and m_weightingRequired.
Referenced by PartitionMesh().
void Nektar::LibUtilities::MeshPartition::GetBndRegionOrdering | ( | BndRegionOrdering & | composites | ) |
Definition at line 183 of file MeshPartition.cpp.
References m_bndRegOrder.
void Nektar::LibUtilities::MeshPartition::GetCompositeOrdering | ( | CompositeOrdering & | composites | ) |
Definition at line 173 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 2156 of file MeshPartition.cpp.
References ASSERTL0, m_localPartition, and m_meshElements.
|
private |
Definition at line 1329 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, 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 1160 of file MeshPartition.cpp.
References CheckPartitions(), ErrorUtil::efatal, m_comm, m_shared, 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 95 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 916 of file MeshPartition.cpp.
References ASSERTL0, CalculateElementWeight(), Nektar::iterator, m_dim, m_domain, m_expansions, m_localPartition, m_mesh, and m_meshComposites.
|
private |
Definition at line 986 of file MeshPartition.cpp.
References ASSERTL0, 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 189 of file MeshPartition.cpp.
References ASSERTL0, Nektar::ParseUtils::GenerateOrderedStringVector(), Nektar::ParseUtils::GenerateOrderedVector(), Nektar::ParseUtils::GenerateSeqVector(), m_dim, m_expansions, m_fieldNameToId, and m_numFields.
Referenced by MeshPartition().
|
private |
Definition at line 292 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 1055 of file MeshPartition.cpp.
References ASSERTL0, CalculateElementWeight(), Nektar::iterator, m_dim, m_domain, m_expansions, m_fieldNameToId, m_meshComposites, m_meshElements, m_numFields, and m_vertWeights.
Referenced by PartitionMesh().
void Nektar::LibUtilities::MeshPartition::WriteAllPartitions | ( | LibUtilities::SessionReaderSharedPtr & | pSession | ) |
Definition at line 140 of file MeshPartition.cpp.
References m_localPartition, OutputPartition(), and Nektar::LibUtilities::PortablePath().
void Nektar::LibUtilities::MeshPartition::WriteLocalPartition | ( | LibUtilities::SessionReaderSharedPtr & | pSession | ) |
Definition at line 110 of file MeshPartition.cpp.
References m_comm, m_localPartition, OutputPartition(), and Nektar::LibUtilities::PortablePath().
|
private |
Definition at line 199 of file MeshPartition.h.
Referenced by GetBndRegionOrdering(), and OutputPartition().
|
private |
Definition at line 204 of file MeshPartition.h.
Referenced by PartitionGraph(), and WriteLocalPartition().
|
private |
Definition at line 179 of file MeshPartition.h.
Referenced by OutputPartition(), PrintPartInfo(), ReadExpansions(), ReadGeometry(), and WeightElements().
|
private |
Definition at line 189 of file MeshPartition.h.
Referenced by OutputPartition(), PrintPartInfo(), ReadGeometry(), and WeightElements().
|
private |
Definition at line 194 of file MeshPartition.h.
Referenced by PrintPartInfo(), ReadExpansions(), and WeightElements().
|
private |
Definition at line 196 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 202 of file MeshPartition.h.
Referenced by GetElementIDs(), PartitionMesh(), PrintPartInfo(), WriteAllPartitions(), and WriteLocalPartition().
|
private |
Definition at line 201 of file MeshPartition.h.
Referenced by PartitionMesh(), and PrintPartInfo().
|
private |
Definition at line 188 of file MeshPartition.h.
Referenced by GetCompositeOrdering(), OutputPartition(), PrintPartInfo(), ReadGeometry(), and WeightElements().
|
private |
Definition at line 186 of file MeshPartition.h.
Referenced by OutputPartition(), and ReadGeometry().
|
private |
Definition at line 187 of file MeshPartition.h.
Referenced by OutputPartition(), and ReadGeometry().
|
private |
Definition at line 183 of file MeshPartition.h.
Referenced by OutputPartition(), and ReadGeometry().
|
private |
Definition at line 185 of file MeshPartition.h.
Referenced by CreateGraph(), GetElementIDs(), OutputPartition(), PartitionMesh(), ReadGeometry(), and WeightElements().
|
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 OutputPartition(), and ReadGeometry().
|
private |
Definition at line 180 of file MeshPartition.h.
Referenced by ReadExpansions(), and WeightElements().
|
private |
Definition at line 207 of file MeshPartition.h.
Referenced by PartitionGraph(), and PartitionMesh().
|
private |
Definition at line 190 of file MeshPartition.h.
Referenced by OutputPartition(), and ReadGeometry().
|
private |
Definition at line 197 of file MeshPartition.h.
Referenced by CreateGraph(), and WeightElements().
|
private |
Definition at line 206 of file MeshPartition.h.
Referenced by CreateGraph(), PartitionGraph(), PartitionMesh(), and ReadConditions().