Commit 000bdb55 authored by David Moxey's avatar David Moxey Committed by Spencer Sherwin
Browse files

Fix input issue with basis, add explists to m_exp to allow us to combine...

Fix input issue with basis, add explists to m_exp to allow us to combine Semtex input with a Nektar++ input file
parent 41c827b2
......@@ -276,6 +276,32 @@ void InputSemtex::Process(po::variables_map &vm)
}
m_f->m_fielddef.push_back(fielddef);
// If we have defined expansion lists, then create additional expansion
// lists.
if (m_f->m_exp.size())
{
int nfields = m_f->m_fielddef[0]->m_fields.size();
m_f->m_exp.resize(nfields);
for (string::size_type i = 0; i < fields.size(); ++i)
{
if (!m_f->m_exp[i])
{
m_f->m_exp[i] = m_f->AppendExpList(
m_f->m_fielddef[0]->m_numHomogeneousDir);
}
m_f->m_exp[i]->ExtractDataToCoeffs(
m_f->m_fielddef[0],
m_f->m_data[0],
m_f->m_fielddef[0]->m_fields[i],
m_f->m_exp[i]->UpdateCoeffs());
m_f->m_exp[i]->BwdTrans(
m_f->m_exp[i]->GetCoeffs(), m_f->m_exp[i]->UpdatePhys());
}
}
}
}
......
......@@ -167,7 +167,7 @@ string InputModule::GuessFormat(string filename)
vector<char> data(64, 0);
inFile.read(&data[0], 64);
string check1(&data[0], 64);
string check(&data[0], 64);
// Nek5000 format: first four characters are: #std
if (data[0] == '#' && data[1] == 's' && data[2] == 't' && data[3] == 'd')
......
......@@ -2305,8 +2305,8 @@ namespace Nektar
modes_offset = 0;
}
datalen = LibUtilities::GetNumberOfCoefficients(fielddef->m_shapeType,
fielddef->m_numModes, modes_offset);
datalen = LibUtilities::GetNumberOfCoefficients(
fielddef->m_shapeType, fielddef->m_numModes, modes_offset);
const int elmtId = fielddef->m_elementIDs[i];
eIt = m_elmtToExpId.find(elmtId);
......
......@@ -1038,7 +1038,15 @@ namespace Nektar
}
int eid = it->second;
bool sameBasis = true;
for (int j = 0; j < fielddef->m_basis.size()-1; ++j)
{
if (fielddef->m_basis[j] != (*m_exp)[eid]->GetBasisType(j))
{
sameBasis = false;
break;
}
}
for(n = 0; n < nzmodes; ++n, offset += datalen)
{
......@@ -1052,7 +1060,7 @@ namespace Nektar
}
planes_offset = it->second;
if(datalen == (*m_exp)[eid]->GetNcoeffs())
if(datalen == (*m_exp)[eid]->GetNcoeffs() && sameBasis)
{
Vmath::Vcopy(datalen,&fielddata[offset],1,&coeffs[m_coeff_offset[eid]+planes_offset*ncoeffs_per_plane],1);
}
......
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