46 "Eigenvalues of the weak advection operator.");
61 std::vector<std::string> vel;
83 m_session->LoadSolverInfo(
"AdvectionType", advName,
"WeakDG");
88 m_session->LoadSolverInfo(
"UpwindType", riemName,
"Upwind");
104 m_session->LoadSolverInfo(
"AdvectionType", advName,
114 ASSERTL0(
false,
"Unsupported projection type.");
146 [[maybe_unused]]
bool dumpInitialConditions)
181 cout <<
"Num Phys Points = " << npoints << endl;
182 cout <<
"Num Coeffs = " << ncoeffs << endl;
183 cout <<
"Num Cont Coeffs = " << dofs << endl;
192 for (
int j = 0; j < npoints; j++)
215 for (
int i = 0; i < nvariables; ++i)
218 m_fields[i]->FwdTrans(outarray[i], WeakAdv[i]);
220 m_fields[i]->BwdTrans(WeakAdv[i], outarray[i]);
228 Vmath::Vcopy(npoints, &(outarray[0][0]), 1, &(MATRIX[j]), npoints);
240 int info = 0, lwork = 3 * npoints;
248 Lapack::Dgeev(jobvl, jobvr, npoints, MATRIX.get(), npoints, EIG_R.get(),
249 EIG_I.get(), &dum, 1, &dum, 1, &work[0], lwork, info);
255 mFile = fopen(
"WeakAdvMatrix.txt",
"w");
256 for (
int j = 0; j < npoints; j++)
258 for (
int k = 0; k < npoints; k++)
260 fprintf(mFile,
"%e ", MATRIX[j * npoints + k]);
262 fprintf(mFile,
"\n");
270 pFile = fopen(
"Eigenvalues.txt",
"w");
271 for (
int j = 0; j < npoints; j++)
273 fprintf(pFile,
"%e %e\n", EIG_R[j], EIG_I[j]);
277 cout <<
"\nEigenvalues : " << endl;
278 for (
int j = 0; j < npoints; j++)
280 cout << EIG_R[j] <<
"\t" << EIG_I[j] << endl;
290 "Dimension of flux array and velocity array do not match");
292 int nq = physfield[0].size();
294 for (
int i = 0; i < flux.size(); ++i)
296 for (
int j = 0; j < flux[0].size(); ++j)
#define ASSERTL0(condition, msg)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
void v_InitObject(bool DeclareFields=true) override
Initialisation object for EquationSystem.
void GetFluxVector(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &flux)
SolverUtils::RiemannSolverSharedPtr m_riemannSolver
Array< OneD, NekDouble > & GetNormalVelocity()
Get the normal velocity.
void v_DoInitialise(bool dumpInitialConditions=false) override
Virtual function for initialisation implementation.
EigenValuesAdvection(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Array< OneD, Array< OneD, NekDouble > > m_velocity
SolverUtils::AdvectionSharedPtr m_advObject
Array< OneD, NekDouble > m_traceVn
void v_DoSolve() override
Virtual function for solve implementation.
static EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
static std::string className
Name of class.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
A base class for describing how to solve specific equations.
int m_spacedim
Spatial dimension (>= expansion dim).
SOLVER_UTILS_EXPORT int GetTraceNpoints()
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
virtual SOLVER_UTILS_EXPORT void v_InitObject(bool DeclareFeld=true)
Initialisation object for EquationSystem.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
Array holding trace normals for DG simulations in the forwards direction.
SOLVER_UTILS_EXPORT int GetNpoints()
SOLVER_UTILS_EXPORT int GetNcoeffs()
enum MultiRegions::ProjectionType m_projectionType
Type of projection; e.g continuous or discontinuous.
SOLVER_UTILS_EXPORT SessionFunctionSharedPtr GetFunction(std::string name, const MultiRegions::ExpListSharedPtr &field=MultiRegions::NullExpListSharedPtr, bool cache=false)
Get a SessionFunction by name.
static void Dgeev(const char &uplo, const char &lrev, const int &n, const double *a, const int &lda, double *wr, double *wi, double *rev, const int &ldr, double *lev, const int &ldv, double *work, const int &lwork, int &info)
Solve general real matrix eigenproblem.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
@ eMixed_CG_Discontinuous
AdvectionFactory & GetAdvectionFactory()
Gets the factory for initialising advection objects.
EquationSystemFactory & GetEquationSystemFactory()
RiemannSolverFactory & GetRiemannSolverFactory()
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
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.
void Neg(int n, T *x, const int incx)
Negate x = -x.
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
void Zero(int n, T *x, const int incx)
Zero vector.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)