Commit 6b3e9ed1 authored by Dave Moxey's avatar Dave Moxey
Browse files

Fix periodic BC bug

parent 89aa3ea4
......@@ -2370,26 +2370,6 @@ namespace Nektar
{
m_expansionMapShPtrMap["DefaultVar"] = expansionMap;
}
// // loop over all elements and set expansion
// for(k = 0; k < fielddef.size(); ++k)
// {
// for(int h = 0; h < fielddef[k]->m_fields.size(); ++h)
// {
// if(fielddef[k]->m_fields[h] == field)
// {
// expansionMap = m_expansionMapShPtrMap.find(field)->second;
// LibUtilities::BasisKeyVector def;
// for(int g = 0; g < fielddef[k]->m_elementIDs.size(); ++g)
// {
// ExpansionShPtr tmpexp =
// MemoryManager<Expansion>::AllocateSharedPtr(geom, def);
// (*expansionMap)[fielddef[k]->m_elementIDs[g]] = tmpexp;
// }
// }
// }
// }
}
}
}
......
......@@ -442,6 +442,8 @@ void InputNek5000::Process()
// Boundary conditions: should be precisely nElements * nFaces lines to
// read.
int lineCnt = 0;
int perIn = 0, perOut = 0;
while (m_mshFile.good())
{
getline(m_mshFile, line);
......@@ -560,14 +562,18 @@ void InputNek5000::Process()
setup = true;
}
if (periodicIn.find(make_pair(perElmt, perFace)) !=
periodicIn.end())
bool hasIn = periodicIn.find(make_pair(perElmt, perFace)) !=
periodicIn.end();
if (hasIn)
{
swap(periodicInId, periodicOutId);
perOut++;
}
else
{
periodicIn.insert(make_pair(elmt, side));
perIn++;
}
std::string periodicInStr = "[" +
......@@ -604,6 +610,12 @@ void InputNek5000::Process()
m_mesh->m_condition[periodicInId] = c;
m_mesh->m_condition[periodicOutId] = c2;
}
if (hasIn)
{
swap(periodicInId, periodicOutId);
}
break;
}
......@@ -701,6 +713,11 @@ void InputNek5000::Process()
<< "from Nek5000 input file." << endl;
}
if (perIn != perOut)
{
cerr << "Warning: number of periodic faces does not match." << endl;
}
m_mshFile.reset();
// -- Process rest of mesh.
......
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