MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
dgcartesiansyseqn.h
Go to the documentation of this file.
1// Copyright (C) 2024 The m-AIA AUTHORS
2//
3// This file is part of m-AIA (https://git.rwth-aachen.de/aia/m-AIA/m-AIA)
4//
5// SPDX-License-Identifier: LGPL-3.0-only
6
7#ifndef DGSYSEQN_H_
8#define DGSYSEQN_H_
9
10#include <vector>
11#include "INCLUDE/maiatypes.h"
12#include "IO/context.h"
13#include "UTIL/debug.h"
14#include "UTIL/functions.h"
15#include "property.h"
16
17
27template <MInt nDim, class SysEqn>
28class DgSysEqn {
29 // CRTP
30 private:
31 SysEqn& derived() { return static_cast<SysEqn&>(*this); }
32 const SysEqn& derived() const { return static_cast<const SysEqn&>(*this); }
34
35 // Methods
36 public:
37 static constexpr MInt noVars() { return SysEqn::s_noVariables; }
38 static constexpr MInt noNodeVars() { return SysEqn::s_noNodeVars; }
39 static constexpr MBool hasTimeDependentNodeVars() { return SysEqn::s_hasTimeDependentNodeVars; }
40 static const MString& sysEqnName() { return SysEqn::s_sysEqnName; }
41 static const MString& consVarNames(MInt i) { return SysEqn::s_consVarNames[i]; }
42 static const MString& primVarNames(MInt i) { return SysEqn::s_primVarNames[i]; }
43 static const MString& nodeVarNames(MInt i) { return SysEqn::s_nodeVarNames[i]; }
44 MFloat cfl() const { return m_cfl; }
45
46 MFloat cflScaled(const MInt polyDeg) const {
47 // cf. Cockburn and Shu, Runge-Kutta Discontinuous Galerkin Methods for
48 // Convection-Dominated Problems, J. Sci. Comp. 16(3), 2001.
49 return cfl() / (2.0 * polyDeg + 1.0);
50 }
51
52 protected:
53 explicit DgSysEqn(MInt solverId);
54
55
56 // Member variables
57 public:
62
63
64 protected:
66};
67
68
69template <MInt nDim, class SysEqn>
70DgSysEqn<nDim, SysEqn>::DgSysEqn(MInt solverId) : m_solverId(solverId) {
71 TRACE();
72
73 // Read and set initial condition
74 m_initialCondition = Context::getSolverProperty<MInt>("initialCondition", m_solverId, AT_);
75
76 // Read and set initial number of waves in the domain
79 Context::getSolverProperty<MFloat>("initialNumberWaves", m_solverId, AT_, &m_initialNumberWaves);
80
81 // Read and set source term
97 m_sourceTerm = 0;
98 m_sourceTerm = Context::getSolverProperty<MInt>("sourceTerm", m_solverId, AT_, &m_sourceTerm);
99
100 // Read and set Riemann solver term
118 m_riemannSolver = 0;
119 m_riemannSolver = Context::getSolverProperty<MInt>("riemannSolver", m_solverId, AT_, &m_riemannSolver);
120
121
122 // Read and set CFL number for the time step calculation
123 m_cfl = Context::getSolverProperty<MFloat>("cfl", m_solverId, AT_);
124}
125
126#endif // DGSYSEQN_H_
Base class for concrete system-of-equations classes (CRTP).
const MInt m_solverId
SysEqn & derived()
DgSysEqn(MInt solverId)
MFloat cflScaled(const MInt polyDeg) const
static const MString & nodeVarNames(MInt i)
static constexpr MInt noVars()
static const MString & sysEqnName()
MInt m_initialCondition
static const MString & primVarNames(MInt i)
const SysEqn & derived() const
MFloat m_initialNumberWaves
static const MString & consVarNames(MInt i)
MInt m_riemannSolver
static constexpr MBool hasTimeDependentNodeVars()
MFloat cfl() const
static constexpr MInt noNodeVars()
int32_t MInt
Definition: maiatypes.h:62
std::basic_string< char > MString
Definition: maiatypes.h:55
double MFloat
Definition: maiatypes.h:52
bool MBool
Definition: maiatypes.h:58