Commit e7f2af74 authored by Pavel Burovskiy's avatar Pavel Burovskiy
Browse files

Merge branch 'master' into fix/cg-svtvp

parents ce8a6cba e7b481f5
......@@ -217,15 +217,28 @@ namespace Nektar
MeshCurved c;
ASSERTL0(x->Attribute("ID", &c.id),
"Failed to get attribute ID");
ASSERTL0(x->Attribute("EDGEID", &c.edgeid),
"Failed to get attribute EDGEID");
c.type = std::string(x->Attribute("TYPE"));
ASSERTL0(!c.type.empty(),
"Failed to get attribute TYPE");
ASSERTL0(x->Attribute("NUMPOINTS", &c.npoints),
"Failed to get attribute NUMPOINTS");
c.data = x->FirstChild()->ToText()->Value();
m_meshCurved[c.id] = c;
c.entitytype = x->Value()[0];
if (c.entitytype == "E")
{
ASSERTL0(x->Attribute("EDGEID", &c.entityid),
"Failed to get attribute EDGEID");
}
else if (c.entitytype == "F")
{
ASSERTL0(x->Attribute("FACEID", &c.entityid),
"Failed to get attribute FACEID");
}
else
{
ASSERTL0(false, "Unknown curve type.");
}
m_meshCurved[std::make_pair(c.entitytype, c.id)] = c;
x = x->NextSiblingElement();
}
}
......@@ -572,15 +585,26 @@ namespace Nektar
if (m_dim >= 2)
{
std::map<int, MeshCurved>::const_iterator vItCurve;
for (vItCurve = m_meshCurved.begin(); vItCurve != m_meshCurved.end(); ++vItCurve)
std::map<MeshCurvedKey, MeshCurved>::const_iterator vItCurve;
for (vItCurve = m_meshCurved.begin();
vItCurve != m_meshCurved.end();
++vItCurve)
{
MeshCurved c = vItCurve->second;
if (vEdges.find(c.edgeid) != vEdges.end())
if (vEdges.find(c.entityid) != vEdges.end() ||
vFaces.find(c.entityid) != vFaces.end())
{
x = new TiXmlElement("E");
x = new TiXmlElement(c.entitytype);
x->SetAttribute("ID", c.id);
x->SetAttribute("EDGEID", c.edgeid);
if (c.entitytype == "E")
{
x->SetAttribute("EDGEID", c.entityid);
}
else
{
x->SetAttribute("FACEID", c.entityid);
}
x->SetAttribute("TYPE", c.type);
x->SetAttribute("NUMPOINTS", c.npoints);
y = new TiXmlText(c.data);
......
......@@ -99,12 +99,14 @@ namespace Nektar
struct MeshCurved
{
int id;
int edgeid;
std::string entitytype;
int entityid;
std::string type;
int npoints;
std::string data;
};
typedef std::pair<std::string, int> MeshCurvedKey;
struct MeshComposite
{
int id;
......@@ -160,20 +162,20 @@ namespace Nektar
BoostGraph
>::adjacency_iterator BoostAdjacencyIterator;
int m_dim;
int m_dim;
std::map<int, MeshVertex> m_meshVertices;
std::map<int, MeshEntity> m_meshEdges;
std::map<int, MeshEntity> m_meshFaces;
std::map<int, MeshEntity> m_meshElements;
std::map<int, MeshCurved> m_meshCurved;
std::map<int, MeshEntity> m_meshComposites;
std::vector<unsigned int> m_domain;
std::map<int, MeshVertex> m_meshVertices;
std::map<int, MeshEntity> m_meshEdges;
std::map<int, MeshEntity> m_meshFaces;
std::map<int, MeshEntity> m_meshElements;
std::map<MeshCurvedKey, MeshCurved> m_meshCurved;
std::map<int, MeshEntity> m_meshComposites;
std::vector<unsigned int> m_domain;
BoostSubGraph m_mesh;
BoostSubGraph m_localPartition;
BoostSubGraph m_mesh;
BoostSubGraph m_localPartition;
CommSharedPtr m_comm;
CommSharedPtr m_comm;
void ReadMesh(const SessionReaderSharedPtr& pSession);
void CreateGraph(BoostSubGraph& pGraph);
......
......@@ -1165,21 +1165,15 @@ namespace Nektar
TiXmlElement *facelement = field->FirstChildElement("F");
int faceindx, faceid;
int nextFaceNumber = -1;
while(facelement)
{
/// These should be ordered.
nextFaceNumber++;
std::string face(facelement->ValueStr());
ASSERTL0(face == "F", (std::string("Unknown 3D curve type: ") + face).c_str());
/// Read id attribute.
err = facelement->QueryIntAttribute("ID", &faceindx);
ASSERTL0(err == TIXML_SUCCESS, "Unable to read curve attribute ID.");
ASSERTL0(faceindx == nextFaceNumber, "Face IDs must begin with zero and be sequential.");
/// Read face id attribute.
err = facelement->QueryIntAttribute("FACEID", &faceid);
......
......@@ -199,8 +199,6 @@ namespace Nektar
{
face_curved[m_curvedFaces[i]->m_curveID] = i;
}
int nextFaceNumber = -1;
/// All faces are of the form: "<? ID="#"> ... </?>", with
/// ? being an element type (either Q or T).
......@@ -214,14 +212,10 @@ namespace Nektar
ASSERTL0(elementType == "Q" || elementType == "T",
(std::string("Unknown 3D face type: ") + elementType).c_str());
/// These should be ordered.
nextFaceNumber++;
/// Read id attribute.
int indx;
int err = element->QueryIntAttribute("ID", &indx);
ASSERTL0(err == TIXML_SUCCESS, "Unable to read face attribute ID.");
// ASSERTL0(indx == nextFaceNumber, "Face IDs must begin with zero and be sequential.");
/// Read text element description.
TiXmlNode* elementChild = element->FirstChild();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment