52 EquationSystem::v_InitObject();
56 std::vector<std::string> vel;
106 cout <<
"Num Phys Points = " << npoints << endl;
107 cout <<
"Num Coeffs = " << ncoeffs << endl;
108 cout <<
"Num Cont Coeffs = " << dofs << endl;
117 for (
int j = 0; j < npoints; j++)
134 m_fields[0]->MultiplyByElmtInvMass(WeakAdv[0],WeakAdv[0]);
136 m_fields[0]->BwdTrans(WeakAdv[0],outarray[0]);
145 for(i = 0; i < nvariables; ++i)
148 m_fields[i]->FwdTrans(inarray[i],WeakAdv[i]);
150 m_fields[i]->BwdTrans_IterPerExp(WeakAdv[i],tmp[i]);
159 m_fields[i]->FwdTrans(outarray[i],WeakAdv[i]);
161 m_fields[i]->BwdTrans_IterPerExp(WeakAdv[i],outarray[i]);
169 Vmath::Vcopy(npoints,&(outarray[0][0]),1,&(MATRIX[j]),npoints);
181 int info = 0, lwork = 3*npoints;
189 Lapack::Dgeev(jobvl,jobvr,npoints,MATRIX.get(),npoints,EIG_R.get(),EIG_I.get(),&dum,1,&dum,1,&work[0],lwork,info);
195 mFile = fopen (
"WeakAdvMatrix.txt",
"w");
196 for(
int j = 0; j<npoints; j++)
198 for(
int k = 0; k<npoints; k++)
200 fprintf(mFile,
"%e ",MATRIX[j*npoints+k]);
210 pFile = fopen (
"Eigenvalues.txt",
"w");
211 for(
int j = 0; j<npoints; j++)
213 fprintf(pFile,
"%e %e\n",EIG_R[j],EIG_I[j]);
217 cout <<
"\nEigenvalues : " << endl;
218 for(
int j = 0; j<npoints; j++)
220 cout << EIG_R[j] <<
"\t" << EIG_I[j] << endl;
228 ASSERTL1(flux.num_elements() ==
m_velocity.num_elements(),
"Dimension of flux array and velocity array do not match");
230 for(
int j = 0; j < flux.num_elements(); ++j)
249 for(i = 0; i < nvel; ++i)
255 for(i = 0; i < numflux.num_elements(); ++i)
257 m_fields[i]->GetFwdBwdTracePhys(physfield[i],Fwd,Bwd);
258 m_fields[i]->GetTrace()->Upwind(Vn,Fwd,Bwd,numflux[i]);
260 Vmath::Vmul(nTraceNumPoints,numflux[i],1,Vn,1,numflux[i],1);
f SOLVER_UTILS_EXPORT void AdvectionNonConservativeForm(const Array< OneD, Array< OneD, NekDouble > > &V, const Array< OneD, const NekDouble > &u, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wk=NullNekDouble1DArray)
Compute the non-conservative advection.
A base class for describing how to solve specific equations.
virtual void v_GetFluxVector(const int i, Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &flux)
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.
static EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession)
Creates an instance of this class.
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
virtual ~EigenValuesAdvection()
static std::string className
Name of class.
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
Array holding trace normals for DG simulations in the forwards direction.
int m_spacedim
Spatial dimension (>= expansion dim).
EigenValuesAdvection(const LibUtilities::SessionReaderSharedPtr &pSession)
void Neg(int n, T *x, const int incx)
Negate x = -x.
virtual void v_DoInitialise()
Virtual function for initialisation implementation.
virtual void v_NumericalFlux(Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &numflux)
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.
EquationSystemFactory & GetEquationSystemFactory()
virtual void v_InitObject()
Initialisation object for EquationSystem.
Array< OneD, Array< OneD, NekDouble > > m_velocity
SOLVER_UTILS_EXPORT int GetNpoints()
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
SOLVER_UTILS_EXPORT int GetTraceNpoints()
SOLVER_UTILS_EXPORT int GetNcoeffs()
SOLVER_UTILS_EXPORT void WeakDGAdvection(const Array< OneD, Array< OneD, NekDouble > > &InField, Array< OneD, Array< OneD, NekDouble > > &OutField, bool NumericalFluxIncludesNormal=true, bool InFieldIsInPhysSpace=false, int nvariables=0)
Calculate the weak discontinuous Galerkin advection.
#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_DoSolve()
Virtual function for solve implementation.
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.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.