Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
NonlinearPeregrine.cpp
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File NonlinearPeregrine.cpp
4 //
5 // For more information, please see: http://www.nektar.info
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10 // Department of Aeronautics, Imperial College London (UK), and Scientific
11 // Computing and Imaging Institute, University of Utah (USA).
12 //
13 // License for the specific language governing rights and limitations under
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 //
32 // Description: Nonlinear Boussinesq equations of Peregrine in
33 // conservative variables (constant depth case)
34 //
35 ///////////////////////////////////////////////////////////////////////////////
36 
37 #include <iostream>
38 #include <iomanip>
39 #include <boost/algorithm/string.hpp>
40 
43 
44 using namespace std;
45 
46 namespace Nektar
47 {
48 
49 string NonlinearPeregrine::className =
51  "NonlinearPeregrine", NonlinearPeregrine::create,
52  "Nonlinear Peregrine equations in conservative variables.");
53 
54 NonlinearPeregrine::NonlinearPeregrine(
56  : ShallowWaterSystem(pSession), m_factors()
57 {
59  m_factors[StdRegions::eFactorTau] = 1000000.0;
60  // note: eFactorTau = 1.0 becomes unstable...
61  // we need to investigate the behaviuor w.r.t. tau
62 }
63 
65 {
67 
68  if (m_session->DefinesSolverInfo("PROBLEMTYPE"))
69  {
70  int i;
71  std::string ProblemTypeStr = m_session->GetSolverInfo("PROBLEMTYPE");
72  for (i = 0; i < (int) SIZE_ProblemType; ++i)
73  {
74  if (boost::iequals(ProblemTypeMap[i], ProblemTypeStr))
75  {
77  break;
78  }
79  }
80  }
81  else
82  {
84  }
85 
87  {
90  }
91  else
92  {
93  ASSERTL0(false, "Implicit Peregrine not set up.");
94  }
95 
96  // NB! At the moment only the constant depth case is
97  // supported for the Peregrine eq.
98  if (m_session->DefinesParameter("ConstDepth"))
99  {
100  m_const_depth = m_session->GetParameter("ConstDepth");
101  }
102  else
103  {
104  ASSERTL0(false, "Constant Depth not specified");
105  }
106 
107  // Type of advection class to be used
108  switch (m_projectionType)
109  {
110  // Continuous field
112  {
113  ASSERTL0(false,
114  "Continuous projection type not supported for Peregrine.");
115  break;
116  }
117  // Discontinuous field
119  {
120  string advName;
121  string diffName;
122  string riemName;
123 
124  //---------------------------------------------------------------
125  // Setting up advection and diffusion operators
126  // NB: diffusion not set up for SWE at the moment
127  // but kept here for future use ...
128  m_session->LoadSolverInfo("AdvectionType", advName, "WeakDG");
129  // m_session->LoadSolverInfo("DiffusionType", diffName, "LDG");
131  advName, advName);
132 
134  this);
135 
136  // Setting up Riemann solver for advection operator
137  m_session->LoadSolverInfo("UpwindType", riemName, "NoSolver");
138 
141  riemName);
142 
143  // Setting up parameters for advection operator Riemann solver
144  m_riemannSolver->SetParam("gravity",
146  m_riemannSolver->SetAuxVec("vecLocs",
149  this);
150  m_riemannSolver->SetScalar("depth", &NonlinearPeregrine::GetDepth,
151  this);
152 
153  // Concluding initialisation of advection / diffusion operators
154  m_advection->SetRiemannSolver(m_riemannSolver);
155  m_advection->InitObject(m_session, m_fields);
156  break;
157  }
158  default:
159  {
160  ASSERTL0(false, "Unsupported projection type.");
161  break;
162  }
163  }
164 
165 }
166 
168 {
169 
170 }
171 
172 // physarray contains the conservative variables
174  const Array<OneD, const Array<OneD, NekDouble> > &physarray,
175  Array<OneD, Array<OneD, NekDouble> > &outarray)
176 {
177 
178  int ncoeffs = GetNcoeffs();
179  int nq = GetTotPoints();
180 
181  Array<OneD, NekDouble> tmp(nq);
182  Array<OneD, NekDouble> mod(ncoeffs);
183 
184  switch (m_projectionType)
185  {
187  {
188  // add to hu equation
189  Vmath::Vmul(nq, m_coriolis, 1, physarray[2], 1, tmp, 1);
190  m_fields[0]->IProductWRTBase(tmp, mod);
191  m_fields[0]->MultiplyByElmtInvMass(mod, mod);
192  m_fields[0]->BwdTrans(mod, tmp);
193  Vmath::Vadd(nq, tmp, 1, outarray[1], 1, outarray[1], 1);
194 
195  // add to hv equation
196  Vmath::Vmul(nq, m_coriolis, 1, physarray[1], 1, tmp, 1);
197  Vmath::Neg(nq, tmp, 1);
198  m_fields[0]->IProductWRTBase(tmp, mod);
199  m_fields[0]->MultiplyByElmtInvMass(mod, mod);
200  m_fields[0]->BwdTrans(mod, tmp);
201  Vmath::Vadd(nq, tmp, 1, outarray[2], 1, outarray[2], 1);
202  break;
203  }
206  {
207  // add to hu equation
208  Vmath::Vmul(nq, m_coriolis, 1, physarray[2], 1, tmp, 1);
209  Vmath::Vadd(nq, tmp, 1, outarray[1], 1, outarray[1], 1);
210 
211  // add to hv equation
212  Vmath::Vmul(nq, m_coriolis, 1, physarray[1], 1, tmp, 1);
213  Vmath::Neg(nq, tmp, 1);
214  Vmath::Vadd(nq, tmp, 1, outarray[2], 1, outarray[2], 1);
215  break;
216  }
217  default:
218  ASSERTL0(false, "Unknown projection scheme for the NonlinearSWE");
219  break;
220  }
221 
222 }
223 
224 // physarray contains the conservative variables
226  const Array<OneD, const Array<OneD, NekDouble> > &physarray,
227  Array<OneD, Array<OneD, NekDouble> > &outarray)
228 {
229 
230  int ncoeffs = GetNcoeffs();
231  int nq = GetTotPoints();
232 
233  Array<OneD, NekDouble> tmp(nq);
234  Array<OneD, NekDouble> mod(ncoeffs);
235 
236  switch (m_projectionType)
237  {
239  {
240  for (int i = 0; i < m_spacedim; ++i)
241  {
242  Vmath::Vmul(nq, m_bottomSlope[i], 1, physarray[0], 1, tmp, 1);
243  Vmath::Smul(nq, m_g, tmp, 1, tmp, 1);
244  m_fields[0]->IProductWRTBase(tmp, mod);
245  m_fields[0]->MultiplyByElmtInvMass(mod, mod);
246  m_fields[0]->BwdTrans(mod, tmp);
247  Vmath::Vadd(nq, tmp, 1, outarray[i + 1], 1, outarray[i + 1], 1);
248  }
249  break;
250  }
253  {
254  for (int i = 0; i < m_spacedim; ++i)
255  {
256  Vmath::Vmul(nq, m_bottomSlope[i], 1, physarray[0], 1, tmp, 1);
257  Vmath::Smul(nq, m_g, tmp, 1, tmp, 1);
258  Vmath::Vadd(nq, tmp, 1, outarray[i + 1], 1, outarray[i + 1], 1);
259  }
260  break;
261  }
262  default:
263  ASSERTL0(false, "Unknown projection scheme for the NonlinearSWE");
264  break;
265  }
266 
267 }
268 
270  const Array<OneD, const Array<OneD, NekDouble> >&inarray,
271  Array<OneD, Array<OneD, NekDouble> >&outarray, const NekDouble time)
272 {
273  int i;
274  int nvariables = inarray.num_elements();
275  int ncoeffs = GetNcoeffs();
276  int nq = GetTotPoints();
277 
278  switch (m_projectionType)
279  {
281  {
282 
283  //-------------------------------------------------------
284  //inarray in physical space
285 
286  Array<OneD, Array<OneD, NekDouble> > modarray(nvariables);
287  for (i = 0; i < nvariables; ++i)
288  {
289  modarray[i] = Array<OneD, NekDouble>(ncoeffs, 0.0);
290  }
291  //-------------------------------------------------------
292 
293  //-------------------------------------------------------
294  // Compute the DG advection including the numerical flux
295  // by using SolverUtils/Advection
296  // Input and output in physical space
298 
299  m_advection->Advect(nvariables - 1, m_fields, advVel, inarray,
300  outarray, time);
301  //-------------------------------------------------------
302 
303  //-------------------------------------------------------
304  // negate the outarray since moving terms to the rhs
305  for (i = 0; i < nvariables - 1; ++i)
306  {
307  Vmath::Neg(nq, outarray[i], 1);
308  }
309  //-------------------------------------------------------
310 
311  //-------------------------------------------------
312  // Add "source terms"
313  // Input and output in physical space
314 
315  // Coriolis forcing
316  if (m_coriolis.num_elements() != 0)
317  {
318  AddCoriolis(inarray, outarray);
319  }
320 
321  // Variable Depth
322  if (m_constantDepth != true)
323  {
324  ASSERTL0(false,
325  "Variable depth not supported for the Peregrine "
326  "equations");
327  }
328 
329  //-------------------------------------------------
330 
331  //---------------------------------------
332  // As no more terms is required for the
333  // continuity equation and we have aleady evaluated
334  // the values for h_t we are done for h
335  //---------------------------------------
336 
337  //-------------------------------------------------
338  // go to modal space
339  m_fields[0]->IProductWRTBase(outarray[1], modarray[1]);
340  m_fields[0]->IProductWRTBase(outarray[2], modarray[2]);
341 
342  // store f1 and f2 for later use (modal space)
343  Array<OneD, NekDouble> f1(ncoeffs);
344  Array<OneD, NekDouble> f2(ncoeffs);
345 
346  Vmath::Vcopy(ncoeffs, modarray[1], 1, f1, 1); // f1
347  Vmath::Vcopy(ncoeffs, modarray[2], 1, f2, 1); // f2
348 
349  // Solve the remaining block-diagonal systems
350  m_fields[0]->MultiplyByElmtInvMass(modarray[1], modarray[1]);
351  m_fields[0]->MultiplyByElmtInvMass(modarray[2], modarray[2]);
352  //---------------------------------------------
353 
354  //---------------------------------------------
355 
356  //-------------------------------------------------
357  // create tmp fields to be used during
358  // the dispersive section
359 
360  Array<OneD, Array<OneD, NekDouble> > coeffsfield(2);
361  Array<OneD, Array<OneD, NekDouble> > physfield(2);
362 
363  for (i = 0; i < 2; ++i)
364  {
365  coeffsfield[i] = Array<OneD, NekDouble>(ncoeffs);
366  physfield[i] = Array<OneD, NekDouble>(nq);
367  }
368  //---------------------------------------------
369 
370  //---------------------------------------------
371  // Go from modal to physical space
372  Vmath::Vcopy(nq, outarray[1], 1, physfield[0], 1);
373  Vmath::Vcopy(nq, outarray[2], 1, physfield[1], 1);
374  //---------------------------------------
375 
376  //---------------------------------------
377  // Start for solve of mixed dispersive terms
378  // using the 'WCE method'
379  // (Eskilsson & Sherwin, JCP 2006)
380 
381  // constant depth case
382  // \nabla \cdot (\nabla z) - invgamma z
383  // = - invgamma (\nabla \cdot {\bf f}_(2,3)
384 
385  NekDouble gamma = (m_const_depth * m_const_depth) * (1.0 / 3.0);
386  NekDouble invgamma = 1.0 / gamma;
387 
388  int nTraceNumPoints = GetTraceTotPoints();
391  upwindX[0] = Array<OneD, NekDouble>(nTraceNumPoints);
392  upwindY[0] = Array<OneD, NekDouble>(nTraceNumPoints);
393  //--------------------------------------------
394 
395  //--------------------------------------------
396  // Compute the forcing function for the
397  // wave continuity equation
398 
399  // Set boundary condidtions for z
400  SetBoundaryConditionsForcing(physfield, time);
401 
402  // \nabla \phi \cdot f_{2,3}
403  m_fields[0]->IProductWRTDerivBase(0, physfield[0], coeffsfield[0]);
404  m_fields[0]->IProductWRTDerivBase(1, physfield[1], coeffsfield[1]);
405  Vmath::Vadd(ncoeffs, coeffsfield[0], 1, coeffsfield[1], 1,
406  coeffsfield[0], 1);
407  Vmath::Neg(ncoeffs, coeffsfield[0], 1);
408 
409  // Evaluate upwind numerical flux (physical space)
410  NumericalFluxForcing(physfield, upwindX[0], upwindY[0]);
411 
412  m_fields[0]->AddTraceIntegral(upwindX[0], upwindY[0],
413  coeffsfield[0]);
414  m_fields[0]->MultiplyByElmtInvMass(coeffsfield[0], coeffsfield[0]);
415  m_fields[0]->BwdTrans(coeffsfield[0], physfield[0]);
416 
417  Vmath::Smul(nq, -invgamma, physfield[0], 1, physfield[0], 1);
418 
419  // ok: forcing function for HelmSolve... done!
420  //--------------------------------------
421 
422  //--------------------------------------
423  // Solve the Helmhotz-type equation
424  // for the wave continuity equation
425  // (missing slope terms...)
426 
427  // note: this is just valid for the constant depth case:
428 
429  // as of now we need not to specify any
430  // BC routine for the WCE: periodic
431  // and zero Neumann (for walls)
432 
433  WCESolve(physfield[0], invgamma);
434 
435  Vmath::Vcopy(nq, physfield[0], 1, outarray[3], 1); // store z
436 
437  // ok: Wave Continuity Equation... done!
438  //------------------------------------
439 
440  //------------------------------------
441  // Return to the primary variables
442 
443  // (h {\bf u})_t = gamma \nabla z + {\bf f}_{2,3}
444 
445  Vmath::Smul(nq, gamma, physfield[0], 1, physfield[0], 1);
446 
447  // Set boundary conditions
448  SetBoundaryConditionsContVariables(physfield[0], time);
449 
450  m_fields[0]->IProductWRTDerivBase(0, physfield[0], coeffsfield[0]);
451  m_fields[1]->IProductWRTDerivBase(1, physfield[0], coeffsfield[1]);
452 
453  Vmath::Neg(ncoeffs, coeffsfield[0], 1);
454  Vmath::Neg(ncoeffs, coeffsfield[1], 1);
455 
456  // Evaluate upwind numerical flux (physical space)
457  NumericalFluxConsVariables(physfield[0], upwindX[0], upwindY[0]);
458 
459  {
460  Array<OneD, NekDouble> uptemp(nTraceNumPoints, 0.0);
461 
462  m_fields[0]->AddTraceIntegral(upwindX[0], uptemp,
463  coeffsfield[0]);
464  m_fields[0]->AddTraceIntegral(uptemp, upwindY[0],
465  coeffsfield[1]);
466  }
467 
468  Vmath::Vadd(ncoeffs, f1, 1, coeffsfield[0], 1, modarray[1], 1);
469  Vmath::Vadd(ncoeffs, f2, 1, coeffsfield[1], 1, modarray[2], 1);
470 
471  m_fields[1]->MultiplyByElmtInvMass(modarray[1], modarray[1]);
472  m_fields[2]->MultiplyByElmtInvMass(modarray[2], modarray[2]);
473 
474  m_fields[1]->BwdTrans(modarray[1], outarray[1]);
475  m_fields[2]->BwdTrans(modarray[2], outarray[2]);
476 
477  // ok: returned to conservative variables... done!
478  //---------------------
479 
480  break;
481  }
484  ASSERTL0(false, "Unknown projection scheme for the Peregrine");
485  break;
486  default:
487  ASSERTL0(false, "Unknown projection scheme for the NonlinearSWE");
488  break;
489  }
490 }
491 
493  const Array<OneD, const Array<OneD, NekDouble> >&inarray,
494  Array<OneD, Array<OneD, NekDouble> >&outarray,
495  const NekDouble time)
496 {
497  int i;
498  int nvariables = inarray.num_elements();
499 
500  switch (m_projectionType)
501  {
503  {
504 
505  // Just copy over array
506  int npoints = GetNpoints();
507 
508  for (i = 0; i < nvariables; ++i)
509  {
510  Vmath::Vcopy(npoints, inarray[i], 1, outarray[i], 1);
511  }
512 
513  SetBoundaryConditions(outarray, time);
514  break;
515  }
518  {
519 
522 
523  for (i = 0; i < nvariables; ++i)
524  {
525  m_fields[i]->FwdTrans(inarray[i], coeffs);
526  m_fields[i]->BwdTrans_IterPerExp(coeffs, outarray[i]);
527  }
528  break;
529  }
530  default:
531  ASSERTL0(false, "Unknown projection scheme");
532  break;
533  }
534 }
535 
536 //----------------------------------------------------
538  Array<OneD, Array<OneD, NekDouble> > &inarray,
539  NekDouble time)
540 {
541 
542  int nvariables = m_fields.num_elements();
543  int cnt = 0;
544  int nTracePts = GetTraceTotPoints();
545 
546  // Extract trace for boundaries. Needs to be done on all processors to avoid
547  // deadlock.
548  Array<OneD, Array<OneD, NekDouble> > Fwd(nvariables);
549  for (int i = 0; i < nvariables; ++i)
550  {
551  Fwd[i] = Array<OneD, NekDouble>(nTracePts);
552  m_fields[i]->ExtractTracePhys(inarray[i], Fwd[i]);
553  }
554 
555  // loop over Boundary Regions
556  for (int n = 0; n < m_fields[0]->GetBndConditions().num_elements(); ++n)
557  {
558 
559  // Wall Boundary Condition
560  if (boost::iequals(m_fields[0]->GetBndConditions()[n]->GetUserDefined(),"Wall"))
561  {
562  WallBoundary2D(n, cnt, Fwd, inarray);
563  }
564 
565  // Time Dependent Boundary Condition (specified in meshfile)
566  if (m_fields[0]->GetBndConditions()[n]->IsTimeDependent())
567  {
568  for (int i = 0; i < nvariables; ++i)
569  {
570  m_fields[i]->EvaluateBoundaryConditions(time);
571  }
572  }
573  cnt += m_fields[0]->GetBndCondExpansions()[n]->GetExpSize();
574  }
575 }
576 
577 //----------------------------------------------------
578 /**
579  * @brief Wall boundary condition.
580  */
581 void NonlinearPeregrine::WallBoundary(int bcRegion, int cnt,
583  Array<OneD, Array<OneD, NekDouble> > &physarray)
584 {
585  int i;
586  int nvariables = physarray.num_elements();
587 
588  // Adjust the physical values of the trace to take
589  // user defined boundaries into account
590  int e, id1, id2, npts;
592  m_fields[0]->GetBndCondExpansions()[bcRegion];
593  for (e = 0; e < bcexp->GetExpSize(); ++e)
594  {
595  npts = bcexp->GetExp(e)->GetTotPoints();
596  id1 = bcexp->GetPhys_Offset(e);
597  id2 = m_fields[0]->GetTrace()->GetPhys_Offset(
598  m_fields[0]->GetTraceMap()->GetBndCondCoeffsToGlobalCoeffsMap(
599  cnt + e));
600 
601  // For 2D/3D, define: v* = v - 2(v.n)n
602  Array<OneD, NekDouble> tmp(npts, 0.0);
603 
604  // Calculate (v.n)
605  for (i = 0; i < m_spacedim; ++i)
606  {
607  Vmath::Vvtvp(npts, &Fwd[1 + i][id2], 1, &m_traceNormals[i][id2], 1,
608  &tmp[0], 1, &tmp[0], 1);
609  }
610 
611  // Calculate 2.0(v.n)
612  Vmath::Smul(npts, -2.0, &tmp[0], 1, &tmp[0], 1);
613 
614  // Calculate v* = v - 2.0(v.n)n
615  for (i = 0; i < m_spacedim; ++i)
616  {
617  Vmath::Vvtvp(npts, &tmp[0], 1, &m_traceNormals[i][id2], 1,
618  &Fwd[1 + i][id2], 1, &Fwd[1 + i][id2], 1);
619  }
620 
621  // copy boundary adjusted values into the boundary expansion
622  for (i = 0; i < nvariables; ++i)
623  {
624  bcexp = m_fields[i]->GetBndCondExpansions()[bcRegion];
625  Vmath::Vcopy(npts, &Fwd[i][id2], 1, &(bcexp->UpdatePhys())[id1], 1);
626  }
627  }
628 }
629 
631  int bcRegion,
632  int cnt,
634  Array<OneD, Array<OneD, NekDouble> > &physarray)
635 {
636 
637  int i;
638  int nvariables = 3;
639 
640  // Adjust the physical values of the trace to take
641  // user defined boundaries into account
642  int e, id1, id2, npts;
644  m_fields[0]->GetBndCondExpansions()[bcRegion];
645 
646  for (e = 0; e < bcexp->GetExpSize();
647  ++e)
648  {
649  npts = bcexp->GetExp(e)->GetNumPoints(0);
650  id1 = bcexp->GetPhys_Offset(e);
651  id2 = m_fields[0]->GetTrace()->GetPhys_Offset(
652  m_fields[0]->GetTraceMap()->GetBndCondCoeffsToGlobalCoeffsMap(
653  cnt + e));
654 
655  switch (m_expdim)
656  {
657  case 1:
658  {
659  // negate the forward flux
660  Vmath::Neg(npts, &Fwd[1][id2], 1);
661  break;
662  }
663  case 2:
664  {
665  Array<OneD, NekDouble> tmp_n(npts);
666  Array<OneD, NekDouble> tmp_t(npts);
667 
668  Vmath::Vmul (npts, &Fwd[1][id2], 1, &m_traceNormals[0][id2], 1,
669  &tmp_n[0], 1);
670  Vmath::Vvtvp(npts, &Fwd[2][id2], 1, &m_traceNormals[1][id2], 1,
671  &tmp_n[0], 1, &tmp_n[0], 1);
672 
673  Vmath::Vmul (npts, &Fwd[1][id2], 1, &m_traceNormals[1][id2], 1,
674  &tmp_t[0], 1);
675  Vmath::Vvtvm(npts, &Fwd[2][id2], 1, &m_traceNormals[0][id2], 1,
676  &tmp_t[0], 1, &tmp_t[0], 1);
677 
678  // negate the normal flux
679  Vmath::Neg(npts, tmp_n, 1);
680 
681  // rotate back to Cartesian
682  Vmath::Vmul (npts, &tmp_t[0], 1, &m_traceNormals[1][id2], 1,
683  &Fwd[1][id2], 1);
684  Vmath::Vvtvm(npts, &tmp_n[0], 1, &m_traceNormals[0][id2], 1,
685  &Fwd[1][id2], 1, &Fwd[1][id2], 1);
686 
687  Vmath::Vmul(npts, &tmp_t[0], 1, &m_traceNormals[0][id2], 1,
688  &Fwd[2][id2], 1);
689  Vmath::Vvtvp(npts, &tmp_n[0], 1, &m_traceNormals[1][id2], 1,
690  &Fwd[2][id2], 1, &Fwd[2][id2], 1);
691  break;
692  }
693  case 3:
694  ASSERTL0(false,
695  "3D not implemented for Shallow Water Equations");
696  break;
697  default:
698  ASSERTL0(false, "Illegal expansion dimension");
699  }
700 
701  // copy boundary adjusted values into the boundary expansion
702  for (i = 0; i < nvariables; ++i)
703  {
704  bcexp = m_fields[i]->GetBndCondExpansions()[bcRegion];
705  Vmath::Vcopy(npts, &Fwd[i][id2], 1, &(bcexp->UpdatePhys())[id1], 1);
706  }
707  }
708 }
709 
710 // Physfield in conservative Form
712  const Array<OneD, const Array<OneD, NekDouble> > &physfield,
714 {
715  int i, j;
716  int nq = m_fields[0]->GetTotPoints();
717 
718  NekDouble g = m_g;
720 
721  // Flux vector for the mass equation
722  for (i = 0; i < m_spacedim; ++i)
723  {
724  velocity[i] = Array<OneD, NekDouble>(nq);
725  Vmath::Vcopy(nq, physfield[i + 1], 1, flux[0][i], 1);
726  }
727 
728  GetVelocityVector(physfield, velocity);
729 
730  // Put (0.5 g h h) in tmp
731  Array<OneD, NekDouble> tmp(nq);
732  Vmath::Vmul(nq, physfield[0], 1, physfield[0], 1, tmp, 1);
733  Vmath::Smul(nq, 0.5 * g, tmp, 1, tmp, 1);
734 
735  // Flux vector for the momentum equations
736  for (i = 0; i < m_spacedim; ++i)
737  {
738  for (j = 0; j < m_spacedim; ++j)
739  {
740  Vmath::Vmul(nq, velocity[j], 1, physfield[i + 1], 1,
741  flux[i + 1][j], 1);
742  }
743 
744  // Add (0.5 g h h) to appropriate field
745  Vmath::Vadd(nq, flux[i + 1][i], 1, tmp, 1, flux[i + 1][i], 1);
746  }
747 
748 }
749 
751  const Array<OneD, const Array<OneD, NekDouble> >&physin,
752  Array<OneD, Array<OneD, NekDouble> >&physout)
753 {
754  int nq = GetTotPoints();
755 
756  if (physin.get() == physout.get())
757  {
758  // copy indata and work with tmp array
760  for (int i = 0; i < 3; ++i)
761  {
762  // deep copy
763  tmp[i] = Array<OneD, NekDouble>(nq);
764  Vmath::Vcopy(nq, physin[i], 1, tmp[i], 1);
765  }
766 
767  // \eta = h - d
768  Vmath::Vsub(nq, tmp[0], 1, m_depth, 1, physout[0], 1);
769 
770  // u = hu/h
771  Vmath::Vdiv(nq, tmp[1], 1, tmp[0], 1, physout[1], 1);
772 
773  // v = hv/ v
774  Vmath::Vdiv(nq, tmp[2], 1, tmp[0], 1, physout[2], 1);
775  }
776  else
777  {
778  // \eta = h - d
779  Vmath::Vsub(nq, physin[0], 1, m_depth, 1, physout[0], 1);
780 
781  // u = hu/h
782  Vmath::Vdiv(nq, physin[1], 1, physin[0], 1, physout[1], 1);
783 
784  // v = hv/ v
785  Vmath::Vdiv(nq, physin[2], 1, physin[0], 1, physout[2], 1);
786  }
787 }
788 
790 {
791  int nq = GetTotPoints();
792 
793  // u = hu/h
794  Vmath::Vdiv(nq, m_fields[1]->GetPhys(), 1, m_fields[0]->GetPhys(), 1,
795  m_fields[1]->UpdatePhys(), 1);
796 
797  // v = hv/ v
798  Vmath::Vdiv(nq, m_fields[2]->GetPhys(), 1, m_fields[0]->GetPhys(), 1,
799  m_fields[2]->UpdatePhys(), 1);
800 
801  // \eta = h - d
802  Vmath::Vsub(nq, m_fields[0]->GetPhys(), 1, m_depth, 1,
803  m_fields[0]->UpdatePhys(), 1);
804 }
805 
807  const Array<OneD, const Array<OneD, NekDouble> >&physin,
808  Array<OneD, Array<OneD, NekDouble> >&physout)
809 {
810 
811  int nq = GetTotPoints();
812 
813  if (physin.get() == physout.get())
814  {
815  // copy indata and work with tmp array
817  for (int i = 0; i < 3; ++i)
818  {
819  // deep copy
820  tmp[i] = Array<OneD, NekDouble>(nq);
821  Vmath::Vcopy(nq, physin[i], 1, tmp[i], 1);
822  }
823 
824  // h = \eta + d
825  Vmath::Vadd(nq, tmp[0], 1, m_depth, 1, physout[0], 1);
826 
827  // hu = h * u
828  Vmath::Vmul(nq, physout[0], 1, tmp[1], 1, physout[1], 1);
829 
830  // hv = h * v
831  Vmath::Vmul(nq, physout[0], 1, tmp[2], 1, physout[2], 1);
832 
833  }
834  else
835  {
836  // h = \eta + d
837  Vmath::Vadd(nq, physin[0], 1, m_depth, 1, physout[0], 1);
838 
839  // hu = h * u
840  Vmath::Vmul(nq, physout[0], 1, physin[1], 1, physout[1], 1);
841 
842  // hv = h * v
843  Vmath::Vmul(nq, physout[0], 1, physin[2], 1, physout[2], 1);
844 
845  }
846 
847 }
848 
850 {
851  int nq = GetTotPoints();
852 
853  // h = \eta + d
854  Vmath::Vadd(nq, m_fields[0]->GetPhys(), 1, m_depth, 1,
855  m_fields[0]->UpdatePhys(), 1);
856 
857  // hu = h * u
858  Vmath::Vmul(nq, m_fields[0]->GetPhys(), 1, m_fields[1]->GetPhys(), 1,
859  m_fields[1]->UpdatePhys(), 1);
860 
861  // hv = h * v
862  Vmath::Vmul(nq, m_fields[0]->GetPhys(), 1, m_fields[2]->GetPhys(), 1,
863  m_fields[2]->UpdatePhys(), 1);
864 }
865 
866 /**
867  * @brief Compute the velocity field \f$ \mathbf{v} \f$ given the momentum
868  * \f$ h\mathbf{v} \f$.
869  *
870  * @param physfield Momentum field.
871  * @param velocity Velocity field.
872  */
874  const Array<OneD, Array<OneD, NekDouble> > &physfield,
875  Array<OneD, Array<OneD, NekDouble> > &velocity)
876 {
877  const int npts = physfield[0].num_elements();
878 
879  for (int i = 0; i < m_spacedim; ++i)
880  {
881  Vmath::Vdiv(npts, physfield[1 + i], 1, physfield[0], 1, velocity[i], 1);
882  }
883 }
884 
886 {
888  SolverUtils::AddSummaryItem(s, "Variables", "h should be in field[0]");
889  SolverUtils::AddSummaryItem(s, "", "hu should be in field[1]");
890  SolverUtils::AddSummaryItem(s, "", "hv should be in field[2]");
891  SolverUtils::AddSummaryItem(s, "", "z should be in field[3]");
892 }
893 
896  NekDouble lambda)
897 {
898  int nq = GetTotPoints();
899 
901 
902  for (int j = 0; j < nq; j++)
903  {
904  (m_fields[3]->UpdatePhys())[j] = fce[j];
905  }
906 
907  m_fields[3]->SetPhysState(true);
908 
909  m_fields[3]->HelmSolve(m_fields[3]->GetPhys(),
910  m_fields[3]->UpdateCoeffs(),
911  NullFlagList,
912  m_factors);
913 
914  m_fields[3]->BwdTrans(m_fields[3]->GetCoeffs(), m_fields[3]->UpdatePhys());
915 
916  m_fields[3]->SetPhysState(true);
917 
918  Vmath::Vcopy(nq, m_fields[3]->GetPhys(), 1, fce, 1);
919 }
920 
922  const Array<OneD, const Array<OneD, NekDouble> > &inarray,
923  Array<OneD, NekDouble> &numfluxX,
924  Array<OneD, NekDouble> &numfluxY)
925 {
926  int i;
927  int nTraceNumPoints = GetTraceTotPoints();
928 
929  //-----------------------------------------------------
930  // get temporary arrays
933 
934  for (i = 0; i < 2; ++i)
935  {
936  Fwd[i] = Array<OneD, NekDouble>(nTraceNumPoints);
937  Bwd[i] = Array<OneD, NekDouble>(nTraceNumPoints);
938  }
939  //-----------------------------------------------------
940 
941  //-----------------------------------------------------
942  // get the physical values at the trace
943  // (any time-dependent BC previuosly put in fields[1] and [2]
944 
945  m_fields[1]->GetFwdBwdTracePhys(inarray[0], Fwd[0], Bwd[0]);
946  m_fields[2]->GetFwdBwdTracePhys(inarray[1], Fwd[1], Bwd[1]);
947  //-----------------------------------------------------
948 
949  //-----------------------------------------------------
950  // use centred fluxes for the numerical flux
951  for (i = 0; i < nTraceNumPoints; ++i)
952  {
953  numfluxX[i] = 0.5 * (Fwd[0][i] + Bwd[0][i]);
954  numfluxY[i] = 0.5 * (Fwd[1][i] + Bwd[1][i]);
955  }
956  //-----------------------------------------------------
957 }
958 
960  Array<OneD, Array<OneD, NekDouble> > &inarray,
961  NekDouble time)
962 {
963  int cnt = 0;
964 
965  // loop over Boundary Regions
966  for (int n = 0; n < m_fields[0]->GetBndConditions().num_elements(); ++n)
967  {
968  // Use wall for all BC...
969  // Wall Boundary Condition
970  if (boost::iequals(m_fields[0]->GetBndConditions()[n]->GetUserDefined(),"Wall"))
971  {
972  WallBoundaryForcing(n, cnt, inarray);
973  }
974 
975  //Timedependent Boundary Condition
976  if (m_fields[0]->GetBndConditions()[n]->IsTimeDependent())
977  {
978  ASSERTL0(false, "time-dependent BC not implemented for Boussinesq");
979  }
980  cnt += m_fields[0]->GetBndCondExpansions()[n]->GetExpSize();
981  }
982 }
983 
984 // fills up boundary expansion for field[1] and [2]
986  int bcRegion,
987  int cnt,
988  Array<OneD, Array<OneD, NekDouble> >&inarray)
989 {
990 
991  //std::cout << " WallBoundaryForcing" << std::endl;
992 
993  int nTraceNumPoints = GetTraceTotPoints();
994  int nvariables = 2;
995 
996  // get physical values of f1 and f2 for the forward trace
997  Array<OneD, Array<OneD, NekDouble> > Fwd(nvariables);
998  for (int i = 0; i < nvariables; ++i)
999  {
1000  Fwd[i] = Array<OneD, NekDouble>(nTraceNumPoints);
1001  m_fields[i]->ExtractTracePhys(inarray[i], Fwd[i]);
1002  }
1003 
1004  // Adjust the physical values of the trace to take
1005  // user defined boundaries into account
1006  int e, id1, id2, npts;
1008  m_fields[0]->GetBndCondExpansions()[bcRegion];
1009  for (e = 0; e < bcexp->GetExpSize(); ++e)
1010  {
1011  npts = bcexp->GetExp(e)->GetTotPoints();
1012  id1 = bcexp->GetPhys_Offset(e);
1013  id2 = m_fields[0]->GetTrace()->GetPhys_Offset(
1014  m_fields[0]->GetTraceMap()->GetBndCondCoeffsToGlobalCoeffsMap(
1015  cnt + e));
1016 
1017  switch (m_expdim)
1018  {
1019  case 1:
1020  {
1021  ASSERTL0(false, "1D not yet implemented for Boussinesq");
1022  break;
1023  }
1024  case 2:
1025  {
1026  Array<OneD, NekDouble> tmp_n(npts);
1027  Array<OneD, NekDouble> tmp_t(npts);
1028 
1029  Vmath::Vmul (npts, &Fwd[0][id2], 1, &m_traceNormals[0][id2], 1,
1030  &tmp_n[0], 1);
1031  Vmath::Vvtvp(npts, &Fwd[1][id2], 1, &m_traceNormals[1][id2], 1,
1032  &tmp_n[0], 1, &tmp_n[0], 1);
1033 
1034  Vmath::Vmul (npts, &Fwd[0][id2], 1, &m_traceNormals[1][id2], 1,
1035  &tmp_t[0], 1);
1036  Vmath::Vvtvm(npts, &Fwd[1][id2], 1, &m_traceNormals[0][id2], 1,
1037  &tmp_t[0], 1, &tmp_t[0], 1);
1038 
1039  // negate the normal flux
1040  Vmath::Neg(npts, tmp_n, 1);
1041 
1042  // rotate back to Cartesian
1043  Vmath::Vmul (npts, &tmp_t[0], 1, &m_traceNormals[1][id2], 1,
1044  &Fwd[0][id2], 1);
1045  Vmath::Vvtvm(npts, &tmp_n[0], 1, &m_traceNormals[0][id2], 1,
1046  &Fwd[0][id2], 1, &Fwd[0][id2], 1);
1047 
1048  Vmath::Vmul (npts, &tmp_t[0], 1, &m_traceNormals[0][id2], 1,
1049  &Fwd[1][id2], 1);
1050  Vmath::Vvtvp(npts, &tmp_n[0], 1, &m_traceNormals[1][id2], 1,
1051  &Fwd[1][id2], 1, &Fwd[1][id2], 1);
1052  break;
1053  }
1054  case 3:
1055  ASSERTL0(false, "3D not implemented for Boussinesq equations");
1056  break;
1057  default:
1058  ASSERTL0(false, "Illegal expansion dimension");
1059  }
1060 
1061  // copy boundary adjusted values into the boundary expansion
1062  bcexp = m_fields[1]->GetBndCondExpansions()[bcRegion];
1063  Vmath::Vcopy(npts, &Fwd[0][id2], 1, &(bcexp->UpdatePhys())[id1], 1);
1064 
1065  bcexp = m_fields[2]->GetBndCondExpansions()[bcRegion];
1066  Vmath::Vcopy(npts, &Fwd[1][id2], 1, &(bcexp->UpdatePhys())[id1], 1);
1067  }
1068 }
1069 
1071  Array<OneD, NekDouble> &inarray,
1072  NekDouble time)
1073 {
1074  int cnt = 0;
1075 
1076  // loop over Boundary Regions
1077  for (int n = 0; n < m_fields[0]->GetBndConditions().num_elements(); ++n)
1078  {
1079  // Use wall for all
1080  // Wall Boundary Condition
1081  if(boost::iequals(m_fields[0]->GetBndConditions()[n]->GetUserDefined(),"Wall"))
1082  {
1083  WallBoundaryContVariables(n, cnt, inarray);
1084  }
1085 
1086  if (m_fields[0]->GetBndConditions()[n]->IsTimeDependent())
1087  {
1088  WallBoundaryContVariables(n, cnt, inarray);
1089  }
1090 
1091  cnt += m_fields[0]->GetBndCondExpansions()[n]->GetExpSize() - 1;
1092  }
1093 }
1094 
1096  int bcRegion,
1097  int cnt,
1098  Array<OneD, NekDouble>&inarray)
1099 {
1100  int nTraceNumPoints = GetTraceTotPoints();
1101 
1102  // get physical values of z for the forward trace
1103  Array<OneD, NekDouble> z(nTraceNumPoints);
1104  m_fields[0]->ExtractTracePhys(inarray, z);
1105 
1106  // Adjust the physical values of the trace to take
1107  // user defined boundaries into account
1108  int e, id1, id2, npts;
1110  m_fields[0]->GetBndCondExpansions()[bcRegion];
1111 
1112  for (e = 0; e < bcexp->GetExpSize(); ++e)
1113  {
1114  npts = bcexp->GetExp(e)->GetTotPoints();
1115  id1 = bcexp->GetPhys_Offset(e);
1116  id2 = m_fields[0]->GetTrace()->GetPhys_Offset(
1117  m_fields[0]->GetTraceMap()->GetBndCondCoeffsToGlobalCoeffsMap(
1118  cnt + e));
1119 
1120  // copy boundary adjusted values into the boundary expansion field[1] and field[2]
1121  bcexp = m_fields[1]->GetBndCondExpansions()[bcRegion];
1122  Vmath::Vcopy(npts, &z[id2], 1, &(bcexp->UpdatePhys())[id1], 1);
1123 
1124  }
1125 }
1126 
1129  Array<OneD, NekDouble> &outY)
1130 {
1131  int i;
1132  int nTraceNumPoints = GetTraceTotPoints();
1133 
1134  //-----------------------------------------------------
1135  // get temporary arrays
1138 
1139  Fwd[0] = Array<OneD, NekDouble>(nTraceNumPoints);
1140  Bwd[0] = Array<OneD, NekDouble>(nTraceNumPoints);
1141  //-----------------------------------------------------
1142 
1143  //-----------------------------------------------------
1144  // get the physical values at the trace
1145  // (we have put any time-dependent BC in field[1])
1146 
1147  m_fields[1]->GetFwdBwdTracePhys(physfield, Fwd[0], Bwd[0]);
1148  //-----------------------------------------------------
1149 
1150  //-----------------------------------------------------
1151  // use centred fluxes for the numerical flux
1152  for (i = 0; i < nTraceNumPoints; ++i)
1153  {
1154  outX[i] = 0.5 * (Fwd[0][i] + Bwd[0][i]);
1155  outY[i] = 0.5 * (Fwd[0][i] + Bwd[0][i]);
1156  }
1157  //-----------------------------------------------------
1158 }
1159 
1160 // initial condition Laitone's first order solitary wave
1162  NekDouble amp,
1163  NekDouble d,
1164  NekDouble time,
1165  NekDouble x_offset)
1166 {
1167  int nq = GetTotPoints();
1168 
1169  NekDouble A = 1.0;
1170  NekDouble C = sqrt(m_g * d) * (1.0 + 0.5 * (amp / d));
1171 
1172  Array<OneD, NekDouble> x0(nq);
1173  Array<OneD, NekDouble> x1(nq);
1174  Array<OneD, NekDouble> zeros(nq, 0.0);
1175 
1176  // get the coordinates (assuming all fields have the same
1177  // discretisation)
1178  m_fields[0]->GetCoords(x0, x1);
1179 
1180  for (int i = 0; i < nq; i++)
1181  {
1182  (m_fields[0]->UpdatePhys())[i] = amp * pow((1.0 / cosh(
1183  sqrt(0.75 * (amp / (d * d * d))) *
1184  (A * (x0[i] + x_offset) - C * time))), 2.0);
1185  (m_fields[1]->UpdatePhys())[i] = (amp / d) * pow((1.0 / cosh(
1186  sqrt(0.75 * (amp / (d * d * d))) *
1187  (A * (x0[i] + x_offset) - C * time)
1188  )), 2.0) * sqrt(m_g * d);
1189  }
1190 
1191  Vmath::Sadd(nq, d, m_fields[0]->GetPhys(), 1, m_fields[0]->UpdatePhys(), 1);
1192  Vmath::Vmul(nq, m_fields[0]->GetPhys(), 1, m_fields[1]->GetPhys(), 1,
1193  m_fields[1]->UpdatePhys(), 1);
1194  Vmath::Vcopy(nq, zeros, 1, m_fields[2]->UpdatePhys(), 1);
1195  Vmath::Vcopy(nq, zeros, 1, m_fields[3]->UpdatePhys(), 1);
1196 
1197  // Forward transform to fill the coefficient space
1198  for (int i = 0; i < 4; ++i)
1199  {
1200  m_fields[i]->SetPhysState(true);
1201  m_fields[i]->FwdTrans(m_fields[i]->GetPhys(),
1202  m_fields[i]->UpdateCoeffs());
1203  }
1204 
1205 }
1206 
1207 /**
1208  * @brief Set the initial conditions.
1209  */
1211  NekDouble initialtime,
1212  bool dumpInitialConditions,
1213  const int domain)
1214 {
1215 
1216  switch (m_problemType)
1217  {
1218  case eSolitaryWave:
1219  {
1220  LaitoneSolitaryWave(0.1, m_const_depth, 0.0, 0.0);
1221  break;
1222  }
1223  default:
1224  {
1225  EquationSystem::v_SetInitialConditions(initialtime, false);
1226  break;
1227  }
1228  }
1229 
1230  if (dumpInitialConditions)
1231  {
1232  // Dump initial conditions to file
1233  Checkpoint_Output(0);
1234  }
1235 }
1236 
1237 } //end of namespace
1238 
Array< OneD, NekDouble > m_coriolis
Coriolis force.
void SetBoundaryConditionsContVariables(Array< OneD, NekDouble > &inarray, NekDouble time)
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
void NumericalFluxForcing(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &numfluxX, Array< OneD, NekDouble > &numfluxY)
Base class for unsteady solvers.
tBaseSharedPtr CreateInstance(tKey idKey BOOST_PP_COMMA_IF(MAX_PARAM) BOOST_PP_ENUM_BINARY_PARAMS(MAX_PARAM, tParam, x))
Create an instance of the class referred to by idKey.
Definition: NekFactory.hpp:162
Array< OneD, NekDouble > m_depth
Still water depth.
void GetFluxVector(const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &flux)
LibUtilities::TimeIntegrationSchemeOperators m_ode
The time integration scheme operators to use.
void WallBoundaryForcing(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &inarray)
std::vector< std::pair< std::string, std::string > > SummaryList
Definition: Misc.h:47
int m_expdim
Expansion dimension.
SOLVER_UTILS_EXPORT void Checkpoint_Output(const int n)
Write checkpoint file of m_fields.
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
Definition: Vmath.cpp:428
enum MultiRegions::ProjectionType m_projectionType
Type of projection; e.g continuous or discontinuous.
const Array< OneD, const Array< OneD, NekDouble > > & GetVecLocs()
STL namespace.
SolverUtils::AdvectionSharedPtr m_advection
void DoOdeProjection(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
void Vdiv(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x/y.
Definition: Vmath.cpp:227
void SetBoundaryConditions(Array< OneD, Array< OneD, NekDouble > > &physarray, NekDouble time)
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:51
const Array< OneD, const Array< OneD, NekDouble > > & GetNormals()
const Array< OneD, NekDouble > & GetDepth()
SOLVER_UTILS_EXPORT int GetTotPoints()
StdRegions::ConstFactorMap m_factors
virtual void v_SetInitialConditions(NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
Set the initial conditions.
void NumericalFluxConsVariables(Array< OneD, NekDouble > &physfield, Array< OneD, NekDouble > &outX, Array< OneD, NekDouble > &outY)
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
Array holding trace normals for DG simulations in the forwards direction.
virtual void v_GenerateSummary(SolverUtils::SummaryList &s)
Print a summary of time stepping parameters.
void DefineProjection(FuncPointerT func, ObjectPointerT obj)
Array< OneD, Array< OneD, NekDouble > > m_bottomSlope
virtual ~NonlinearPeregrine()
problem type selector
virtual void v_InitObject()
Init object for UnsteadySystem class.
void WallBoundary(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray)
Wall boundary condition.
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
Definition: Vmath.cpp:199
bool m_explicitAdvection
Indicates if explicit or implicit treatment of advection is used.
void DefineOdeRhs(FuncPointerT func, ObjectPointerT obj)
virtual void v_InitObject()
Init object for UnsteadySystem class.
void AddSummaryItem(SummaryList &l, const std::string &name, const std::string &value)
Adds a summary item to the summary info list.
Definition: Misc.cpp:50
RiemannSolverFactory & GetRiemannSolverFactory()
void WCESolve(Array< OneD, NekDouble > &fce, NekDouble lambda)
SolverUtils::RiemannSolverSharedPtr m_riemannSolver
boost::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
static std::string npts
Definition: InputFld.cpp:43
int m_spacedim
Spatial dimension (>= expansion dim).
AdvectionFactory & GetAdvectionFactory()
Gets the factory for initialising advection objects.
Definition: Advection.cpp:46
virtual void v_GenerateSummary(SolverUtils::SummaryList &s)
Print a summary of time stepping parameters.
void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.cpp:382
double NekDouble
virtual SOLVER_UTILS_EXPORT void v_SetInitialConditions(NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
Length of enum list.
Definition: EulerADCFE.h:47
void SetBoundaryConditionsForcing(Array< OneD, Array< OneD, NekDouble > > &inarray, NekDouble time)
void Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add vector y = alpha + x.
Definition: Vmath.cpp:301
EquationSystemFactory & GetEquationSystemFactory()
void AddVariableDepth(const Array< OneD, const Array< OneD, NekDouble > > &physarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
SOLVER_UTILS_EXPORT void SetBoundaryConditions(NekDouble time)
Evaluates the boundary conditions at the given time.
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
Definition: Vmath.cpp:329
SOLVER_UTILS_EXPORT int GetTraceTotPoints()
void WallBoundary2D(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray)
SOLVER_UTILS_EXPORT int GetNpoints()
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
void GetVelocityVector(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &velocity)
Compute the velocity field given the momentum .
void Vvtvm(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)
vvtvm (vector times vector plus vector): z = w*x - y
Definition: Vmath.cpp:451
SOLVER_UTILS_EXPORT int GetNcoeffs()
First order Laitone solitary wave.
bool m_constantDepth
Indicates if constant depth case.
ProblemType
Definition: EulerADCFE.h:44
void WallBoundaryContVariables(int bcRegion, int cnt, Array< OneD, NekDouble > &inarray)
void AddCoriolis(const Array< OneD, const Array< OneD, NekDouble > > &physarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
NekDouble m_g
Acceleration of gravity.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1047
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:285
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.
Definition: Vmath.cpp:169
static FlagList NullFlagList
An empty flag list.
void LaitoneSolitaryWave(NekDouble amp, NekDouble d, NekDouble time, NekDouble x_offset)
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.
Definition: NekFactory.hpp:215
const char *const ProblemTypeMap[]
Definition: EulerADCFE.h:50