Commit c6e633b9 authored by Chris Cantwell's avatar Chris Cantwell

Added SetBaseFlow functionality to linearised advection classes in IncNavierStokes

parent d0609402
......@@ -85,5 +85,13 @@ namespace Nektar
}
}
}
void Advection::v_SetBaseFlow(
const Array<OneD, Array<OneD, NekDouble> > &inarray)
{
ASSERTL0(false,
"A baseflow is not appropriate for this advection type.");
}
}
}
......@@ -113,7 +113,25 @@ namespace Nektar
m_fluxVector = fluxVector;
}
/**
* @brief Set the base flow used for linearised advection objects.
*
* @param inarray Vector to use as baseflow
*/
inline void SetBaseFlow(const Array<OneD, Array<OneD, NekDouble> >& inarray)
{
v_SetBaseFlow(inarray);
}
protected:
/// Callback function to the flux vector (set when advection is in
/// conservative form).
AdvectionFluxVecCB m_fluxVector;
/// Riemann solver for DG-type schemes.
RiemannSolverSharedPtr m_riemann;
/// Storage for space dimension. Used for homogeneous extension.
int m_spaceDim;
virtual void v_InitObject(
LibUtilities::SessionReaderSharedPtr pSession,
Array<OneD, MultiRegions::ExpListSharedPtr> pFields);
......@@ -125,14 +143,9 @@ namespace Nektar
const Array<OneD, Array<OneD, NekDouble> > &inarray,
Array<OneD, Array<OneD, NekDouble> > &outarray,
const NekDouble &time)=0;
/// Callback function to the flux vector (set when advection is in
/// conservative form).
AdvectionFluxVecCB m_fluxVector;
/// Riemann solver for DG-type schemes.
RiemannSolverSharedPtr m_riemann;
/// Storage for space dimension. Used for homogeneous extension.
int m_spaceDim;
virtual void v_SetBaseFlow(
const Array<OneD, Array<OneD, NekDouble> > &inarray);
};
/// A shared pointer to an Advection object.
......
......@@ -25,13 +25,5 @@ namespace Nektar {
{
UnsteadySystem::v_InitObject();
}
//////////////////////////////////////////////////////////////////////////////////////////////
void AdvectionSystem::UpdateBaseFlow(const Array<OneD, Array<OneD, NekDouble> > &inarray)
{
ASSERTL0(false,"This function is not defined in parent class");
}
//////////////////////////////////////////////////////////////////////////////////////////////
}
}
......@@ -55,10 +55,7 @@ namespace Nektar {
{
return m_advObject;
}
void UpdateBaseFlow(const Array<OneD, Array<OneD, NekDouble> > &inarray);
protected:
/// Advection term
SolverUtils::AdvectionSharedPtr m_advObject;
......
......@@ -144,7 +144,7 @@ namespace Nektar
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// A->GetAdvObject()->UpdateBaseFlow(q0);
A->GetAdvObject()->SetBaseFlow(q0);
////////////////////////////////////////////////////////////////////////////////////////////////////////////
......
......@@ -478,6 +478,23 @@ namespace Nektar
}
void AdjointAdvection::v_SetBaseFlow(
const Array<OneD, Array<OneD, NekDouble> > &inarray)
{
ASSERTL1(inarray.num_elements() == m_baseflow.num_elements(),
"Number of base flow variables does not match what is"
"expected.");
int npts = inarray[0].num_elements();
for (int i = 0; i < inarray.num_elements(); ++i)
{
ASSERTL1(npts == m_baseflow.num_elements(),
"Size of base flow array does not match expected.");
Vmath::Vcopy(npts, inarray[i], 1, m_baseflow[i], 1);
}
}
/**
* Import field from infile and load into \a m_fields. This routine will
* also perform a \a BwdTrans to ensure data is in both the physical and
......
......@@ -116,6 +116,9 @@ namespace Nektar
Array<OneD, Array<OneD, NekDouble> > &outarray,
const NekDouble &time);
virtual void v_SetBaseFlow(
const Array<OneD, Array<OneD, NekDouble> > &inarray);
void UpdateBase(const NekDouble m_slices,
Array<OneD, const NekDouble> &inarray,
Array<OneD, NekDouble> &outarray,
......
......@@ -548,6 +548,23 @@ namespace Nektar
}
void LinearisedAdvection::v_SetBaseFlow(
const Array<OneD, Array<OneD, NekDouble> > &inarray)
{
ASSERTL1(inarray.num_elements() == m_baseflow.num_elements(),
"Number of base flow variables does not match what is"
"expected.");
int npts = inarray[0].num_elements();
for (int i = 0; i < inarray.num_elements(); ++i)
{
ASSERTL1(npts == m_baseflow.num_elements(),
"Size of base flow array does not match expected.");
Vmath::Vcopy(npts, inarray[i], 1, m_baseflow[i], 1);
}
}
/**
* Import field from infile and load into \a m_fields. This routine will
* also perform a \a BwdTrans to ensure data is in both the physical and
......
......@@ -124,6 +124,9 @@ namespace Nektar
Array<OneD, Array<OneD, NekDouble> > &outarray,
const NekDouble &time);
virtual void v_SetBaseFlow(
const Array<OneD, Array<OneD, NekDouble> > &inarray);
void UpdateBase(const NekDouble m_slices,
Array<OneD, const NekDouble> &inarray,
Array<OneD, NekDouble> &outarray,
......
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