46#include <boost/algorithm/string/predicate.hpp>
47#include <boost/archive/iterators/base64_from_binary.hpp>
48#include <boost/archive/iterators/binary_from_base64.hpp>
49#include <boost/archive/iterators/transform_width.hpp>
50#include <boost/format.hpp>
60 "IO with compressed Xml geometry");
64 int spaceDimension =
m_meshGraph->GetSpaceDimension();
67 TiXmlElement *element =
m_xmlGeom->FirstChildElement(
"VERTEX");
68 ASSERTL0(element,
"Unable to find mesh VERTEX tag in file.");
75 const char *xscal = element->Attribute(
"XSCALE");
82 std::string xscalstr = xscal;
84 xscale = expEvaluator.
Evaluate(expr_id);
87 const char *yscal = element->Attribute(
"YSCALE");
94 std::string yscalstr = yscal;
96 yscale = expEvaluator.
Evaluate(expr_id);
99 const char *zscal = element->Attribute(
"ZSCALE");
106 std::string zscalstr = zscal;
108 zscale = expEvaluator.
Evaluate(expr_id);
116 const char *xmov = element->Attribute(
"XMOVE");
123 std::string xmovstr = xmov;
125 xmove = expEvaluator.
Evaluate(expr_id);
128 const char *ymov = element->Attribute(
"YMOVE");
135 std::string ymovstr = ymov;
137 ymove = expEvaluator.
Evaluate(expr_id);
140 const char *zmov = element->Attribute(
"ZMOVE");
147 std::string zmovstr = zmov;
149 zmove = expEvaluator.
Evaluate(expr_id);
154 const char *zrot = element->Attribute(
"ZROT");
161 std::string zrotstr = zrot;
163 zrotate = expEvaluator.
Evaluate(expr_id);
166 std::string IsCompressed;
167 element->QueryStringAttribute(
"COMPRESSED", &IsCompressed);
169 if (boost::iequals(IsCompressed,
173 TiXmlNode *vertexChild = element->FirstChild();
174 ASSERTL0(vertexChild,
"Unable to extract the data from the compressed "
177 std::string vertexStr;
178 if (vertexChild->Type() == TiXmlNode::TINYXML_TEXT)
180 vertexStr += vertexChild->ToText()->ValueStr();
183 std::vector<SpatialDomains::MeshVertex> vertData;
189 for (
int i = 0; i < vertData.size(); ++i)
191 indx = vertData[i].id;
192 xval = vertData[i].x;
193 yval = vertData[i].y;
194 zval = vertData[i].z;
196 xval = xval * xscale + xmove;
197 yval = yval * yscale + ymove;
198 zval = zval * zscale + zmove;
202 NekDouble xval_tmp = xval * cos(zrotate) - yval * sin(zrotate);
203 yval = xval * sin(zrotate) + yval * cos(zrotate);
207 m_meshGraph->CreatePointGeom(spaceDimension, indx, xval, yval,
213 ASSERTL0(
false,
"Compressed formats do not match. Expected :" +
215 " but got " + IsCompressed);
223 auto &curveNodes =
m_meshGraph->GetAllCurveNodes();
224 int spaceDimension =
m_meshGraph->GetSpaceDimension();
228 TiXmlElement *element =
m_xmlGeom->FirstChildElement(
"VERTEX");
229 ASSERTL0(element,
"Unable to find mesh VERTEX tag in file.");
234 const char *xscal = element->Attribute(
"XSCALE");
241 std::string xscalstr = xscal;
243 xscale = expEvaluator.
Evaluate(expr_id);
246 const char *yscal = element->Attribute(
"YSCALE");
253 std::string yscalstr = yscal;
255 yscale = expEvaluator.
Evaluate(expr_id);
258 const char *zscal = element->Attribute(
"ZSCALE");
265 std::string zscalstr = zscal;
267 zscale = expEvaluator.
Evaluate(expr_id);
275 const char *xmov = element->Attribute(
"XMOVE");
282 std::string xmovstr = xmov;
284 xmove = expEvaluator.
Evaluate(expr_id);
287 const char *ymov = element->Attribute(
"YMOVE");
294 std::string ymovstr = ymov;
296 ymove = expEvaluator.
Evaluate(expr_id);
299 const char *zmov = element->Attribute(
"ZMOVE");
306 std::string zmovstr = zmov;
308 zmove = expEvaluator.
Evaluate(expr_id);
313 const char *zrot = element->Attribute(
"ZROT");
320 std::string zrotstr = zrot;
322 zrotate = expEvaluator.
Evaluate(expr_id);
326 TiXmlElement *field =
m_xmlGeom->FirstChildElement(
"CURVED");
333 std::string IsCompressed;
334 field->QueryStringAttribute(
"COMPRESSED", &IsCompressed);
336 if (IsCompressed.size() == 0)
343 ASSERTL0(boost::iequals(IsCompressed,
345 "Compressed formats do not match. Expected :" +
349 std::vector<SpatialDomains::MeshCurvedInfo> edginfo;
350 std::vector<SpatialDomains::MeshCurvedInfo> facinfo;
354 TiXmlElement *x = field->FirstChildElement();
357 const char *entitytype = x->Value();
359 if (boost::iequals(entitytype,
"E"))
363 TiXmlNode *child = x->FirstChild();
365 if (child->Type() == TiXmlNode::TINYXML_TEXT)
367 elmtStr += child->ToText()->ValueStr();
373 else if (boost::iequals(entitytype,
"F"))
377 TiXmlNode *child = x->FirstChild();
379 if (child->Type() == TiXmlNode::TINYXML_TEXT)
381 elmtStr += child->ToText()->ValueStr();
387 else if (boost::iequals(entitytype,
"DATAPOINTS"))
391 "Failed to get ID from PTS section");
397 TiXmlElement *DataIdx = x->FirstChildElement(
"INDEX");
398 ASSERTL0(DataIdx,
"Cannot read data index tag in compressed "
401 TiXmlNode *child = DataIdx->FirstChild();
402 if (child->Type() == TiXmlNode::TINYXML_TEXT)
404 elmtStr = child->ToText()->ValueStr();
410 TiXmlElement *DataPts = x->FirstChildElement(
"POINTS");
411 ASSERTL0(DataPts,
"Cannot read data pts tag in compressed "
414 child = DataPts->FirstChild();
415 if (child->Type() == TiXmlNode::TINYXML_TEXT)
417 elmtStr = child->ToText()->ValueStr();
425 ASSERTL0(
false,
"Unknown tag in curved section");
427 x = x->NextSiblingElement();
431 for (
int i = 0; i < cpts.
pts.size(); ++i)
433 cpts.
pts[i].x = xscale * cpts.
pts[i].x + xmove;
434 cpts.
pts[i].y = yscale * cpts.
pts[i].y + ymove;
435 cpts.
pts[i].z = zscale * cpts.
pts[i].z + zmove;
440 cpts.
pts[i].x * cos(zrotate) - cpts.
pts[i].y * sin(zrotate);
442 cpts.
pts[i].x * sin(zrotate) + cpts.
pts[i].y * cos(zrotate);
443 cpts.
pts[i].x = xval_tmp;
447 for (
int i = 0; i < edginfo.size(); ++i)
449 int edgeid = edginfo[i].entityid;
456 int offset = edginfo[i].ptoffset;
457 for (
int j = 0; j < edginfo[i].npoints; ++j)
459 int idx = cpts.
index[offset + j];
460 curveNodes.emplace_back(
462 spaceDimension, edginfo[i].
id, cpts.
pts[idx].x,
463 cpts.
pts[idx].y, cpts.
pts[idx].z));
464 curvedEdges[edgeid]->m_points.emplace_back(curveNodes.back().get());
468 for (
int i = 0; i < facinfo.size(); ++i)
470 int faceid = facinfo[i].entityid;
476 int offset = facinfo[i].ptoffset;
477 for (
int j = 0; j < facinfo[i].npoints; ++j)
479 int idx = cpts.
index[offset + j];
480 curveNodes.emplace_back(
482 spaceDimension, facinfo[i].
id, cpts.
pts[idx].x,
483 cpts.
pts[idx].y, cpts.
pts[idx].z));
484 curvedFaces[faceid]->m_points.emplace_back(curveNodes.back().get());
492 int spaceDimension =
m_meshGraph->GetSpaceDimension();
494 CurveMap::iterator it;
497 TiXmlElement *field =
m_xmlGeom->FirstChildElement(
"EDGE");
499 ASSERTL0(field,
"Unable to find EDGE tag in file.");
501 std::string IsCompressed;
502 field->QueryStringAttribute(
"COMPRESSED", &IsCompressed);
504 ASSERTL0(boost::iequals(IsCompressed,
506 "Compressed formats do not match. Expected :" +
510 TiXmlNode *edgeChild = field->FirstChild();
511 ASSERTL0(edgeChild,
"Unable to extract the data from "
512 "the compressed edge tag.");
515 if (edgeChild->Type() == TiXmlNode::TINYXML_TEXT)
517 edgeStr += edgeChild->ToText()->ValueStr();
520 std::vector<SpatialDomains::MeshEdge> edgeData;
524 for (
int i = 0; i < edgeData.size(); ++i)
526 indx = edgeData[i].id;
527 std::array<PointGeom *, 2> vertices = {
531 it = curvedEdges.find(indx);
532 if (it == curvedEdges.end())
536 indx, spaceDimension, vertices));
542 indx, spaceDimension, vertices, it->second));
552 TiXmlElement *field =
m_xmlGeom->FirstChildElement(
"FACE");
554 ASSERTL0(field,
"Unable to find FACE tag in file.");
560 TiXmlElement *element = field->FirstChildElement();
561 CurveMap::iterator it;
565 std::string elementType(element->ValueStr());
567 ASSERTL0(elementType ==
"Q" || elementType ==
"T",
568 (std::string(
"Unknown 3D face type: ") + elementType).c_str());
570 std::string IsCompressed;
571 element->QueryStringAttribute(
"COMPRESSED", &IsCompressed);
574 boost::iequals(IsCompressed,
576 "Compressed formats do not match. Expected :" +
581 TiXmlNode *faceChild = element->FirstChild();
582 ASSERTL0(faceChild,
"Unable to extract the data from "
583 "the compressed face tag.");
586 if (faceChild->Type() == TiXmlNode::TINYXML_TEXT)
588 faceStr += faceChild->ToText()->ValueStr();
592 if (elementType ==
"T")
594 std::vector<SpatialDomains::MeshTri> faceData;
598 for (
int i = 0; i < faceData.size(); ++i)
600 indx = faceData[i].id;
603 it = curvedFaces.find(indx);
606 std::array<SegGeom *, TriGeom::kNedges> edges = {
611 if (it == curvedFaces.end())
621 indx, edges, it->second));
625 else if (elementType ==
"Q")
627 std::vector<SpatialDomains::MeshQuad> faceData;
631 for (
int i = 0; i < faceData.size(); ++i)
633 indx = faceData[i].id;
636 it = curvedFaces.find(indx);
639 std::array<SegGeom *, QuadGeom::kNedges> edges = {
645 if (it == curvedFaces.end())
655 indx, edges, it->second));
660 element = element->NextSiblingElement();
667 int spaceDimension =
m_meshGraph->GetSpaceDimension();
669 TiXmlElement *field =
nullptr;
672 field =
m_xmlGeom->FirstChildElement(
"ELEMENT");
674 ASSERTL0(field,
"Unable to find ELEMENT tag in file.");
679 TiXmlElement *segment = field->FirstChildElement(
"S");
680 CurveMap::iterator it;
684 std::string IsCompressed;
685 segment->QueryStringAttribute(
"COMPRESSED", &IsCompressed);
687 boost::iequals(IsCompressed,
689 "Compressed formats do not match. Expected :" +
694 TiXmlNode *child = segment->FirstChild();
695 ASSERTL0(child,
"Unable to extract the data from "
696 "the compressed face tag.");
699 if (child->Type() == TiXmlNode::TINYXML_TEXT)
701 str += child->ToText()->ValueStr();
706 std::vector<SpatialDomains::MeshEdge> data;
709 for (
int i = 0; i < data.size(); ++i)
714 it = curvedEdges.find(indx);
716 std::array<PointGeom *, 2> vertices = {
721 if (it == curvedEdges.end())
725 indx, spaceDimension, vertices));
731 indx, spaceDimension, vertices, it->second));
735 segment = segment->NextSiblingElement(
"S");
744 TiXmlElement *field =
m_xmlGeom->FirstChildElement(
"ELEMENT");
746 ASSERTL0(field,
"Unable to find ELEMENT tag in file.");
749 CurveMap::iterator it;
754 TiXmlElement *element = field->FirstChildElement();
758 std::string elementType(element->ValueStr());
761 elementType ==
"Q" || elementType ==
"T",
762 (std::string(
"Unknown 2D element type: ") + elementType).c_str());
764 std::string IsCompressed;
765 element->QueryStringAttribute(
"COMPRESSED", &IsCompressed);
768 boost::iequals(IsCompressed,
770 "Compressed formats do not match. Expected :" +
775 TiXmlNode *faceChild = element->FirstChild();
776 ASSERTL0(faceChild,
"Unable to extract the data from "
777 "the compressed face tag.");
780 if (faceChild->Type() == TiXmlNode::TINYXML_TEXT)
782 faceStr += faceChild->ToText()->ValueStr();
786 if (elementType ==
"T")
788 std::vector<SpatialDomains::MeshTri> faceData;
792 for (
int i = 0; i < faceData.size(); ++i)
794 indx = faceData[i].id;
797 it = curvedFaces.find(indx);
800 std::array<SegGeom *, TriGeom::kNedges> edges = {
805 if (it == curvedFaces.end())
815 indx, edges, it->second));
819 else if (elementType ==
"Q")
821 std::vector<SpatialDomains::MeshQuad> faceData;
825 for (
int i = 0; i < faceData.size(); ++i)
827 indx = faceData[i].id;
830 it = curvedFaces.find(indx);
833 std::array<SegGeom *, QuadGeom::kNedges> edges = {
839 if (it == curvedFaces.end())
849 indx, edges, it->second));
854 element = element->NextSiblingElement();
861 TiXmlElement *field =
m_xmlGeom->FirstChildElement(
"ELEMENT");
863 ASSERTL0(field,
"Unable to find ELEMENT tag in file.");
868 TiXmlElement *element = field->FirstChildElement();
872 std::string elementType(element->ValueStr());
876 elementType ==
"A" || elementType ==
"P" || elementType ==
"R" ||
878 (std::string(
"Unknown 3D element type: ") + elementType).c_str());
880 std::string IsCompressed;
881 element->QueryStringAttribute(
"COMPRESSED", &IsCompressed);
884 boost::iequals(IsCompressed,
886 "Compressed formats do not match. Expected :" +
891 TiXmlNode *child = element->FirstChild();
892 ASSERTL0(child,
"Unable to extract the data from "
893 "the compressed face tag.");
896 if (child->Type() == TiXmlNode::TINYXML_TEXT)
898 str += child->ToText()->ValueStr();
902 if (elementType ==
"A")
904 std::vector<SpatialDomains::MeshTet> data;
906 std::array<TriGeom *, 4> tfaces;
907 for (
int i = 0; i < data.size(); ++i)
910 for (
int j = 0; j < 4; ++j)
913 tfaces[j] =
static_cast<TriGeom *
>(face);
918 m_meshGraph->PopulateFaceToElMap(tetGeom.get(), 4);
922 else if (elementType ==
"P")
924 std::vector<SpatialDomains::MeshPyr> data;
926 std::array<Geometry2D *, 5> faces;
927 for (
int i = 0; i < data.size(); ++i)
932 for (
int j = 0; j < 5; ++j)
936 if (face ==
nullptr ||
940 std::stringstream errorstring;
941 errorstring <<
"Element " << indx
942 <<
" has invalid face: " << j;
943 ASSERTL0(
false, errorstring.str().c_str());
947 faces[j] =
static_cast<TriGeom *
>(face);
953 faces[j] =
static_cast<QuadGeom *
>(face);
957 ASSERTL0((Ntfaces == 4) && (Nqfaces == 1),
958 "Did not identify the correct number of "
959 "triangular and quadrilateral faces for a "
964 m_meshGraph->PopulateFaceToElMap(pyrGeom.get(), 5);
968 else if (elementType ==
"R")
970 std::vector<SpatialDomains::MeshPrism> data;
972 std::array<Geometry2D *, 5> faces;
973 for (
int i = 0; i < data.size(); ++i)
978 for (
int j = 0; j < 5; ++j)
981 if (face ==
nullptr ||
985 std::stringstream errorstring;
986 errorstring <<
"Element " << indx
987 <<
" has invalid face: " << j;
988 ASSERTL0(
false, errorstring.str().c_str());
992 faces[j] =
static_cast<TriGeom *
>(face);
998 faces[j] =
static_cast<QuadGeom *
>(face);
1002 ASSERTL0((Ntfaces == 2) && (Nqfaces == 3),
1003 "Did not identify the correct number of "
1004 "triangular and quadrilateral faces for a "
1009 m_meshGraph->PopulateFaceToElMap(prismGeom.get(), 5);
1013 else if (elementType ==
"H")
1015 std::vector<SpatialDomains::MeshHex> data;
1018 std::array<QuadGeom *, 6> faces;
1019 for (
int i = 0; i < data.size(); ++i)
1022 for (
int j = 0; j < 6; ++j)
1025 faces[j] =
static_cast<QuadGeom *
>(face);
1030 m_meshGraph->PopulateFaceToElMap(hexGeom.get(), 6);
1035 element = element->NextSiblingElement();
1046 vertInfo.push_back(v);
1049 std::vector<int> keysToWrite)
1057 TiXmlElement *vertTag =
new TiXmlElement(
"VERTEX");
1059 std::vector<MeshVertex> vertInfo;
1061 if (keysToWrite.empty())
1063 for (
auto [
id, vert] : verts)
1070 for (
int id : keysToWrite)
1076 vertTag->SetAttribute(
"COMPRESSED",
1078 vertTag->SetAttribute(
"BITSIZE",
1081 std::string vertStr;
1084 vertTag->LinkEndChild(
new TiXmlText(vertStr));
1086 geomTag->LinkEndChild(vertTag);
1095 edgeInfo.push_back(e);
1098 std::vector<int> keysToWrite)
1106 int meshDimension =
m_meshGraph->GetMeshDimension();
1108 TiXmlElement *edgeTag =
new TiXmlElement(meshDimension == 1 ?
"S" :
"EDGE");
1110 std::vector<MeshEdge> edgeInfo;
1112 if (keysToWrite.empty())
1114 for (
auto [
id, edge] : edges)
1121 for (
int id : keysToWrite)
1127 std::string edgeStr;
1130 edgeTag->SetAttribute(
"COMPRESSED",
1132 edgeTag->SetAttribute(
"BITSIZE",
1135 edgeTag->LinkEndChild(
new TiXmlText(edgeStr));
1137 if (meshDimension == 1)
1139 TiXmlElement *tmp =
new TiXmlElement(
"ELEMENT");
1140 tmp->LinkEndChild(edgeTag);
1141 geomTag->LinkEndChild(tmp);
1145 geomTag->LinkEndChild(edgeTag);
1156 triInfo.push_back(t);
1159 std::vector<int> keysToWrite)
1163 if (tris.size() == 0)
1168 std::string tag =
"T";
1170 std::vector<MeshTri> triInfo;
1172 if (keysToWrite.empty())
1174 for (
auto [
id, tri] : tris)
1181 for (
int id : keysToWrite)
1183 WriteTri(tris.at(
id), triInfo,
id);
1187 TiXmlElement *x =
new TiXmlElement(tag);
1191 x->SetAttribute(
"COMPRESSED",
1195 x->LinkEndChild(
new TiXmlText(triStr));
1197 faceTag->LinkEndChild(x);
1204 q.e[0] = quad->
GetEid(0);
1205 q.e[1] = quad->
GetEid(1);
1206 q.e[2] = quad->
GetEid(2);
1207 q.e[3] = quad->
GetEid(3);
1208 quadInfo.push_back(q);
1211 std::vector<int> keysToWrite)
1215 if (quads.size() == 0)
1220 std::string tag =
"Q";
1222 std::vector<MeshQuad> quadInfo;
1224 if (keysToWrite.empty())
1226 for (
auto [
id, quad] : quads)
1233 for (
int id : keysToWrite)
1239 TiXmlElement *x =
new TiXmlElement(tag);
1240 std::string quadStr;
1243 x->SetAttribute(
"COMPRESSED",
1247 x->LinkEndChild(
new TiXmlText(quadStr));
1249 faceTag->LinkEndChild(x);
1262 elementInfo.push_back(e);
1265 std::vector<int> keysToWrite)
1269 if (hexes.size() == 0)
1274 std::string tag =
"H";
1276 std::vector<MeshHex> elementInfo;
1278 if (keysToWrite.empty())
1280 for (
auto [
id, hex] : hexes)
1287 for (
int id : keysToWrite)
1289 WriteHex(hexes.at(
id), elementInfo,
id);
1293 TiXmlElement *x =
new TiXmlElement(tag);
1297 x->SetAttribute(
"COMPRESSED",
1301 x->LinkEndChild(
new TiXmlText(elStr));
1303 elmtTag->LinkEndChild(x);
1316 elementInfo.push_back(e);
1319 std::vector<int> keysToWrite)
1323 if (prisms.size() == 0)
1328 std::string tag =
"R";
1330 std::vector<MeshPrism> elementInfo;
1332 if (keysToWrite.empty())
1334 for (
auto [
id, prism] : prisms)
1341 for (
int id : keysToWrite)
1347 TiXmlElement *x =
new TiXmlElement(tag);
1351 x->SetAttribute(
"COMPRESSED",
1355 x->LinkEndChild(
new TiXmlText(elStr));
1357 elmtTag->LinkEndChild(x);
1369 elementInfo.push_back(e);
1372 std::vector<int> keysToWrite)
1376 if (pyrs.size() == 0)
1381 std::string tag =
"P";
1383 std::vector<MeshPyr> elementInfo;
1385 if (keysToWrite.empty())
1387 for (
auto [
id, pyr] : pyrs)
1394 for (
int id : keysToWrite)
1396 WritePyr(pyrs.at(
id), elementInfo,
id);
1400 TiXmlElement *x =
new TiXmlElement(tag);
1404 x->SetAttribute(
"COMPRESSED",
1408 x->LinkEndChild(
new TiXmlText(elStr));
1410 elmtTag->LinkEndChild(x);
1421 elementInfo.push_back(e);
1424 std::vector<int> keysToWrite)
1428 if (tets.size() == 0)
1433 std::string tag =
"A";
1435 std::vector<MeshTet> elementInfo;
1437 if (keysToWrite.empty())
1439 for (
auto [
id, tet] : tets)
1446 for (
int id : keysToWrite)
1448 WriteTet(tets.at(
id), elementInfo,
id);
1452 TiXmlElement *x =
new TiXmlElement(tag);
1456 x->SetAttribute(
"COMPRESSED",
1460 x->LinkEndChild(
new TiXmlText(elStr));
1462 elmtTag->LinkEndChild(x);
1468 if (edges.size() == 0 && faces.size() == 0)
1473 TiXmlElement *curveTag =
new TiXmlElement(
"CURVED");
1475 std::vector<MeshCurvedInfo> edgeInfo;
1476 std::vector<MeshCurvedInfo> faceInfo;
1484 for (
auto &i : edges)
1487 cinfo.
id = edgeCnt++;
1489 cinfo.
npoints = i.second->m_points.size();
1490 cinfo.
ptype = i.second->m_ptype;
1494 edgeInfo.push_back(cinfo);
1496 for (
int j = 0; j < i.second->m_points.size(); j++)
1500 v.
x = i.second->m_points[j]->x();
1501 v.
y = i.second->m_points[j]->y();
1502 v.
z = i.second->m_points[j]->z();
1503 curvedPts.
pts.push_back(v);
1504 curvedPts.
index.push_back(newIdx);
1510 for (
auto &i : faces)
1513 cinfo.
id = faceCnt++;
1515 cinfo.
npoints = i.second->m_points.size();
1516 cinfo.
ptype = i.second->m_ptype;
1520 faceInfo.push_back(cinfo);
1522 for (
int j = 0; j < i.second->m_points.size(); j++)
1526 v.
x = i.second->m_points[j]->x();
1527 v.
y = i.second->m_points[j]->y();
1528 v.
z = i.second->m_points[j]->z();
1529 curvedPts.
pts.push_back(v);
1530 curvedPts.
index.push_back(newIdx);
1536 curveTag->SetAttribute(
"COMPRESSED",
1538 curveTag->SetAttribute(
"BITSIZE",
1541 if (edgeInfo.size())
1543 TiXmlElement *x =
new TiXmlElement(
"E");
1544 std::string dataStr;
1547 x->LinkEndChild(
new TiXmlText(dataStr));
1548 curveTag->LinkEndChild(x);
1551 if (faceInfo.size())
1553 TiXmlElement *x =
new TiXmlElement(
"F");
1554 std::string dataStr;
1557 x->LinkEndChild(
new TiXmlText(dataStr));
1558 curveTag->LinkEndChild(x);
1561 if (edgeInfo.size() || faceInfo.size())
1563 TiXmlElement *x =
new TiXmlElement(
"DATAPOINTS");
1564 x->SetAttribute(
"ID", curvedPts.
id);
1565 TiXmlElement *subx =
new TiXmlElement(
"INDEX");
1566 std::string dataStr;
1569 subx->LinkEndChild(
new TiXmlText(dataStr));
1570 x->LinkEndChild(subx);
1572 subx =
new TiXmlElement(
"POINTS");
1575 subx->LinkEndChild(
new TiXmlText(dataStr));
1576 x->LinkEndChild(subx);
1577 curveTag->LinkEndChild(x);
1580 geomTag->LinkEndChild(curveTag);
#define ASSERTL0(condition, msg)
Interpreter class for the evaluation of mathematical expressions.
int DefineFunction(const std::string &vlist, const std::string &expr)
Defines a function for the purposes of evaluation.
NekDouble Evaluate(const int id)
Evaluate a function which depends only on constants and/or parameters.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
boost::call_traits< DataType >::const_reference x() const
boost::call_traits< DataType >::const_reference z() const
boost::call_traits< DataType >::const_reference y() const
Generic object pool allocator/deallocator.
static std::unique_ptr< DataType, UniquePtrDeleter > AllocateUniquePtr(const Args &...args)
LibUtilities::ShapeType GetShapeType(void)
Get the geometric shape type of this object.
int GetVid(int i) const
Returns global id of vertex i of this object.
int GetFid(int i) const
Get the ID of face i of this object.
int GetEid(int i) const
Get the ID of edge i of this object.
MeshGraphSharedPtr m_meshGraph
void v_ReadElements2D() override
void v_WriteTris(TiXmlElement *faceTag, std::vector< int > keysToWrite=std::vector< int >()) override
static std::string className
void v_WritePyrs(TiXmlElement *elmtTag, std::vector< int > keysToWrite=std::vector< int >()) override
void v_ReadVertices() override
void v_WriteVertices(TiXmlElement *geomTag, std::vector< int > keysToWrite=std::vector< int >()) override
void v_WritePrisms(TiXmlElement *elmtTag, std::vector< int > keysToWrite=std::vector< int >()) override
void v_ReadFaces() override
void v_WriteHexs(TiXmlElement *elmtTag, std::vector< int > keysToWrite=std::vector< int >()) override
void v_ReadCurves() override
void v_ReadElements3D() override
void v_WriteCurves(TiXmlElement *geomTag, CurveMap &edges, CurveMap &faces) override
void v_ReadEdges() override
void v_WriteTets(TiXmlElement *elmtTag, std::vector< int > keysToWrite=std::vector< int >()) override
void v_WriteEdges(TiXmlElement *geomTag, std::vector< int > keysToWrite=std::vector< int >()) override
void v_ReadElements1D() override
void v_WriteQuads(TiXmlElement *faceTag, std::vector< int > keysToWrite=std::vector< int >()) override
static MeshGraphIOSharedPtr create()
std::string GetBitSizeStr(void)
int ZlibDecodeFromBase64Str(std::string &in64, std::vector< T > &out)
std::string GetCompressString(void)
int ZlibEncodeToBase64Str(std::vector< T > &in, std::string &out64)
void WriteVert(PointGeom *vert, TiXmlElement *vertTag)
void WritePrism(PrismGeom *pri, TiXmlElement *elmtTag, std::string &tag, int priID)
void WriteTri(TriGeom *tri, TiXmlElement *faceTag, std::string &tag, int triID)
void WriteEdge(SegGeom *seg, TiXmlElement *edgeTag, std::string &tag, int edgeID)
std::unordered_map< int, CurveSharedPtr > CurveMap
void WriteQuad(QuadGeom *quad, TiXmlElement *faceTag, std::string &tag, int quadID)
void WriteHex(HexGeom *hex, TiXmlElement *elmtTag, std::string &tag, int hexID)
MeshGraphIOFactory & GetMeshGraphIOFactory()
void WritePyr(PyrGeom *pyr, TiXmlElement *elmtTag, std::string &tag, int pyrID)
unique_ptr_objpool< SegGeom > SegGeomUniquePtr
void WriteTet(TetGeom *tet, TiXmlElement *elmtTag, std::string &tag, int tetID)
int64_t ptype
point offset of data entry for this curve
int64_t npoints
The entity id corresponding to the global edge/curve.
int64_t ptoffset
the id of point data map (currently always 0 since we are using just one set).
int64_t entityid
Id of this curved information.
int64_t ptid
The number of points in this curved entity.
std::vector< int64_t > index
Mapping to access the pts value. Given a 'ptoffset' value the npoints subsquent values provide the in...
std::vector< MeshVertex > pts
mapping to access pts value.