Documentation 6b54b78464
Loading...
Searching...
No Matches
CIntegration.hpp
Go to the documentation of this file.
1/*!
2 * \file CIntegration.hpp
3 * \brief Declaration of the main routines to orchestrate space and time integration.
4 * \author F. Palacios, T. Economon
5 * \version 8.5.0 "Harrier"
6 *
7 * SU2 Project Website: https://su2code.github.io
8 *
9 * The SU2 Project is maintained by the SU2 Foundation
10 * (http://su2foundation.org)
11 *
12 * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
13 *
14 * SU2 is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2.1 of the License, or (at your option) any later version.
18 *
19 * SU2 is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
26 */
27
28#pragma once
29
30#include <cmath>
31#include <iostream>
32#include <cstdlib>
33
34#include "../solvers/CSolver.hpp"
35#include "../../../Common/include/geometry/CGeometry.hpp"
36#include "../../../Common/include/CConfig.hpp"
37
38using namespace std;
39
40/*!
41 * \class CIntegration
42 * \ingroup Drivers
43 * \brief Main class for doing the space integration, time integration, and monitoring
44 * of a system of Partial Differential Equations (PDE).
45 * \author F. Palacios
46 */
48protected:
49 int rank, /*!< \brief MPI Rank. */
50 size; /*!< \brief MPI Size. */
51
52 /*!
53 * \brief Do the space integration of the numerical system.
54 * \param[in] geometry - Geometrical definition of the problem.
55 * \param[in] solver_container - Container vector with all the solutions.
56 * \param[in] solver - Description of the numerical method.
57 * \param[in] config - Definition of the particular problem.
58 * \param[in] iMesh - Index of the mesh in multigrid computations.
59 * \param[in] iRKStep - Current step of the Runge-Kutta iteration.
60 * \param[in] RunTime_EqSystem - System of equations which is going to be solved.
61 */
62 void Space_Integration(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics,
63 CConfig *config, unsigned short iMesh, unsigned short iRKStep,
64 unsigned short RunTime_EqSystem);
65
66 /*!
67 * \brief Do the time integration (explicit or implicit) of the numerical system.
68 * \param[in] geometry - Geometrical definition of the problem.
69 * \param[in] solver_container - Container vector with all the solutions.
70 * \param[in] config - Definition of the particular problem.
71 * \param[in] iRKStep - Current step of the Runge-Kutta iteration.
72 * \param[in] RunTime_EqSystem - System of equations which is going to be solved.
73 */
74 void Time_Integration(CGeometry *geometry, CSolver **solver_container, CConfig *config,
75 unsigned short iRKStep, unsigned short RunTime_EqSystem);
76
77public:
78 /*!
79 * \brief Constructor of the class.
80 */
82
83 /*!
84 * \brief Destructor of the class.
85 */
86 virtual ~CIntegration(void) = default;
87
88 /*!
89 * \brief Save the geometry at different time steps.
90 * \param[in] geometry - Geometrical definition of the problem.
91 * \param[in] solver - Mesh solver.
92 * \param[in] config - Definition of the particular problem.
93 */
94 void SetDualTime_Geometry(CGeometry *geometry, CSolver *mesh_solver, const CConfig *config, unsigned short iMesh);
95
96 /*!
97 * \brief Save the solution at different time steps, and reset certain fields for the next timestep.
98 * \param[in] geometry - Geometrical definition of the problem.
99 * \param[in] solver - Some solver.
100 * \param[in] config - Definition of the particular problem.
101 */
102 virtual void SetDualTime_Solver(const CGeometry *geometry, CSolver *solver, const CConfig *config, unsigned short iMesh);
103
104 /*!
105 * \brief A virtual member.
106 * \param[in] geometry - Geometrical definition of the problem.
107 * \param[in] solver_container - Container vector with all the solutions.
108 * \param[in] numerics_container - Description of the numerical method (the way in which the equations are solved).
109 * \param[in] config - Definition of the particular problem.
110 * \param[in] RunTime_EqSystem - System of equations which is going to be solved.
111 */
112 virtual void MultiGrid_Iteration(CGeometry ****geometry, CSolver *****solver_container,
113 CNumerics ******numerics_container, CConfig **config,
114 unsigned short RunTime_EqSystem, unsigned short iZone, unsigned short iInst) { };
115
116 /*!
117 * \brief Report the convergence fields on the active mesh level to a Full-MG startup.
118 * \param[in] convFields - Name and log10 value of each monitored residual field.
119 * \param[in] config - Definition of the particular problem.
120 */
121 virtual void MonitorFullMG_Startup(const vector<pair<string, passivedouble> >& convFields,
122 const CConfig *config) { };
123
124 /*!
125 * \brief Whether the Full-MG startup is still ramping the CFL of the finest grid.
126 */
127 virtual bool GetFullMG_CFLRamp() const { return false; }
128
129 /*!
130 * \brief InnerIter at which the currently active Full-MG level became active.
131 */
132 virtual unsigned long GetLevelStartIter() const { return 0; }
133
134 /*!
135 * \brief A virtual member.
136 * \param[in] geometry - Geometrical definition of the problem.
137 * \param[in] solver_container - Container vector with all the solutions.
138 * \param[in] numerics_container - Description of the numerical method (the way in which the equations are solved).
139 * \param[in] config - Definition of the particular problem.
140 * \param[in] RunTime_EqSystem - System of equations which is going to be solved.
141 */
142 virtual void SingleGrid_Iteration(CGeometry ****geometry, CSolver *****solver_container,
143 CNumerics ******numerics_container, CConfig **config,
144 unsigned short RunTime_EqSystem, unsigned short iZone, unsigned short iInst) { };
145
146 /*!
147 * \brief A virtual member.
148 * \param[in] geometry - Geometrical definition of the problem.
149 * \param[in] solver_container - Container vector with all the solutions.
150 * \param[in] numerics_container - Description of the numerical method (the way in which the equations are solved).
151 * \param[in] config - Definition of the particular problem.
152 * \param[in] RunTime_EqSystem - System of equations which is going to be solved.
153 */
154 virtual void Structural_Iteration(CGeometry ****geometry, CSolver *****solver_container,
155 CNumerics ******numerics_container, CConfig **config,
156 unsigned short RunTime_EqSystem, unsigned short iZone, unsigned short iInst) { };
157
158};
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
Parent class for defining the geometry of the problem (complete geometry, multigrid agglomerated geom...
Definition CGeometry.hpp:75
Main class for doing the space integration, time integration, and monitoring of a system of Partial D...
Definition CIntegration.hpp:47
void SetDualTime_Geometry(CGeometry *geometry, CSolver *mesh_solver, const CConfig *config, unsigned short iMesh)
Save the geometry at different time steps.
Definition CIntegration.cpp:224
virtual void Structural_Iteration(CGeometry ****geometry, CSolver *****solver_container, CNumerics ******numerics_container, CConfig **config, unsigned short RunTime_EqSystem, unsigned short iZone, unsigned short iInst)
A virtual member.
Definition CIntegration.hpp:154
virtual ~CIntegration(void)=default
Destructor of the class.
virtual void SingleGrid_Iteration(CGeometry ****geometry, CSolver *****solver_container, CNumerics ******numerics_container, CConfig **config, unsigned short RunTime_EqSystem, unsigned short iZone, unsigned short iInst)
A virtual member.
Definition CIntegration.hpp:142
int rank
MPI Rank.
Definition CIntegration.hpp:49
virtual unsigned long GetLevelStartIter() const
InnerIter at which the currently active Full-MG level became active.
Definition CIntegration.hpp:132
virtual bool GetFullMG_CFLRamp() const
Whether the Full-MG startup is still ramping the CFL of the finest grid.
Definition CIntegration.hpp:127
int size
MPI Size.
Definition CIntegration.hpp:50
void Time_Integration(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iRKStep, unsigned short RunTime_EqSystem)
Do the time integration (explicit or implicit) of the numerical system.
Definition CIntegration.cpp:201
virtual void MonitorFullMG_Startup(const vector< pair< string, passivedouble > > &convFields, const CConfig *config)
Report the convergence fields on the active mesh level to a Full-MG startup.
Definition CIntegration.hpp:121
virtual void MultiGrid_Iteration(CGeometry ****geometry, CSolver *****solver_container, CNumerics ******numerics_container, CConfig **config, unsigned short RunTime_EqSystem, unsigned short iZone, unsigned short iInst)
A virtual member.
Definition CIntegration.hpp:112
CIntegration()
Constructor of the class.
Definition CIntegration.cpp:32
virtual void SetDualTime_Solver(const CGeometry *geometry, CSolver *solver, const CConfig *config, unsigned short iMesh)
Save the solution at different time steps, and reset certain fields for the next timestep.
Definition CIntegration.cpp:244
void Space_Integration(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem)
Do the space integration of the numerical system.
Definition CIntegration.cpp:38
Class for defining the numerical methods.
Definition CNumerics.hpp:48
Definition CSolver.hpp:71