56 std::vector<std::string> vel;
81 Array<OneD, Array<OneD, NekDouble> > inarray(nvariables);
82 Array<OneD, Array<OneD, NekDouble> > tmp(nvariables);
83 Array<OneD, Array<OneD, NekDouble> > outarray(nvariables);
84 Array<OneD, Array<OneD, NekDouble> > WeakAdv(nvariables);
106 cout <<
"Num Phys Points = " << npoints << endl;
107 cout <<
"Num Coeffs = " << ncoeffs << endl;
108 cout <<
"Num Cont Coeffs = " << dofs << endl;
110 inarray[0] = Array<OneD, NekDouble>(npoints,0.0);
111 outarray[0] = Array<OneD, NekDouble>(npoints,0.0);
112 tmp[0] = Array<OneD, NekDouble>(npoints,0.0);
114 WeakAdv[0] = Array<OneD, NekDouble>(ncoeffs,0.0);
115 Array<OneD, NekDouble> MATRIX(npoints*npoints,0.0);
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;
184 Array<OneD, NekDouble> EIG_R(npoints);
185 Array<OneD, NekDouble> EIG_I(npoints);
187 Array<OneD, NekDouble> work(lwork);
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;
226 Array<
OneD, Array<OneD, NekDouble> > &flux)
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)
244 Array<OneD, NekDouble > Fwd(nTraceNumPoints);
245 Array<OneD, NekDouble > Bwd(nTraceNumPoints);
246 Array<OneD, NekDouble > Vn (nTraceNumPoints,0.0);
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);