Commit 5cf44eb6 authored by Gianmarco Mengaldo's avatar Gianmarco Mengaldo
Browse files

Implementation of the new Advection Base class into ADRSolver.


git-svn-id: https://gforge.sci.utah.edu/svn/nektar/trunk@3983 305cdda6-5ce1-45b3-a98d-dfc68c8b3305
parent df55b1c2
......@@ -47,6 +47,13 @@ namespace Nektar
return Type::Instance();
}
void Advection::InitObject(
const LibUtilities::SessionReaderSharedPtr pSession,
Array<OneD, MultiRegions::ExpListSharedPtr> pFields)
{
v_InitObject(pSession, pFields);
}
void Advection::Advect(
const int nConvectiveFields,
const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
......
......@@ -57,6 +57,10 @@ namespace Nektar
class Advection
{
public:
SOLVER_UTILS_EXPORT void InitObject(
LibUtilities::SessionReaderSharedPtr pSession,
Array<OneD, MultiRegions::ExpListSharedPtr> pFields);
SOLVER_UTILS_EXPORT void Advect(
const int nConvectiveFields,
const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
......@@ -74,8 +78,15 @@ namespace Nektar
{
m_riemann = riemann;
}
protected:
virtual void v_InitObject(
LibUtilities::SessionReaderSharedPtr pSession,
Array<OneD, MultiRegions::ExpListSharedPtr> pFields)
{
};
virtual void v_Advect(
const int nConvectiveFields,
const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
......@@ -89,10 +100,10 @@ namespace Nektar
/// A shared pointer to an EquationSystem object
typedef boost::shared_ptr<Advection> AdvectionSharedPtr;
/// Datatype of the NekFactory used to instantiate classes derived
/// from the Advection class.
typedef LibUtilities::NekFactory<std::string, Advection>
AdvectionFactory;
typedef LibUtilities::NekFactory<std::string, Advection> AdvectionFactory;
SOLVER_UTILS_EXPORT AdvectionFactory& GetAdvectionFactory();
}
}
......
......@@ -63,8 +63,7 @@ namespace Nektar
Array<OneD, Array<OneD, NekDouble> > fluxvector(nVelDim);
Array<OneD, Array<OneD, NekDouble> > tmp (nConvectiveFields);
ASSERTL1(m_riemann,
"Riemann solver must be provided for AdvectionWeakDG.");
ASSERTL1(m_riemann, "Riemann solver must be provided for AdvectionWeakDG.");
for(i = 0; i < nVelDim; ++i)
{
......
......@@ -125,12 +125,15 @@ namespace Nektar
const Array<OneD, const Array<OneD, NekDouble> > &inarray,
Array<OneD, Array<OneD, NekDouble> > &outarray)
{
const Array<OneD, const Array<OneD, NekDouble> > &normals =
m_vectors["N"]();
const Array<OneD, const Array<OneD, NekDouble> > &normals = m_vectors["N"]();
const Array<OneD, NekDouble> &velLoc = m_scalars["velLoc"]();
switch(normals.num_elements())
{
case 1:
ASSERTL0(false, "1D and 3D not implemented yet.");
break;
case 2:
{
int vx = (int)velLoc[0];
......@@ -139,10 +142,8 @@ namespace Nektar
for (i = 0; i < normals[0].num_elements(); ++i)
{
double tmp1 = inarray[vx][i]*normals[0][i] +
inarray[vy][i]*normals[1][i];
double tmp2 = -inarray[vx][i]*normals[1][i] +
inarray[vy][i]*normals[0][i];
double tmp1 = inarray[vx][i]*normals[0][i] + inarray[vy][i]*normals[1][i];
double tmp2 = -inarray[vx][i]*normals[1][i] + inarray[vy][i]*normals[0][i];
outarray[vx][i] = tmp1;
outarray[vy][i] = tmp2;
}
......@@ -154,16 +155,15 @@ namespace Nektar
continue;
}
Vmath::Vcopy(inarray[i].num_elements(), inarray[i], 1,
outarray[i], 1);
Vmath::Vcopy(inarray[i].num_elements(), inarray[i], 1, outarray[i], 1);
}
break;
}
case 1:
case 3:
ASSERTL0(false, "1D and 3D not implemented yet.");
break;
default:
ASSERTL0(false, "Invalid space dimension.");
break;
......@@ -182,12 +182,15 @@ namespace Nektar
const Array<OneD, const Array<OneD, NekDouble> > &inarray,
Array<OneD, Array<OneD, NekDouble> > &outarray)
{
const Array<OneD, const Array<OneD, NekDouble> > &normals =
m_vectors["N"]();
const Array<OneD, const Array<OneD, NekDouble> > &normals = m_vectors["N"]();
const Array<OneD, NekDouble> &velLoc = m_scalars["velLoc"]();
switch(normals.num_elements())
{
case 1:
ASSERTL0(false, "1D and 3D not implemented yet.");
break;
case 2:
{
int vx = (int)velLoc[0];
......@@ -196,10 +199,8 @@ namespace Nektar
for (i = 0; i < normals[0].num_elements(); ++i)
{
double tmp1 = inarray[vx][i]*normals[0][i] -
inarray[vy][i]*normals[1][i];
double tmp2 = inarray[vx][i]*normals[1][i] +
inarray[vy][i]*normals[0][i];
double tmp1 = inarray[vx][i]*normals[0][i] - inarray[vy][i]*normals[1][i];
double tmp2 = inarray[vx][i]*normals[1][i] + inarray[vy][i]*normals[0][i];
outarray[vx][i] = tmp1;
outarray[vy][i] = tmp2;
}
......@@ -211,16 +212,15 @@ namespace Nektar
continue;
}
Vmath::Vcopy(inarray[i].num_elements(), inarray[i], 1,
outarray[i], 1);
Vmath::Vcopy(inarray[i].num_elements(), inarray[i], 1, outarray[i], 1);
}
break;
}
case 1:
case 3:
ASSERTL0(false, "1D and 3D not implemented yet.");
break;
default:
ASSERTL0(false, "Invalid space dimension.");
break;
......
......@@ -91,8 +91,7 @@ namespace Nektar
for (int j = 0; j < traceVel.num_elements(); ++j)
{
const Array<OneD, const Array<OneD, NekDouble> > &tmp =
traceVel[j] >= 0 ? Fwd : Bwd;
const Array<OneD, const Array<OneD, NekDouble> > &tmp = traceVel[j] >= 0 ? Fwd : Bwd;
for (int i = 0; i < Fwd.num_elements(); ++i)
{
flux[i][j] = traceVel[j]*tmp[i][j];
......
......@@ -159,9 +159,9 @@ int main(int argc, char* argv[])
Execute("ADRSolver","Test_UnsteadyAdvectionDiffusion_3DHomo2D_MVM.xml","3D-Homogeneous-2D unsteady advection-diffusion (MVM)");
// Test inviscid Burger equation in 1D for DG and FR
Execute("ADRSolver","Test_InviscidBurger1D_StandardDG_GLL_LAGRANGE.xml","1D unsteady StandardDG inviscidBurger GLL_LAGRANGE, P=11");
Execute("ADRSolver","Test_InviscidBurger1D_StandardDG_GLL_LAGRANGE.xml","1D unsteady WeakDG inviscidBurger GLL_LAGRANGE, P=11");
Execute("ADRSolver","Test_InviscidBurger1D_StandardDG_MODIFIED.xml","1D unsteady StandardDG inviscidBurger MODIFIED, P=11");
Execute("ADRSolver","Test_InviscidBurger1D_StandardDG_MODIFIED.xml","1D unsteady WeakDG inviscidBurger MODIFIED, P=11");
Execute("ADRSolver","Test_InviscidBurger1D_FR-DG_GLL_LAGRANGE.xml","1D unsteady FR-DG inviscidBurger GLL_LAGRANGE, P=11");
......
......@@ -63,9 +63,12 @@
</PARAMETERS>
<SOLVERINFO>
<I PROPERTY="EQTYPE" VALUE="UnsteadyAdvection"/>
<I PROPERTY="Projection" VALUE="Continuous"/>
<I PROPERTY="TimeIntegrationMethod" VALUE="AdamsBashforthOrder2"/>
<I PROPERTY="EQTYPE" VALUE="UnsteadyAdvection" />
<I PROPERTY="Projection" VALUE="Continuous" />
<I PROPERTY="AdvectionType" VALUE="NonConservative" />
<I PROPERTY="FRSchemeRecovered" VALUE="DG" />
<I PROPERTY="UpwindType" VALUE="Upwind" />
<I PROPERTY="TimeIntegrationMethod" VALUE="AdamsBashforthOrder2"/>
</SOLVERINFO>
<!--One of these for each dimension. These are the vector
......
......@@ -76,9 +76,12 @@
</PARAMETERS>
<SOLVERINFO>
<I PROPERTY="EQTYPE" VALUE="UnsteadyAdvection"/>
<I PROPERTY="Projection" VALUE="Continuous"/>
<I PROPERTY="TimeIntegrationMethod" VALUE="ClassicalRungeKutta4"/>
<I PROPERTY="EQTYPE" VALUE="UnsteadyAdvection" />
<I PROPERTY="Projection" VALUE="Continuous" />
<I PROPERTY="AdvectionType" VALUE="NonConservative" />
<I PROPERTY="FRSchemeRecovered" VALUE="DG" />
<I PROPERTY="UpwindType" VALUE="Upwind" />
<I PROPERTY="TimeIntegrationMethod" VALUE="ClassicalRungeKutta4"/>
</SOLVERINFO>
<VARIABLES>
......
......@@ -76,10 +76,12 @@
</PARAMETERS>
<SOLVERINFO>
<I PROPERTY="EQTYPE" VALUE="UnsteadyAdvection"/>
<I PROPERTY="Projection" VALUE="DisContinuous"/>
<I PROPERTY="DiscontinuousApproach" VALUE="StandardDG" />
<I PROPERTY="TimeIntegrationMethod" VALUE="ClassicalRungeKutta4"/>
<I PROPERTY="EQTYPE" VALUE="UnsteadyAdvection" />
<I PROPERTY="Projection" VALUE="DisContinuous" />
<I PROPERTY="AdvectionType" VALUE="WeakDG" />
<I PROPERTY="FRSchemeRecovered" VALUE="DG" />
<I PROPERTY="UpwindType" VALUE="Upwind" />
<I PROPERTY="TimeIntegrationMethod" VALUE="ClassicalRungeKutta4"/>
</SOLVERINFO>
<VARIABLES>
......
......@@ -49,9 +49,12 @@
</PARAMETERS>
<SOLVERINFO>
<I PROPERTY="EQTYPE" VALUE="UnsteadyAdvection" />
<I PROPERTY="Projection" VALUE="Continuous" />
<I PROPERTY="TimeIntegrationMethod" VALUE="AdamsBashforthOrder2" />
<I PROPERTY="EQTYPE" VALUE="UnsteadyAdvection" />
<I PROPERTY="Projection" VALUE="Continuous" />
<I PROPERTY="AdvectionType" VALUE="NonConservative" />
<I PROPERTY="FRSchemeRecovered" VALUE="DG" />
<I PROPERTY="UpwindType" VALUE="Upwind" />
<I PROPERTY="TimeIntegrationMethod" VALUE="AdamsBashforthOrder2"/>
</SOLVERINFO>
<VARIABLES>
......
......@@ -49,10 +49,12 @@
</PARAMETERS>
<SOLVERINFO>
<I PROPERTY="EQTYPE" VALUE="UnsteadyAdvection" />
<I PROPERTY="Projection" VALUE="DisContinuous" />
<I PROPERTY="DiscontinuousApproach" VALUE="StandardDG" />
<I PROPERTY="TimeIntegrationMethod" VALUE="AdamsBashforthOrder2" />
<I PROPERTY="EQTYPE" VALUE="UnsteadyAdvection" />
<I PROPERTY="Projection" VALUE="DisContinuous" />
<I PROPERTY="AdvectionType" VALUE="WeakDG" />
<I PROPERTY="FRSchemeRecovered" VALUE="DG" />
<I PROPERTY="UpwindType" VALUE="Upwind" />
<I PROPERTY="TimeIntegrationMethod" VALUE="AdamsBashforthOrder2"/>
</SOLVERINFO>
<VARIABLES>
......
......@@ -49,9 +49,12 @@
</PARAMETERS>
<SOLVERINFO>
<I PROPERTY="EQTYPE" VALUE="UnsteadyAdvection" />
<I PROPERTY="Projection" VALUE="Continuous" />
<I PROPERTY="TimeIntegrationMethod" VALUE="ClassicalRungeKutta4" />
<I PROPERTY="EQTYPE" VALUE="UnsteadyAdvection" />
<I PROPERTY="Projection" VALUE="Continuous" />
<I PROPERTY="AdvectionType" VALUE="NonConservative" />
<I PROPERTY="FRSchemeRecovered" VALUE="DG" />
<I PROPERTY="UpwindType" VALUE="Upwind" />
<I PROPERTY="TimeIntegrationMethod" VALUE="ClassicalRungeKutta4"/>
</SOLVERINFO>
<VARIABLES>
......
......@@ -50,10 +50,12 @@
</PARAMETERS>
<SOLVERINFO>
<I PROPERTY="EQTYPE" VALUE="UnsteadyAdvection" />
<I PROPERTY="Projection" VALUE="DisContinuous" />
<I PROPERTY="DiscontinuousApproach" VALUE="StandardDG" />
<I PROPERTY="TimeIntegrationMethod" VALUE="AdamsBashforthOrder2" />
<I PROPERTY="EQTYPE" VALUE="UnsteadyAdvection" />
<I PROPERTY="Projection" VALUE="DisContinuous" />
<I PROPERTY="AdvectionType" VALUE="WeakDG" />
<I PROPERTY="FRSchemeRecovered" VALUE="DG" />
<I PROPERTY="UpwindType" VALUE="Upwind" />
<I PROPERTY="TimeIntegrationMethod" VALUE="AdamsBashforthOrder2"/>
</SOLVERINFO>
<VARIABLES>
......
......@@ -49,9 +49,12 @@
</PARAMETERS>
<SOLVERINFO>
<I PROPERTY="EQTYPE" VALUE="UnsteadyAdvection" />
<I PROPERTY="Projection" VALUE="Continuous" />
<I PROPERTY="TimeIntegrationMethod" VALUE="ForwardEuler" />
<I PROPERTY="EQTYPE" VALUE="UnsteadyAdvection" />
<I PROPERTY="Projection" VALUE="Continuous" />
<I PROPERTY="AdvectionType" VALUE="NonConservative" />
<I PROPERTY="FRSchemeRecovered" VALUE="DG" />
<I PROPERTY="UpwindType" VALUE="Upwind" />
<I PROPERTY="TimeIntegrationMethod" VALUE="ForwardEuler" />
</SOLVERINFO>
<VARIABLES>
......
......@@ -140,10 +140,12 @@
</PARAMETERS>
<SOLVERINFO>
<I PROPERTY="EQTYPE" VALUE="UnsteadyAdvection" />
<I PROPERTY="Projection" VALUE="DisContinuous" />
<I PROPERTY="DiscontinuousApproach" VALUE="StandardDG" />
<I PROPERTY="TimeIntegrationMethod" VALUE="ClassicalRungeKutta4" />
<I PROPERTY="EQTYPE" VALUE="UnsteadyAdvection" />
<I PROPERTY="Projection" VALUE="DisContinuous" />
<I PROPERTY="AdvectionType" VALUE="WeakDG" />
<I PROPERTY="FRSchemeRecovered" VALUE="DG" />
<I PROPERTY="UpwindType" VALUE="Upwind" />
<I PROPERTY="TimeIntegrationMethod" VALUE="ClassicalRungeKutta4"/>
</SOLVERINFO>
<VARIABLES>
......
......@@ -504,11 +504,13 @@
</PARAMETERS>
<SOLVERINFO>
<I PROPERTY="EQTYPE" VALUE="UnsteadyAdvection" />
<I PROPERTY="Projection" VALUE="DisContinuous" />
<I PROPERTY="DiscontinuousApproach" VALUE="StandardDG" />
<I PROPERTY="TimeIntegrationMethod" VALUE="ClassicalRungeKutta4" />
<I PROPERTY="GlobalSysSoln" VALUE="IterativeFull" />
<I PROPERTY="EQTYPE" VALUE="UnsteadyAdvection" />
<I PROPERTY="Projection" VALUE="DisContinuous" />
<I PROPERTY="AdvectionType" VALUE="WeakDG" />
<I PROPERTY="FRSchemeRecovered" VALUE="DG" />
<I PROPERTY="UpwindType" VALUE="Upwind" />
<I PROPERTY="TimeIntegrationMethod" VALUE="ClassicalRungeKutta4"/>
<I PROPERTY="GlobalSysSoln" VALUE="IterativeFull" />
</SOLVERINFO>
<VARIABLES>
......
......@@ -328,10 +328,12 @@
</PARAMETERS>
<SOLVERINFO>
<I PROPERTY="EQTYPE" VALUE="UnsteadyAdvection" />
<I PROPERTY="Projection" VALUE="DisContinuous" />
<I PROPERTY="DiscontinuousApproach" VALUE="StandardDG" />
<I PROPERTY="TimeIntegrationMethod" VALUE="ClassicalRungeKutta4" />
<I PROPERTY="EQTYPE" VALUE="UnsteadyAdvection" />
<I PROPERTY="Projection" VALUE="DisContinuous" />
<I PROPERTY="AdvectionType" VALUE="WeakDG" />
<I PROPERTY="FRSchemeRecovered" VALUE="DG" />
<I PROPERTY="UpwindType" VALUE="Upwind" />
<I PROPERTY="TimeIntegrationMethod" VALUE="ClassicalRungeKutta4"/>
</SOLVERINFO>
<VARIABLES>
......
......@@ -72,11 +72,12 @@
</PARAMETERS>
<SOLVERINFO>
<I PROPERTY="EQTYPE" VALUE="UnsteadyAdvection" />
<I PROPERTY="Projection" VALUE="DisContinuous" />
<I PROPERTY="DiscontinuousApproach" VALUE="StandardDG" />
<I PROPERTY="TimeIntegrationMethod" VALUE="ForwardEuler" />
<I PROPERTY="EQTYPE" VALUE="UnsteadyAdvection" />
<I PROPERTY="Projection" VALUE="DisContinuous" />
<I PROPERTY="AdvectionType" VALUE="WeakDG" />
<I PROPERTY="FRSchemeRecovered" VALUE="DG" />
<I PROPERTY="UpwindType" VALUE="Upwind" />
<I PROPERTY="TimeIntegrationMethod" VALUE="ForwardEuler" />
</SOLVERINFO>
<VARIABLES>
......
......@@ -72,10 +72,12 @@
</PARAMETERS>
<SOLVERINFO>
<I PROPERTY="EQTYPE" VALUE="UnsteadyAdvection" />
<I PROPERTY="Projection" VALUE="DisContinuous" />
<I PROPERTY="DiscontinuousApproach" VALUE="StandardDG" />
<I PROPERTY="TimeIntegrationMethod" VALUE="AdamsBashforthOrder2" />
<I PROPERTY="EQTYPE" VALUE="UnsteadyAdvection" />
<I PROPERTY="Projection" VALUE="DisContinuous" />
<I PROPERTY="AdvectionType" VALUE="WeakDG" />
<I PROPERTY="FRSchemeRecovered" VALUE="DG" />
<I PROPERTY="UpwindType" VALUE="Upwind" />
<I PROPERTY="TimeIntegrationMethod" VALUE="AdamsBashforthOrder2"/>
</SOLVERINFO>
<VARIABLES>
......
......@@ -72,10 +72,12 @@
</PARAMETERS>
<SOLVERINFO>
<I PROPERTY="EQTYPE" VALUE="UnsteadyAdvection" />
<I PROPERTY="Projection" VALUE="DisContinuous" />
<I PROPERTY="DiscontinuousApproach" VALUE="StandardDG" />
<I PROPERTY="TimeIntegrationMethod" VALUE="ClassicalRungeKutta4" />
<I PROPERTY="EQTYPE" VALUE="UnsteadyAdvection" />
<I PROPERTY="Projection" VALUE="DisContinuous" />
<I PROPERTY="AdvectionType" VALUE="WeakDG" />
<I PROPERTY="FRSchemeRecovered" VALUE="DG" />
<I PROPERTY="UpwindType" VALUE="Upwind" />
<I PROPERTY="TimeIntegrationMethod" VALUE="ClassicalRungeKutta4"/>
</SOLVERINFO>
<VARIABLES>
......
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