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
69 Loki::NoDestroy > Type;
70 return Type::Instance();
76 m_comm(pSession->GetComm()),
77 m_weightingRequired(false)
92 "Partitioning only necessary in parallel case.");
94 "Too few elements for this many processes.");
105 TiXmlDeclaration * decl =
new TiXmlDeclaration(
"1.0",
"utf-8",
"");
106 vNew.LinkEndChild(decl);
108 TiXmlElement* vElmtNektar;
109 vElmtNektar =
new TiXmlElement(
"NEKTAR");
111 int rank =
m_comm->GetRowComm()->GetRank();
114 vNew.LinkEndChild(vElmtNektar);
116 std::string dirname = pSession->GetSessionName() +
"_xml";
117 fs::path pdirname(dirname);
119 boost::format pad(
"P%1$07d.xml");
121 fs::path pFilename(pad.str());
123 if(!fs::is_directory(dirname))
125 fs::create_directory(dirname);
128 fs::path fullpath = pdirname / pFilename;
134 for (
int i = 0; i <
m_comm->GetRowComm()->GetSize(); ++i)
137 TiXmlDeclaration * decl =
new TiXmlDeclaration(
"1.0",
"utf-8",
"");
138 vNew.LinkEndChild(decl);
140 TiXmlElement* vElmtNektar;
141 vElmtNektar =
new TiXmlElement(
"NEKTAR");
145 vNew.LinkEndChild(vElmtNektar);
147 std::string dirname = pSession->GetSessionName() +
"_xml";
148 fs::path pdirname(dirname);
150 boost::format pad(
"P%1$07d.xml");
152 fs::path pFilename(pad.str());
154 fs::path fullpath = pdirname / pFilename;
156 if(!fs::is_directory(dirname))
158 fs::create_directory(dirname);
171 composites[it->first] = it->second.list;
184 TiXmlElement *expansionTypes = pSession->GetElement(
"Nektar/Expansions");
187 TiXmlElement *expansion = expansionTypes->FirstChildElement();
188 std::string expType = expansion->Value();
193 ASSERTL0(
false,
"Expansion type not defined or not supported at the moment");
205 std::vector<unsigned int> composite;
206 std::vector<unsigned int> nummodes;
207 std::vector<std::string> fieldName;
209 const char *nModesStr = expansion->Attribute(
"NUMMODES");
210 ASSERTL0(nModesStr,
"NUMMODES was not defined in EXPANSION section of input");
211 std::string numModesStr = nModesStr;
213 ASSERTL0(valid,
"Unable to correctly parse the number of modes.");
215 if (nummodes.size() == 1)
217 for (
int i = 1; i <
m_dim; i++)
219 nummodes.push_back( nummodes[0] );
222 ASSERTL0(nummodes.size() ==
m_dim,
"Number of modes should match mesh dimension");
225 const char *fStr = expansion->Attribute(
"FIELDS");
228 std::string fieldStr = fStr;
230 ASSERTL0(valid,
"Unable to correctly parse the field string in ExpansionTypes.");
232 for (
int i = 0; i < fieldName.size(); ++i)
244 fieldName.push_back(
"DefaultVar");
250 "Omitting field variables and explicitly listing " \
251 "them in different ExpansionTypes is wrong practise");
258 std::string compositeStr = expansion->Attribute(
"COMPOSITE");
259 ASSERTL0(compositeStr.length() > 3,
"COMPOSITE must be specified in expansion definition");
260 int beg = compositeStr.find_first_of(
"[");
261 int end = compositeStr.find_first_of(
"]");
262 std::string compositeListStr = compositeStr.substr(beg+1,end-beg-1);
264 ASSERTL0(parseGood && !composite.empty(),
265 (std::string(
"Unable to read composite index range: ") + compositeListStr).c_str());
269 for (
int i = 0; i < composite.size(); ++i)
271 for (
int j = 0; j < fieldName.size(); j++)
277 expansion = expansion->NextSiblingElement(
"E");
287 TiXmlElement *vGeometry, *vSubElement;
290 vGeometry = pSession->GetElement(
"Nektar/Geometry");
291 m_dim = atoi(vGeometry->Attribute(
"DIM"));
294 vSubElement = pSession->GetElement(
"Nektar/Geometry/Vertex");
297 std::string attr[] = {
"XSCALE",
"YSCALE",
"ZSCALE",
298 "XMOVE",
"YMOVE",
"ZMOVE" };
299 for (i = 0; i < 6; ++i)
301 const char *val = vSubElement->Attribute(attr[i].c_str());
308 x = vSubElement->FirstChildElement();
310 if (x->FirstAttribute())
312 i = x->FirstAttribute()->IntValue();
316 TiXmlAttribute* y = x->FirstAttribute();
317 ASSERTL0(y,
"Failed to get attribute.");
319 v.
id = y->IntValue();
320 ASSERTL0(v.
id == i++,
"Vertex IDs not sequential.");
321 std::vector<std::string> vCoords;
322 std::string vCoordStr = x->FirstChild()->ToText()->Value();
323 boost::split(vCoords, vCoordStr, boost::is_any_of(
"\t "));
324 v.
x = atof(vCoords[0].c_str());
325 v.
y = atof(vCoords[1].c_str());
326 v.
z = atof(vCoords[2].c_str());
328 x = x->NextSiblingElement();
334 vSubElement = pSession->GetElement(
"Nektar/Geometry/Edge");
335 ASSERTL0(vSubElement,
"Cannot read edges");
336 x = vSubElement->FirstChildElement();
340 TiXmlAttribute* y = x->FirstAttribute();
341 ASSERTL0(y,
"Failed to get attribute.");
343 e.
id = y->IntValue();
345 ASSERTL0(e.
id == i++,
"Edge IDs not sequential.");
346 std::vector<std::string> vVertices;
347 std::string vVerticesString = x->FirstChild()->ToText()->Value();
348 boost::split(vVertices, vVerticesString, boost::is_any_of(
"\t "));
349 e.
list.push_back(atoi(vVertices[0].c_str()));
350 e.
list.push_back(atoi(vVertices[1].c_str()));
352 x = x->NextSiblingElement();
359 vSubElement = pSession->GetElement(
"Nektar/Geometry/Face");
360 ASSERTL0(vSubElement,
"Cannot read faces.");
361 x = vSubElement->FirstChildElement();
365 TiXmlAttribute* y = x->FirstAttribute();
366 ASSERTL0(y,
"Failed to get attribute.");
368 f.
id = y->IntValue();
369 f.
type = x->Value()[0];
370 ASSERTL0(f.
id == i++,
"Face IDs not sequential.");
371 std::vector<std::string> vEdges;
372 std::string vEdgeStr = x->FirstChild()->ToText()->Value();
373 boost::split(vEdges, vEdgeStr, boost::is_any_of(
"\t "));
374 for (
int i = 0; i < vEdges.size(); ++i)
376 f.
list.push_back(atoi(vEdges[i].c_str()));
379 x = x->NextSiblingElement();
384 vSubElement = pSession->GetElement(
"Nektar/Geometry/Element");
385 ASSERTL0(vSubElement,
"Cannot read elements.");
386 x = vSubElement->FirstChildElement();
390 TiXmlAttribute* y = x->FirstAttribute();
391 ASSERTL0(y,
"Failed to get attribute.");
393 e.
id = y->IntValue();
394 ASSERTL0(e.
id == i++,
"Element IDs not sequential.");
395 std::vector<std::string> vItems;
396 std::string vItemStr = x->FirstChild()->ToText()->Value();
397 boost::split(vItems, vItemStr, boost::is_any_of(
"\t "));
398 for (
int i = 0; i < vItems.size(); ++i)
400 e.
list.push_back(atoi(vItems[i].c_str()));
402 e.
type = x->Value()[0];
404 x = x->NextSiblingElement();
408 if (pSession->DefinesElement(
"Nektar/Geometry/Curved"))
410 vSubElement = pSession->GetElement(
"Nektar/Geometry/Curved");
411 x = vSubElement->FirstChildElement();
417 "Failed to get attribute ID");
418 c.
type = std::string(x->Attribute(
"TYPE"));
420 "Failed to get attribute TYPE");
422 "Failed to get attribute NUMPOINTS");
423 c.
data = x->FirstChild()->ToText()->Value();
428 "Failed to get attribute EDGEID");
433 "Failed to get attribute FACEID");
437 ASSERTL0(
false,
"Unknown curve type.");
440 x = x->NextSiblingElement();
445 vSubElement = pSession->GetElement(
"Nektar/Geometry/Composite");
446 ASSERTL0(vSubElement,
"Cannot read composites.");
447 x = vSubElement->FirstChildElement();
451 TiXmlAttribute* y = x->FirstAttribute();
452 ASSERTL0(y,
"Failed to get attribute.");
454 c.
id = y->IntValue();
455 std::string vSeqStr = x->FirstChild()->ToText()->Value();
457 std::string::size_type indxBeg = vSeqStr.find_first_of(
'[') + 1;
458 std::string::size_type indxEnd = vSeqStr.find_last_of(
']') - 1;
459 vSeqStr = vSeqStr.substr(indxBeg, indxEnd - indxBeg + 1);
461 std::vector<unsigned int> vSeq;
464 for (
int i = 0; i < vSeq.size(); ++i)
466 c.
list.push_back(vSeq[i]);
469 x = x->NextSiblingElement();
473 vSubElement = pSession->GetElement(
"Nektar/Geometry/Domain");
474 ASSERTL0(vSubElement,
"Cannot read domain");
475 std::string vSeqStr = vSubElement->FirstChild()->ToText()->Value();
476 std::string::size_type indxBeg = vSeqStr.find_first_of(
'[') + 1;
477 std::string::size_type indxEnd = vSeqStr.find_last_of(
']') - 1;
478 vSeqStr = vSeqStr.substr(indxBeg, indxEnd - indxBeg + 1);
484 int nElmt = boost::num_vertices(
m_mesh);
485 int nPart =
m_comm->GetRowComm()->GetSize();
487 out <<
"# Partition information:" << std::endl;
488 out <<
"# No. elements : " << nElmt << std::endl;
489 out <<
"# No. partitions: " << nPart << std::endl;
492 std::vector<int> partElmtCount(nPart, 0);
493 std::vector<int> partLocCount (nPart, 0);
494 std::vector<int> partBndCount (nPart, 0);
496 std::map<int, int> elmtSizes;
497 std::map<int, int> elmtBndSizes;
499 for (
unsigned int i = 0; i <
m_domain.size(); ++i)
507 " Number of directional" \
508 " modes in expansion spec for composite id = " +
509 boost::lexical_cast<std::string>(cId) +
511 boost::lexical_cast<std::string>(it->first) +
512 " does not correspond to mesh dimension");
514 int na = it->second[0];
515 int nb = it->second[1];
565 elmtSizes[elid] = weight;
566 elmtBndSizes[elid] = bndWeight;
571 for (boost::tie(vertit, vertit_end) = boost::vertices(
m_mesh);
572 vertit != vertit_end; ++vertit)
574 int partId =
m_mesh[*vertit].partition;
575 partElmtCount[partId]++;
576 partLocCount [partId] += elmtSizes[
m_mesh[*vertit].id];
577 partBndCount [partId] += elmtBndSizes[m_mesh[*vertit].id];
580 for (
int i = 0; i < nPart; ++i)
582 out << i <<
" " << partElmtCount[i] <<
" " << partLocCount[i] <<
" " << partBndCount[i] << std::endl;
588 if (!pSession->DefinesElement(
"Nektar/Conditions/SolverInfo"))
595 TiXmlElement* solverInfoElement =
596 pSession->GetElement(
"Nektar/Conditions/SolverInfo");
598 TiXmlElement* solverInfo =
599 solverInfoElement->FirstChildElement(
"I");
600 ASSERTL0(solverInfo,
"Cannot read SolverInfo tags");
605 ASSERTL0(solverInfo->Attribute(
"PROPERTY"),
606 "Missing PROPERTY attribute in solver info "
608 std::string solverProperty =
609 solverInfo->Attribute(
"PROPERTY");
611 "Solver info properties must have a non-empty "
614 std::string solverPropertyUpper =
615 boost::to_upper_copy(solverProperty);
619 ASSERTL0(solverInfo->Attribute(
"VALUE"),
620 "Missing VALUE attribute in solver info section. ");
621 std::string solverValue = solverInfo->Attribute(
"VALUE");
623 "Solver info properties must have a non-empty value");
625 std::string propertyValueUpper =
626 boost::to_upper_copy(solverValue);
628 if (solverPropertyUpper ==
"WEIGHTPARTITIONS")
630 if (propertyValueUpper !=
"UNIFORM")
636 solverInfo = solverInfo->NextSiblingElement(
"I");
663 for (
unsigned int i = 0; i <
m_domain.size(); ++i)
671 " Number of directional" \
672 " modes in expansion spec for composite id = " +
673 boost::lexical_cast<std::string>(cId) +
675 boost::lexical_cast<std::string>(it->first) +
676 " does not correspond to mesh dimension");
678 int na = it->second[0];
744 std::map<int, int> vGraphEdges;
751 pGraph[v].partition = 0;
764 if (vGraphEdges.find(eId) != vGraphEdges.end())
766 BoostEdge e = boost::add_edge( p, vGraphEdges[eId], pGraph).first;
771 vGraphEdges[eId] = p;
778 std::vector<BoostSubGraph>& pLocalPartition)
781 int nGraphVerts = boost::num_vertices(pGraph);
782 int nGraphEdges = boost::num_edges(pGraph);
786 Array<OneD, int> part(nGraphVerts,0);
788 if (
m_comm->GetRowComm()->TreatAsRankZero())
792 int nWeight = nGraphVerts;
794 Array<OneD, int> xadj(nGraphVerts+1,0);
795 Array<OneD, int> adjncy(2*nGraphEdges);
796 Array<OneD, int> vwgt(nWeight, 1);
797 Array<OneD, int> vsize(nGraphVerts, 1);
798 for ( boost::tie(vertit, vertit_end) = boost::vertices(pGraph);
799 vertit != vertit_end;
802 for ( boost::tie(adjvertit, adjvertit_end) = boost::adjacent_vertices(*vertit,pGraph);
803 adjvertit != adjvertit_end;
806 adjncy[acnt++] = *adjvertit;
813 vwgt[pGraph[*vertit].id ] = pGraph[*vertit].weight[0];
817 vwgt[pGraph[*vertit].id] = 1;
822 int npart =
m_comm->GetRowComm()->GetSize();
830 if(
m_comm->GetColumnComm()->GetRank() == 0)
841 for (i = 1; i <
m_comm->GetColumnComm()->GetSize(); ++i)
843 m_comm->GetColumnComm()->Send(i, part);
849 m_comm->GetColumnComm()->Recv(0, part);
853 m_comm->GetColumnComm()->Block();
857 for (i = 1; i <
m_comm->GetRowComm()->GetSize(); ++i)
859 m_comm->GetRowComm()->Send(i, part);
866 "Error in calling metis to partition graph.");
871 m_comm->GetRowComm()->Recv(0, part);
875 int nCols =
m_comm->GetRowComm()->GetSize();
876 pLocalPartition.resize(nCols);
877 for (i = 0; i < nCols; ++i)
879 pLocalPartition[i] = pGraph.create_subgraph();
884 for ( boost::tie(vertit, vertit_end) = boost::vertices(pGraph);
885 vertit != vertit_end;
888 pGraph[*vertit].partition = part[i];
889 pGraph[*vertit].partid = boost::num_vertices(pLocalPartition[part[i]]);
890 boost::add_vertex(i, pLocalPartition[part[i]]);
898 unsigned int cnt = 0;
899 const unsigned int npart =
m_comm->GetRowComm()->GetSize();
903 for (i = 0; i < npart; ++i)
905 cnt = std::count(pPart.begin(), pPart.end(), i);
919 for (i = 0; i < pPart.num_elements(); ++i)
921 pPart[i] = i % npart;
930 TiXmlElement* pNektar)
933 std::string vDim = pSession->GetElement(
"Nektar/Geometry")->Attribute(
"DIM");
934 std::string vSpace = pSession->GetElement(
"Nektar/Geometry")->Attribute(
"SPACE");
935 std::string vPart = boost::lexical_cast<std::string>(pGraph[*boost::vertices(pGraph).first].partition);
936 TiXmlElement* vElmtGeometry =
new TiXmlElement(
"GEOMETRY");
937 vElmtGeometry->SetAttribute(
"DIM", vDim);
938 vElmtGeometry->SetAttribute(
"SPACE", vSpace);
939 vElmtGeometry->SetAttribute(
"PARTITION", vPart);
941 TiXmlElement *vVertex =
new TiXmlElement(
"VERTEX");
942 TiXmlElement *vEdge =
new TiXmlElement(
"EDGE");
943 TiXmlElement *vFace =
new TiXmlElement(
"FACE");
944 TiXmlElement *vElement =
new TiXmlElement(
"ELEMENT");
945 TiXmlElement *vCurved =
new TiXmlElement(
"CURVED");
946 TiXmlElement *vComposite =
new TiXmlElement(
"COMPOSITE");
947 TiXmlElement *vDomain =
new TiXmlElement(
"DOMAIN");
955 std::map<int, MeshEntity> vComposites;
956 std::map<int, MeshEntity> vElements;
957 std::map<int, MeshEntity> vEdges;
958 std::map<int, MeshEntity> vFaces;
959 std::map<int, MeshVertex> vVertices;
965 for ( boost::tie(vertit, vertit_end) = boost::vertices(pGraph);
966 vertit != vertit_end;
969 id = pGraph[*vertit].id;
973 std::map<int, MeshEntity> * vNext = &vElements;
979 for (vIt = vNext->begin(); vIt != vNext->end(); vIt++)
981 for (
unsigned int j = 0; j < vIt->second.list.size(); ++j)
983 id = vIt->second.list[j];
992 for (vIt = vNext->begin(); vIt != vNext->end(); vIt++)
994 for (
unsigned int j = 0; j < vIt->second.list.size(); ++j)
996 id = vIt->second.list[j];
1005 for (vIt = vNext->begin(); vIt != vNext->end(); vIt++)
1007 for (
unsigned int j = 0; j < vIt->second.list.size(); ++j)
1009 id = vIt->second.list[j];
1017 for (vVertIt = vVertices.begin(); vVertIt != vVertices.end(); vVertIt++)
1019 x =
new TiXmlElement(
"V");
1020 x->SetAttribute(
"ID", vVertIt->first);
1021 std::stringstream vCoords;
1022 vCoords.precision(12);
1023 vCoords << std::setw(15) << vVertIt->second.x
1024 << std::setw(15) << vVertIt->second.y
1025 << std::setw(15) << vVertIt->second.z <<
" ";
1026 y =
new TiXmlText(vCoords.str());
1028 vVertex->LinkEndChild(x);
1036 vVertex->SetAttribute(vAttrIt->first, vAttrIt->second);
1041 for (vIt = vEdges.begin(); vIt != vEdges.end(); vIt++)
1043 x =
new TiXmlElement(
"E");
1044 x->SetAttribute(
"ID", vIt->first);
1045 std::stringstream vVertices;
1046 vVertices << std::setw(10) << vIt->second.list[0]
1047 << std::setw(10) << vIt->second.list[1] <<
" ";
1048 y =
new TiXmlText(vVertices.str());
1050 vEdge->LinkEndChild(x);
1056 for (vIt = vFaces.begin(); vIt != vFaces.end(); vIt++)
1058 std::string vType(
"F");
1059 vType[0] = vIt->second.type;
1060 x =
new TiXmlElement(vType);
1061 x->SetAttribute(
"ID", vIt->first);
1062 std::stringstream vListStr;
1063 for (
unsigned int i = 0; i < vIt->second.list.size(); ++i)
1065 vListStr << std::setw(10) << vIt->second.list[i];
1068 y =
new TiXmlText(vListStr.str());
1070 vFace->LinkEndChild(x);
1074 for (vIt = vElements.begin(); vIt != vElements.end(); vIt++)
1076 std::string vType(
"T");
1077 vType[0] = vIt->second.type;
1078 x =
new TiXmlElement(vType.c_str());
1079 x->SetAttribute(
"ID", vIt->first);
1080 std::stringstream vEdges;
1081 for (
unsigned i = 0; i < vIt->second.list.size(); ++i)
1083 vEdges << std::setw(10) << vIt->second.list[i];
1086 y =
new TiXmlText(vEdges.str());
1088 vElement->LinkEndChild(x);
1093 std::map<MeshCurvedKey, MeshCurved>::const_iterator vItCurve;
1100 if (vEdges.find(c.
entityid) != vEdges.end() ||
1101 vFaces.find(c.
entityid) != vFaces.end())
1104 x->SetAttribute(
"ID", c.
id);
1107 x->SetAttribute(
"EDGEID", c.
entityid);
1111 x->SetAttribute(
"FACEID", c.
entityid);
1113 x->SetAttribute(
"TYPE", c.
type);
1114 x->SetAttribute(
"NUMPOINTS", c.
npoints);
1115 y =
new TiXmlText(c.
data);
1117 vCurved->LinkEndChild(x);
1129 std::string vCompositeStr =
"";
1130 for (
unsigned int j = 0; j < vIt->second.list.size(); ++j)
1133 switch (vIt->second.type)
1136 if (vVertices.find(vIt->second.list[j]) == vVertices.end())
1142 if (vEdges.find(vIt->second.list[j]) == vEdges.end())
1148 if (vFaces.find(vIt->second.list[j]) == vFaces.end())
1154 if (vElements.find(vIt->second.list[j]) == vElements.end())
1163 if (last_idx + 1 == vIt->second.list[j])
1173 vCompositeStr +=
"-" + boost::lexical_cast<std::string>(last_idx);
1178 vCompositeStr += comma ?
"," :
"";
1179 vCompositeStr += boost::lexical_cast<std::string>(vIt->second.list[j]);
1180 last_idx = vIt->second.list[j];
1186 vCompositeStr +=
"-" + boost::lexical_cast<std::string>(last_idx);
1189 if (vCompositeStr.length() > 0)
1191 vComposites[vIt->first] = vIt->second;
1192 x =
new TiXmlElement(
"C");
1193 x->SetAttribute(
"ID", vIt->first);
1194 vCompositeStr =
"X[" + vCompositeStr +
"]";
1195 vCompositeStr[0] = vIt->second.type;
1196 y =
new TiXmlText(vCompositeStr.c_str());
1198 vComposite->LinkEndChild(x);
1202 std::string vDomainListStr;
1204 for (
unsigned int i = 0; i <
m_domain.size(); ++i)
1206 if (vComposites.find(
m_domain[i]) != vComposites.end())
1208 vDomainListStr += comma ?
"," :
"";
1210 vDomainListStr += boost::lexical_cast<std::string>(
m_domain[i]);
1213 vDomainListStr =
"C[" + vDomainListStr +
"]";
1214 TiXmlText* vDomainList =
new TiXmlText(vDomainListStr);
1215 vDomain->LinkEndChild(vDomainList);
1217 vElmtGeometry->LinkEndChild(vVertex);
1220 vElmtGeometry->LinkEndChild(vEdge);
1224 vElmtGeometry->LinkEndChild(vFace);
1226 vElmtGeometry->LinkEndChild(vElement);
1229 vElmtGeometry->LinkEndChild(vCurved);
1231 vElmtGeometry->LinkEndChild(vComposite);
1232 vElmtGeometry->LinkEndChild(vDomain);
1234 pNektar->LinkEndChild(vElmtGeometry);
1236 if (pSession->DefinesElement(
"Nektar/Conditions"))
1238 std::set<int> vBndRegionIdList;
1239 TiXmlElement* vConditions =
new TiXmlElement(*pSession->GetElement(
"Nektar/Conditions"));
1240 TiXmlElement* vBndRegions = vConditions->FirstChildElement(
"BOUNDARYREGIONS");
1241 TiXmlElement* vBndConditions = vConditions->FirstChildElement(
"BOUNDARYCONDITIONS");
1242 TiXmlElement* vItem;
1246 TiXmlElement* vNewBndRegions =
new TiXmlElement(
"BOUNDARYREGIONS");
1247 vItem = vBndRegions->FirstChildElement();
1250 std::string vSeqStr = vItem->FirstChild()->ToText()->Value();
1251 std::string::size_type indxBeg = vSeqStr.find_first_of(
'[') + 1;
1252 std::string::size_type indxEnd = vSeqStr.find_last_of(
']') - 1;
1253 vSeqStr = vSeqStr.substr(indxBeg, indxEnd - indxBeg + 1);
1254 std::vector<unsigned int> vSeq;
1256 std::string vListStr;
1258 for (
unsigned int i = 0; i < vSeq.size(); ++i)
1260 if (vComposites.find(vSeq[i]) != vComposites.end())
1262 vListStr += comma ?
"," :
"";
1264 vListStr += boost::lexical_cast<std::string>(vSeq[i]);
1267 int p = atoi(vItem->Attribute(
"ID"));
1268 if (vListStr.length() == 0)
1270 vBndRegions->RemoveChild(vItem);
1274 vListStr =
"C[" + vListStr +
"]";
1275 TiXmlText* vList =
new TiXmlText(vListStr);
1276 TiXmlElement* vNewElement =
new TiXmlElement(
"B");
1277 vNewElement->SetAttribute(
"ID", p);
1278 vNewElement->LinkEndChild(vList);
1279 vNewBndRegions->LinkEndChild(vNewElement);
1280 vBndRegionIdList.insert(p);
1286 vItem = vItem->NextSiblingElement();
1288 vConditions->ReplaceChild(vBndRegions, *vNewBndRegions);
1293 vItem = vBndConditions->FirstChildElement();
1297 if ((x = vBndRegionIdList.find(atoi(vItem->Attribute(
"REF")))) != vBndRegionIdList.end())
1299 vItem->SetAttribute(
"REF", *x);
1303 vBndConditions->RemoveChild(vItem);
1305 vItem = vItem->NextSiblingElement();
1308 pNektar->LinkEndChild(vConditions);
1312 TiXmlElement* vSrc = pSession->GetElement(
"Nektar")
1313 ->FirstChildElement();
1316 std::string vName = boost::to_upper_copy(vSrc->ValueStr());
1317 if (vName !=
"GEOMETRY" && vName !=
"CONDITIONS")
1319 pNektar->LinkEndChild(
new TiXmlElement(*vSrc));
1321 vSrc = vSrc->NextSiblingElement();
1332 for ( boost::tie(vertit, vertit_end) = boost::vertices(
m_localPartition[procid]);
1333 vertit != vertit_end;