45 EigenValuesAdvection::EigenValuesAdvection(
58 std::vector<std::string> vel;
81 "AdvectionType", advName,
"WeakDG");
87 "UpwindType", riemName,
"Upwind");
104 "AdvectionType", advName,
"NonConservative");
113 ASSERTL0(
false,
"Unsupported projection type.");
188 cout <<
"Num Phys Points = " << npoints << endl;
189 cout <<
"Num Coeffs = " << ncoeffs << endl;
190 cout <<
"Num Cont Coeffs = " << dofs << endl;
199 for (
int j = 0; j < npoints; j++)
221 for(
int i = 0; i < nvariables; ++i)
225 m_fields[i]->FwdTrans(outarray[i],WeakAdv[i]);
227 m_fields[i]->BwdTrans_IterPerExp(WeakAdv[i],outarray[i]);
235 Vmath::Vcopy(npoints,&(outarray[0][0]),1,&(MATRIX[j]),npoints);
247 int info = 0, lwork = 3*npoints;
255 Lapack::Dgeev(jobvl,jobvr,npoints,MATRIX.get(),npoints,EIG_R.get(),EIG_I.get(),&dum,1,&dum,1,&work[0],lwork,info);
261 mFile = fopen (
"WeakAdvMatrix.txt",
"w");
262 for(
int j = 0; j<npoints; j++)
264 for(
int k = 0; k<npoints; k++)
266 fprintf(mFile,
"%e ",MATRIX[j*npoints+k]);
276 pFile = fopen (
"Eigenvalues.txt",
"w");
277 for(
int j = 0; j<npoints; j++)
279 fprintf(pFile,
"%e %e\n",EIG_R[j],EIG_I[j]);
283 cout <<
"\nEigenvalues : " << endl;
284 for(
int j = 0; j<npoints; j++)
286 cout << EIG_R[j] <<
"\t" << EIG_I[j] << endl;
296 "Dimension of flux array and velocity array do not match");
298 int nq = physfield[0].size();
300 for (
int i = 0; i < flux.size(); ++i)
302 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()
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
virtual void v_DoSolve()
Virtual function for solve implementation.
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 ~EigenValuesAdvection()
virtual void v_DoInitialise()
Virtual function for initialisation implementation.
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.
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.
virtual SOLVER_UTILS_EXPORT void v_InitObject()
Initialisation object for EquationSystem.
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)