Nektar++
ShallowWaterSystem.cpp
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: ShallowWaterSystem.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: Generic timestepping for shallow water solvers
32//
33///////////////////////////////////////////////////////////////////////////////
34
35#include <iostream>
36
38
39namespace Nektar
40{
41/**
42 * @class ShallowWaterSystem
43 *
44 * Provides the underlying timestepping framework for shallow water flow solvers
45 * including the general timestepping routines. This class is not intended
46 * to be directly instantiated, but rather is a base class on which to
47 * define shallow water solvers, e.g. SWE, Boussinesq, linear and nonlinear
48 * versions.
49 *
50 * For details on implementing unsteady solvers see
51 * \ref sectionADRSolverModuleImplementation
52 */
53
54/**
55 * Processes SolverInfo parameters from the session file and sets up
56 * timestepping-specific code.
57 * @param pSession Session object to read parameters from.
58 */
59
62 "ShallowWaterSystem", ShallowWaterSystem::create,
63 "Auxiliary functions for the shallow water system.");
64
68 : UnsteadySystem(pSession, pGraph)
69{
70}
71
72void ShallowWaterSystem::v_InitObject(bool DeclareFields)
73{
74 UnsteadySystem::v_InitObject(DeclareFields);
75
76 // Set up locations of velocity vector.
79 for (int i = 0; i < m_spacedim; ++i)
80 {
81 m_vecLocs[0][i] = 1 + i;
82 }
83
84 // Load acceleration of gravity
85 m_session->LoadParameter("Gravity", m_g, 9.81);
86
88
89 m_constantDepth = true;
90 NekDouble depth = m_depth[0];
91 for (int i = 0; i < GetTotPoints(); ++i)
92 {
93 if (m_depth[i] != depth)
94 {
95 m_constantDepth = false;
96 break;
97 }
98 }
99
100 // Compute the bottom slopes
101 int nq = GetTotPoints();
102 if (m_constantDepth != true)
103 {
105 for (int i = 0; i < m_spacedim; ++i)
106 {
109 m_bottomSlope[i]);
110 Vmath::Neg(nq, m_bottomSlope[i], 1);
111 }
112 }
113
115
117 {
119 }
120}
121
123 [[maybe_unused]] const Array<OneD, const Array<OneD, NekDouble>> &inarray,
124 [[maybe_unused]] Array<OneD, Array<OneD, NekDouble>> &outarray,
125 [[maybe_unused]] const NekDouble time)
126{
127}
128
130{
133 m_constantDepth ? "constant" : "variable");
134}
135
137{
138 unsigned int nvariables = m_fields.size();
139 int ntotal = nvariables * m_fields[0]->GetNpoints();
140
141 // Create the key to hold settings for nonlin solver
143
144 // Load required LinSys parameters:
145 m_session->LoadParameter("NekLinSysMaxIterations",
147 m_session->LoadParameter("LinSysMaxStorage", key.m_LinSysMaxStorage, 30);
148 m_session->LoadParameter("LinSysRelativeTolInNonlin",
149 key.m_NekLinSysTolerance, 5.0E-2);
150 m_session->LoadParameter("GMRESMaxHessMatBand", key.m_KrylovMaxHessMatBand,
151 31);
152
153 // Load required NonLinSys parameters:
154 m_session->LoadParameter("JacobiFreeEps", m_jacobiFreeEps, 5.0E-8);
155 m_session->LoadParameter("NekNonlinSysMaxIterations",
157 m_session->LoadParameter("NewtonRelativeIteTol",
158 key.m_NekNonLinSysTolerance, 1.0E-12);
159 WARNINGL0(!m_session->DefinesParameter("NewtonAbsoluteIteTol"),
160 "Please specify NewtonRelativeIteTol instead of "
161 "NewtonAbsoluteIteTol in XML session file");
162 m_session->LoadParameter("NonlinIterTolRelativeL2",
163 key.m_NonlinIterTolRelativeL2, 1.0E-3);
164 m_session->LoadSolverInfo("LinSysIterSolverTypeInNonlin",
165 key.m_LinSysIterSolverTypeInNonlin, "GMRES");
166
169 this);
171 this);
173
174 // Initialize non-linear system
176 "Newton", m_session, m_comm->GetRowComm(), ntotal, key);
177 m_nonlinsol->SetSysOperators(nekSysOp);
178}
179
181 const Array<OneD, const Array<OneD, NekDouble>> &inpnts,
182 Array<OneD, Array<OneD, NekDouble>> &outpnt, const NekDouble time,
183 const NekDouble lambda)
184{
185 m_TimeIntegLambda = lambda;
186 m_bndEvaluateTime = time;
187 unsigned int npoints = m_fields[0]->GetNpoints();
188 unsigned int nvariables = m_fields.size();
189
190 Array<OneD, NekDouble> inarray(nvariables * npoints);
191 Array<OneD, NekDouble> outarray(nvariables * npoints);
193
194 for (int i = 0; i < nvariables; ++i)
195 {
196 int noffset = i * npoints;
197 Vmath::Vcopy(npoints, inpnts[i], 1, tmp = inarray + noffset, 1);
198 }
199
200 DoImplicitSolve1D(inarray, outarray);
201
202 for (int i = 0; i < nvariables; ++i)
203 {
204 int noffset = i * npoints;
205 Vmath::Vcopy(npoints, outarray + noffset, 1, outpnt[i], 1);
206 }
207}
208
211{
212 CalcRefValues(inarray);
213
214 m_nonlinsol->SetRhsMagnitude(m_inArrayNorm);
215
216 m_TotNewtonIts += m_nonlinsol->SolveSystem(inarray.size(), inarray, out, 0);
217
218 m_TotLinIts += m_nonlinsol->GetNtotLinSysIts();
219
221}
222
224 const Array<OneD, const NekDouble> &inarray)
225{
226 unsigned int npoints = m_fields[0]->GetNpoints();
227
228 Array<OneD, NekDouble> magnitdEstimat(3, 0.0);
229
230 for (int i = 0; i < 3; ++i)
231 {
232 int offset = i * npoints;
233 magnitdEstimat[i] =
234 Vmath::Dot(npoints, inarray + offset, inarray + offset);
235 }
236 m_comm->GetSpaceComm()->AllReduce(magnitdEstimat,
238
239 m_inArrayNorm = 0.0;
240 for (int i = 0; i < 3; ++i)
241 {
242 m_inArrayNorm += magnitdEstimat[i];
243 }
244}
245
248 [[maybe_unused]] const bool &flag)
249{
250 unsigned int npoints = m_fields[0]->GetNpoints();
251 unsigned int nvariables = m_fields.size();
252 Array<OneD, Array<OneD, NekDouble>> in2D(nvariables);
253 Array<OneD, Array<OneD, NekDouble>> out2D(nvariables);
254 for (int i = 0; i < nvariables; ++i)
255 {
256 int offset = i * npoints;
257 in2D[i] = inarray + offset;
258 out2D[i] = out + offset;
259 }
260 NonlinSysEvaluator(in2D, out2D);
261}
262
264 const Array<OneD, const Array<OneD, NekDouble>> &inarray,
266{
267 unsigned int npoints = m_fields[0]->GetNpoints();
268 unsigned int nvariables = m_fields.size();
269 Array<OneD, Array<OneD, NekDouble>> inpnts(nvariables);
270 for (int i = 0; i < nvariables; ++i)
271 {
272 inpnts[i] = Array<OneD, NekDouble>(npoints, 0.0);
273 }
274
275 DoOdeProjection(inarray, inpnts, m_bndEvaluateTime);
276 v_DoOdeRhs(inpnts, out, m_bndEvaluateTime);
277
278 for (int i = 0; i < nvariables; ++i)
279 {
280 Vmath::Svtvp(npoints, -m_TimeIntegLambda, out[i], 1, inarray[i], 1,
281 out[i], 1);
282 Vmath::Vsub(npoints, out[i], 1,
283 m_nonlinsol->GetRefSourceVec() + i * npoints, 1, out[i], 1);
284 }
285}
286
289 [[maybe_unused]] const bool &flag)
290{
291 const Array<OneD, const NekDouble> solref = m_nonlinsol->GetRefSolution();
292 const Array<OneD, const NekDouble> resref = m_nonlinsol->GetRefResidual();
293
294 unsigned int ntotal = inarray.size();
295 NekDouble magninarray = Vmath::Dot(ntotal, inarray, inarray);
296 m_comm->GetSpaceComm()->AllReduce(magninarray,
298 NekDouble eps =
299 m_jacobiFreeEps * sqrt((sqrt(m_inArrayNorm) + 1.0) / magninarray);
300
301 Array<OneD, NekDouble> solplus{ntotal};
302 Array<OneD, NekDouble> resplus{ntotal};
303
304 Vmath::Svtvp(ntotal, eps, inarray, 1, solref, 1, solplus, 1);
305 NonlinSysEvaluator1D(solplus, resplus, flag);
306 Vmath::Vsub(ntotal, resplus, 1, resref, 1, out, 1);
307 Vmath::Smul(ntotal, 1.0 / eps, out, 1, out, 1);
308}
309
311 const Array<OneD, const NekDouble> &inarray,
312 Array<OneD, NekDouble> &outarray, [[maybe_unused]] const bool &flag)
313{
314 Vmath::Vcopy(inarray.size(), inarray, 1, outarray, 1);
315}
316
318 const Array<OneD, const Array<OneD, NekDouble>> &inarray,
319 Array<OneD, Array<OneD, NekDouble>> &outarray, const NekDouble time)
320{
321 int nvariables = inarray.size();
322
323 switch (m_projectionType)
324 {
326 {
327 // Just copy over array
328 if (inarray != outarray)
329 {
330 int npoints = GetNpoints();
331
332 for (int i = 0; i < nvariables; ++i)
333 {
334 Vmath::Vcopy(npoints, inarray[i], 1, outarray[i], 1);
335 }
336 }
337
338 SetBoundaryConditions(outarray, time);
339 break;
340 }
342 {
344 Array<OneD, NekDouble> coeffs(m_fields[0]->GetNcoeffs(), 0.0);
345
346 for (int i = 0; i < nvariables; ++i)
347 {
348 m_fields[i]->FwdTrans(inarray[i], coeffs);
349 m_fields[i]->BwdTrans(coeffs, outarray[i]);
350 }
351 break;
352 }
353 default:
354 ASSERTL0(false, "Unknown projection scheme");
355 break;
356 }
357}
358
360 const Array<OneD, const Array<OneD, NekDouble>> &inarray, NekDouble time)
361{
362 std::string varName;
363 int nvariables = 3;
364 int cnt = 0;
365 int nTracePts = GetTraceTotPoints();
366
367 // Extract trace for boundaries. Needs to be done on all processors to avoid
368 // deadlock.
369 Array<OneD, Array<OneD, NekDouble>> Fwd(nvariables);
370 for (int i = 0; i < nvariables; ++i)
371 {
372 Fwd[i] = Array<OneD, NekDouble>(nTracePts);
373 m_fields[i]->ExtractTracePhys(inarray[i], Fwd[i]);
374 }
375
376 // Loop over Boundary Regions
377 for (int n = 0; n < m_fields[0]->GetBndConditions().size(); ++n)
378 {
379 if (m_fields[0]->GetBndConditions()[n]->GetBoundaryConditionType() ==
381 {
382 continue;
383 }
384
385 // Wall Boundary Condition
386 if (boost::iequals(m_fields[0]->GetBndConditions()[n]->GetUserDefined(),
387 "Wall"))
388 {
389 WallBoundary2D(n, cnt, Fwd);
390 }
391
392 // Time Dependent Boundary Condition (specified in meshfile)
393 if (m_fields[0]->GetBndConditions()[n]->IsTimeDependent())
394 {
395 for (int i = 0; i < nvariables; ++i)
396 {
397 varName = m_session->GetVariable(i);
398 m_fields[i]->EvaluateBoundaryConditions(time, varName);
399 }
400 }
401 cnt += m_fields[0]->GetBndCondExpansions()[n]->GetExpSize();
402 }
403}
404
406 int bcRegion, int cnt, Array<OneD, Array<OneD, NekDouble>> &Fwd)
407{
408 int nvariables = 3;
409
410 // Adjust the physical values of the trace to take
411 // user defined boundaries into account
412 int id1, id2, npts;
413
414 for (int e = 0;
415 e < m_fields[0]->GetBndCondExpansions()[bcRegion]->GetExpSize(); ++e)
416 {
417 npts = m_fields[0]
418 ->GetBndCondExpansions()[bcRegion]
419 ->GetExp(e)
420 ->GetNumPoints(0);
421 id1 = m_fields[0]->GetBndCondExpansions()[bcRegion]->GetPhys_Offset(e);
422 id2 = m_fields[0]->GetTrace()->GetPhys_Offset(
423 m_fields[0]->GetTraceMap()->GetBndCondIDToGlobalTraceID(cnt + e));
424
425 switch (m_expdim)
426 {
427 case 1:
428 {
429 // negate the forward flux
430 Vmath::Neg(npts, &Fwd[1][id2], 1);
431 }
432 break;
433 case 2:
434 {
435 Array<OneD, NekDouble> tmp_n(npts);
436 Array<OneD, NekDouble> tmp_t(npts);
437
438 Vmath::Vmul(npts, &Fwd[1][id2], 1, &m_traceNormals[0][id2], 1,
439 &tmp_n[0], 1);
440 Vmath::Vvtvp(npts, &Fwd[2][id2], 1, &m_traceNormals[1][id2], 1,
441 &tmp_n[0], 1, &tmp_n[0], 1);
442
443 Vmath::Vmul(npts, &Fwd[1][id2], 1, &m_traceNormals[1][id2], 1,
444 &tmp_t[0], 1);
445 Vmath::Vvtvm(npts, &Fwd[2][id2], 1, &m_traceNormals[0][id2], 1,
446 &tmp_t[0], 1, &tmp_t[0], 1);
447
448 // negate the normal flux
449 Vmath::Neg(npts, tmp_n, 1);
450
451 // rotate back to Cartesian
452 Vmath::Vmul(npts, &tmp_t[0], 1, &m_traceNormals[1][id2], 1,
453 &Fwd[1][id2], 1);
454 Vmath::Vvtvm(npts, &tmp_n[0], 1, &m_traceNormals[0][id2], 1,
455 &Fwd[1][id2], 1, &Fwd[1][id2], 1);
456
457 Vmath::Vmul(npts, &tmp_t[0], 1, &m_traceNormals[0][id2], 1,
458 &Fwd[2][id2], 1);
459 Vmath::Vvtvp(npts, &tmp_n[0], 1, &m_traceNormals[1][id2], 1,
460 &Fwd[2][id2], 1, &Fwd[2][id2], 1);
461 }
462 break;
463 case 3:
464 ASSERTL0(false,
465 "3D not implemented for Shallow Water Equations");
466 break;
467 default:
468 ASSERTL0(false, "Illegal expansion dimension");
469 }
470
471 // copy boundary adjusted values into the boundary expansion
472 for (int i = 0; i < nvariables; ++i)
473 {
474 Vmath::Vcopy(npts, &Fwd[i][id2], 1,
475 &(m_fields[i]
476 ->GetBndCondExpansions()[bcRegion]
477 ->UpdatePhys())[id1],
478 1);
479 }
480 }
481}
482
483// physarray contains the conservative variables
485 const Array<OneD, const Array<OneD, NekDouble>> &physarray,
487{
488 int ncoeffs = GetNcoeffs();
489 int nq = GetTotPoints();
490
492 Array<OneD, NekDouble> mod(ncoeffs);
493
494 switch (m_projectionType)
495 {
497 {
498 // add to u equation
499 Vmath::Vmul(nq, m_coriolis, 1, physarray[2], 1, tmp, 1);
500 m_fields[0]->IProductWRTBase(tmp, mod);
501 m_fields[0]->MultiplyByElmtInvMass(mod, mod);
502 m_fields[0]->BwdTrans(mod, tmp);
503 Vmath::Vadd(nq, tmp, 1, outarray[1], 1, outarray[1], 1);
504
505 // add to v equation
506 Vmath::Vmul(nq, m_coriolis, 1, physarray[1], 1, tmp, 1);
507 Vmath::Neg(nq, tmp, 1);
508 m_fields[0]->IProductWRTBase(tmp, mod);
509 m_fields[0]->MultiplyByElmtInvMass(mod, mod);
510 m_fields[0]->BwdTrans(mod, tmp);
511 Vmath::Vadd(nq, tmp, 1, outarray[2], 1, outarray[2], 1);
512 }
513 break;
515 {
516 // add to u equation
517 Vmath::Vmul(nq, m_coriolis, 1, physarray[2], 1, tmp, 1);
518 Vmath::Vadd(nq, tmp, 1, outarray[1], 1, outarray[1], 1);
519
520 // add to v equation
521 Vmath::Vmul(nq, m_coriolis, 1, physarray[1], 1, tmp, 1);
522 Vmath::Neg(nq, tmp, 1);
523 Vmath::Vadd(nq, tmp, 1, outarray[2], 1, outarray[2], 1);
524 }
525 break;
526 default:
527 ASSERTL0(false, "Unknown projection scheme for the NonlinearSWE");
528 break;
529 }
530}
531
533{
534 int nq = GetTotPoints();
535
536 // \eta = h - d
537 Vmath::Vsub(nq, m_fields[0]->GetPhys(), 1, m_depth, 1,
538 m_fields[0]->UpdatePhys(), 1);
539
540 // u = hu / h
541 Vmath::Vdiv(nq, m_fields[1]->GetPhys(), 1, m_fields[0]->GetPhys(), 1,
542 m_fields[1]->UpdatePhys(), 1);
543
544 // v = hv / v
545 Vmath::Vdiv(nq, m_fields[2]->GetPhys(), 1, m_fields[0]->GetPhys(), 1,
546 m_fields[2]->UpdatePhys(), 1);
547}
548
550{
551 int nq = GetTotPoints();
552
553 // h = \eta + d
554 Vmath::Vadd(nq, m_fields[0]->GetPhys(), 1, m_depth, 1,
555 m_fields[0]->UpdatePhys(), 1);
556
557 // hu = h * u
558 Vmath::Vmul(nq, m_fields[0]->GetPhys(), 1, m_fields[1]->GetPhys(), 1,
559 m_fields[1]->UpdatePhys(), 1);
560
561 // hv = h * v
562 Vmath::Vmul(nq, m_fields[0]->GetPhys(), 1, m_fields[2]->GetPhys(), 1,
563 m_fields[2]->UpdatePhys(), 1);
564}
565
567{
568 GetFunction("WaterDepth")->Evaluate("d", m_depth);
569}
570
572{
573 GetFunction("Coriolis")->Evaluate("f", m_coriolis);
574}
575
576} // namespace Nektar
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
#define WARNINGL0(condition, msg)
Definition: ErrorUtil.hpp:215
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
NekDouble m_NonlinIterTolRelativeL2
Definition: NekSys.h:221
std::string m_LinSysIterSolverTypeInNonlin
Definition: NekSys.h:222
void DefineNekSysResEval(FuncPointerT func, ObjectPointerT obj)
Definition: NekSys.h:100
void DefineNekSysLhsEval(FuncPointerT func, ObjectPointerT obj)
Definition: NekSys.h:107
void DefineNekSysPrecon(FuncPointerT func, ObjectPointerT obj)
Definition: NekSys.h:114
NekDouble m_g
Acceleration of gravity.
void MatrixMultiplyMatrixFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out, const bool &flag)
static std::string className
Name of class.
void WallBoundary2D(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd)
Array< OneD, Array< OneD, NekDouble > > m_bottomSlope
void DoImplicitSolve1D(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out)
void SetBoundaryConditions(const Array< OneD, const Array< OneD, NekDouble > > &physarray, NekDouble time)
void AddCoriolis(const Array< OneD, const Array< OneD, NekDouble > > &physarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
LibUtilities::NekNonlinSysIterSharedPtr m_nonlinsol
void DoOdeProjection(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
void NonlinSysEvaluator(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &out)
void DoNullPrecon(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const bool &flag)
virtual void v_DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
bool m_constantDepth
Indicates if constant depth case.
void v_GenerateSummary(SolverUtils::SummaryList &s) override
Print a summary of time stepping parameters.
ShallowWaterSystem(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Initialises UnsteadySystem class members.
Array< OneD, NekDouble > m_coriolis
Coriolis force.
void NonlinSysEvaluator1D(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out, const bool &flag)
void DoImplicitSolve(const Array< OneD, const Array< OneD, NekDouble > > &inpnts, Array< OneD, Array< OneD, NekDouble > > &outpnt, const NekDouble time, const NekDouble lambda)
Array< OneD, Array< OneD, NekDouble > > m_vecLocs
Array< OneD, NekDouble > m_depth
Still water depth.
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
void v_InitObject(bool DeclareFields=true) override
Init object for UnsteadySystem class.
void CalcRefValues(const Array< OneD, const NekDouble > &inarray)
int m_spacedim
Spatial dimension (>= expansion dim).
int m_expdim
Expansion dimension.
LibUtilities::CommSharedPtr m_comm
Communicator.
SOLVER_UTILS_EXPORT int GetTraceTotPoints()
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
SOLVER_UTILS_EXPORT int GetExpSize()
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 GetNpoints()
SOLVER_UTILS_EXPORT int GetNcoeffs()
enum MultiRegions::ProjectionType m_projectionType
Type of projection; e.g continuous or discontinuous.
SOLVER_UTILS_EXPORT void SetBoundaryConditions(NekDouble time)
Evaluates the boundary conditions at the given time.
SOLVER_UTILS_EXPORT SessionFunctionSharedPtr GetFunction(std::string name, const MultiRegions::ExpListSharedPtr &field=MultiRegions::NullExpListSharedPtr, bool cache=false)
Get a SessionFunction by name.
SOLVER_UTILS_EXPORT int GetTotPoints()
Base class for unsteady solvers.
bool m_explicitAdvection
Indicates if explicit or implicit treatment of advection is used.
SOLVER_UTILS_EXPORT void v_GenerateSummary(SummaryList &s) override
Print a summary of time stepping parameters.
SOLVER_UTILS_EXPORT void v_InitObject(bool DeclareField=true) override
Init object for UnsteadySystem class.
NekNonlinSysIterFactory & GetNekNonlinSysIterFactory()
std::shared_ptr< SessionReader > SessionReaderSharedPtr
MultiRegions::Direction const DirCartesianMap[]
Definition: ExpList.h:87
std::vector< std::pair< std::string, std::string > > SummaryList
Definition: Misc.h:46
EquationSystemFactory & GetEquationSystemFactory()
void AddSummaryItem(SummaryList &l, const std::string &name, const std::string &value)
Adds a summary item to the summary info list.
Definition: Misc.cpp:47
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:174
double NekDouble
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 Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Svtvp (scalar times vector plus vector): z = alpha*x + y.
Definition: Vmath.hpp:396
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
T Dot(int n, const T *w, const T *x)
dot product
Definition: Vmath.hpp:761
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 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.hpp:126
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.hpp:825
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.hpp:220
scalarT< T > sqrt(scalarT< T > in)
Definition: scalar.hpp:294