45 "Acoustic perturbation equations in conservative variables.");
99 m_vecLocs = Array<OneD, Array<OneD, NekDouble> >(1);
104 m_vecLocs[0][i] = 1 + i;
108 m_session->LoadSolverInfo(
"UpwindType", riemName,
"APEUpwind");
109 riemName =
"APEUpwind";
125 ASSERTL0(
false,
"Implicit APE not set up.");
153 Array<
OneD, Array<OneD, NekDouble> > &physfield,
154 Array<
OneD, Array<OneD, NekDouble> > &numflux)
158 int nvar = physfield.num_elements();
161 Array<OneD, Array<OneD, NekDouble> > Fwd(nvar);
162 Array<OneD, Array<OneD, NekDouble> > Bwd(nvar);
164 for (
int i = 0; i < nvar; ++i)
166 Fwd[i] = Array<OneD, NekDouble>(ntp);
167 Bwd[i] = Array<OneD, NekDouble>(ntp);
171 for (
int i = 0; i < nvar; ++i)
173 m_fields[i]->GetFwdBwdTracePhys(physfield[i],Fwd[i],Bwd[i]);
186 Array<
OneD, Array<OneD, NekDouble> > &physfield,
187 Array<
OneD, Array<OneD, NekDouble> > &numfluxX,
188 Array<
OneD, Array<OneD, NekDouble> > &numfluxY )
190 ASSERTL0(
false,
"This function is not implemented for this equation.");
198 Array<
OneD, Array<OneD, NekDouble> > &physfield,
199 Array<
OneD, Array<OneD, NekDouble> > &flux)
209 Array<
OneD, Array<OneD, NekDouble> > &physfield,
210 Array<
OneD, Array<OneD, NekDouble> > &flux)
215 "Dimension of flux array and velocity array do not match");
217 int nq = physfield[0].num_elements();
219 Array<OneD, NekDouble> tmp1(nq);
220 Array<OneD, NekDouble> tmp2(nq);
225 for (
int j = 0; j < flux.num_elements(); ++j)
231 Vmath::Vmul(nq, tmp1, 1, physfield[j+1], 1, tmp1, 1);
243 for (
int j = 0; j < flux.num_elements(); ++j)
251 Vmath::Smul(nq, tmp0, physfield[0], 1, flux[j], 1);
255 for (
int k = 0; k < flux.num_elements(); ++k)
274 Array<
OneD, Array<OneD, NekDouble> >&outarray,
279 int nvariables = inarray.num_elements();
290 Array<OneD, Array<OneD, NekDouble> > modarray(nvariables);
292 for (i = 0; i < nvariables; ++i)
294 modarray[i] = Array<OneD, NekDouble>(ncoeffs);
305 for(i = 0; i < nvariables; ++i)
315 for(i = 0; i < nvariables; ++i)
317 m_fields[i]->MultiplyByElmtInvMass(modarray[i],modarray[i]);
318 m_fields[i]->BwdTrans(modarray[i],outarray[i]);
326 Array<OneD, Array<OneD, NekDouble> > physarray(nvariables);
327 Array<OneD, Array<OneD, NekDouble> > modarray(nvariables);
329 for (i = 0; i < nvariables; ++i)
331 physarray[i] = Array<OneD, NekDouble>(nq);
332 modarray[i] = Array<OneD, NekDouble>(ncoeffs);
336 for(i = 0; i < nvariables; ++i)
341 Array<OneD, Array<OneD, NekDouble> > fluxvector(ndim);
342 for(i = 0; i < ndim; ++i)
344 fluxvector[i] = Array<OneD, NekDouble>(nq);
347 Array<OneD,NekDouble> tmp(nq);
348 Array<OneD, NekDouble>tmp1(nq);
350 for(i = 0; i < nvariables; ++i)
356 for (
int j = 0; j < ndim; ++j)
359 m_fields[0]->PhysDeriv(j,fluxvector[j],tmp1);
360 Vmath::Vadd(nq, outarray[i], 1, tmp1, 1, outarray[i], 1);
373 ASSERTL0(
false,
"Unknown projection scheme for the APE");
384 Array<
OneD, Array<OneD, NekDouble> >&outarray,
388 int nvariables = inarray.num_elements();
392 for(
int i = 0; i < nvariables; ++i)
411 for(i = 0; i < nvariables; ++i)
413 m_fields[i]->FwdTrans(outarray[i],coeffs);
414 m_fields[i]->BwdTrans_IterPerExp(coeffs,outarray[i]);
420 ASSERTL0(
false,
"Unknown projection scheme");
433 int nvariables =
m_fields.num_elements();
437 for(
int n = 0; n <
m_fields[0]->GetBndConditions().num_elements(); ++n)
448 for (
int i = 0; i < nvariables; ++i)
451 m_fields[i]->EvaluateBoundaryConditions(time, varName);
454 cnt +=
m_fields[0]->GetBndCondExpansions()[n]->GetExpSize();
463 Array<
OneD, Array<OneD, NekDouble> > &physarray)
466 int nVariables = physarray.num_elements();
468 const Array<OneD, const int> &traceBndMap =
m_fields[0]->GetTraceBndMap();
471 Array<OneD, Array<OneD, NekDouble> > Fwd(nVariables);
472 for (
int i = 0; i < nVariables; ++i)
474 Fwd[i] = Array<OneD, NekDouble>(nTracePts);
475 m_fields[i]->ExtractTracePhys(physarray[i], Fwd[i]);
480 int id1, id2, nBCEdgePts;
481 int eMax =
m_fields[0]->GetBndCondExpansions()[bcRegion]->GetExpSize();
483 for (
int e = 0; e < eMax; ++e)
485 nBCEdgePts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
486 GetExp(e)->GetTotPoints();
487 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->GetPhys_Offset(e);
488 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
491 Array<OneD, NekDouble> tmp(nBCEdgePts, 0.0);
504 Vmath::Smul(nBCEdgePts, -2.0, &tmp[0], 1, &tmp[0], 1);
517 for (
int i = 0; i < nVariables; ++i)
521 &(
m_fields[i]->GetBndCondExpansions()[bcRegion]->UpdatePhys())[id1], 1);
531 Array<
OneD, Array< OneD, NekDouble > > &outarray)
533 int ncoeffs = outarray[0].num_elements();
534 int nq = inarray[0].num_elements();
535 Array<OneD, NekDouble> source(nq);
540 m_fields[0]->IProductWRTBase(source,source);
542 Vmath::Vadd(ncoeffs,source,1,outarray[0],1,outarray[0],1);