Commit d909da3a authored by Dave Moxey's avatar Dave Moxey
Browse files

Fixed Semtex input converter for periodic and high-order edges.


git-svn-id: https://gforge.sci.utah.edu/svn/nektar/trunk@4045 305cdda6-5ce1-45b3-a98d-dfc68c8b3305
parent 3c60283d
......@@ -555,6 +555,8 @@ namespace Nektar
int elmt, side;
int periodicTagId = -1;
set<pair<int, int> > visitedPeriodic;
while (i < nSurf)
{
getline(mshFile, line);
......@@ -597,9 +599,17 @@ namespace Nektar
ss >> elmtB >> sideB;
elmtB--;
sideB--;
pair<int, int> c1(elmt, side );
pair<int, int> c2(elmtB, sideB);
insertEdge(elmt, side, periodicTagId);
insertEdge(elmtB, sideB, periodicTagId+1);
if (visitedPeriodic.count(c1) == 0 && visitedPeriodic.count(c2) == 0)
{
visitedPeriodic.insert(make_pair(elmtB, sideB));
visitedPeriodic.insert(make_pair(elmt, side ));
insertEdge(elmt, side, periodicTagId);
insertEdge(elmtB, sideB, periodicTagId+1);
}
}
else if (word == "<B>")
{
......
......@@ -318,10 +318,13 @@ namespace Nektar
* The list of composites may include individual element IDs or ranges
* of element IDs.
*/
string Composite::GetXmlString()
string Composite::GetXmlString(bool doSort)
{
element_id_less_than sortOperator;
sort(items.begin(), items.end(), sortOperator);
if (doSort)
{
element_id_less_than sortOperator;
sort(items.begin(), items.end(), sortOperator);
}
stringstream st;
vector<ElementSharedPtr>::iterator it;
......@@ -685,7 +688,7 @@ namespace Nektar
edgeNodes,
m_conf.edgeCurveType)));
}
if (m_conf.faceNodes)
{
volumeNodes.insert(volumeNodes.begin(),
......
......@@ -852,7 +852,7 @@ namespace Nektar
Composite() {}
/// Generate the list of IDs of elements within this composite.
std::string GetXmlString();
std::string GetXmlString(bool doSort=true);
/// ID of composite.
unsigned int id;
......
......@@ -176,6 +176,13 @@ namespace Nektar
{
e2->curveType = ed->curveType;
e2->edgeNodes = ed->edgeNodes;
// Reverse nodes if appropriate.
if (e2->n1->id != ed->n1->id)
{
reverse(e2->edgeNodes.begin(),
e2->edgeNodes.end());
}
}
}
}
......
......@@ -253,16 +253,31 @@ namespace Nektar
{
TiXmlElement* verTag = new TiXmlElement("COMPOSITE");
CompositeMap::iterator it;
ConditionMap::iterator it2;
int cnt = 0;
for (it = m->composite.begin(); it != m->composite.end(); ++it)
for (it = m->composite.begin(); it != m->composite.end(); ++it, ++cnt)
{
if (it->second->items.size() > 0)
{
TiXmlElement *comp_tag = new TiXmlElement("C"); // Composite
TiXmlElement *elm_tag;
bool doSort = true;
// Ensure that this composite is not used for periodic BCs!
for (it2 = m->condition.begin(); it2 != m->condition.end(); ++it2)
{
for (int i = 0; i < it2->second->composite.size(); ++i)
{
if (it2->second->composite[i] == cnt)
{
doSort = false;
}
}
}
comp_tag->SetAttribute("ID", it->second->id);
comp_tag->LinkEndChild( new TiXmlText(it->second->GetXmlString()) );
comp_tag->LinkEndChild( new TiXmlText(it->second->GetXmlString(doSort)) );
verTag->LinkEndChild(comp_tag);
}
else
......
Supports Markdown
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