44 "UnsteadyAdvectionDiffusion",
49 : UnsteadySystem(pSession),
50 AdvectionSystem(pSession)
61 AdvectionSystem::v_InitObject();
68 std::vector<std::string> vel;
97 m_session->LoadSolverInfo(
"AdvectionType", advName,
"WeakDG");
99 CreateInstance(advName, advName);
102 m_session->LoadSolverInfo(
"UpwindType", riemName,
"Upwind");
104 CreateInstance(riemName);
111 std::string diffName;
112 m_session->LoadSolverInfo(
"DiffusionType", diffName,
"LDG");
114 CreateInstance(diffName, diffName);
126 m_session->LoadSolverInfo(
"AdvectionType", advName,
129 CreateInstance(advName, advName);
136 ASSERTL0(
false,
"Explicit Galerkin diffusion not set up.");
143 ASSERTL0(
false,
"Unsupported projection type.");
182 for (i = 0; i <
m_velocity.num_elements(); ++i)
210 int nVariables = inarray.num_elements();
217 for (
int i = 0; i < nVariables; ++i)
224 inarray, outarray, time);
227 for (
int i = 0; i < nVariables; ++i)
237 for (
int i = 0; i < nVariables; ++i)
240 &outarrayDiff[i][0], 1, &outarray[i][0], 1);
260 int nvariables = inarray.num_elements();
269 for(i = 0; i < nvariables; ++i)
280 for(i = 0; i < nvariables; ++i)
282 m_fields[i]->FwdTrans(inarray[i], coeffs);
283 m_fields[i]->BwdTrans_IterPerExp(coeffs, outarray[i]);
289 ASSERTL0(
false,
"Unknown projection scheme");
309 int nvariables = inarray.num_elements();
324 for (
int n = 1; n < nvariables; ++n)
333 for (
int i = 0; i < nvariables; ++i)
337 inarray[i], 1, F[i], 1);
343 for (
int i = 0; i < nvariables; ++i)
364 "Dimension of flux array and velocity array do not match");
366 const int nq =
m_fields[0]->GetNpoints();
368 for (
int i = 0; i < flux.num_elements(); ++i)
370 for (
int j = 0; j < flux[0].num_elements(); ++j)
394 for (
int k = 0; k < flux.num_elements(); ++k)
404 AdvectionSystem::v_GenerateSummary(s);
#define ASSERTL0(condition, msg)
void GetFluxVectorAdv(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &flux)
Evaluate the flux at each solution point for the advection part.
bool m_homoInitialFwd
Flag to determine if simulation should start in homogeneous forward transformed state.
SolverUtils::AdvectionSharedPtr m_advObject
Advection term.
bool m_explicitDiffusion
Indicates if explicit or implicit treatment of diffusion is used.
void DefineImplicitSolve(FuncPointerT func, ObjectPointerT obj)
LibUtilities::TimeIntegrationSchemeOperators m_ode
The time integration scheme operators to use.
std::vector< std::pair< std::string, std::string > > SummaryList
Array< OneD, Array< OneD, NekDouble > > m_velocity
DiffusionFactory & GetDiffusionFactory()
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
enum MultiRegions::ProjectionType m_projectionType
Type of projection; e.g continuous or discontinuous.
std::map< ConstFactorType, NekDouble > ConstFactorMap
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Array< OneD, NekDouble > & GetNormalVelocity()
Get the normal velocity.
SolverUtils::RiemannSolverSharedPtr m_riemannSolver
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
Array holding trace normals for DG simulations in the forwards direction.
void DoOdeProjection(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Perform the projection.
void DefineProjection(FuncPointerT func, ObjectPointerT obj)
virtual void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Compute the RHS.
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
NekDouble m_sVVCutoffRatio
void DefineOdeRhs(FuncPointerT func, ObjectPointerT obj)
Array< OneD, NekDouble > m_traceVn
virtual void v_GenerateSummary(SolverUtils::SummaryList &s)
Print Summary.
RiemannSolverFactory & GetRiemannSolverFactory()
int m_spacedim
Spatial dimension (>= expansion dim).
virtual ~UnsteadyAdvectionDiffusion()
Destructor.
SolverUtils::DiffusionSharedPtr m_diffusion
AdvectionFactory & GetAdvectionFactory()
Gets the factory for initialising advection objects.
void Neg(int n, T *x, const int incx)
Negate x = -x.
SOLVER_UTILS_EXPORT void EvaluateFunction(Array< OneD, Array< OneD, NekDouble > > &pArray, std::string pFunctionName, const NekDouble pTime=0.0, const int domain=0)
Evaluates a function as specified in the session file.
static std::string className
Name of class.
EquationSystemFactory & GetEquationSystemFactory()
SOLVER_UTILS_EXPORT void SetBoundaryConditions(NekDouble time)
Evaluates the boundary conditions at the given time.
UnsteadyAdvectionDiffusion(const LibUtilities::SessionReaderSharedPtr &pSession)
Session reader.
virtual void DoImplicitSolve(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, NekDouble time, NekDouble lambda)
Solve implicitly the diffusion term.
SOLVER_UTILS_EXPORT int GetNpoints()
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
SOLVER_UTILS_EXPORT int GetTraceNpoints()
SOLVER_UTILS_EXPORT int GetNcoeffs()
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession)
Creates an instance of this class.
void GetFluxVectorDiff(const int i, const int j, const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &derivatives, Array< OneD, Array< OneD, NekDouble > > &flux)
Evaluate the flux at each solution point for the diffusion part.
void Zero(int n, T *x, const int incx)
Zero vector.
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
virtual void v_InitObject()
Initialise the object.
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
static FlagList NullFlagList
An empty flag list.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.