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.get()));
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.get()));
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.get()));
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));
732 indx, spaceDimension, vertices, it->second.get()));
736 segment = segment->NextSiblingElement(
"S");
745 TiXmlElement *field =
m_xmlGeom->FirstChildElement(
"ELEMENT");
747 ASSERTL0(field,
"Unable to find ELEMENT tag in file.");
750 CurveMap::iterator it;
755 TiXmlElement *element = field->FirstChildElement();
759 std::string elementType(element->ValueStr());
762 elementType ==
"Q" || elementType ==
"T",
763 (std::string(
"Unknown 2D element type: ") + elementType).c_str());
765 std::string IsCompressed;
766 element->QueryStringAttribute(
"COMPRESSED", &IsCompressed);
769 boost::iequals(IsCompressed,
771 "Compressed formats do not match. Expected :" +
776 TiXmlNode *faceChild = element->FirstChild();
777 ASSERTL0(faceChild,
"Unable to extract the data from "
778 "the compressed face tag.");
781 if (faceChild->Type() == TiXmlNode::TINYXML_TEXT)
783 faceStr += faceChild->ToText()->ValueStr();
787 if (elementType ==
"T")
789 std::vector<SpatialDomains::MeshTri> faceData;
793 for (
int i = 0; i < faceData.size(); ++i)
795 indx = faceData[i].id;
798 it = curvedFaces.find(indx);
801 std::array<SegGeom *, TriGeom::kNedges> edges = {
806 if (it == curvedFaces.end())
816 indx, edges, it->second.get()));
820 else if (elementType ==
"Q")
822 std::vector<SpatialDomains::MeshQuad> faceData;
826 for (
int i = 0; i < faceData.size(); ++i)
828 indx = faceData[i].id;
831 it = curvedFaces.find(indx);
834 std::array<SegGeom *, QuadGeom::kNedges> edges = {
840 if (it == curvedFaces.end())
850 indx, edges, it->second.get()));
855 element = element->NextSiblingElement();
862 TiXmlElement *field =
m_xmlGeom->FirstChildElement(
"ELEMENT");
864 ASSERTL0(field,
"Unable to find ELEMENT tag in file.");
869 TiXmlElement *element = field->FirstChildElement();
873 std::string elementType(element->ValueStr());
877 elementType ==
"A" || elementType ==
"P" || elementType ==
"R" ||
879 (std::string(
"Unknown 3D element type: ") + elementType).c_str());
881 std::string IsCompressed;
882 element->QueryStringAttribute(
"COMPRESSED", &IsCompressed);
885 boost::iequals(IsCompressed,
887 "Compressed formats do not match. Expected :" +
892 TiXmlNode *child = element->FirstChild();
893 ASSERTL0(child,
"Unable to extract the data from "
894 "the compressed face tag.");
897 if (child->Type() == TiXmlNode::TINYXML_TEXT)
899 str += child->ToText()->ValueStr();
903 if (elementType ==
"A")
905 std::vector<SpatialDomains::MeshTet> data;
907 std::array<TriGeom *, 4> tfaces;
908 for (
int i = 0; i < data.size(); ++i)
911 for (
int j = 0; j < 4; ++j)
914 tfaces[j] =
static_cast<TriGeom *
>(face);
919 m_meshGraph->PopulateFaceToElMap(tetGeom.get(), 4);
923 else if (elementType ==
"P")
925 std::vector<SpatialDomains::MeshPyr> data;
927 std::array<Geometry2D *, 5> faces;
928 for (
int i = 0; i < data.size(); ++i)
933 for (
int j = 0; j < 5; ++j)
937 if (face ==
nullptr ||
941 std::stringstream errorstring;
942 errorstring <<
"Element " << indx
943 <<
" has invalid face: " << j;
944 ASSERTL0(
false, errorstring.str().c_str());
948 faces[j] =
static_cast<TriGeom *
>(face);
954 faces[j] =
static_cast<QuadGeom *
>(face);
958 ASSERTL0((Ntfaces == 4) && (Nqfaces == 1),
959 "Did not identify the correct number of "
960 "triangular and quadrilateral faces for a "
965 m_meshGraph->PopulateFaceToElMap(pyrGeom.get(), 5);
969 else if (elementType ==
"R")
971 std::vector<SpatialDomains::MeshPrism> data;
973 std::array<Geometry2D *, 5> faces;
974 for (
int i = 0; i < data.size(); ++i)
979 for (
int j = 0; j < 5; ++j)
982 if (face ==
nullptr ||
986 std::stringstream errorstring;
987 errorstring <<
"Element " << indx
988 <<
" has invalid face: " << j;
989 ASSERTL0(
false, errorstring.str().c_str());
993 faces[j] =
static_cast<TriGeom *
>(face);
999 faces[j] =
static_cast<QuadGeom *
>(face);
1003 ASSERTL0((Ntfaces == 2) && (Nqfaces == 3),
1004 "Did not identify the correct number of "
1005 "triangular and quadrilateral faces for a "
1010 m_meshGraph->PopulateFaceToElMap(prismGeom.get(), 5);
1014 else if (elementType ==
"H")
1016 std::vector<SpatialDomains::MeshHex> data;
1019 std::array<QuadGeom *, 6> faces;
1020 for (
int i = 0; i < data.size(); ++i)
1023 for (
int j = 0; j < 6; ++j)
1026 faces[j] =
static_cast<QuadGeom *
>(face);
1031 m_meshGraph->PopulateFaceToElMap(hexGeom.get(), 6);
1036 element = element->NextSiblingElement();
1047 vertInfo.push_back(v);
1050 std::vector<int> keysToWrite)
1058 TiXmlElement *vertTag =
new TiXmlElement(
"VERTEX");
1060 std::vector<MeshVertex> vertInfo;
1062 if (keysToWrite.empty())
1064 for (
auto [
id, vert] : verts)
1071 for (
int id : keysToWrite)
1077 vertTag->SetAttribute(
"COMPRESSED",
1079 vertTag->SetAttribute(
"BITSIZE",
1082 std::string vertStr;
1085 vertTag->LinkEndChild(
new TiXmlText(vertStr));
1087 geomTag->LinkEndChild(vertTag);
1096 edgeInfo.push_back(e);
1099 std::vector<int> keysToWrite)
1107 int meshDimension =
m_meshGraph->GetMeshDimension();
1109 TiXmlElement *edgeTag =
new TiXmlElement(meshDimension == 1 ?
"S" :
"EDGE");
1111 std::vector<MeshEdge> edgeInfo;
1113 if (keysToWrite.empty())
1115 for (
auto [
id, edge] : edges)
1122 for (
int id : keysToWrite)
1128 std::string edgeStr;
1131 edgeTag->SetAttribute(
"COMPRESSED",
1133 edgeTag->SetAttribute(
"BITSIZE",
1136 edgeTag->LinkEndChild(
new TiXmlText(edgeStr));
1138 if (meshDimension == 1)
1140 TiXmlElement *tmp =
new TiXmlElement(
"ELEMENT");
1141 tmp->LinkEndChild(edgeTag);
1142 geomTag->LinkEndChild(tmp);
1146 geomTag->LinkEndChild(edgeTag);
1157 triInfo.push_back(t);
1160 std::vector<int> keysToWrite)
1164 if (tris.size() == 0)
1169 std::string tag =
"T";
1171 std::vector<MeshTri> triInfo;
1173 if (keysToWrite.empty())
1175 for (
auto [
id, tri] : tris)
1182 for (
int id : keysToWrite)
1184 WriteTri(tris.at(
id), triInfo,
id);
1188 TiXmlElement *x =
new TiXmlElement(tag);
1192 x->SetAttribute(
"COMPRESSED",
1196 x->LinkEndChild(
new TiXmlText(triStr));
1198 faceTag->LinkEndChild(x);
1205 q.e[0] = quad->
GetEid(0);
1206 q.e[1] = quad->
GetEid(1);
1207 q.e[2] = quad->
GetEid(2);
1208 q.e[3] = quad->
GetEid(3);
1209 quadInfo.push_back(q);
1212 std::vector<int> keysToWrite)
1216 if (quads.size() == 0)
1221 std::string tag =
"Q";
1223 std::vector<MeshQuad> quadInfo;
1225 if (keysToWrite.empty())
1227 for (
auto [
id, quad] : quads)
1234 for (
int id : keysToWrite)
1240 TiXmlElement *x =
new TiXmlElement(tag);
1241 std::string quadStr;
1244 x->SetAttribute(
"COMPRESSED",
1248 x->LinkEndChild(
new TiXmlText(quadStr));
1250 faceTag->LinkEndChild(x);
1263 elementInfo.push_back(e);
1266 std::vector<int> keysToWrite)
1270 if (hexes.size() == 0)
1275 std::string tag =
"H";
1277 std::vector<MeshHex> elementInfo;
1279 if (keysToWrite.empty())
1281 for (
auto [
id, hex] : hexes)
1288 for (
int id : keysToWrite)
1290 WriteHex(hexes.at(
id), elementInfo,
id);
1294 TiXmlElement *x =
new TiXmlElement(tag);
1298 x->SetAttribute(
"COMPRESSED",
1302 x->LinkEndChild(
new TiXmlText(elStr));
1304 elmtTag->LinkEndChild(x);
1317 elementInfo.push_back(e);
1320 std::vector<int> keysToWrite)
1324 if (prisms.size() == 0)
1329 std::string tag =
"R";
1331 std::vector<MeshPrism> elementInfo;
1333 if (keysToWrite.empty())
1335 for (
auto [
id, prism] : prisms)
1342 for (
int id : keysToWrite)
1348 TiXmlElement *x =
new TiXmlElement(tag);
1352 x->SetAttribute(
"COMPRESSED",
1356 x->LinkEndChild(
new TiXmlText(elStr));
1358 elmtTag->LinkEndChild(x);
1370 elementInfo.push_back(e);
1373 std::vector<int> keysToWrite)
1377 if (pyrs.size() == 0)
1382 std::string tag =
"P";
1384 std::vector<MeshPyr> elementInfo;
1386 if (keysToWrite.empty())
1388 for (
auto [
id, pyr] : pyrs)
1395 for (
int id : keysToWrite)
1397 WritePyr(pyrs.at(
id), elementInfo,
id);
1401 TiXmlElement *x =
new TiXmlElement(tag);
1405 x->SetAttribute(
"COMPRESSED",
1409 x->LinkEndChild(
new TiXmlText(elStr));
1411 elmtTag->LinkEndChild(x);
1422 elementInfo.push_back(e);
1425 std::vector<int> keysToWrite)
1429 if (tets.size() == 0)
1434 std::string tag =
"A";
1436 std::vector<MeshTet> elementInfo;
1438 if (keysToWrite.empty())
1440 for (
auto [
id, tet] : tets)
1447 for (
int id : keysToWrite)
1449 WriteTet(tets.at(
id), elementInfo,
id);
1453 TiXmlElement *x =
new TiXmlElement(tag);
1457 x->SetAttribute(
"COMPRESSED",
1461 x->LinkEndChild(
new TiXmlText(elStr));
1463 elmtTag->LinkEndChild(x);
1467 std::vector<MeshCurvedInfo> &edgeInfo,
int &edgeCnt,
1471 cinfo.
id = edgeCnt++;
1473 cinfo.
npoints = curve->m_points.size();
1474 cinfo.
ptype = curve->m_ptype;
1478 edgeInfo.push_back(cinfo);
1480 for (
int j = 0; j < curve->m_points.size(); j++)
1484 v.
x = curve->m_points[j]->x();
1485 v.
y = curve->m_points[j]->y();
1486 v.
z = curve->m_points[j]->z();
1487 curvedPts.
pts.push_back(v);
1488 curvedPts.
index.push_back(newIdx);
1494 std::vector<MeshCurvedInfo> &faceInfo,
int &faceCnt,
1498 cinfo.
id = faceCnt++;
1500 cinfo.
npoints = curve->m_points.size();
1501 cinfo.
ptype = curve->m_ptype;
1505 faceInfo.push_back(cinfo);
1507 for (
int j = 0; j < curve->m_points.size(); j++)
1511 v.
x = curve->m_points[j]->x();
1512 v.
y = curve->m_points[j]->y();
1513 v.
z = curve->m_points[j]->z();
1514 curvedPts.
pts.push_back(v);
1515 curvedPts.
index.push_back(newIdx);
1522 std::vector<int> *keysToWriteEdges,
1523 std::vector<int> *keysToWriteFaces)
1525 if (edges.size() == 0 && faces.size() == 0)
1529 else if (keysToWriteEdges !=
nullptr && keysToWriteFaces !=
nullptr)
1531 if (keysToWriteEdges->size() == 0 && keysToWriteFaces->size() == 0)
1537 TiXmlElement *curveTag =
new TiXmlElement(
"CURVED");
1539 std::vector<MeshCurvedInfo> edgeInfo;
1540 std::vector<MeshCurvedInfo> faceInfo;
1548 if (keysToWriteEdges ==
nullptr)
1550 for (
auto &i : edges)
1558 for (
int key : *keysToWriteEdges)
1565 if (keysToWriteFaces ==
nullptr)
1567 for (
auto &i : faces)
1575 for (
int key : *keysToWriteFaces)
1582 curveTag->SetAttribute(
"COMPRESSED",
1584 curveTag->SetAttribute(
"BITSIZE",
1587 if (edgeInfo.size())
1589 TiXmlElement *x =
new TiXmlElement(
"E");
1590 std::string dataStr;
1593 x->LinkEndChild(
new TiXmlText(dataStr));
1594 curveTag->LinkEndChild(x);
1597 if (faceInfo.size())
1599 TiXmlElement *x =
new TiXmlElement(
"F");
1600 std::string dataStr;
1603 x->LinkEndChild(
new TiXmlText(dataStr));
1604 curveTag->LinkEndChild(x);
1607 if (edgeInfo.size() || faceInfo.size())
1609 TiXmlElement *x =
new TiXmlElement(
"DATAPOINTS");
1610 x->SetAttribute(
"ID", curvedPts.
id);
1611 TiXmlElement *subx =
new TiXmlElement(
"INDEX");
1612 std::string dataStr;
1615 subx->LinkEndChild(
new TiXmlText(dataStr));
1616 x->LinkEndChild(subx);
1618 subx =
new TiXmlElement(
"POINTS");
1621 subx->LinkEndChild(
new TiXmlText(dataStr));
1622 x->LinkEndChild(subx);
1623 curveTag->LinkEndChild(x);
1626 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.
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_WriteCurves(TiXmlElement *geomTag, CurveMap &edges, CurveMap &faces, std::vector< int > *keysToWriteEdges=nullptr, std::vector< int > *keysToWriteFaces=nullptr) 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_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)
unique_ptr_objpool< Curve > CurveUniquePtr
void WriteVert(PointGeom *vert, TiXmlElement *vertTag)
void WriteCurvedFace(CurveUniquePtr &curve, TiXmlElement *curveTag, int &curveId)
std::map< int, CurveUniquePtr > CurveMap
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)
void WriteCurvedEdge(CurveUniquePtr &curve, TiXmlElement *curveTag, int &curveId)
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.