29 #ifndef NEMOSYS_MESHPARTITIONER_H_ 30 #define NEMOSYS_MESHPARTITIONER_H_ 32 #include "nemosys_export.h" 64 const std::vector<int> &glbElmPartedIdx,
65 const std::vector<int> &glbElmConn,
70 std::vector<double> getCrds(
const std::vector<double> &crds)
const;
71 std::vector<int>
getConns()
const {
return partElmConn; }
72 std::vector<double> getElmSlns(
const std::vector<double> &slns)
const;
73 std::vector<double> getElmSlnsVec(
const std::vector<double> &slns,
int nComp)
const;
102 const std::vector<int> &elemConn,
104 nNde(nNde), nElm(nElm), nPart(0), meshType(meshType)
106 elmConn.insert(elmConn.begin(), elemConn.begin(), elemConn.end());
123 if (!meshParts.empty())
124 for (
int iPart = 0; iPart < nPart; iPart++)
125 delete meshParts[iPart];
131 int partition(
int nPartition);
134 std::vector<double> getPartedNde()
const;
135 std::vector<double> getPartedElm()
const;
137 void setPartedElm(
const std::vector<double> &prtElm);
140 const std::vector<double> &crds)
const 141 {
return meshParts[iPart]->getCrds(crds); }
143 {
return meshParts[iPart]->getConns(); }
144 int getNNdePart(
int iPart)
const {
return meshParts[iPart]->nNde; }
145 int getNElmPart(
int iPart)
const {
return meshParts[iPart]->nElm; }
147 std::map<int, int> getPartToGlobNodeMap(
int iPart)
const;
148 std::map<int, int> getPartToGlobElmMap(
int iPart)
const;
155 const std::vector<double> &slns)
const 156 {
return getCrds(iPart, slns); }
159 const std::vector<double> &slns)
const 160 {
return meshParts[iPart]->getElmSlns(slns); }
162 const std::vector<double> &slns,
164 {
return meshParts[iPart]->getElmSlnsVec(slns, nComp); }
167 void buildPartitions();
178 idx_t options[METIS_NOPTIONS];
186 #endif // NEMOSYS_MESHPARTITIONER_H_
int getNElmPart(int iPart) const
meshPartitioner(int nNde, int nElm, const std::vector< int > &elemConn, MeshType_t meshType)
A brief description of meshBase.
std::vector< meshPartition * > meshParts
std::vector< int > globNdeIdx
std::map< int, int > ndeIdxPartToGlob
int getNNdePart(int iPart) const
std::vector< double > getElmSlnVec(int iPart, const std::vector< double > &slns, int nComp) const
std::map< int, int > getPartToGlobNodeMap() const
std::vector< double > getNdeSlnScalar(int iPart, const std::vector< double > &slns) const
std::vector< int > elmConn
std::vector< int > elmConnVec
void setNPartition(int nPartition)
std::map< int, int > ndeIdxGlobToPart
std::vector< double > getCrds(int iPart, const std::vector< double > &crds) const
std::vector< double > getElmSlnScalar(int iPart, const std::vector< double > &slns) const
std::map< int, int > getPartToGlobElmMap() const
std::vector< int > getConns(int iPart) const
std::vector< int > globElmIdx
std::map< int, int > elmIdxGlobToPart
int getNPartition() const
std::vector< int > partElmConn
std::vector< int > getConns() const
std::map< int, int > elmIdxPartToGlob