43 string EigenValuesAdvection::className =
45 "EigenValuesAdvection", EigenValuesAdvection::create,
46 "Eigenvalues of the weak advection operator.");
48 EigenValuesAdvection::EigenValuesAdvection(
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.");
184 cout <<
"Num Phys Points = " << npoints << endl;
185 cout <<
"Num Coeffs = " << ncoeffs << endl;
186 cout <<
"Num Cont Coeffs = " << dofs << endl;
195 for (
int j = 0; j < npoints; j++)
218 for (
int i = 0; i < nvariables; ++i)
222 m_fields[i]->FwdTrans(outarray[i], WeakAdv[i]);
224 m_fields[i]->BwdTrans(WeakAdv[i], outarray[i]);
232 Vmath::Vcopy(npoints, &(outarray[0][0]), 1, &(MATRIX[j]), npoints);
244 int info = 0, lwork = 3 * npoints;
252 Lapack::Dgeev(jobvl, jobvr, npoints, MATRIX.get(), npoints, EIG_R.get(),
253 EIG_I.get(), &dum, 1, &dum, 1, &work[0], lwork, info);
259 mFile = fopen(
"WeakAdvMatrix.txt",
"w");
260 for (
int j = 0; j < npoints; j++)
262 for (
int k = 0; k < npoints; k++)
264 fprintf(mFile,
"%e ", MATRIX[j * npoints + k]);
266 fprintf(mFile,
"\n");
274 pFile = fopen(
"Eigenvalues.txt",
"w");
275 for (
int j = 0; j < npoints; j++)
277 fprintf(pFile,
"%e %e\n", EIG_R[j], EIG_I[j]);
281 cout <<
"\nEigenvalues : " << endl;
282 for (
int j = 0; j < npoints; j++)
284 cout << EIG_R[j] <<
"\t" << EIG_I[j] << endl;
294 "Dimension of flux array and velocity array do not match");
296 int nq = physfield[0].size();
298 for (
int i = 0; i < flux.size(); ++i)
300 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....
virtual void v_InitObject(bool DeclareFields=true) override
Initialisation object for EquationSystem.
virtual void v_DoInitialise() override
Virtual function for initialisation implementation.
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.
Array< OneD, Array< OneD, NekDouble > > m_velocity
SolverUtils::AdvectionSharedPtr m_advObject
Array< OneD, NekDouble > m_traceVn
virtual void v_DoSolve() override
Virtual function for solve implementation.
virtual ~EigenValuesAdvection()
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
The above copyright notice and this permission notice shall be included.
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)