Commit 8f6cd3e9 authored by Spencer Sherwin's avatar Spencer Sherwin

First executing version of InterpField - working for 2D test case

parent b11b5427
......@@ -362,7 +362,8 @@ namespace Nektar
return exp;
};
MultiRegions::ExpListSharedPtr AppendExpList(string var = "DefaultVar",
MultiRegions::ExpListSharedPtr AppendExpList(int NumHomogeneousDir,
string var = "DefaultVar",
bool NewField = false)
{
MultiRegions::ExpListSharedPtr tmp;
......@@ -370,7 +371,7 @@ namespace Nektar
{
case 1:
{
if (m_fielddef[0]->m_numHomogeneousDir == 1)
if (NumHomogeneousDir == 1)
{
if(m_declareExpansionAsContField||
m_declareExpansionAsDisContField)
......@@ -387,7 +388,7 @@ namespace Nektar
AllocateSharedPtr(*tmp2);
}
else if (m_fielddef[0]->m_numHomogeneousDir == 2)
else if (NumHomogeneousDir == 2)
{
if(m_declareExpansionAsContField)
{
......@@ -457,7 +458,7 @@ namespace Nektar
break;
case 2:
{
if (m_fielddef[0]->m_numHomogeneousDir == 1)
if (NumHomogeneousDir == 1)
{
if(m_declareExpansionAsContField)
{
......
......@@ -180,17 +180,18 @@ namespace Nektar
{
if(i < vars.size())
{
m_f->m_exp[i] = m_f->AppendExpList(vars[i]);
m_f->m_exp[i] = m_f->AppendExpList(m_f->m_fielddef[0]->m_numHomogeneousDir,
vars[i]);
}
else
{
if(vars.size())
{
m_f->m_exp[i] = m_f->AppendExpList(vars[0]);
m_f->m_exp[i] = m_f->AppendExpList(m_f->m_fielddef[0]->m_numHomogeneousDir,vars[0]);
}
else
{
m_f->m_exp[i] = m_f->AppendExpList();
m_f->m_exp[i] = m_f->AppendExpList(m_f->m_fielddef[0]->m_numHomogeneousDir);
}
}
}
......
......@@ -66,7 +66,8 @@ namespace Nektar
// generate an C0 expansion field with no boundary conditions.
bool savedef = m_f->m_declareExpansionAsContField;
m_f->m_declareExpansionAsContField = true;
m_c0ProjectExp = m_f->AppendExpList("DefaultVar",true);
m_c0ProjectExp = m_f->AppendExpList(m_f->m_fielddef[0]->m_numHomogeneousDir,
"DefaultVar",true);
m_f->m_declareExpansionAsContField = savedef;
if (m_f->m_verbose)
......
......@@ -153,13 +153,13 @@ namespace Nektar
ElementGIDs[i++] = expIt->second->m_geomShPtr->GetGlobalID();
}
m_fromField->m_fld->Import(m_config["fromfld"].as<string>(),
m_fromField->m_fielddef,
m_fromField->m_data,
LibUtilities::NullFieldMetaDataMap,
ElementGIDs);
string fromfld = m_config["fromfld"].as<string>();
m_f->m_fld->Import(fromfld,m_fromField->m_fielddef,
m_fromField->m_data,
LibUtilities::NullFieldMetaDataMap,
ElementGIDs);
int NumHomogeneousDir = m_f->m_fielddef[0]->m_numHomogeneousDir;
int NumHomogeneousDir = m_fromField->m_fielddef[0]->m_numHomogeneousDir;
//----------------------------------------------
// Set up Expansion information to use mode order from field
......@@ -168,28 +168,30 @@ namespace Nektar
int nfields = m_fromField->m_fielddef[0]->m_fields.size();
m_fromField->m_exp.resize(nfields);
m_fromField->m_exp[0] = m_f->SetUpFirstExpList(NumHomogeneousDir,true);
m_fromField->m_exp[0] = m_fromField->SetUpFirstExpList(NumHomogeneousDir,true);
m_f->m_exp.resize(nfields);
// declare auxiliary fields.
for(i = 1; i < nfields; ++i)
{
m_f->m_exp[i] = m_f->AppendExpList();
m_fromField->m_exp[i] = m_fromField->AppendExpList();
m_f->m_exp[i] = m_f->AppendExpList(NumHomogeneousDir);
m_fromField->m_exp[i] = m_fromField->AppendExpList(NumHomogeneousDir);
}
// load field into expansion in fromfield.
for(int j = 0; j < nfields; ++j)
{
for (i = 0; i < m_f->m_fielddef.size(); i++)
for (i = 0; i < m_fromField->m_fielddef.size(); i++)
{
m_fromField->m_exp[j]->ExtractDataToCoeffs(m_fromField->m_fielddef[i],
m_fromField->m_data[i],
m_fromField->m_fielddef[0]->m_fields[j],
m_fromField->m_exp[j]->UpdateCoeffs());
}
m_fromField->m_exp[j]->BwdTrans(m_fromField->m_exp[j]->GetCoeffs(),m_fromField->m_exp[j]->UpdatePhys());
}
int nq1 = m_f->m_exp[0]->GetTotPoints();
......
......@@ -236,7 +236,7 @@ namespace Nektar
for (i = 0; i < addfields; ++i)
{
m_f->m_exp[nfields + i] = m_f->AppendExpList();
m_f->m_exp[nfields + i] = m_f->AppendExpList(m_f->m_fielddef[0]->m_numHomogeneousDir);
m_f->m_exp[nfields + i]->UpdatePhys() = outfield[i];
m_f->m_exp[nfields + i]->FwdTrans(outfield[i],
m_f->m_exp[nfields + i]->UpdateCoeffs());
......
......@@ -136,7 +136,7 @@ namespace Nektar
for (i = 0; i < addfields; ++i)
{
m_f->m_exp[nfields + i] = m_f->AppendExpList();
m_f->m_exp[nfields + i] = m_f->AppendExpList(m_f->m_fielddef[0]->m_numHomogeneousDir);
m_f->m_exp[nfields + i]->UpdatePhys() = outfield[i];
m_f->m_exp[nfields + i]->FwdTrans(outfield[i],
m_f->m_exp[nfields + i]->UpdateCoeffs());
......
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