Documentation 6b54b78464
Loading...
Searching...
No Matches
task_definition.hpp
Go to the documentation of this file.
1/*!
2 * \file task_definition.hpp
3 * \brief Header of the task definition class for the SU2 solvers.
4 * \author E. van der Weide, 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 "../../Common/include/parallelization/mpi_structure.hpp"
31
32#include <iostream>
33
34using namespace std;
35
36/*!
37 * \class CTaskDefinition
38 * \brief Class for defining a task to be carried out
39 * \author: E. van der Weide, T. Economon
40 * \version 8.5.0 "Harrier"
41 */
43
44public:
45
46 /*!
47 * \brief Enumerated type, which defines the tasks to be carried out.
48 */
50 NO_TASK = 0, /*!< \brief Default value used for checking. */
51 ADER_PREDICTOR_STEP_COMM_ELEMENTS = 1, /*!< \brief ADER predictor step for elements whose solution must be communicated. */
52 ADER_PREDICTOR_STEP_INTERNAL_ELEMENTS = 2, /*!< \brief ADER predictor step for internal elements. */
53 INITIATE_MPI_COMMUNICATION = 3, /*!< \brief Start the communication of the conserved variables. */
54 COMPLETE_MPI_COMMUNICATION = 4, /*!< \brief Complete the communication of the conserved variables. */
55 INITIATE_REVERSE_MPI_COMMUNICATION = 5, /*!< \brief Start the communication of the residuals. */
56 COMPLETE_REVERSE_MPI_COMMUNICATION = 6, /*!< \brief Complete the communication of the residuals. */
57 ADER_TIME_INTERPOLATE_OWNED_ELEMENTS = 7, /*!< \brief Carry out a time interpolation to an integration point for the owned elements. */
58 ADER_TIME_INTERPOLATE_HALO_ELEMENTS = 8, /*!< \brief Carry out a time interpolation to an integration point for the halo elements. */
59 SHOCK_CAPTURING_VISCOSITY_OWNED_ELEMENTS = 9, /*!< \brief Compute the shock capturing artificial viscosity for the owned elements, if needed. */
60 SHOCK_CAPTURING_VISCOSITY_HALO_ELEMENTS = 10, /*!< \brief Compute the shock capturing artificial viscosity for the halo elements, if needed. */
61 VOLUME_RESIDUAL = 11, /*!< \brief Compute the contribution to the residual from the volume integral. */
62 SURFACE_RESIDUAL_OWNED_ELEMENTS = 12, /*!< \brief Compute the contribution to the residual from the interior surface integral between owned elements. */
63 SURFACE_RESIDUAL_HALO_ELEMENTS = 13, /*!< \brief Compute the contribution to the residual from the interior surface integral between an owned and halo element. */
64 BOUNDARY_CONDITIONS_DEPEND_ON_OWNED = 14, /*!< \brief Compute the contribution to the residual from the boundary conditions that only depend on owned elements. */
65 BOUNDARY_CONDITIONS_DEPEND_ON_HALO = 15, /*!< \brief Compute the contribution to the residual from the boundary conditions that depend on halo elements. */
66 SUM_UP_RESIDUAL_CONTRIBUTIONS_OWNED_ELEMENTS = 16, /*!< \brief Sum up all contributions to the residual for the owned elements. */
67 SUM_UP_RESIDUAL_CONTRIBUTIONS_HALO_ELEMENTS = 17, /*!< \brief Sum up all contributions to the residual for the halo elements. */
68 ADER_ACCUMULATE_SPACETIME_RESIDUAL_OWNED_ELEMENTS = 18, /*!< \brief Accumlate the ADER space time residual for the owned elements. */
69 ADER_ACCUMULATE_SPACETIME_RESIDUAL_HALO_ELEMENTS = 19, /*!< \brief Accumlate the ADER space time residual for the halo elements. */
70 MULTIPLY_INVERSE_MASS_MATRIX = 20, /*!< \brief Multiply the accumulated residual with the inverse of the mass matrix. */
71 ADER_UPDATE_SOLUTION = 21 /*!< \brief Update the solution for the ADER scheme. */
72 };
73
74 SOLVER_TASK task; /*!< \brief Task to be carried out. */
75 unsigned short timeLevel; /*!< \brief Time level of the task to be carried out. */
76 unsigned short intPointADER; /*!< \brief Time integration point for ADER, if relevant for the task. */
77 bool secondPartTimeIntADER; /*!< \brief Whether or not this is the second part of the time interval for elements
78 adjacent to a lower time level. */
79 unsigned short nIndMustBeCompleted; /*!< \brief Number of relevant indices in indMustBeCompleted. */
80 int indMustBeCompleted[5]; /*!< \brief Indices in the list of tasks that must be completed before this task can be carried out. */
81
82 /*!
83 * \brief Constructor of the class.
84 */
85 CTaskDefinition(void);
86
87 /*!
88 * \brief Alternative constructor of the class, which initializes the member
89 variables to the given arguments.
90 * \param[in] val_task - Task to be set.
91 * \param[in] val_timeLevel - Time level to be set.
92 * \param[in] val_ind0MustBeCompleted - Completed index to be set, defaulted to -1.
93 * \param[in] val_ind1MustBeCompleted - Completed index to be set, defaulted to -1.
94 * \param[in] val_ind2MustBeCompleted - Completed index to be set, defaulted to -1.
95 * \param[in] val_ind3MustBeCompleted - Completed index to be set, defaulted to -1.
96 * \param[in] val_ind4MustBeCompleted - Completed index to be set, defaulted to -1.
97 */
99 unsigned short val_timeLevel,
100 int val_ind0MustBeCompleted = -1,
101 int val_ind1MustBeCompleted = -1,
102 int val_ind2MustBeCompleted = -1,
103 int val_ind3MustBeCompleted = -1,
104 int val_ind4MustBeCompleted = -1);
105
106 /*!
107 * \brief Destructor of the class.
108 */
109 ~CTaskDefinition(void);
110
111 /*!
112 * \brief Copy constructor of the class.
113 */
114 CTaskDefinition(const CTaskDefinition &other);
115
116 /*!
117 * \brief Assignment operator.
118 */
120
121private:
122 /*!
123 * \brief Function that copies the data from other into the member variables.
124 * \param[in] other - Object from which the data must be copied.
125 */
126 void Copy(const CTaskDefinition &other);
127};
128
129#include "task_definition.inl"
Class for defining a task to be carried out.
Definition task_definition.hpp:42
~CTaskDefinition(void)
Destructor of the class.
Definition task_definition.inl:70
CTaskDefinition & operator=(const CTaskDefinition &other)
Assignment operator.
Definition task_definition.inl:74
unsigned short intPointADER
Time integration point for ADER, if relevant for the task.
Definition task_definition.hpp:76
SOLVER_TASK task
Task to be carried out.
Definition task_definition.hpp:74
SOLVER_TASK
Enumerated type, which defines the tasks to be carried out.
Definition task_definition.hpp:49
@ NO_TASK
Default value used for checking.
Definition task_definition.hpp:50
@ BOUNDARY_CONDITIONS_DEPEND_ON_OWNED
Compute the contribution to the residual from the boundary conditions that only depend on owned eleme...
Definition task_definition.hpp:64
@ INITIATE_REVERSE_MPI_COMMUNICATION
Start the communication of the residuals.
Definition task_definition.hpp:55
@ ADER_PREDICTOR_STEP_INTERNAL_ELEMENTS
ADER predictor step for internal elements.
Definition task_definition.hpp:52
@ INITIATE_MPI_COMMUNICATION
Start the communication of the conserved variables.
Definition task_definition.hpp:53
@ ADER_ACCUMULATE_SPACETIME_RESIDUAL_HALO_ELEMENTS
Accumlate the ADER space time residual for the halo elements.
Definition task_definition.hpp:69
@ ADER_UPDATE_SOLUTION
Update the solution for the ADER scheme.
Definition task_definition.hpp:71
@ SURFACE_RESIDUAL_OWNED_ELEMENTS
Compute the contribution to the residual from the interior surface integral between owned elements.
Definition task_definition.hpp:62
@ SUM_UP_RESIDUAL_CONTRIBUTIONS_OWNED_ELEMENTS
Sum up all contributions to the residual for the owned elements.
Definition task_definition.hpp:66
@ COMPLETE_MPI_COMMUNICATION
Complete the communication of the conserved variables.
Definition task_definition.hpp:54
@ ADER_TIME_INTERPOLATE_HALO_ELEMENTS
Carry out a time interpolation to an integration point for the halo elements.
Definition task_definition.hpp:58
@ SHOCK_CAPTURING_VISCOSITY_HALO_ELEMENTS
Compute the shock capturing artificial viscosity for the halo elements, if needed.
Definition task_definition.hpp:60
@ SHOCK_CAPTURING_VISCOSITY_OWNED_ELEMENTS
Compute the shock capturing artificial viscosity for the owned elements, if needed.
Definition task_definition.hpp:59
@ SURFACE_RESIDUAL_HALO_ELEMENTS
Compute the contribution to the residual from the interior surface integral between an owned and halo...
Definition task_definition.hpp:63
@ ADER_PREDICTOR_STEP_COMM_ELEMENTS
ADER predictor step for elements whose solution must be communicated.
Definition task_definition.hpp:51
@ BOUNDARY_CONDITIONS_DEPEND_ON_HALO
Compute the contribution to the residual from the boundary conditions that depend on halo elements.
Definition task_definition.hpp:65
@ SUM_UP_RESIDUAL_CONTRIBUTIONS_HALO_ELEMENTS
Sum up all contributions to the residual for the halo elements.
Definition task_definition.hpp:67
@ ADER_TIME_INTERPOLATE_OWNED_ELEMENTS
Carry out a time interpolation to an integration point for the owned elements.
Definition task_definition.hpp:57
@ MULTIPLY_INVERSE_MASS_MATRIX
Multiply the accumulated residual with the inverse of the mass matrix.
Definition task_definition.hpp:70
@ ADER_ACCUMULATE_SPACETIME_RESIDUAL_OWNED_ELEMENTS
Accumlate the ADER space time residual for the owned elements.
Definition task_definition.hpp:68
@ COMPLETE_REVERSE_MPI_COMMUNICATION
Complete the communication of the residuals.
Definition task_definition.hpp:56
@ VOLUME_RESIDUAL
Compute the contribution to the residual from the volume integral.
Definition task_definition.hpp:61
unsigned short timeLevel
Time level of the task to be carried out.
Definition task_definition.hpp:75
bool secondPartTimeIntADER
Whether or not this is the second part of the time interval for elements adjacent to a lower time lev...
Definition task_definition.hpp:77
int indMustBeCompleted[5]
Indices in the list of tasks that must be completed before this task can be carried out.
Definition task_definition.hpp:80
CTaskDefinition(void)
Constructor of the class.
Definition task_definition.inl:30
unsigned short nIndMustBeCompleted
Number of relevant indices in indMustBeCompleted.
Definition task_definition.hpp:79
In-Line subroutines of the task_definition.hpp file.