Commit 1b0b6dc9 authored by Chris Cantwell's avatar Chris Cantwell
Browse files

Moved initialisation of Extrapolation to avoid multiple m_fields instantiations.

parent 02dab7a7
......@@ -366,7 +366,7 @@ namespace Nektar
}
doCheckTime = false;
}
// Step advance
++step;
}
......
......@@ -63,7 +63,6 @@ namespace Nektar
void CoupledLinearNS::v_InitObject()
{
UnsteadySystem::v_InitObject();
IncNavierStokes::v_InitObject();
int i;
......@@ -149,6 +148,26 @@ namespace Nektar
{
ASSERTL0(false,"Exp dimension not recognised");
}
// creation of the extrapolation object
if(m_equationType == eUnsteadyNavierStokes)
{
std::string vExtrapolation = "Standard";
if (m_session->DefinesSolverInfo("Extrapolation"))
{
vExtrapolation = m_session->GetSolverInfo("Extrapolation");
}
m_extrapolation = GetExtrapolateFactory().CreateInstance(
vExtrapolation,
m_session,
m_fields,
m_pressure,
m_velocity,
m_advObject);
}
}
/**
......
......@@ -246,25 +246,7 @@ namespace Nektar
// Set up Field Meta Data for output files
m_fieldMetaDataMap["Kinvis"] = boost::lexical_cast<std::string>(m_kinvis);
m_fieldMetaDataMap["TimeStep"] = boost::lexical_cast<std::string>(m_timestep);
// creation of the extrapolation object
if(m_equationType == eUnsteadyNavierStokes)
{
std::string vExtrapolation = "Standard";
if (m_session->DefinesSolverInfo("Extrapolation"))
{
vExtrapolation = m_session->GetSolverInfo("Extrapolation");
}
m_extrapolation = GetExtrapolateFactory().CreateInstance(
vExtrapolation,
m_session,
m_fields,
m_pressure,
m_velocity,
m_advObject);
}
}
/**
......
......@@ -63,7 +63,7 @@ namespace Nektar
{
int n;
UnsteadySystem::v_InitObject();
IncNavierStokes::v_InitObject();
// Set m_pressure to point to last field of m_fields;
if (boost::iequals(m_session->GetVariable(m_fields.num_elements()-1), "p"))
......@@ -75,8 +75,25 @@ namespace Nektar
{
ASSERTL0(false,"Need to set up pressure field definition");
}
IncNavierStokes::v_InitObject();
// creation of the extrapolation object
if(m_equationType == eUnsteadyNavierStokes)
{
std::string vExtrapolation = "Standard";
if (m_session->DefinesSolverInfo("Extrapolation"))
{
vExtrapolation = m_session->GetSolverInfo("Extrapolation");
}
m_extrapolation = GetExtrapolateFactory().CreateInstance(
vExtrapolation,
m_session,
m_fields,
m_pressure,
m_velocity,
m_advObject);
}
// Integrate only the convective fields
for (n = 0; n < m_nConvectiveFields; ++n)
......
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