Nektar++
AcousticSystem.cpp
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: AcousticSystem.cpp
4//
5// For more information, please see: http://www.nektar.info
6//
7// The MIT License
8//
9// Copyright (c) 2018 Kilian Lackhove
10// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
11// Department of Aeronautics, Imperial College London (UK), and Scientific
12// Computing and Imaging Institute, University of Utah (USA).
13//
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: AcousticSystem
33//
34///////////////////////////////////////////////////////////////////////////////
35
36#include <iostream>
37
38// Define variable to avoid deprecated warning in Boost 1.69.
39#include <boost/version.hpp>
40#if BOOST_VERSION >= 106900 && BOOST_VERSION < 107000
41#define BOOST_ALLOW_DEPRECATED_HEADERS
42#endif
43
44#include <boost/random/normal_distribution.hpp>
45#include <boost/random/variate_generator.hpp>
46
48
50
51using namespace std;
52
53namespace Nektar
54{
55
59 : UnsteadySystem(pSession, pGraph), AdvectionSystem(pSession, pGraph),
60 m_ip(-1), m_irho(-1), m_iu(1), m_conservative(false)
61{
62}
63
64/**
65 * @brief Initialization object for the AcousticSystem class.
66 */
67void AcousticSystem::v_InitObject(bool DeclareFields)
68{
69 AdvectionSystem::v_InitObject(DeclareFields);
70
73 "Only Projection=DisContinuous supported by the AcousticSystem class.");
74
75 m_bfNames.push_back("c0sq");
76 m_bfNames.push_back("rho0");
77 m_bfNames.push_back("u0");
78 m_bfNames.push_back("v0");
79 m_bfNames.push_back("w0");
80
81 // Resize the advection velocities vector to dimension of the problem
82 m_bfNames.resize(m_spacedim + 2);
83
85 m_fields, m_fields.size());
86
87 // Do not forwards transform initial condition
88 m_homoInitialFwd = false;
89
90 // Set up locations of velocity and base velocity vectors.
93 for (int i = 0; i < m_spacedim; ++i)
94 {
95 // u', v', w'
96 m_vecLocs[0][i] = m_iu + i;
97 }
98
99 if (m_session->DefinesElement("Nektar/Coupling"))
100 {
101 TiXmlElement *vCoupling = m_session->GetElement("Nektar/Coupling");
102
103 ASSERTL0(vCoupling->Attribute("TYPE"),
104 "Missing TYPE attribute in Coupling");
105 string vType = vCoupling->Attribute("TYPE");
106 ASSERTL0(!vType.empty(),
107 "TYPE attribute must be non-empty in Coupling");
108
109 m_coupling = GetCouplingFactory().CreateInstance(vType, m_fields[0]);
110 }
111
113 m_whiteNoiseBC_p = 0.0;
114}
115
116/**
117 * @brief Destructor for AcousticSystem class.
118 */
120{
121}
122
123/**
124 * @brief v_PreIntegrate
125 */
127{
128 GetFunction("Baseflow", m_fields[0], true)
129 ->Evaluate(m_bfNames, m_bf, m_time);
130
131 if (m_coupling)
132 {
133 int numForceFields = 0;
134 for (auto &x : m_forcing)
135 {
136 numForceFields += x->GetForces().size();
137 }
138 vector<string> varNames;
140 m_fields.size() + m_bfNames.size() + numForceFields);
141 for (int i = 0; i < m_fields.size(); ++i)
142 {
143 varNames.push_back(m_session->GetVariable(i));
144 phys[i] = m_fields[i]->UpdatePhys();
145 }
146 for (int i = 0; i < m_bfNames.size(); ++i)
147 {
148 varNames.push_back(m_bfNames[i]);
149 phys[m_fields.size() + i] = m_bf[i];
150 }
151
152 int f = 0;
153 for (auto &x : m_forcing)
154 {
155 for (int i = 0; i < x->GetForces().size(); ++i)
156 {
157 phys[m_fields.size() + m_bfNames.size() + f + i] =
158 x->GetForces()[i];
159 varNames.push_back("F_" + boost::lexical_cast<string>(f) + "_" +
160 m_session->GetVariable(i));
161 }
162 f++;
163 }
164
165 m_coupling->Send(step, m_time, phys, varNames);
166 m_coupling->Receive(step, m_time, phys, varNames);
167 }
168
170}
171
173{
174 if (m_coupling)
175 {
176 m_coupling->Finalize();
177 }
178
180}
181
182/**
183 * @brief Compute the right-hand side.
184 */
186 const Array<OneD, const Array<OneD, NekDouble>> &inarray,
187 Array<OneD, Array<OneD, NekDouble>> &outarray, const NekDouble time)
188{
189 int nVariables = inarray.size();
190 int nq = GetTotPoints();
191
192 // WeakDG does not use advVel, so we only provide a dummy array
194 m_advection->Advect(nVariables, m_fields, advVel, inarray, outarray, time);
195
196 // Negate the LHS terms
197 for (int i = 0; i < nVariables; ++i)
198 {
199 Vmath::Neg(nq, outarray[i], 1);
200 }
201
202 v_AddLinTerm(inarray, outarray);
203
204 for (auto &x : m_forcing)
205 {
206 x->Apply(m_fields, inarray, outarray, m_time);
207 }
208}
209
210/**
211 * @brief Compute the projection and call the method for imposing the
212 * boundary conditions in case of discontinuous projection.
213 */
215 const Array<OneD, const Array<OneD, NekDouble>> &inarray,
216 Array<OneD, Array<OneD, NekDouble>> &outarray, const NekDouble time)
217{
218 int nvariables = inarray.size();
219 int nq = m_fields[0]->GetNpoints();
220
221 // deep copy
222 if (inarray != outarray)
223 {
224 for (int i = 0; i < nvariables; ++i)
225 {
226 Vmath::Vcopy(nq, inarray[i], 1, outarray[i], 1);
227 }
228 }
229
231
232 SetBoundaryConditions(outarray, time);
233}
234
235/**
236 * @brief Apply the Boundary Conditions to the AcousticSystem equations.
237 */
240{
241 std::string varName;
242 int nvariables = m_fields.size();
243 int cnt = 0;
244 int nTracePts = GetTraceTotPoints();
245
246 // Extract trace for boundaries. Needs to be done on all processors to avoid
247 // deadlock.
248 Array<OneD, Array<OneD, NekDouble>> Fwd(nvariables);
249 for (int i = 0; i < nvariables; ++i)
250 {
251 Fwd[i] = Array<OneD, NekDouble>(nTracePts);
252 m_fields[i]->ExtractTracePhys(inarray[i], Fwd[i]);
253 }
255
256 // loop over Boundary Regions
257 for (int n = 0; n < m_fields[0]->GetBndConditions().size(); ++n)
258 {
259 std::string userDefStr =
260 m_fields[0]->GetBndConditions()[n]->GetUserDefined();
261
262 if (!userDefStr.empty())
263 {
264 // Wall Boundary Condition
265 if (boost::iequals(userDefStr, "Wall"))
266 {
267 WallBC(n, cnt, Fwd, inarray);
268 }
269 else if (boost::iequals(userDefStr, "WhiteNoise"))
270 {
271 WhiteNoiseBC(n, cnt, Fwd, bfFwd, inarray);
272 }
273 else if (boost::iequals(userDefStr, "RiemannInvariantBC"))
274 {
275 v_RiemannInvariantBC(n, cnt, Fwd, bfFwd, inarray);
276 }
277 else if (boost::iequals(userDefStr, "TimeDependent"))
278 {
279 for (int i = 0; i < nvariables; ++i)
280 {
281 varName = m_session->GetVariable(i);
282 m_fields[i]->EvaluateBoundaryConditions(time, varName);
283 }
284 }
285 else
286 {
287 string errmsg = "Unrecognised boundary condition: ";
288 errmsg += userDefStr;
289 ASSERTL0(false, errmsg.c_str());
290 }
291 }
292 else
293 {
294 for (int i = 0; i < nvariables; ++i)
295 {
296 varName = m_session->GetVariable(i);
297 m_fields[i]->EvaluateBoundaryConditions(time, varName);
298 }
299 }
300
301 cnt += m_fields[0]->GetBndCondExpansions()[n]->GetExpSize();
302 }
303}
304
305/**
306 * @brief Wall boundary conditions for the AcousticSystem equations.
307 */
308void AcousticSystem::WallBC(int bcRegion, int cnt,
310 Array<OneD, Array<OneD, NekDouble>> &physarray)
311{
312 int nVariables = physarray.size();
313
314 const Array<OneD, const int> &traceBndMap = m_fields[0]->GetTraceBndMap();
315
316 // Adjust the physical values of the trace to take
317 // user defined boundaries into account
318 int id1, id2, nBCEdgePts;
319 int eMax = m_fields[0]->GetBndCondExpansions()[bcRegion]->GetExpSize();
320
321 for (int e = 0; e < eMax; ++e)
322 {
323 nBCEdgePts = m_fields[0]
324 ->GetBndCondExpansions()[bcRegion]
325 ->GetExp(e)
326 ->GetTotPoints();
327 id1 = m_fields[0]->GetBndCondExpansions()[bcRegion]->GetPhys_Offset(e);
328 id2 = m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt + e]);
329
330 // For 2D/3D, define: v* = v - 2(v.n)n
331 Array<OneD, NekDouble> tmp(nBCEdgePts, 0.0);
332
333 // Calculate (v.n)
334 for (int i = 0; i < m_spacedim; ++i)
335 {
336 Vmath::Vvtvp(nBCEdgePts, &Fwd[m_iu + i][id2], 1,
337 &m_traceNormals[i][id2], 1, &tmp[0], 1, &tmp[0], 1);
338 }
339
340 // Calculate 2.0(v.n)
341 Vmath::Smul(nBCEdgePts, -2.0, &tmp[0], 1, &tmp[0], 1);
342
343 // Calculate v* = v - 2.0(v.n)n
344 for (int i = 0; i < m_spacedim; ++i)
345 {
346 Vmath::Vvtvp(nBCEdgePts, &tmp[0], 1, &m_traceNormals[i][id2], 1,
347 &Fwd[m_iu + i][id2], 1, &Fwd[m_iu + i][id2], 1);
348 }
349
350 // Copy boundary adjusted values into the boundary expansion
351 for (int i = 0; i < nVariables; ++i)
352 {
353 Vmath::Vcopy(nBCEdgePts, &Fwd[i][id2], 1,
354 &(m_fields[i]
355 ->GetBndCondExpansions()[bcRegion]
356 ->UpdatePhys())[id1],
357 1);
358 }
359 }
360}
361
362/**
363 * @brief Wall boundary conditions for the AcousticSystem equations.
364 */
366 int bcRegion, int cnt,
367 [[maybe_unused]] Array<OneD, Array<OneD, NekDouble>> &Fwd,
369 Array<OneD, Array<OneD, NekDouble>> &physarray)
370{
371 int id1, id2, nBCEdgePts;
372 int nVariables = physarray.size();
373
374 const Array<OneD, const int> &traceBndMap = m_fields[0]->GetTraceBndMap();
375
376 if (m_rng.count(bcRegion) == 0)
377 {
378 m_rng[bcRegion] = boost::mt19937(bcRegion);
379 }
380
381 ASSERTL0(
382 m_fields[0]->GetBndConditions()[bcRegion]->GetBoundaryConditionType() ==
384 "WhiteNoise BCs must be Dirichlet type BCs");
385
387 std::static_pointer_cast<SpatialDomains::DirichletBoundaryCondition>(
388 m_fields[0]->GetBndConditions()[bcRegion])
389 ->m_dirichletCondition;
390 NekDouble sigma = cond.Evaluate();
391
393 "sigma must be greater than zero");
394
395 // random velocity perturbation
397 {
399
400 boost::normal_distribution<> dist(0, sigma);
401 m_whiteNoiseBC_p = dist(m_rng[bcRegion]);
402 }
403
404 int eMax = m_fields[0]->GetBndCondExpansions()[bcRegion]->GetExpSize();
405 for (int e = 0; e < eMax; ++e)
406 {
407 nBCEdgePts = m_fields[0]
408 ->GetBndCondExpansions()[bcRegion]
409 ->GetExp(e)
410 ->GetTotPoints();
411 id1 = m_fields[0]->GetBndCondExpansions()[bcRegion]->GetPhys_Offset(e);
412 id2 = m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt + e]);
413
414 Array<OneD, Array<OneD, NekDouble>> tmp(nVariables);
415 for (int i = 0; i < nVariables; ++i)
416 {
417 tmp[i] = Array<OneD, NekDouble>(nBCEdgePts, 0.0);
418 }
419
420 // pressure perturbation
421 Vmath::Fill(nBCEdgePts, m_whiteNoiseBC_p, &tmp[m_ip][0], 1);
422
423 if (m_conservative)
424 {
425 for (int i = 0; i < nBCEdgePts; ++i)
426 {
427 // density perturbation
428 tmp[m_irho][i] = m_whiteNoiseBC_p *
429 BfFwd[m_spacedim + 2][id2 + i] /
430 BfFwd[0][id2 + i];
431
432 // velocity perturbation
433 NekDouble ru = m_whiteNoiseBC_p / sqrt(BfFwd[0][id2 + i]);
434 for (int j = 0; j < m_spacedim; ++j)
435 {
436 tmp[m_iu + j][i] = -1.0 * ru * m_traceNormals[j][id2 + i];
437 }
438 }
439 }
440 else
441 {
442 for (int i = 0; i < nBCEdgePts; ++i)
443 {
444 // velocity perturbation
446 (sqrt(BfFwd[0][id2 + i]) * BfFwd[1][id2 + i]);
447
448 for (int j = 0; j < m_spacedim; ++j)
449 {
450 tmp[m_iu + j][i] = -1.0 * u * m_traceNormals[j][id2 + i];
451 }
452 }
453 }
454
455 // Copy boundary adjusted values into the boundary expansion
456 for (int i = 0; i < nVariables; ++i)
457 {
458 Vmath::Vcopy(nBCEdgePts, &tmp[i][0], 1,
459 &(m_fields[i]
460 ->GetBndCondExpansions()[bcRegion]
461 ->UpdatePhys())[id1],
462 1);
463 }
464 }
465}
466
467/**
468 * @brief Compute the advection velocity in the standard space
469 * for each element of the expansion.
470 *
471 * @return Standard velocity field.
472 */
474 [[maybe_unused]] const NekDouble SpeedSoundFactor)
475{
476 int nElm = m_fields[0]->GetExpSize();
477
478 Array<OneD, NekDouble> stdV(nElm, 0.0);
479
483
484 int cnt = 0;
485
486 for (int el = 0; el < nElm; ++el)
487 {
488 ptsKeys = m_fields[0]->GetExp(el)->GetPointsKeys();
489
490 // Possible bug: not multiply by jacobian??
491 const SpatialDomains::GeomFactorsSharedPtr metricInfo =
492 m_fields[0]->GetExp(el)->GetGeom()->GetMetricInfo();
493 const Array<TwoD, const NekDouble> &gmat =
494 m_fields[0]
495 ->GetExp(el)
496 ->GetGeom()
497 ->GetMetricInfo()
498 ->GetDerivFactors(ptsKeys);
499
500 int nq = m_fields[0]->GetExp(el)->GetTotPoints();
501
502 for (int i = 0; i < m_spacedim; ++i)
503 {
504 stdVelocity[i] = Array<OneD, NekDouble>(nq, 0.0);
505
506 velocity[i] = Array<OneD, NekDouble>(nq, 0.0);
507 for (int j = 0; j < nq; ++j)
508 {
509 // The total advection velocity is v+c, so we need to scale c by
510 // adding it before we do the transformation.
511 NekDouble c = sqrt(m_bf[0][cnt + j]);
512 velocity[i][j] = m_bf[i + 2][cnt + j] + c;
513 }
514 }
515
516 // scale the velocity components
517 if (metricInfo->GetGtype() == SpatialDomains::eDeformed)
518 {
519 // d xi/ dx = gmat = 1/J * d x/d xi
520 for (int i = 0; i < m_spacedim; ++i)
521 {
522 Vmath::Vmul(nq, gmat[i], 1, velocity[0], 1, stdVelocity[i], 1);
523 for (int j = 1; j < m_spacedim; ++j)
524 {
525 Vmath::Vvtvp(nq, gmat[m_spacedim * j + i], 1, velocity[j],
526 1, stdVelocity[i], 1, stdVelocity[i], 1);
527 }
528 }
529 }
530 else
531 {
532 for (int i = 0; i < m_spacedim; ++i)
533 {
534 Vmath::Smul(nq, gmat[i][0], velocity[0], 1, stdVelocity[i], 1);
535 for (int j = 1; j < m_spacedim; ++j)
536 {
537 Vmath::Svtvp(nq, gmat[m_spacedim * j + i][0], velocity[j],
538 1, stdVelocity[i], 1, stdVelocity[i], 1);
539 }
540 }
541 }
542
543 // compute the max absolute velocity of the element
544 for (int i = 0; i < nq; ++i)
545 {
546 NekDouble pntVelocity = 0.0;
547 for (int j = 0; j < m_spacedim; ++j)
548 {
549 pntVelocity += stdVelocity[j][i] * stdVelocity[j][i];
550 }
551 pntVelocity = sqrt(pntVelocity);
552
553 if (pntVelocity > stdV[el])
554 {
555 stdV[el] = pntVelocity;
556 }
557 }
558
559 cnt += nq;
560 }
561
562 return stdV;
563}
564
566 std::vector<Array<OneD, NekDouble>> &fieldcoeffs,
567 std::vector<std::string> &variables)
568{
569 for (int i = 0; i < m_bfNames.size(); i++)
570 {
571 variables.push_back(m_bfNames[i]);
573 m_fields[0]->FwdTrans(m_bf[i], tmpC);
574 fieldcoeffs.push_back(tmpC);
575 }
576
577 int f = 0;
578 for (auto &x : m_forcing)
579 {
580 for (int i = 0; i < x->GetForces().size(); ++i)
581 {
582 variables.push_back("F_" + boost::lexical_cast<string>(f) + "_" +
583 m_session->GetVariable(i));
585 m_fields[0]->FwdTrans(x->GetForces()[i], tmpC);
586 fieldcoeffs.push_back(tmpC);
587 }
588 f++;
589 }
590}
591
592/**
593 * @brief Get the normal vectors.
594 */
596{
597 return m_traceNormals;
598}
599
600/**
601 * @brief Get the locations of the components of the directed fields within the
602 * fields array.
603 */
605{
606 return m_vecLocs;
607}
608
609/**
610 * @brief Get the baseflow field.
611 */
614{
615 return m_bfFwdBwd;
616}
617
619{
620 for (int i = 0; i < m_bfNames.size(); i++)
621 {
622 int j = m_bfNames.size() + i;
623 m_fields[0]->GetFwdBwdTracePhys(m_bf[i], m_bfFwdBwd[i], m_bfFwdBwd[j]);
625 }
626}
627
630{
631 int cnt = 0;
632 // loop over Boundary Regions
633 for (int bcRegion = 0; bcRegion < m_fields[0]->GetBndConditions().size();
634 ++bcRegion)
635 {
636
637 // Copy the forward trace of the field to the backward trace
638 int e, id2, npts;
639
640 for (e = 0;
641 e < m_fields[0]->GetBndCondExpansions()[bcRegion]->GetExpSize();
642 ++e)
643 {
644 npts = m_fields[0]
645 ->GetBndCondExpansions()[bcRegion]
646 ->GetExp(e)
647 ->GetTotPoints();
648 id2 = m_fields[0]->GetTrace()->GetPhys_Offset(
649 m_fields[0]->GetTraceMap()->GetBndCondIDToGlobalTraceID(cnt +
650 e));
651
652 Vmath::Vcopy(npts, &Fwd[id2], 1, &Bwd[id2], 1);
653 }
654
655 cnt += m_fields[0]->GetBndCondExpansions()[bcRegion]->GetExpSize();
656 }
657}
658
659} // namespace Nektar
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
SolverUtils::CouplingSharedPtr m_coupling
void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Compute the right-hand side.
const Array< OneD, const Array< OneD, NekDouble > > & GetVecLocs()
Get the locations of the components of the directed fields within the fields array.
const Array< OneD, const Array< OneD, NekDouble > > & GetNormals()
Get the normal vectors.
void v_Output() override
Array< OneD, NekDouble > v_GetMaxStdVelocity(const NekDouble SpeedSoundFactor) override
Compute the advection velocity in the standard space for each element of the expansion.
std::vector< std::string > m_bfNames
Array< OneD, Array< OneD, NekDouble > > m_vecLocs
void CopyBoundaryTrace(const Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
bool m_conservative
we are dealing with a conservative formualtion
void v_ExtraFldOutput(std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables) override
virtual void v_RiemannInvariantBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &BfFwd, Array< OneD, Array< OneD, NekDouble > > &physarray)=0
SolverUtils::AdvectionSharedPtr m_advection
void WallBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray)
Wall boundary conditions for the AcousticSystem equations.
AcousticSystem(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Initialises UnsteadySystem class members.
void WhiteNoiseBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &BfFwd, Array< OneD, Array< OneD, NekDouble > > &physarray)
Wall boundary conditions for the AcousticSystem equations.
int m_ip
indices of the fields
std::map< int, boost::mt19937 > m_rng
Array< OneD, Array< OneD, NekDouble > > m_bfFwdBwd
void DoOdeProjection(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Compute the projection and call the method for imposing the boundary conditions in case of discontinu...
Array< OneD, Array< OneD, NekDouble > > m_bf
void v_InitObject(bool DeclareFields=true) override
Initialization object for the AcousticSystem class.
std::vector< SolverUtils::ForcingSharedPtr > m_forcing
const Array< OneD, const Array< OneD, NekDouble > > & GetBasefieldFwdBwd()
Get the baseflow field.
virtual void v_AddLinTerm(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
NekDouble m_whiteNoiseBC_lastUpdate
~AcousticSystem() override
Destructor.
void SetBoundaryConditions(Array< OneD, Array< OneD, NekDouble > > &physarray, NekDouble time)
Apply the Boundary Conditions to the AcousticSystem equations.
bool v_PreIntegrate(int step) override
v_PreIntegrate
A base class for PDEs which include an advection component.
SOLVER_UTILS_EXPORT void v_InitObject(bool DeclareField=true) override
Initialisation object for EquationSystem.
int m_spacedim
Spatial dimension (>= expansion dim).
NekDouble m_time
Current time of simulation.
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 GetNcoeffs()
enum MultiRegions::ProjectionType m_projectionType
Type of projection; e.g continuous or discontinuous.
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()
virtual SOLVER_UTILS_EXPORT void v_Output(void)
static SOLVER_UTILS_EXPORT std::vector< ForcingSharedPtr > Load(const LibUtilities::SessionReaderSharedPtr &pSession, const std::weak_ptr< EquationSystem > &pEquation, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const unsigned int &pNumForcingFields=0)
Definition: Forcing.cpp:118
Base class for unsteady solvers.
virtual SOLVER_UTILS_EXPORT bool v_PreIntegrate(int step)
bool m_homoInitialFwd
Flag to determine if simulation should start in homogeneous forward transformed state.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::vector< PointsKey > PointsKeyVector
Definition: Points.h:231
static const NekDouble kNekZeroTol
CouplingFactory & GetCouplingFactory()
Declaration of the Coupling factory singleton.
Definition: Coupling.cpp:42
std::shared_ptr< GeomFactors > GeomFactorsSharedPtr
Pointer to a GeomFactors object.
Definition: GeomFactors.h:60
@ eDeformed
Geometry is curved or has non-constant factors.
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
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 Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
Definition: Vmath.hpp:54
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.hpp:825
STL namespace.
scalarT< T > sqrt(scalarT< T > in)
Definition: scalar.hpp:294