Nektar++
Loading...
Searching...
No Matches
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// Permission is hereby granted, free of charge, to any person obtaining a
14// copy of this software and associated documentation files (the "Software"),
15// to deal in the Software without restriction, including without limitation
16// the rights to use, copy, modify, merge, publish, distribute, sublicense,
17// and/or sell copies of the Software, and to permit persons to whom the
18// Software is furnished to do so, subject to the following conditions:
19//
20// The above copyright notice and this permission notice shall be included
21// in all copies or substantial portions of the Software.
22//
23// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29// DEALINGS IN THE SOFTWARE.
30//
31// Description: Nonlinear Boussinesq equations of Peregrine in
32// conservative variables (constant depth case)
33//
34///////////////////////////////////////////////////////////////////////////////
35
36#include <iomanip>
37#include <iostream>
38
41
42namespace Nektar
43{
44
47 "NonlinearPeregrine", NonlinearPeregrine::create,
48 "Nonlinear Peregrine equations in conservative variables.");
49
53 : NonlinearSWE(pSession, pGraph), m_factors()
54{
57 // note: eFactorTau = 1.0 becomes unstable...
58 // we need to investigate the behaviuor w.r.t. tau
59}
60
61void NonlinearPeregrine::v_InitObject(bool DeclareFields)
62{
63 NonlinearSWE::v_InitObject(DeclareFields);
64
65 if (m_session->DefinesSolverInfo("PROBLEMTYPE"))
66 {
67 std::string ProblemTypeStr = m_session->GetSolverInfo("PROBLEMTYPE");
68 for (int i = 0; i < (int)SIZE_ProblemType; ++i)
69 {
70 if (boost::iequals(ProblemTypeMap[i], ProblemTypeStr))
71 {
73 break;
74 }
75 }
76 }
77 else
78 {
80 }
81
82 // NB! At the moment only the constant depth case is
83 // supported for the Peregrine eq.
84 if (m_session->DefinesParameter("ConstDepth"))
85 {
86 m_const_depth = m_session->GetParameter("ConstDepth");
87 }
88 else
89 {
90 ASSERTL0(false, "Constant Depth not specified");
91 }
92
94 "Continuous projection type not supported for Peregrine.");
95
99}
100
101/**
102 * @brief Set the initial conditions.
103 */
105 NekDouble initialtime, bool dumpInitialConditions,
106 [[maybe_unused]] const int domain)
107{
108 switch (m_problemType)
109 {
110 case eSolitaryWave:
111 {
112 LaitoneSolitaryWave(0.1, m_const_depth, 0.0, 0.0);
113 break;
114 }
115 default:
116 {
117 EquationSystem::v_SetInitialConditions(initialtime, false);
118 m_nchk--; // Note: m_nchk has been incremented in EquationSystem.
119 break;
120 }
121 }
122
123 // Update time in field info if required
124 if (m_fieldMetaDataMap.find("Time") != m_fieldMetaDataMap.end())
125 {
126 m_fieldMetaDataMap["Time"] = boost::lexical_cast<std::string>(m_time);
127 }
128
129 if (dumpInitialConditions && m_checksteps && m_nchk == 0 &&
130 !m_comm->IsParallelInTime())
131 {
133 }
134 else if (dumpInitialConditions && m_nchk == 0 && m_comm->IsParallelInTime())
135 {
136 std::string newdir = m_sessionName + ".pit";
137 if (!fs::is_directory(newdir))
138 {
139 fs::create_directory(newdir);
140 }
141 if (m_comm->GetTimeComm()->GetRank() == 0)
142 {
143 WriteFld(newdir + "/" + m_sessionName + "_0.fld");
144 }
145 }
146 m_nchk++;
147}
148
150 const Array<OneD, const Array<OneD, NekDouble>> &inarray,
151 Array<OneD, Array<OneD, NekDouble>> &outarray, const NekDouble time)
152{
153 int nvariables = inarray.size() - 1;
154 int ncoeffs = GetNcoeffs();
155 int nq = GetTotPoints();
156
157 switch (m_projectionType)
158 {
160 {
161 //-------------------------------------------------------
162 // Compute the DG advection including the numerical flux
163 // by using SolverUtils/Advection
164 // Input and output in physical space
166 inarray, outarray, time);
167 //-------------------------------------------------------
168
169 //-------------------------------------------------------
170 // negate the outarray since moving terms to the rhs
171 for (int i = 0; i < nvariables; ++i)
172 {
173 Vmath::Neg(nq, outarray[i], 1);
174 }
175 //-------------------------------------------------------
176
177 //-------------------------------------------------
178 // Add "source terms"
179 // Input and output in physical space
180
181 // Coriolis forcing
182 if (m_coriolis.size() != 0)
183 {
184 AddCoriolis(inarray, outarray);
185 }
186
187 // Variable Depth
188 if (m_constantDepth != true)
189 {
190 ASSERTL0(false,
191 "Variable depth not supported for the Peregrine "
192 "equations");
193 }
194
195 //-------------------------------------------------
196
197 //---------------------------------------
198 // As no more terms is required for the
199 // continuity equation and we have aleady evaluated
200 // the values for h_t we are done for h
201 //---------------------------------------
202
203 //---------------------------------------------
204
205 //-------------------------------------------------
206 // create tmp fields to be used during
207 // the dispersive section
208
209 int nTraceNumPoints = GetTraceTotPoints();
210 Array<OneD, NekDouble> upwindX(nTraceNumPoints);
211 Array<OneD, NekDouble> upwindY(nTraceNumPoints);
212
215 for (int i = 0; i < 2; ++i)
216 {
217 coeffsfield[i] = Array<OneD, NekDouble>(ncoeffs);
218 physfield[i] = Array<OneD, NekDouble>(nq);
219 }
220
221 Vmath::Vcopy(nq, outarray[1], 1, physfield[0], 1);
222 Vmath::Vcopy(nq, outarray[2], 1, physfield[1], 1);
223
224 //---------------------------------------
225 // Start for solve of mixed dispersive terms using the 'WCE method'
226 // (Eskilsson & Sherwin, JCP 2006)
227
228 // constant depth case
229 // \nabla \cdot (\nabla z) - invgamma z
230 // = - invgamma (\nabla \cdot {\bf f}_(2,3)
231
232 NekDouble gamma = (m_const_depth * m_const_depth) / 3.0;
233 NekDouble invgamma = 1.0 / gamma;
234 //--------------------------------------------
235
236 //--------------------------------------------
237 // Compute the forcing function for the wave continuity equation (eq
238 // 26a)
239
240 // Set boundary condidtions for z
241 SetBoundaryConditionsForcing(physfield, time);
242
243 // \nabla \phi \cdot f_{2,3}
244 m_fields[0]->IProductWRTDerivBase(0, physfield[0], coeffsfield[0]);
245 m_fields[0]->IProductWRTDerivBase(1, physfield[1], coeffsfield[1]);
246 Vmath::Vadd(ncoeffs, coeffsfield[0], 1, coeffsfield[1], 1,
247 coeffsfield[0], 1);
248 Vmath::Neg(ncoeffs, coeffsfield[0], 1);
249
250 // Evaluate upwind numerical flux (physical space)
251 NumericalFluxForcing(physfield, upwindX, upwindY);
252 Array<OneD, NekDouble> normflux(nTraceNumPoints);
253 Vmath::Vvtvvtp(nTraceNumPoints, upwindX, 1, m_traceNormals[0], 1,
254 upwindY, 1, m_traceNormals[1], 1, normflux, 1);
255 m_fields[0]->AddTraceIntegral(normflux, coeffsfield[0]);
256 m_fields[0]->MultiplyByElmtInvMass(coeffsfield[0], coeffsfield[0]);
257 m_fields[0]->BwdTrans(coeffsfield[0], physfield[0]);
258
259 Vmath::Smul(nq, -invgamma, physfield[0], 1, physfield[0], 1);
260
261 //--------------------------------------
262
263 //--------------------------------------
264 // Solve the Helmhotz-type equation for the wave continuity equation
265 // (eq. 26b)
266
267 WCESolve(physfield[0], invgamma);
268
269 Vmath::Vcopy(nq, physfield[0], 1, outarray[3], 1); // store z
270
271 //------------------------------------
272
273 //------------------------------------
274 // Return to the primary variables (eq. 26c)
275
276 // Compute gamma \nabla z
277 Vmath::Smul(nq, gamma, physfield[0], 1, physfield[0], 1);
278
279 m_fields[0]->IProductWRTDerivBase(0, physfield[0], coeffsfield[0]);
280 m_fields[0]->IProductWRTDerivBase(1, physfield[0], coeffsfield[1]);
281
282 Vmath::Neg(ncoeffs, coeffsfield[0], 1);
283 Vmath::Neg(ncoeffs, coeffsfield[1], 1);
284
285 // Set boundary conditions
286 SetBoundaryConditionsContVariables(physfield[0], time);
287
288 // Evaluate upwind numerical flux (physical space)
289 NumericalFluxConsVariables(physfield[0], upwindX, upwindY);
290
291 Vmath::Vmul(nTraceNumPoints, upwindX, 1, m_traceNormals[0], 1,
292 normflux, 1);
293 m_fields[0]->AddTraceIntegral(normflux, coeffsfield[0]);
294 Vmath::Vmul(nTraceNumPoints, upwindY, 1, m_traceNormals[1], 1,
295 normflux, 1);
296 m_fields[0]->AddTraceIntegral(normflux, coeffsfield[1]);
297
298 // Solve the remaining block-diagonal systems
300 for (int i = 0; i < 2; ++i)
301 {
302 modarray[i] = Array<OneD, NekDouble>(ncoeffs);
303 }
304 m_fields[0]->IProductWRTBase(outarray[1], modarray[0]);
305 m_fields[0]->IProductWRTBase(outarray[2], modarray[1]);
306
307 Vmath::Vadd(ncoeffs, modarray[0], 1, coeffsfield[0], 1, modarray[0],
308 1);
309 Vmath::Vadd(ncoeffs, modarray[1], 1, coeffsfield[1], 1, modarray[1],
310 1);
311
312 m_fields[0]->MultiplyByElmtInvMass(modarray[0], modarray[0]);
313 m_fields[0]->MultiplyByElmtInvMass(modarray[1], modarray[1]);
314
315 m_fields[0]->BwdTrans(modarray[0], outarray[1]);
316 m_fields[0]->BwdTrans(modarray[1], outarray[2]);
317
318 //------------------------------------
319
320 break;
321 }
323 ASSERTL0(false, "Unknown projection scheme for the Peregrine");
324 break;
325 default:
326 ASSERTL0(false, "Unknown projection scheme for the NonlinearSWE");
327 break;
328 }
329}
330
335
336// initial condition Laitone's first order solitary wave
338 NekDouble time, NekDouble x_offset)
339{
340 int nq = GetTotPoints();
341
342 NekDouble A = 1.0;
343 NekDouble C = sqrt(m_g * d) * (1.0 + 0.5 * (amp / d));
344
347 Array<OneD, NekDouble> zeros(nq, 0.0);
348
349 // get the coordinates (assuming all fields have the same
350 // discretisation)
351 m_fields[0]->GetCoords(x0, x1);
352
353 for (int i = 0; i < nq; i++)
354 {
355 (m_fields[0]->UpdatePhys())[i] =
356 amp * pow((1.0 / cosh(sqrt(0.75 * (amp / (d * d * d))) *
357 (A * (x0[i] + x_offset) - C * time))),
358 2.0);
359 (m_fields[1]->UpdatePhys())[i] =
360 (amp / d) *
361 pow((1.0 / cosh(sqrt(0.75 * (amp / (d * d * d))) *
362 (A * (x0[i] + x_offset) - C * time))),
363 2.0) *
364 sqrt(m_g * d);
365 }
366
367 Vmath::Sadd(nq, d, m_fields[0]->GetPhys(), 1, m_fields[0]->UpdatePhys(), 1);
368 Vmath::Vmul(nq, m_fields[0]->GetPhys(), 1, m_fields[1]->GetPhys(), 1,
369 m_fields[1]->UpdatePhys(), 1);
370 Vmath::Vcopy(nq, zeros, 1, m_fields[2]->UpdatePhys(), 1);
371 Vmath::Vcopy(nq, zeros, 1, m_fields[3]->UpdatePhys(), 1);
372
373 // Forward transform to fill the coefficient space
374 for (int i = 0; i < 4; ++i)
375 {
376 m_fields[i]->SetPhysState(true);
377 m_fields[i]->FwdTrans(m_fields[i]->GetPhys(),
378 m_fields[i]->UpdateCoeffs());
379 }
380}
381
383{
384 // As of now we need not to specify any BC routine for the WCE: periodic
385 // and zero Neumann (for walls)
386
387 // Note: this is just valid for the constant depth case:
388
390
391 m_fields[3]->HelmSolve(fce, m_fields[3]->UpdateCoeffs(), m_factors);
392
393 m_fields[3]->BwdTrans(m_fields[3]->GetCoeffs(), m_fields[3]->UpdatePhys());
394
395 Vmath::Vcopy(fce.size(), m_fields[3]->GetPhys(), 1, fce, 1);
396}
397
400 [[maybe_unused]] NekDouble time)
401{
402 int cnt = 0;
403
404 // Loop over Boundary Regions
405 for (int n = 0; n < m_fields[0]->GetBndConditions().size(); ++n)
406 {
407 // Wall Boundary Condition
408 if (boost::iequals(m_fields[0]->GetBndConditions()[n]->GetUserDefined(),
409 "Wall"))
410 {
411 WallBoundaryForcing(n, cnt, inarray);
412 }
413
414 // Timedependent Boundary Condition
415 if (m_fields[0]->GetBndConditions()[n]->IsTimeDependent())
416 {
417 ASSERTL0(false, "time-dependent BC not implemented for Boussinesq");
418 }
419 cnt += m_fields[0]->GetBndCondExpansions()[n]->GetExpSize();
420 }
421}
422
424 int bcRegion, int cnt, Array<OneD, Array<OneD, NekDouble>> &inarray)
425{
426 int nTraceNumPoints = GetTraceTotPoints();
427
428 // Get physical values of f1 and f2 for the forward trace
430 for (int i = 0; i < 2; ++i)
431 {
432 Fwd[i] = Array<OneD, NekDouble>(nTraceNumPoints);
433 m_fields[i]->ExtractTracePhys(inarray[i], Fwd[i]);
434 }
435
436 // Adjust the physical values of the trace to take
437 // user defined boundaries into account
438 int id1, id2, npts;
440 m_fields[0]->GetBndCondExpansions()[bcRegion];
441
442 for (int e = 0; e < bcexp->GetExpSize(); ++e)
443 {
444 npts = bcexp->GetExp(e)->GetTotPoints();
445 id1 = bcexp->GetPhys_Offset(e);
446 id2 = m_fields[0]->GetTrace()->GetPhys_Offset(
447 m_fields[0]->GetTraceMap()->GetBndCondIDToGlobalTraceID(cnt + e));
448
449 switch (m_expdim)
450 {
451 case 1:
452 {
453 ASSERTL0(false, "1D not yet implemented for Boussinesq");
454 break;
455 }
456 case 2:
457 {
458 Array<OneD, NekDouble> tmp_n(npts);
459 Array<OneD, NekDouble> tmp_t(npts);
460
461 Vmath::Vmul(npts, &Fwd[0][id2], 1, &m_traceNormals[0][id2], 1,
462 &tmp_n[0], 1);
463 Vmath::Vvtvp(npts, &Fwd[1][id2], 1, &m_traceNormals[1][id2], 1,
464 &tmp_n[0], 1, &tmp_n[0], 1);
465
466 Vmath::Vmul(npts, &Fwd[0][id2], 1, &m_traceNormals[1][id2], 1,
467 &tmp_t[0], 1);
468 Vmath::Vvtvm(npts, &Fwd[1][id2], 1, &m_traceNormals[0][id2], 1,
469 &tmp_t[0], 1, &tmp_t[0], 1);
470
471 // Negate the normal flux
472 Vmath::Neg(npts, tmp_n, 1);
473
474 // Rotate back to Cartesian
475 Vmath::Vmul(npts, &tmp_t[0], 1, &m_traceNormals[1][id2], 1,
476 &Fwd[0][id2], 1);
477 Vmath::Vvtvm(npts, &tmp_n[0], 1, &m_traceNormals[0][id2], 1,
478 &Fwd[0][id2], 1, &Fwd[0][id2], 1);
479
480 Vmath::Vmul(npts, &tmp_t[0], 1, &m_traceNormals[0][id2], 1,
481 &Fwd[1][id2], 1);
482 Vmath::Vvtvp(npts, &tmp_n[0], 1, &m_traceNormals[1][id2], 1,
483 &Fwd[1][id2], 1, &Fwd[1][id2], 1);
484 break;
485 }
486 case 3:
487 ASSERTL0(false, "3D not implemented for Boussinesq equations");
488 break;
489 default:
490 ASSERTL0(false, "Illegal expansion dimension");
491 }
492
493 // Copy boundary adjusted values into the boundary expansion
494 bcexp = m_fields[1]->GetBndCondExpansions()[bcRegion];
495 Vmath::Vcopy(npts, &Fwd[0][id2], 1, &(bcexp->UpdatePhys())[id1], 1);
496
497 bcexp = m_fields[2]->GetBndCondExpansions()[bcRegion];
498 Vmath::Vcopy(npts, &Fwd[1][id2], 1, &(bcexp->UpdatePhys())[id1], 1);
499 }
500}
501
503 const Array<OneD, const Array<OneD, NekDouble>> &inarray,
505{
506 int nTraceNumPoints = GetTraceTotPoints();
507
508 //-----------------------------------------------------
509 // get temporary arrays
512
513 for (int i = 0; i < 2; ++i)
514 {
515 Fwd[i] = Array<OneD, NekDouble>(nTraceNumPoints);
516 Bwd[i] = Array<OneD, NekDouble>(nTraceNumPoints);
517 }
518 //-----------------------------------------------------
519
520 //-----------------------------------------------------
521 // get the physical values at the trace
522 // (any time-dependent BC previously put in fields[1] and [2]
523
524 m_fields[1]->GetFwdBwdTracePhys(inarray[0], Fwd[0], Bwd[0]);
525 m_fields[2]->GetFwdBwdTracePhys(inarray[1], Fwd[1], Bwd[1]);
526 //-----------------------------------------------------
527
528 //-----------------------------------------------------
529 // use centred fluxes for the numerical flux
530 for (int i = 0; i < nTraceNumPoints; ++i)
531 {
532 numfluxX[i] = 0.5 * (Fwd[0][i] + Bwd[0][i]);
533 numfluxY[i] = 0.5 * (Fwd[1][i] + Bwd[1][i]);
534 }
535 //-----------------------------------------------------
536}
537
539 const Array<OneD, const NekDouble> &inarray,
540 [[maybe_unused]] NekDouble time)
541{
542 int cnt = 0;
543
544 // Loop over Boundary Regions
545 for (int n = 0; n < m_fields[3]->GetBndConditions().size(); ++n)
546 {
547 // Wall Boundary Condition
548 if (boost::iequals(m_fields[3]->GetBndConditions()[n]->GetUserDefined(),
549 "Wall") ||
550 m_fields[3]->GetBndConditions()[n]->IsTimeDependent())
551 {
552 WallBoundaryContVariables(n, cnt, inarray);
553 }
554
555 cnt += m_fields[3]->GetBndCondExpansions()[n]->GetExpSize();
556 }
557}
558
560 int bcRegion, int cnt, const Array<OneD, const NekDouble> &inarray)
561{
562 int nTraceNumPoints = GetTraceTotPoints();
563
564 // Get physical values of z for the forward trace
565 Array<OneD, NekDouble> z(nTraceNumPoints);
566 m_fields[3]->ExtractTracePhys(inarray, z);
567
568 // Adjust the physical values of the trace to take
569 // user defined boundaries into account
570 int id1, id2, npts;
572 m_fields[3]->GetBndCondExpansions()[bcRegion];
573
574 for (int e = 0; e < bcexp->GetExpSize(); ++e)
575 {
576 npts = bcexp->GetExp(e)->GetTotPoints();
577 id1 = bcexp->GetPhys_Offset(e);
578 id2 = m_fields[3]->GetTrace()->GetPhys_Offset(
579 m_fields[3]->GetTraceMap()->GetBndCondIDToGlobalTraceID(cnt + e));
580
581 // Copy boundary adjusted values into the boundary expansion
582 // field[3]
583 bcexp = m_fields[3]->GetBndCondExpansions()[bcRegion];
584 Vmath::Vcopy(npts, &z[id2], 1, &(bcexp->UpdatePhys())[id1], 1);
585 }
586}
587
591{
592 int nTraceNumPoints = GetTraceTotPoints();
593
594 //-----------------------------------------------------
595 // get temporary arrays
596 Array<OneD, NekDouble> Fwd(nTraceNumPoints);
597 Array<OneD, NekDouble> Bwd(nTraceNumPoints);
598 //-----------------------------------------------------
599
600 //-----------------------------------------------------
601 // get the physical values at the trace
602 // (we have put any time-dependent BC in field[3])
603
604 m_fields[3]->GetFwdBwdTracePhys(physfield, Fwd, Bwd);
605 //-----------------------------------------------------
606
607 //-----------------------------------------------------
608 // use centred fluxes for the numerical flux
609 for (int i = 0; i < nTraceNumPoints; ++i)
610 {
611 outX[i] = 0.5 * (Fwd[i] + Bwd[i]);
612 outY[i] = 0.5 * (Fwd[i] + Bwd[i]);
613 }
614 //-----------------------------------------------------
615}
616
617} // namespace Nektar
#define ASSERTL0(condition, msg)
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
void DefineProjection(FuncPointerT func, ObjectPointerT obj)
void DefineImplicitSolve(FuncPointerT func, ObjectPointerT obj)
void v_SetInitialConditions(NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0) override
Set the initial conditions.
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
void SetBoundaryConditionsContVariables(const Array< OneD, const NekDouble > &inarray, NekDouble time)
void SetBoundaryConditionsForcing(Array< OneD, Array< OneD, NekDouble > > &inarray, NekDouble time)
void WallBoundaryForcing(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &inarray)
void v_GenerateSummary(SolverUtils::SummaryList &s) override
Virtual function for generating summary information.
void LaitoneSolitaryWave(NekDouble amp, NekDouble d, NekDouble time, NekDouble x_offset)
static std::string className
Name of class.
void NumericalFluxForcing(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &numfluxX, Array< OneD, NekDouble > &numfluxY)
StdRegions::ConstFactorMap m_factors
void v_InitObject(bool DeclareFields=true) override
Initialisation object for EquationSystem.
NonlinearPeregrine(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
void WallBoundaryContVariables(int bcRegion, int cnt, const Array< OneD, const NekDouble > &inarray)
void WCESolve(Array< OneD, NekDouble > &fce, NekDouble lambda)
void v_DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time) override
void NumericalFluxConsVariables(const Array< OneD, const NekDouble > &physfield, Array< OneD, NekDouble > &outX, Array< OneD, NekDouble > &outY)
void v_GenerateSummary(SolverUtils::SummaryList &s) override
Virtual function for generating summary information.
void v_InitObject(bool DeclareFields=true) override
Initialisation object for EquationSystem.
NekDouble m_g
Acceleration of gravity.
void AddCoriolis(const Array< OneD, const Array< OneD, NekDouble > > &physarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
void DoOdeProjection(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
SolverUtils::AdvectionSharedPtr m_advection
bool m_constantDepth
Indicates if constant depth case.
Array< OneD, NekDouble > m_coriolis
Coriolis force.
void DoImplicitSolve(const Array< OneD, const Array< OneD, NekDouble > > &inpnts, Array< OneD, Array< OneD, NekDouble > > &outpnt, const NekDouble time, const NekDouble lambda)
virtual SOLVER_UTILS_EXPORT void v_SetInitialConditions(NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
LibUtilities::CommSharedPtr m_comm
Communicator.
NekDouble m_time
Current time of simulation.
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
SOLVER_UTILS_EXPORT int GetNcoeffs()
SOLVER_UTILS_EXPORT void Checkpoint_Output(const int n)
Write checkpoint file of m_fields.
SOLVER_UTILS_EXPORT void WriteFld(const std::string &outname)
Write field data to the given filename.
std::string m_sessionName
Name of the session.
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 GetTotPoints()
int m_nchk
Number of checkpoints written so far.
enum MultiRegions::ProjectionType m_projectionType
Type of projection; e.g continuous or discontinuous.
SOLVER_UTILS_EXPORT int GetTraceTotPoints()
LibUtilities::FieldMetaDataMap m_fieldMetaDataMap
Map to identify relevant solver info to dump in output fields.
int m_checksteps
Number of steps between checkpoints.
LibUtilities::TimeIntegrationSchemeOperators m_ode
The time integration scheme operators to use.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::vector< std::pair< std::string, std::string > > SummaryList
Definition Misc.h:46
EquationSystemFactory & GetEquationSystemFactory()
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition MeshGraph.h:224
static Array< OneD, Array< OneD, NekDouble > > NullNekDoubleArrayOfArray
const char *const ProblemTypeMap[]
@ SIZE_ProblemType
Length of enum list.
@ eSolitaryWave
First order Laitone solitary wave.
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.hpp:72
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition Vmath.hpp:292
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.hpp:366
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.hpp:180
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 minus vector): z = w*x - y
Definition Vmath.hpp:381
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
Definition Vmath.hpp:100
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.hpp:194
void Vvtvvtp(int n, const T *v, int incv, const T *w, int incw, const T *x, int incx, const T *y, int incy, T *z, int incz)
vvtvvtp (vector times vector plus vector times vector):
Definition Vmath.hpp:439
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition Vmath.hpp:825
scalarT< T > sqrt(scalarT< T > in)
Definition scalar.hpp:290