Nektar++
Loading...
Searching...
No Matches
UnsteadyADR.cpp
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: UnsteadyADR.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: UnsteadyADR problem solve routines
32//
33///////////////////////////////////////////////////////////////////////////////
34
36
46#include <SolverCore/Advection/AdvectionWeakDG/AdvectionWeakDGOp.hpp>
47#include <SolverCore/Core/SessionFunction.h>
48#include <SolverCore/Diffusion/DiffusionIP/DiffusionIPOp.hpp>
49#include <SolverCore/GlobalLinSysOps/LinearSolvers/LinearSolverOp.hpp>
50#include <SolverCore/GlobalLinSysOps/LinearSystems/FwdTrans/FwdTransOp.hpp>
51#include <SolverCore/GlobalLinSysOps/LinearSystems/HelmSolve/HelmSolveOp.hpp>
52#include <SolverCore/GlobalLinSysOps/LinearSystems/LinearADRSolve/LinearADRSolveOp.hpp>
53#include <SolverCore/GlobalLinSysOps/LinearSystems/LinearSystemOp.hpp>
54#include <SolverCore/GlobalLinSysOps/LinearSystems/PoissonSolve/PoissonSolveOp.hpp>
55#include <SolverCore/PreconOps/PreconOp.hpp>
56#include <SolverCore/TimeOps/TimeOp.hpp>
57#include <SolverCore/TraceFlux/TraceFluxOp.hpp>
58
59namespace Nektar
60{
61using namespace MultiRegions;
62
63std::string UnsteadyADR::className0 =
66std::string UnsteadyADR::className1 =
69std::string UnsteadyADR::className2 =
71 "UnsteadyAdvectionDiffusion", UnsteadyADR::create);
72
78
79/**
80 * @brief Initialisation object for the UnsteadyADR problem.
81 */
82void UnsteadyADR::v_InitObject(bool declareExpansionLists)
83{
84 // Call to the initialisation object of EquationSystem
85 UnsteadySystem::v_InitObject(declareExpansionLists);
86
87 /// Load parameters from session
89
90 /// Create Fields for solution m_phys, m_coeff and others
91 v_InitialiseFields();
92
93 // Set advection velocity
95
96 // Set up diffusion Coeff.
98
99 // Create and initialise all operators
101}
102
104{
106
107 AddSummaryItem(s, "Equations", "Advection-Diffusion-Reaction");
108 if (m_advection)
109 {
110 AddSummaryItem(s, "Advect. advancement",
111 m_explicitAdvection ? "explicit" : "implicit");
112 }
113 if (m_diffusion)
114 {
115 AddSummaryItem(s, "Diffusion advancement",
116 m_explicitDiffusion ? "explicit" : "implicit");
117 }
118
119 std::stringstream ss;
120 ss << R"(
121 _ _ _ _
122| \ | | | | | | _ _
123| \| | ___| | _| |_ __ _ _ __ _| |_ _| |_
124| . ` |/ _ \ |/ / __/ _` | '__|_ _|_ _|
125| |\ | __/ <| || (_| | | |_| |_|
126\_| \_/\___|_|\_\\__\__,_|_|
127 _ _ _
128 | | (_) | |
129 _ __ ___ __| | ___ ___ _ __ _ _ __ ___ __| |
130| '__/ _ \/ _` |/ _ \/ __| |/ _` | '_ \ / _ \/ _` |
131| | | __/ (_| | __/\__ \ | (_| | | | | __/ (_| |
132|_| \___|\__,_|\___||___/_|\__, |_| |_|\___|\__,_|
133 __/ |
134 |___/
135)";
136 AddSummaryItem(s, "Redesign disclaimer", ss.str());
137}
138
139/**
140 * @brief Project onto the solution space: a copy for DG, a forward and
141 * backward transform with the Dirichlet values at time for CG.
142 */
145 LibUtilities::Field<double, FieldState::Phys> &out, const double &time)
146{
147 switch (m_projectionType)
148 {
150 {
151 if (&in != &out)
152 {
153 m_math.copy(in, out);
154 }
155 break;
156 }
158 {
159 m_fwdTransOp->UpdateBndCoeffs(time);
160 m_fwdTransOp->Apply(in, m_coeff[0]);
161 m_bwdTransOp->Apply(m_coeff[0], out);
162 break;
163 }
164 default:
165 {
166 ASSERTL0(false, "Unsupported projection type.");
167 break;
168 }
169 }
170}
171
173 LibUtilities::Field<double, FieldState::Phys> &in,
174 [[maybe_unused]] LibUtilities::Field<double, FieldState::Phys> &out,
175 const double &time, const double &dt_inv_gamma)
176{
177 if (m_session->GetSolverInfo("EQTYPE") == "UnsteadyAdvection")
178 {
179 ASSERTL0(false,
180 "Implicit time-stepping not supported for pure advection");
181 return;
182 }
183
185 {
186 m_varDiffCoeffFunction->Evaluate(m_varDiffCoeff, time);
187 m_preconOp.clear();
188 }
189
190 // Switch on the projection type (Discontinuous or Continuous)
191 switch (m_projectionType)
192 {
193 // Discontinuous projection
195 {
196 ASSERTL0(false, "Implicit/IMEX time-stepping not supported for DG");
198 {
199 // To be completed
200 }
202 {
203 // To be completed
204 }
205 break;
206 }
207 // Continuous field
209 {
210 // Update \lambda = \gamma / \Delta t
211 m_lambda = 1.0 / dt_inv_gamma;
212
213 // Update LinearSystem
215 {
216 std::dynamic_pointer_cast<LinearADRSolveOp<double>>(
219 }
220 else if (m_implicitDiffusion)
221 {
222 std::dynamic_pointer_cast<HelmSolveOp<double>>(m_linearSystemOp)
224 }
225
226 if (m_preconOp.find(dt_inv_gamma) == m_preconOp.end())
227 {
228 // Configure and cache preconditioner
229 m_preconOp.insert(
230 {dt_inv_gamma,
231 PreconOp<double>::Create(m_expansionLists[0],
232 m_session->GetVariables())});
233 m_linearSystemOp->SetPrecon(m_preconOp[dt_inv_gamma]);
234 m_linearSystemOp->UpdatePrecon();
235 }
236 else
237 {
238 // Re-use preconditioner
239 m_linearSystemOp->SetPrecon(m_preconOp[dt_inv_gamma]);
240 }
241
242 // Multiply by negative lambda
243 m_math.mul(-m_lambda, in, out);
244
245 // Refresh time-dependent Dirichlet and Neumann coefficients at the
246 // current implicit stage time before applying the linear system.
247 m_linearSystemOp->UpdateBndCoeffs(time);
248
249 // Solve implicit ADR problem
250 m_linearSystemOp->Apply(out, m_coeff[0]);
251
252 // Transform to physical space
253 m_bwdTransOp->Apply(m_coeff[0], out);
254 break;
255 }
256 default:
257 {
258 ASSERTL0(false, "Unsupported projection type.");
259 break;
260 }
261 }
262}
263
264/*
265 * @brief Evaluate reaction and/or forcing terms.
266 *
267 * Upon input
268 * param in: = u^{n}
269 *
270 * Upon output
271 * param out: = \kappa u^{n}
272 */
274 LibUtilities::Field<double, FieldState::Phys> &in,
275 LibUtilities::Field<double, FieldState::Phys> &out, const double &time,
276 const double &dt)
277{
278 // Switch on the projection type (Discontinuous or Continuous)
279 switch (m_projectionType)
280 {
281 // Discontinuous projection
283 {
284 // Add advection term
286 {
287 // Refresh time-dependent boundary values at the current stage
288 // time, as the continuous branch does through the linear
289 // system operator.
290 m_advectionWeakDGOp->UpdateBndPhys(time);
291 m_advectionWeakDGOp->SetScale(-dt);
292 m_advectionWeakDGOp->Apply(in, out);
293 }
295 {
296 m_diffusionIPOp->UpdateBndPhys(time);
297 m_diffusionIPOp->SetScale(dt);
299 m_diffusionIPOp->Apply(in, out);
300 }
301 break;
302 }
303 // Continuous field
305 {
306 // Add advection term
308 {
309 m_advectionCGOp->SetScale(-dt);
310 m_advectionCGOp->Apply(in, out);
311 }
313 {
314 // To be completed
315 }
316 break;
317 }
318 default:
319 {
320 ASSERTL0(false, "Unsupported projection type.");
321 break;
322 }
323 }
324
325 // Add forcing terms, if defined. The first forcing assigns when there is
326 // no preceding explicit contribution; subsequent forcings append.
327 const bool hasExplicitTerm = m_explicitAdvection || m_explicitDiffusion;
328 for (unsigned int i = 0; i < m_forcing.size(); ++i)
329 {
330 m_forcing[i]->SetAppend(hasExplicitTerm || i > 0);
331 m_forcing[i]->Apply(in, out, time, dt);
332 }
334 // Zero output if no explicit term.
335 if (!hasExplicitTerm && m_forcing.empty())
336 {
337 m_math.zero(out);
338 }
339}
341/**
342 * @brief Offer the advection velocity to the Courant estimate.
343 *
344 * Without advection this field is never constructed, and
345 * ComputeCFLInvTimeScale() skips the estimate when the returned field is not
346 * instantiated.
347 */
348UnsteadySystem::CFLVelocity UnsteadyADR::v_GetCFLVelocity()
349{
350 std::vector<std::string> vel = {"Vx", "Vy", "Vz"};
351 vel.resize(m_coordim);
352 return {&m_advectionVel, 0, vel};
353}
354
356{
357 // Get variable strings and number of variables.
358 if ((m_session->GetSolverInfo("EQTYPE") == "UnsteadyAdvection") ||
359 (m_session->GetSolverInfo("EQTYPE") == "UnsteadyAdvectionDiffusion"))
360 {
361 m_advection = true;
362 m_session->MatchSolverInfo("ADVECTIONADVANCEMENT", "Explicit",
363 m_explicitAdvection, true);
365 }
366
367 if ((m_session->GetSolverInfo("EQTYPE") == "UnsteadyDiffusion") ||
368 (m_session->GetSolverInfo("EQTYPE") == "UnsteadyAdvectionDiffusion"))
369 {
370 m_diffusion = true;
371 m_session->MatchSolverInfo("DIFFUSIONADVANCEMENT", "Explicit",
372 m_explicitDiffusion, true);
374 }
375
376 // Get diffusion parameters.
377 if (m_diffusion)
378 {
379 // Resize diffCoeff vector.
380 const auto nDiffCoeff = m_coordim * (m_coordim + 1) / 2;
381 m_diffCoeff.resize(nDiffCoeff);
382
383 m_session->LoadParameter("epsilon", m_epsilon, 1.0);
384 if (m_coordim == 1)
385 {
386 m_session->LoadParameter("D00", m_diffCoeff[0], 1.0);
387 }
388 else if (m_coordim == 2)
389 {
390 m_session->LoadParameter("D00", m_diffCoeff[0], 1.0);
391 m_session->LoadParameter("D01", m_diffCoeff[1], 0.0);
392 m_session->LoadParameter("D11", m_diffCoeff[2], 1.0);
393 }
394 else if (m_coordim == 3)
395 {
396 m_session->LoadParameter("D00", m_diffCoeff[0], 1.0);
397 m_session->LoadParameter("D01", m_diffCoeff[1], 0.0);
398 m_session->LoadParameter("D11", m_diffCoeff[2], 1.0);
399 m_session->LoadParameter("D02", m_diffCoeff[3], 0.0);
400 m_session->LoadParameter("D12", m_diffCoeff[4], 0.0);
401 m_session->LoadParameter("D22", m_diffCoeff[5], 1.0);
402 }
403 }
404}
405
406/*
407 * @brief Sets the Advection Veclocity
408 */
410{
411 if (m_advection)
412 {
413 // Read advection velocity from session.
414 if (m_session->DefinesFunction("AdvectionVelocity"))
415 {
416 auto bAtr_phys =
418 m_expansionLists[0]);
419 m_advectionVel = LibUtilities::Field<double, FieldState::Phys>(
420 "advVel", bAtr_phys, m_coordim, m_npointsZ);
421
422 // Reads the Session File Velocity defined as function.
423 std::vector<std::string> vel = {"Vx", "Vy", "Vz"};
424 vel.resize(m_coordim);
425 SessionFunction advectionVelocity(m_session, m_expansionLists[0],
426 vel, "AdvectionVelocity");
427 advectionVelocity.Evaluate(m_advectionVel, m_time);
428 }
429 else
430 {
431 NEKERROR(ErrorUtil::efatal, "Function 'AdvectionVelocity' was "
432 "not defined in session file.")
433 }
434 }
435}
436
437/**
438 * @brief Set the diffusion Coeff.
439 * the diff. coeff., diffCoeff_{ij} := \epslion * D_{ij}
440 * where,
441 * \epslion is scalar part
442 * D_{ij} is a 2D tensor for enforcing anisotropy
443 * Note, it is assumed that, diffCoeff_{ij} = diffCoeff_{ji}
444 *
445 * Let, Vec be a Vector<double> storing a flatten \diffCoeff_{ij}, then
446 * Case 1: For 1D
447 * Vec[0] = D_{00}
448 * Case 2: For 2D
449 * Vec[0] = D_{00}
450 * Vec[1] = D_{01}
451 * Vec[2] = D_{11}
452 * Case 3: For 3D
453 * Vec[0] = D_{00}
454 * Vec[1] = D_{01}
455 * Vec[2] = D_{11}
456 * Vec[3] = D_{02}
457 * Vec[4] = D_{12}
458 * Vec[5] = D_{22}
459 */
461{
462 // Optional physical tensor, in the same D00,D01,D11,D02,D12,D22 order
463 // as the constant parameters. epsilon scales every tensor component.
464 if (m_session->DefinesFunction("DiffusionCoefficient"))
465 {
467 "Variable DiffusionCoefficient requires implicit diffusion");
468
469 std::vector<std::string> names = {"D00", "D01", "D11",
470 "D02", "D12", "D22"};
471 names.resize(m_coordim * (m_coordim + 1) / 2);
472 auto bAtr_phys =
474 m_expansionLists[0]);
476 "DiffusionCoefficient", bAtr_phys, names.size(), m_npointsZ);
477 m_varDiffCoeffFunction = std::make_shared<SessionFunction>(
478 m_session, m_expansionLists[0], names, "DiffusionCoefficient");
482 }
483 else if (m_diffusion)
484 {
485 if (m_coordim == 1)
486 {
487 // Multiply by Scalar Part
489 }
490 else if (m_coordim == 2)
491 {
492 // Multiply by Scalar Part
496 }
497 else if (m_coordim == 3)
499 // Multiply by Scalar Part
506 }
507 }
508}
509
510/*
511 * Create and initialise all operators for this solver
512 */
514{
515 // Transforms, and the projection of the solution to coefficients for
516 // output: a global mass matrix solve for CG, element local for DG.
518 BwdTransOp<double>::Create(m_expansionLists[0], m_variables[0]);
520 {
521 m_fwdTransOp = CreateFwdTransOp(m_expansionLists[0], m_variables[0]);
522 }
523 else
524 {
526 m_expansionLists[0], m_variables[0]);
528 m_expansionLists[0], m_variables[0]);
529 }
530
531 // Configure Time-integration
532 m_timeOp = TimeOp<double>::Create(m_expansionLists[0], m_variables[0]);
533 m_timeOp->DefineProjection(&UnsteadyADR::DoProjection, this);
534 m_timeOp->DefineImplicit(&UnsteadyADR::DoImplicit, this);
535 m_timeOp->DefineExplicitRhs(&UnsteadyADR::DoExplicitRhs, this);
536
537 // Switch on the projection type (Discontinuous or Continuous).
538 switch (m_projectionType)
539 {
541 {
542 // Create operators.
543 if (m_advection)
544 {
545 m_advectionWeakDGOp = AdvectionWeakDGOp<double>::Create(
546 m_expansionLists[0], m_variables[0]);
548 m_expansionLists[0], m_variables[0]);
549
550 // Set volume flux and Riemann solver for advection operator
551 m_advectionWeakDGOp->SetVolumeFluxOp(m_volumeFluxOp);
552
554 m_expansionLists[0], m_variables[0]);
555 m_advectionWeakDGOp->SetTraceFlux(m_traceFluxOp);
556
557 // Set up trace advection velocity on trace for upwind
558 // solver
559 m_traceAdvVel = LibUtilities::Field<double, FieldState::Phys>(
560 "traceAdvVel",
563 m_expansionLists[0]),
564 m_coordim, m_npointsZ);
565
566 // extract advection trace
567 auto physTraceExtractOp = PhysTraceExtractOp<double>::Create(
568 m_expansionLists[0], m_advectionVel.GetComponentNames());
569 physTraceExtractOp->Apply(m_advectionVel, m_traceAdvVel);
570 // the trace flux reads it through a pointer from here on
571 m_traceFluxOp->SetTraceAdvVel(m_traceAdvVel);
572
573 // Set advection velocity in volume flux
574 m_volumeFluxOp->SetAdvVel(m_advectionVel);
575 }
576 if (m_diffusion)
577 {
578 m_diffusionIPOp = DiffusionIPOp<double>::Create(
579 m_expansionLists[0], m_variables[0]);
580 auto diffusionScalarVolFluxOp =
582 m_expansionLists[0], m_variables[0]);
583
584 auto diffusionScalarIPTraceFluxOp =
586 m_expansionLists[0], m_variables[0]);
587
588 diffusionScalarVolFluxOp->SetDiffCoeff(m_diffCoeff);
589 diffusionScalarIPTraceFluxOp->SetDiffCoeff(m_diffCoeff);
590
591 m_diffusionIPOp->SetVolumeFluxOp(diffusionScalarVolFluxOp);
592 m_diffusionIPOp->SetTraceFluxOp(diffusionScalarIPTraceFluxOp);
593 }
594 break;
595 }
597 {
598 // Explicit operators.
600 {
602 m_expansionLists[0], m_variables[0]);
604 }
606 {
607 // To be completed
608 }
609
610 // Implicit operators.
612 {
613 m_linearSolverOp = LinearSolverOp<double>::Create(
614 m_expansionLists[0], m_session->GetVariables());
615 auto linearADRSolveOp = LinearADRSolveOp<double>::Create(
616 m_expansionLists[0], m_session->GetVariables());
617 linearADRSolveOp->SetLinearSolver(m_linearSolverOp);
619 {
620 linearADRSolveOp->SetVarDiffCoeff(m_varDiffCoeff);
621 }
622 else
623 {
624 linearADRSolveOp->SetDiffCoeff(m_diffCoeff);
625 }
626 linearADRSolveOp->SetAdvVel(m_advectionVel);
627 m_linearSystemOp = linearADRSolveOp;
628 }
629 else if (m_implicitDiffusion)
630 {
632 {
633 m_linearSolverOp = LinearSolverOp<double>::Create(
634 m_expansionLists[0], m_session->GetVariables(),
635 "ConjGrad");
636 }
637 else
638 {
639 m_linearSolverOp = LinearSolverOp<double>::Create(
640 m_expansionLists[0], m_session->GetVariables());
641 }
642 auto helmSolveOp = HelmSolveOp<double>::Create(
643 m_expansionLists[0], m_session->GetVariables());
644 helmSolveOp->SetLinearSolver(m_linearSolverOp);
646 {
647 helmSolveOp->SetVarDiffCoeff(m_varDiffCoeff);
648 }
649 else
650 {
651 helmSolveOp->SetDiffCoeff(m_diffCoeff);
652 }
653 m_linearSystemOp = helmSolveOp;
654 }
655 break;
656 }
657 default:
658 {
659 ASSERTL0(false, "Unsupported projection type.");
660 break;
661 }
662 }
663
664 // Load forcing terms, if defined in the session file.
665 m_forcing = Forcing::Load(m_session, m_expansionLists[0], m_variables[0]);
666}
667
668CoefficientFieldViews UnsteadyADR::v_GetOutputFieldViews()
669{
670 // The solution is advanced in physical space, so project back to
671 // coefficients before exposing it to output filters. CG uses its global
672 // transform with boundary coefficients; DG uses the element-local L2
673 // projection required by the restart path.
675 {
676 m_fwdTransOp->UpdateBndCoeffs(m_time);
677 m_math.zero(m_coeff[0]);
678 m_fwdTransOp->Apply(m_phys[0], m_coeff[0]);
679 }
681 {
682 m_iProductWRTBaseOp->Apply(m_phys[0], m_wsp_coeff[0]);
683 m_multiplyByElmtInvMassOp->Apply(m_wsp_coeff[0], m_coeff[0]);
684 }
685
686 return UnsteadySystem::v_GetOutputFieldViews();
687}
688
689} // namespace Nektar
Whole-field interface of the advection element operator, which evaluates the convective term V ....
Public interface of the backward-transform (BwdTrans) element operator, which maps a field from coeff...
#define ASSERTL0(condition, msg)
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Whole-field interface of the IProductWRTBase element operator, which takes a physical-space field to ...
Whole-field interface of the MultiplyByElmtInvMass element operator, which multiplies a coefficient-s...
Public interface of the PhysTraceExtract element operator, which interpolates a volume physical-space...
static std::shared_ptr< DiffusionScalarIPTraceFluxOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="")
Create the implementation for the requested execution space.
static std::shared_ptr< DiffusionScalarVolFluxOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="")
A Field represents expansion data to be operated on.
std::vector< std::string > GetComponentNames() const
Gets a copy of the components names for a vector field.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
static std::shared_ptr< LinearAdvVolumeFluxOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="")
static std::shared_ptr< AdvectionOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="", const std::string &implStr="")
Build a complete advection operator through the operator and block-operator factories.
static std::shared_ptr< BwdTransOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="", const std::string &implStr="")
Create a backward-transform operator through the operator and block-operator factories.
static std::shared_ptr< IProductWRTBaseOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="", const std::string &implStr="")
Build a complete IProductWRTBase operator through the operator and block-operator factories.
static std::shared_ptr< MultiplyByElmtInvMassOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="", const std::string &implStr="")
Build a complete element-wise inverse mass operator through the operator and block-operator factories...
static std::shared_ptr< PhysTraceExtractOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="", const std::string &implStr="")
Create a trace extraction operator through the operator and block-operator factories.
static std::shared_ptr< ScalarTraceFluxOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &solverType="", const std::string &execStr="")
Create the implementation registered for solverType.
NekDouble m_time
Current time of simulation.
SOLVER_UTILS_EXPORT void SetLambda(NekDouble lambda)
Set parameter m_lambda.
int m_npointsZ
number of points in Z direction (if homogeneous)
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
enum MultiRegions::ProjectionType m_projectionType
Type of projection; e.g continuous or discontinuous.
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:77
Base class for unsteady solvers.
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.
void v_InitialiseOperators() override
void DoImplicit(LibUtilities::Field< double, FieldState::Phys > &inout, LibUtilities::Field< double, FieldState::Phys > &out, const double &time, const double &lambda)
std::vector< double > m_diffCoeff
Definition UnsteadyADR.h:94
LibUtilities::Field< double, FieldState::Phys > m_traceAdvVel
The advection velocity on the local trace, which the trace flux operator reads through a pointer; kep...
LibUtilities::Field< double, FieldState::Phys > m_advectionVel
std::shared_ptr< LinearSolverOp< double > > m_linearSolverOp
SessionFunctionSharedPtr m_varDiffCoeffFunction
Definition UnsteadyADR.h:97
std::shared_ptr< SolverCore::TraceFluxOp< double > > m_traceFluxOp
UnsteadyADR(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
std::shared_ptr< DiffusionIPOp< double > > m_diffusionIPOp
std::shared_ptr< LinearSystemOp< double > > m_linearSystemOp
std::map< double, std::shared_ptr< PreconOp< double > > > m_preconOp
std::shared_ptr< AdvectionWeakDGOp< double > > m_advectionWeakDGOp
static EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
Definition UnsteadyADR.h:76
std::vector< ForcingSharedPtr > m_forcing
std::shared_ptr< AdvectionOp< double > > m_advectionCGOp
CFLVelocity v_GetCFLVelocity() override
Offer the advection velocity to the Courant estimate.
std::shared_ptr< MultiplyByElmtInvMassOp< double > > m_multiplyByElmtInvMassOp
static std::string className0
Name of class.
Definition UnsteadyADR.h:87
void SetDiffusionCoeff()
Set the diffusion Coeff. the diff. coeff., diffCoeff_{ij} := \epslion * D_{ij} where,...
void v_InitObject(bool declareExpansionLists=true) override
Initialisation object for the UnsteadyADR problem.
void v_GenerateSummary(SummaryList &s) override
Virtual function for generating summary information.
void DoExplicitRhs(LibUtilities::Field< double, FieldState::Phys > &in, LibUtilities::Field< double, FieldState::Phys > &out, const double &time, const double &dt)
std::shared_ptr< FwdTransOp< double > > m_fwdTransOp
void DoProjection(LibUtilities::Field< double, FieldState::Phys > &in, LibUtilities::Field< double, FieldState::Phys > &out, const double &time)
Project onto the solution space: a copy for DG, a forward and backward transform with the Dirichlet v...
static std::string className2
Definition UnsteadyADR.h:89
CoefficientFieldViews v_GetOutputFieldViews() override
Project the solution to coefficients and return views of them.
bool m_isTimeDependentDiffCoeff
Definition UnsteadyADR.h:99
static std::string className1
Definition UnsteadyADR.h:88
std::shared_ptr< LinearAdvVolumeFluxOp< double > > m_volumeFluxOp
std::shared_ptr< IProductWRTBaseOp< double > > m_iProductWRTBaseOp
std::shared_ptr< BwdTransOp< double > > m_bwdTransOp
LibUtilities::Field< double, FieldState::Phys > m_varDiffCoeff
Definition UnsteadyADR.h:96
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::vector< BlockAttributes< TState > > GetLocTraceBlockAttributes(const MultiRegions::ExpListSharedPtr explist, const unsigned interleave_width, const bool useGLLTracePoints)
template std::vector< BlockAttributes< FieldState::Phys > > GetBlockAttributes< double, FieldState::Phys >(const MultiRegions::ExpListSharedPtr explist, const std::vector< unsigned int > &interleave_widths)
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:46
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition MeshGraph.h:287