55 #include <boost/algorithm/string.hpp>
56 #include <boost/graph/adjacency_list.hpp>
57 #include <boost/graph/adjacency_iterator.hpp>
58 #include <boost/graph/detail/edge.hpp>
59 #include <boost/format.hpp>
63 namespace LibUtilities
70 Loki::SingleThreaded> Type;
71 return Type::Instance();
77 m_comm(pSession->GetComm()),
78 m_weightingRequired(false)
93 "Too few elements for this many processes.");
107 TiXmlDeclaration * decl =
new TiXmlDeclaration(
"1.0",
"utf-8",
"");
108 vNew.LinkEndChild(decl);
110 TiXmlElement* vElmtNektar;
111 vElmtNektar =
new TiXmlElement(
"NEKTAR");
113 int rank =
m_comm->GetRowComm()->GetRank();
116 vNew.LinkEndChild(vElmtNektar);
118 std::string dirname = pSession->GetSessionName() +
"_xml";
119 fs::path pdirname(dirname);
121 boost::format pad(
"P%1$07d.xml");
123 fs::path pFilename(pad.str());
125 if(!fs::is_directory(dirname))
127 fs::create_directory(dirname);
130 fs::path fullpath = pdirname / pFilename;
139 TiXmlDeclaration * decl =
new TiXmlDeclaration(
"1.0",
"utf-8",
"");
140 vNew.LinkEndChild(decl);
142 TiXmlElement* vElmtNektar;
143 vElmtNektar =
new TiXmlElement(
"NEKTAR");
147 vNew.LinkEndChild(vElmtNektar);
149 std::string dirname = pSession->GetSessionName() +
"_xml";
150 fs::path pdirname(dirname);
152 boost::format pad(
"P%1$07d.xml");
154 fs::path pFilename(pad.str());
156 fs::path fullpath = pdirname / pFilename;
158 if(!fs::is_directory(dirname))
160 fs::create_directory(dirname);
173 composites[it->first] = it->second.list;
186 TiXmlElement *expansionTypes = pSession->GetElement(
"Nektar/Expansions");
189 TiXmlElement *expansion = expansionTypes->FirstChildElement();
190 std::string expType = expansion->Value();
195 ASSERTL0(
false,
"Expansion type not defined or not supported at the moment");
207 std::vector<unsigned int> composite;
208 std::vector<unsigned int> nummodes;
209 std::vector<std::string> fieldName;
211 const char *nModesStr = expansion->Attribute(
"NUMMODES");
212 ASSERTL0(nModesStr,
"NUMMODES was not defined in EXPANSION section of input");
213 std::string numModesStr = nModesStr;
215 ASSERTL0(valid,
"Unable to correctly parse the number of modes.");
217 if (nummodes.size() == 1)
219 for (
int i = 1; i <
m_dim; i++)
221 nummodes.push_back( nummodes[0] );
224 ASSERTL0(nummodes.size() ==
m_dim,
"Number of modes should match mesh dimension");
227 const char *fStr = expansion->Attribute(
"FIELDS");
230 std::string fieldStr = fStr;
232 ASSERTL0(valid,
"Unable to correctly parse the field string in ExpansionTypes.");
234 for (
int i = 0; i < fieldName.size(); ++i)
246 fieldName.push_back(
"DefaultVar");
252 "Omitting field variables and explicitly listing " \
253 "them in different ExpansionTypes is wrong practise");
260 std::string compositeStr = expansion->Attribute(
"COMPOSITE");
261 ASSERTL0(compositeStr.length() > 3,
"COMPOSITE must be specified in expansion definition");
262 int beg = compositeStr.find_first_of(
"[");
263 int end = compositeStr.find_first_of(
"]");
264 std::string compositeListStr = compositeStr.substr(beg+1,end-beg-1);
266 ASSERTL0(parseGood && !composite.empty(),
267 (std::string(
"Unable to read composite index range: ") + compositeListStr).c_str());
271 for (
int i = 0; i < composite.size(); ++i)
273 for (
int j = 0; j < fieldName.size(); j++)
279 expansion = expansion->NextSiblingElement(
"E");
289 TiXmlElement *vGeometry, *vSubElement;
291 vGeometry = pSession->GetElement(
"Nektar/Geometry");
292 m_dim = atoi(vGeometry->Attribute(
"DIM"));
295 vSubElement = pSession->GetElement(
"Nektar/Geometry/Vertex");
298 std::string attr[] = {
"XSCALE",
"YSCALE",
"ZSCALE",
299 "XMOVE",
"YMOVE",
"ZMOVE" };
300 for (
int i = 0; i < 6; ++i)
302 const char *val = vSubElement->Attribute(attr[i].c_str());
309 x = vSubElement->FirstChildElement();
313 TiXmlAttribute* y = x->FirstAttribute();
314 ASSERTL0(y,
"Failed to get attribute.");
316 v.
id = y->IntValue();
317 std::vector<std::string> vCoords;
318 std::string vCoordStr = x->FirstChild()->ToText()->Value();
319 boost::split(vCoords, vCoordStr, boost::is_any_of(
"\t "));
320 v.
x = atof(vCoords[0].c_str());
321 v.
y = atof(vCoords[1].c_str());
322 v.
z = atof(vCoords[2].c_str());
324 x = x->NextSiblingElement();
330 vSubElement = pSession->GetElement(
"Nektar/Geometry/Edge");
331 ASSERTL0(vSubElement,
"Cannot read edges");
332 x = vSubElement->FirstChildElement();
335 TiXmlAttribute* y = x->FirstAttribute();
336 ASSERTL0(y,
"Failed to get attribute.");
338 e.
id = y->IntValue();
340 std::vector<std::string> vVertices;
341 std::string vVerticesString = x->FirstChild()->ToText()->Value();
342 boost::split(vVertices, vVerticesString, boost::is_any_of(
"\t "));
343 e.
list.push_back(atoi(vVertices[0].c_str()));
344 e.
list.push_back(atoi(vVertices[1].c_str()));
346 x = x->NextSiblingElement();
353 vSubElement = pSession->GetElement(
"Nektar/Geometry/Face");
354 ASSERTL0(vSubElement,
"Cannot read faces.");
355 x = vSubElement->FirstChildElement();
358 TiXmlAttribute* y = x->FirstAttribute();
359 ASSERTL0(y,
"Failed to get attribute.");
361 f.
id = y->IntValue();
362 f.
type = x->Value()[0];
363 std::vector<std::string> vEdges;
364 std::string vEdgeStr = x->FirstChild()->ToText()->Value();
365 boost::split(vEdges, vEdgeStr, boost::is_any_of(
"\t "));
366 for (
int i = 0; i < vEdges.size(); ++i)
368 f.
list.push_back(atoi(vEdges[i].c_str()));
371 x = x->NextSiblingElement();
376 vSubElement = pSession->GetElement(
"Nektar/Geometry/Element");
377 ASSERTL0(vSubElement,
"Cannot read elements.");
378 x = vSubElement->FirstChildElement();
381 TiXmlAttribute* y = x->FirstAttribute();
382 ASSERTL0(y,
"Failed to get attribute.");
384 e.
id = y->IntValue();
385 std::vector<std::string> vItems;
386 std::string vItemStr = x->FirstChild()->ToText()->Value();
387 boost::split(vItems, vItemStr, boost::is_any_of(
"\t "));
388 for (
int i = 0; i < vItems.size(); ++i)
390 e.
list.push_back(atoi(vItems[i].c_str()));
392 e.
type = x->Value()[0];
394 x = x->NextSiblingElement();
398 if (pSession->DefinesElement(
"Nektar/Geometry/Curved"))
400 vSubElement = pSession->GetElement(
"Nektar/Geometry/Curved");
401 x = vSubElement->FirstChildElement();
406 "Failed to get attribute ID");
407 c.
type = std::string(x->Attribute(
"TYPE"));
409 "Failed to get attribute TYPE");
411 "Failed to get attribute NUMPOINTS");
412 c.
data = x->FirstChild()->ToText()->Value();
417 "Failed to get attribute EDGEID");
422 "Failed to get attribute FACEID");
426 ASSERTL0(
false,
"Unknown curve type.");
429 x = x->NextSiblingElement();
434 vSubElement = pSession->GetElement(
"Nektar/Geometry/Composite");
435 ASSERTL0(vSubElement,
"Cannot read composites.");
436 x = vSubElement->FirstChildElement();
439 TiXmlAttribute* y = x->FirstAttribute();
440 ASSERTL0(y,
"Failed to get attribute.");
442 c.
id = y->IntValue();
443 std::string vSeqStr = x->FirstChild()->ToText()->Value();
445 std::string::size_type indxBeg = vSeqStr.find_first_of(
'[') + 1;
446 std::string::size_type indxEnd = vSeqStr.find_last_of(
']') - 1;
447 vSeqStr = vSeqStr.substr(indxBeg, indxEnd - indxBeg + 1);
449 std::vector<unsigned int> vSeq;
452 for (
int i = 0; i < vSeq.size(); ++i)
454 c.
list.push_back(vSeq[i]);
457 x = x->NextSiblingElement();
461 vSubElement = pSession->GetElement(
"Nektar/Geometry/Domain");
462 ASSERTL0(vSubElement,
"Cannot read domain");
463 std::string vSeqStr = vSubElement->FirstChild()->ToText()->Value();
464 std::string::size_type indxBeg = vSeqStr.find_first_of(
'[') + 1;
465 std::string::size_type indxEnd = vSeqStr.find_last_of(
']') - 1;
466 vSeqStr = vSeqStr.substr(indxBeg, indxEnd - indxBeg + 1);
472 int nElmt = boost::num_vertices(
m_mesh);
475 out <<
"# Partition information:" << std::endl;
476 out <<
"# No. elements : " << nElmt << std::endl;
477 out <<
"# No. partitions: " << nPart << std::endl;
478 out <<
"# ID nElmt nLocDof nBndDof" << std::endl;
481 std::vector<int> partElmtCount(nPart, 0);
482 std::vector<int> partLocCount (nPart, 0);
483 std::vector<int> partBndCount (nPart, 0);
485 std::map<int, int> elmtSizes;
486 std::map<int, int> elmtBndSizes;
488 for (
unsigned int i = 0; i <
m_domain.size(); ++i)
496 " Number of directional" \
497 " modes in expansion spec for composite id = " +
498 boost::lexical_cast<std::string>(cId) +
500 boost::lexical_cast<std::string>(it->first) +
501 " does not correspond to mesh dimension");
503 int na = it->second[0];
504 int nb = it->second[1];
519 elmtSizes[elid] = weight;
520 elmtBndSizes[elid] = bndWeight;
525 for (boost::tie(vertit, vertit_end) = boost::vertices(
m_mesh);
526 vertit != vertit_end; ++vertit)
528 int partId =
m_mesh[*vertit].partition;
529 partElmtCount[partId]++;
530 partLocCount [partId] += elmtSizes[
m_mesh[*vertit].id];
531 partBndCount [partId] += elmtBndSizes[m_mesh[*vertit].id];
534 for (
int i = 0; i < nPart; ++i)
536 out << i <<
" " << partElmtCount[i] <<
" " << partLocCount[i] <<
" " << partBndCount[i] << std::endl;
542 if (!pSession->DefinesElement(
"Nektar/Conditions/SolverInfo"))
549 TiXmlElement* solverInfoElement =
550 pSession->GetElement(
"Nektar/Conditions/SolverInfo");
552 TiXmlElement* solverInfo =
553 solverInfoElement->FirstChildElement(
"I");
554 ASSERTL0(solverInfo,
"Cannot read SolverInfo tags");
559 ASSERTL0(solverInfo->Attribute(
"PROPERTY"),
560 "Missing PROPERTY attribute in solver info "
562 std::string solverProperty =
563 solverInfo->Attribute(
"PROPERTY");
565 "Solver info properties must have a non-empty "
568 std::string solverPropertyUpper =
569 boost::to_upper_copy(solverProperty);
573 ASSERTL0(solverInfo->Attribute(
"VALUE"),
574 "Missing VALUE attribute in solver info section. ");
575 std::string solverValue = solverInfo->Attribute(
"VALUE");
577 "Solver info properties must have a non-empty value");
579 std::string propertyValueUpper =
580 boost::to_upper_copy(solverValue);
582 if (solverPropertyUpper ==
"WEIGHTPARTITIONS")
584 if (propertyValueUpper !=
"UNIFORM")
590 solverInfo = solverInfo->NextSiblingElement(
"I");
618 for (
unsigned int i = 0; i <
m_domain.size(); ++i)
626 " Number of directional" \
627 " modes in expansion spec for composite id = " +
628 boost::lexical_cast<std::string>(cId) +
630 boost::lexical_cast<std::string>(it->first) +
631 " does not correspond to mesh dimension");
633 int na = it->second[0];
661 std::map<int, int> vGraphEdges;
669 pGraph[v].id = eIt->first;
670 pGraph[v].partition = 0;
678 for (
unsigned j = 0; j < eIt->second.list.size(); ++j)
680 int eId = eIt->second.list[j];
684 if (vGraphEdges.find(eId) != vGraphEdges.end())
686 BoostEdge e = boost::add_edge(vcnt, vGraphEdges[eId], pGraph).first;
691 vGraphEdges[eId] = vcnt;
699 std::vector<BoostSubGraph>& pLocalPartition)
702 int nGraphVerts = boost::num_vertices(pGraph);
703 int nGraphEdges = boost::num_edges(pGraph);
709 if (
m_comm->GetRowComm()->TreatAsRankZero())
713 int nWeight = nGraphVerts;
720 for ( boost::tie(vertit, vertit_end) = boost::vertices(pGraph);
721 vertit != vertit_end;
724 for ( boost::tie(adjvertit, adjvertit_end) = boost::adjacent_vertices(*vertit,pGraph);
725 adjvertit != adjvertit_end;
728 adjncy[acnt++] = *adjvertit;
735 vwgt[vcnt-1] = pGraph[*vertit].weight[0];
751 if(
m_comm->GetColumnComm()->GetRank() == 0)
762 for (i = 1; i <
m_comm->GetColumnComm()->GetSize(); ++i)
764 m_comm->GetColumnComm()->Send(i, part);
770 m_comm->GetColumnComm()->Recv(0, part);
774 m_comm->GetColumnComm()->Block();
778 for (i = 1; i <
m_comm->GetRowComm()->GetSize(); ++i)
780 m_comm->GetRowComm()->Send(i, part);
787 "Error in calling metis to partition graph.");
792 m_comm->GetRowComm()->Recv(0, part);
797 pLocalPartition.resize(nCols);
798 for (i = 0; i < nCols; ++i)
800 pLocalPartition[i] = pGraph.create_subgraph();
805 for ( boost::tie(vertit, vertit_end) = boost::vertices(pGraph);
806 vertit != vertit_end;
809 pGraph[*vertit].partition = part[i];
810 boost::add_vertex(i, pLocalPartition[part[i]]);
818 unsigned int cnt = 0;
822 for (i = 0; i < nParts; ++i)
824 cnt = std::count(pPart.begin(), pPart.end(), i);
838 for (i = 0; i < pPart.num_elements(); ++i)
840 pPart[i] = i % nParts;
849 TiXmlElement* pNektar)
852 std::string vDim = pSession->GetElement(
"Nektar/Geometry")->Attribute(
"DIM");
853 std::string vSpace = pSession->GetElement(
"Nektar/Geometry")->Attribute(
"SPACE");
854 std::string vPart = boost::lexical_cast<std::string>(pGraph[*boost::vertices(pGraph).first].partition);
855 TiXmlElement* vElmtGeometry =
new TiXmlElement(
"GEOMETRY");
856 vElmtGeometry->SetAttribute(
"DIM", vDim);
857 vElmtGeometry->SetAttribute(
"SPACE", vSpace);
858 vElmtGeometry->SetAttribute(
"PARTITION", vPart);
860 TiXmlElement *vVertex =
new TiXmlElement(
"VERTEX");
861 TiXmlElement *vEdge =
new TiXmlElement(
"EDGE");
862 TiXmlElement *vFace =
new TiXmlElement(
"FACE");
863 TiXmlElement *vElement =
new TiXmlElement(
"ELEMENT");
864 TiXmlElement *vCurved =
new TiXmlElement(
"CURVED");
865 TiXmlElement *vComposite =
new TiXmlElement(
"COMPOSITE");
866 TiXmlElement *vDomain =
new TiXmlElement(
"DOMAIN");
874 std::map<int, MeshEntity> vComposites;
875 std::map<int, MeshEntity> vElements;
876 std::map<int, MeshEntity> vEdges;
877 std::map<int, MeshEntity> vFaces;
878 std::map<int, MeshVertex> vVertices;
884 for ( boost::tie(vertit, vertit_end) = boost::vertices(pGraph);
885 vertit != vertit_end;
888 id = pGraph[*vertit].id;
892 std::map<int, MeshEntity> * vNext = &vElements;
898 for (vIt = vNext->begin(); vIt != vNext->end(); vIt++)
900 for (
unsigned int j = 0; j < vIt->second.list.size(); ++j)
902 id = vIt->second.list[j];
911 for (vIt = vNext->begin(); vIt != vNext->end(); vIt++)
913 for (
unsigned int j = 0; j < vIt->second.list.size(); ++j)
915 id = vIt->second.list[j];
924 for (vIt = vNext->begin(); vIt != vNext->end(); vIt++)
926 for (
unsigned int j = 0; j < vIt->second.list.size(); ++j)
928 id = vIt->second.list[j];
936 for (vVertIt = vVertices.begin(); vVertIt != vVertices.end(); vVertIt++)
938 x =
new TiXmlElement(
"V");
939 x->SetAttribute(
"ID", vVertIt->first);
940 std::stringstream vCoords;
941 vCoords.precision(12);
942 vCoords << std::setw(15) << vVertIt->second.x <<
" "
943 << std::setw(15) << vVertIt->second.y <<
" "
944 << std::setw(15) << vVertIt->second.z <<
" ";
945 y =
new TiXmlText(vCoords.str());
947 vVertex->LinkEndChild(x);
955 vVertex->SetAttribute(vAttrIt->first, vAttrIt->second);
960 for (vIt = vEdges.begin(); vIt != vEdges.end(); vIt++)
962 x =
new TiXmlElement(
"E");
963 x->SetAttribute(
"ID", vIt->first);
964 std::stringstream vVertices;
965 vVertices << std::setw(10) << vIt->second.list[0]
966 << std::setw(10) << vIt->second.list[1] <<
" ";
967 y =
new TiXmlText(vVertices.str());
969 vEdge->LinkEndChild(x);
975 for (vIt = vFaces.begin(); vIt != vFaces.end(); vIt++)
977 std::string vType(
"F");
978 vType[0] = vIt->second.type;
979 x =
new TiXmlElement(vType);
980 x->SetAttribute(
"ID", vIt->first);
981 std::stringstream vListStr;
982 for (
unsigned int i = 0; i < vIt->second.list.size(); ++i)
984 vListStr << std::setw(10) << vIt->second.list[i];
987 y =
new TiXmlText(vListStr.str());
989 vFace->LinkEndChild(x);
993 for (vIt = vElements.begin(); vIt != vElements.end(); vIt++)
995 std::string vType(
"T");
996 vType[0] = vIt->second.type;
997 x =
new TiXmlElement(vType.c_str());
998 x->SetAttribute(
"ID", vIt->first);
999 std::stringstream vEdges;
1000 for (
unsigned i = 0; i < vIt->second.list.size(); ++i)
1002 vEdges << std::setw(10) << vIt->second.list[i];
1005 y =
new TiXmlText(vEdges.str());
1007 vElement->LinkEndChild(x);
1012 std::map<MeshCurvedKey, MeshCurved>::const_iterator vItCurve;
1019 if (vEdges.find(c.
entityid) != vEdges.end() ||
1020 vFaces.find(c.
entityid) != vFaces.end())
1023 x->SetAttribute(
"ID", c.
id);
1026 x->SetAttribute(
"EDGEID", c.
entityid);
1030 x->SetAttribute(
"FACEID", c.
entityid);
1032 x->SetAttribute(
"TYPE", c.
type);
1033 x->SetAttribute(
"NUMPOINTS", c.
npoints);
1034 y =
new TiXmlText(c.
data);
1036 vCurved->LinkEndChild(x);
1048 std::string vCompositeStr =
"";
1049 for (
unsigned int j = 0; j < vIt->second.list.size(); ++j)
1052 switch (vIt->second.type)
1055 if (vVertices.find(vIt->second.list[j]) == vVertices.end())
1061 if (vEdges.find(vIt->second.list[j]) == vEdges.end())
1067 if (vFaces.find(vIt->second.list[j]) == vFaces.end())
1073 if (vElements.find(vIt->second.list[j]) == vElements.end())
1082 if (last_idx + 1 == vIt->second.list[j])
1092 vCompositeStr +=
"-" + boost::lexical_cast<std::string>(last_idx);
1097 vCompositeStr += comma ?
"," :
"";
1098 vCompositeStr += boost::lexical_cast<std::string>(vIt->second.list[j]);
1099 last_idx = vIt->second.list[j];
1105 vCompositeStr +=
"-" + boost::lexical_cast<std::string>(last_idx);
1108 if (vCompositeStr.length() > 0)
1110 vComposites[vIt->first] = vIt->second;
1111 x =
new TiXmlElement(
"C");
1112 x->SetAttribute(
"ID", vIt->first);
1113 vCompositeStr =
"X[" + vCompositeStr +
"]";
1114 vCompositeStr[0] = vIt->second.type;
1115 y =
new TiXmlText(vCompositeStr.c_str());
1117 vComposite->LinkEndChild(x);
1121 std::string vDomainListStr;
1123 for (
unsigned int i = 0; i <
m_domain.size(); ++i)
1125 if (vComposites.find(
m_domain[i]) != vComposites.end())
1127 vDomainListStr += comma ?
"," :
"";
1129 vDomainListStr += boost::lexical_cast<std::string>(
m_domain[i]);
1132 vDomainListStr =
"C[" + vDomainListStr +
"]";
1133 TiXmlText* vDomainList =
new TiXmlText(vDomainListStr);
1134 vDomain->LinkEndChild(vDomainList);
1136 vElmtGeometry->LinkEndChild(vVertex);
1139 vElmtGeometry->LinkEndChild(vEdge);
1143 vElmtGeometry->LinkEndChild(vFace);
1145 vElmtGeometry->LinkEndChild(vElement);
1148 vElmtGeometry->LinkEndChild(vCurved);
1150 vElmtGeometry->LinkEndChild(vComposite);
1151 vElmtGeometry->LinkEndChild(vDomain);
1153 pNektar->LinkEndChild(vElmtGeometry);
1155 if (pSession->DefinesElement(
"Nektar/Conditions"))
1157 std::set<int> vBndRegionIdList;
1158 TiXmlElement* vConditions =
new TiXmlElement(*pSession->GetElement(
"Nektar/Conditions"));
1159 TiXmlElement* vBndRegions = vConditions->FirstChildElement(
"BOUNDARYREGIONS");
1160 TiXmlElement* vBndConditions = vConditions->FirstChildElement(
"BOUNDARYCONDITIONS");
1161 TiXmlElement* vItem;
1165 TiXmlElement* vNewBndRegions =
new TiXmlElement(
"BOUNDARYREGIONS");
1166 vItem = vBndRegions->FirstChildElement();
1169 std::string vSeqStr = vItem->FirstChild()->ToText()->Value();
1170 std::string::size_type indxBeg = vSeqStr.find_first_of(
'[') + 1;
1171 std::string::size_type indxEnd = vSeqStr.find_last_of(
']') - 1;
1172 vSeqStr = vSeqStr.substr(indxBeg, indxEnd - indxBeg + 1);
1173 std::vector<unsigned int> vSeq;
1175 std::string vListStr;
1177 for (
unsigned int i = 0; i < vSeq.size(); ++i)
1179 if (vComposites.find(vSeq[i]) != vComposites.end())
1181 vListStr += comma ?
"," :
"";
1183 vListStr += boost::lexical_cast<std::string>(vSeq[i]);
1186 int p = atoi(vItem->Attribute(
"ID"));
1188 if (vListStr.length() == 0)
1190 TiXmlElement* tmp = vItem;
1191 vItem = vItem->NextSiblingElement();
1192 vBndRegions->RemoveChild(tmp);
1196 vListStr =
"C[" + vListStr +
"]";
1197 TiXmlText* vList =
new TiXmlText(vListStr);
1198 TiXmlElement* vNewElement =
new TiXmlElement(
"B");
1199 vNewElement->SetAttribute(
"ID", p);
1200 vNewElement->LinkEndChild(vList);
1201 vNewBndRegions->LinkEndChild(vNewElement);
1202 vBndRegionIdList.insert(p);
1203 vItem = vItem->NextSiblingElement();
1210 vConditions->ReplaceChild(vBndRegions, *vNewBndRegions);
1215 vItem = vBndConditions->FirstChildElement();
1219 if ((x = vBndRegionIdList.find(atoi(vItem->Attribute(
"REF")))) != vBndRegionIdList.end())
1221 vItem->SetAttribute(
"REF", *x);
1222 vItem = vItem->NextSiblingElement();
1226 TiXmlElement* tmp = vItem;
1227 vItem = vItem->NextSiblingElement();
1228 vBndConditions->RemoveChild(tmp);
1232 pNektar->LinkEndChild(vConditions);
1236 TiXmlElement* vSrc = pSession->GetElement(
"Nektar")
1237 ->FirstChildElement();
1240 std::string vName = boost::to_upper_copy(vSrc->ValueStr());
1241 if (vName !=
"GEOMETRY" && vName !=
"CONDITIONS")
1243 pNektar->LinkEndChild(
new TiXmlElement(*vSrc));
1245 vSrc = vSrc->NextSiblingElement();
1256 for ( boost::tie(vertit, vertit_end) = boost::vertices(
m_localPartition[procid]);
1257 vertit != vertit_end;
1276 weight = bndWeight ?
1281 weight = bndWeight ?
1286 weight = bndWeight ?
1291 weight = bndWeight ?
1296 weight = bndWeight ?
1301 weight = bndWeight ?
1306 weight = bndWeight ?
void GetCompositeOrdering(CompositeOrdering &composites)
int CalculateElementWeight(char elmtType, bool bndWeight, int na, int nb, int nc)
#define ASSERTL0(condition, msg)
static bool GenerateOrderedStringVector(const char *const str, std::vector< std::string > &vec)
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mod...
std::map< std::string, std::string > m_vertexAttributes
int getNumberOfBndCoefficients(int Na, int Nb)
int getNumberOfCoefficients(int Na, int Nb, int Nc)
static bool GenerateOrderedVector(const char *const str, std::vector< unsigned int > &vec)
std::map< int, MeshEntity > m_meshComposites
void WriteLocalPartition(SessionReaderSharedPtr &pSession)
int getNumberOfBndCoefficients(int Na, int Nb, int Nc)
std::map< int, MeshVertex > m_meshVertices
void CheckPartitions(int nParts, Array< OneD, int > &pPart)
void ReadConditions(const SessionReaderSharedPtr &pSession)
int getNumberOfBndCoefficients(int Na, int Nb, int Nc)
std::map< MeshCurvedKey, MeshCurved > m_meshCurved
std::map< int, std::vector< unsigned int > > BndRegionOrdering
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 PartitionMesh(int nParts, bool shared=false)
boost::graph_traits< BoostGraph >::vertex_descriptor BoostVertex
std::map< int, MultiWeight > m_vertWeights
std::map< int, std::vector< unsigned int > > CompositeOrdering
int getNumberOfCoefficients(int Na, int Nb, int Nc)
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
static bool GenerateSeqVector(const char *const str, std::vector< unsigned int > &vec)
std::map< std::string, NumModes > NummodesPerField
std::map< std::string, int > m_fieldNameToId
void ReadExpansions(const SessionReaderSharedPtr &pSession)
std::map< int, NummodesPerField > m_expansions
std::vector< unsigned int > list
std::map< int, MeshEntity > m_meshElements
int getNumberOfCoefficients(int Na)
LibUtilities::NekFactory< std::string, MeshPartition, const SessionReaderSharedPtr & > MeshPartitionFactory
Datatype of the NekFactory used to instantiate classes derived from the EquationSystem class...
void CreateGraph(BoostSubGraph &pGraph)
void GetBndRegionOrdering(BndRegionOrdering &composites)
int getNumberOfCoefficients(int Na, int Nb)
void GetElementIDs(const int procid, std::vector< unsigned int > &tmp)
std::vector< unsigned int > m_domain
std::vector< BoostSubGraph > m_localPartition
std::string PortablePath(const boost::filesystem::path &path)
create portable path on different platforms for boost::filesystem path
void ReadGeometry(const SessionReaderSharedPtr &pSession)
int getNumberOfBndCoefficients(int Na)
int getNumberOfBndCoefficients(int Na, int Nb)
BndRegionOrdering m_bndRegOrder
int getNumberOfCoefficients(int Na, int Nb, int Nc)
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
boost::graph_traits< BoostGraph >::adjacency_iterator BoostAdjacencyIterator
std::map< int, MeshEntity > m_meshEdges
int getNumberOfBndCoefficients(int Na, int Nb, int Nc)
void PartitionGraph(BoostSubGraph &pGraph, int nParts, std::vector< BoostSubGraph > &pLocalPartition)
int getNumberOfCoefficients(int Na, int Nb)
boost::graph_traits< BoostGraph >::edge_descriptor BoostEdge
void PrintPartInfo(std::ostream &out)
std::map< int, MeshEntity > m_meshFaces
void WriteAllPartitions(SessionReaderSharedPtr &pSession)
boost::graph_traits< BoostGraph >::vertex_iterator BoostVertexIterator
void OutputPartition(SessionReaderSharedPtr &pSession, BoostSubGraph &pGraph, TiXmlElement *pGeometry)
int getNumberOfCoefficients(int Na, int Nb, int Nc)
MeshPartition(const SessionReaderSharedPtr &pSession)
MeshPartitionFactory & GetMeshPartitionFactory()
int getNumberOfBndCoefficients(int Na, int Nb, int Nc)
Provides a generic Factory class.
boost::subgraph< BoostGraph > BoostSubGraph