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