Skip to content

Commit acb75bd

Browse files
authored
change kind_solver option to enum class (#1451)
* changed kind_solver option to enum class
1 parent 60b91d7 commit acb75bd

55 files changed

Lines changed: 765 additions & 708 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Common/include/CConfig.hpp

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,8 @@ class CConfig {
472472
CONDUCTIVITYMODEL Kind_ConductivityModel; /*!< \brief Kind of the Thermal Conductivity Model */
473473
CONDUCTIVITYMODEL_TURB Kind_ConductivityModel_Turb; /*!< \brief Kind of the Turbulent Thermal Conductivity Model */
474474
FREESTREAM_OPTION Kind_FreeStreamOption; /*!< \brief Kind of free stream option to choose if initializing with density or temperature */
475-
unsigned short Kind_Solver, /*!< \brief Kind of solver Euler, NS, Continuous adjoint, etc. */
476-
Kind_FluidModel, /*!< \brief Kind of the Fluid Model: Ideal or Van der Walls, ... . */
475+
MAIN_SOLVER Kind_Solver; /*!< \brief Kind of solver: Euler, NS, Continuous adjoint, etc. */
476+
unsigned short Kind_FluidModel, /*!< \brief Kind of the Fluid Model: Ideal, van der Waals, etc. */
477477
Kind_InitOption, /*!< \brief Kind of Init option to choose if initializing with Reynolds number or with thermodynamic conditions */
478478
Kind_GridMovement, /*!< \brief Kind of the static mesh movement. */
479479
*Kind_SurfaceMovement, /*!< \brief Kind of the static mesh movement. */
@@ -3539,25 +3539,18 @@ class CConfig {
35393539
* \param[in] val_zone - Zone where the soler is applied.
35403540
* \return Governing equation that we are solving.
35413541
*/
3542-
unsigned short GetKind_Solver(void) const { return Kind_Solver; }
3543-
3544-
/*!
3545-
* \brief Governing equations of the flow (it can be different from the run time equation).
3546-
* \param[in] val_zone - Zone where the soler is applied.
3547-
* \return Governing equation that we are solving.
3548-
*/
3549-
void SetKind_Solver(unsigned short val_solver) { Kind_Solver = val_solver; }
3542+
MAIN_SOLVER GetKind_Solver(void) const { return Kind_Solver; }
35503543

35513544
/*!
35523545
* \brief Return true if a fluid solver is in use.
35533546
*/
35543547
bool GetFluidProblem(void) const {
35553548
switch (Kind_Solver) {
3556-
case EULER : case NAVIER_STOKES: case RANS:
3557-
case INC_EULER : case INC_NAVIER_STOKES: case INC_RANS:
3558-
case NEMO_EULER : case NEMO_NAVIER_STOKES:
3559-
case DISC_ADJ_INC_EULER: case DISC_ADJ_INC_NAVIER_STOKES: case DISC_ADJ_INC_RANS:
3560-
case DISC_ADJ_EULER: case DISC_ADJ_NAVIER_STOKES: case DISC_ADJ_RANS:
3549+
case MAIN_SOLVER::EULER : case MAIN_SOLVER::NAVIER_STOKES: case MAIN_SOLVER::RANS:
3550+
case MAIN_SOLVER::INC_EULER : case MAIN_SOLVER::INC_NAVIER_STOKES: case MAIN_SOLVER::INC_RANS:
3551+
case MAIN_SOLVER::NEMO_EULER : case MAIN_SOLVER::NEMO_NAVIER_STOKES:
3552+
case MAIN_SOLVER::DISC_ADJ_INC_EULER: case MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_INC_RANS:
3553+
case MAIN_SOLVER::DISC_ADJ_EULER: case MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_RANS:
35613554
return true;
35623555
default:
35633556
return false;
@@ -3568,23 +3561,23 @@ class CConfig {
35683561
* \brief Return true if a structural solver is in use.
35693562
*/
35703563
bool GetStructuralProblem(void) const {
3571-
return (Kind_Solver == FEM_ELASTICITY) || (Kind_Solver == DISC_ADJ_FEM);
3564+
return (Kind_Solver == MAIN_SOLVER::FEM_ELASTICITY) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_FEM);
35723565
}
35733566

35743567
/*!
35753568
* \brief Return true if a heat solver is in use.
35763569
*/
35773570
bool GetHeatProblem(void) const {
3578-
return (Kind_Solver == HEAT_EQUATION) || (Kind_Solver == DISC_ADJ_HEAT);
3571+
return (Kind_Solver == MAIN_SOLVER::HEAT_EQUATION) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_HEAT);
35793572
}
35803573

35813574
/*!
35823575
* \brief Return true if a high order FEM solver is in use.
35833576
*/
35843577
bool GetFEMSolver(void) const {
35853578
switch (Kind_Solver) {
3586-
case FEM_EULER: case FEM_NAVIER_STOKES: case FEM_RANS: case FEM_LES:
3587-
case DISC_ADJ_FEM_EULER: case DISC_ADJ_FEM_NS: case DISC_ADJ_FEM_RANS:
3579+
case MAIN_SOLVER::FEM_EULER: case MAIN_SOLVER::FEM_NAVIER_STOKES: case MAIN_SOLVER::FEM_RANS: case MAIN_SOLVER::FEM_LES:
3580+
case MAIN_SOLVER::DISC_ADJ_FEM_EULER: case MAIN_SOLVER::DISC_ADJ_FEM_NS: case MAIN_SOLVER::DISC_ADJ_FEM_RANS:
35883581
return true;
35893582
default:
35903583
return false;
@@ -3596,7 +3589,7 @@ class CConfig {
35963589
*/
35973590
bool GetNEMOProblem(void) const {
35983591
switch (Kind_Solver) {
3599-
case NEMO_EULER : case NEMO_NAVIER_STOKES:
3592+
case MAIN_SOLVER::NEMO_EULER : case MAIN_SOLVER::NEMO_NAVIER_STOKES:
36003593
return true;
36013594
default:
36023595
return false;
@@ -6207,7 +6200,7 @@ class CConfig {
62076200
* \param[in] val_solver - Solver of the simulation.
62086201
* \param[in] val_system - Runtime system that we are solving.
62096202
*/
6210-
void SetGlobalParam(unsigned short val_solver, unsigned short val_system);
6203+
void SetGlobalParam(MAIN_SOLVER val_solver, unsigned short val_system);
62116204

62126205
/*!
62136206
* \brief Center of rotation for a rotational periodic boundary.

Common/include/option_structure.hpp

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -225,71 +225,71 @@ static const MapType<std::string, AVERAGE_TYPE> Average_Map = {
225225
/*!
226226
* \brief different solver types for the CFD component
227227
*/
228-
enum ENUM_MAIN_SOLVER {
229-
NO_SOLVER = 0, /*!< \brief Definition of no solver. */
230-
EULER = 1, /*!< \brief Definition of the Euler's solver. */
231-
NAVIER_STOKES = 2, /*!< \brief Definition of the Navier-Stokes' solver. */
232-
RANS = 3, /*!< \brief Definition of the Reynolds-averaged Navier-Stokes' (RANS) solver. */
233-
INC_EULER = 4, /*!< \brief Definition of the incompressible Euler's solver. */
234-
INC_NAVIER_STOKES =5, /*!< \brief Definition of the incompressible Navier-Stokes' solver. */
235-
INC_RANS = 6, /*!< \brief Definition of the incompressible Reynolds-averaged Navier-Stokes' (RANS) solver. */
236-
HEAT_EQUATION = 7, /*!< \brief Definition of the finite volume heat solver. */
237-
FEM_ELASTICITY = 9, /*!< \brief Definition of a FEM solver. */
238-
ADJ_EULER = 10, /*!< \brief Definition of the continuous adjoint Euler's solver. */
239-
ADJ_NAVIER_STOKES = 11, /*!< \brief Definition of the continuous adjoint Navier-Stokes' solver. */
240-
ADJ_RANS = 12, /*!< \brief Definition of the continuous adjoint Reynolds-averaged Navier-Stokes' (RANS) solver. */
241-
TEMPLATE_SOLVER = 13, /*!< \brief Definition of template solver. */
242-
DISC_ADJ_EULER = 15, /*!< \brief Definition of the discrete adjoint Euler solver. */
243-
DISC_ADJ_RANS = 16, /*!< \brief Definition of the discrete adjoint Reynolds-averaged Navier-Stokes' (RANS) solver. */
244-
DISC_ADJ_NAVIER_STOKES = 17, /*!< \brief Definition of the discrete adjoint Navier-Stokes' solver. */
245-
DISC_ADJ_INC_EULER = 18, /*!< \brief Definition of the discrete adjoint incompressible Euler solver. */
246-
DISC_ADJ_INC_RANS = 19, /*!< \brief Definition of the discrete adjoint imcompressible Reynolds-averaged Navier-Stokes' (RANS) solver. */
247-
DISC_ADJ_INC_NAVIER_STOKES = 20, /*!< \brief Definition of the discrete adjoint imcompressible Navier-Stokes'. */
248-
DISC_ADJ_HEAT = 21, /*!< \brief Definition of the discrete adjoint heat solver. */
249-
DISC_ADJ_FEM_EULER = 22, /*!< \brief Definition of the discrete adjoint FEM Euler solver. */
250-
DISC_ADJ_FEM_RANS = 23, /*!< \brief Definition of the discrete adjoint FEM Reynolds-averaged Navier-Stokes' (RANS) solver. */
251-
DISC_ADJ_FEM_NS = 24, /*!< \brief Definition of the discrete adjoint FEM Navier-Stokes' solver. */
252-
DISC_ADJ_FEM = 25, /*!< \brief Definition of the discrete adjoint FEM solver. */
253-
FEM_EULER = 26, /*!< \brief Definition of the finite element Euler's solver. */
254-
FEM_NAVIER_STOKES = 27, /*!< \brief Definition of the finite element Navier-Stokes' solver. */
255-
FEM_RANS = 28, /*!< \brief Definition of the finite element Reynolds-averaged Navier-Stokes' (RANS) solver. */
256-
FEM_LES = 29, /*!< \brief Definition of the finite element Large Eddy Simulation Navier-Stokes' (LES) solver. */
257-
MULTIPHYSICS = 30,
258-
NEMO_EULER = 41, /*!< \brief Definition of the NEMO Euler solver. */
259-
NEMO_NAVIER_STOKES = 42 /*!< \brief Definition of the NEMO NS solver. */
260-
};
261-
static const MapType<std::string, ENUM_MAIN_SOLVER> Solver_Map = {
262-
MakePair("NONE", NO_SOLVER)
263-
MakePair("EULER", EULER)
264-
MakePair("NAVIER_STOKES", NAVIER_STOKES)
265-
MakePair("RANS", RANS)
266-
MakePair("INC_EULER", INC_EULER)
267-
MakePair("INC_NAVIER_STOKES", INC_NAVIER_STOKES)
268-
MakePair("INC_RANS", INC_RANS)
269-
MakePair("FEM_EULER", FEM_EULER)
270-
MakePair("FEM_NAVIER_STOKES", FEM_NAVIER_STOKES)
271-
MakePair("FEM_RANS", FEM_RANS)
272-
MakePair("FEM_LES", FEM_LES)
273-
MakePair("NEMO_EULER",NEMO_EULER)
274-
MakePair("NEMO_NAVIER_STOKES",NEMO_NAVIER_STOKES)
275-
MakePair("ADJ_EULER", ADJ_EULER)
276-
MakePair("ADJ_NAVIER_STOKES", ADJ_NAVIER_STOKES)
277-
MakePair("ADJ_RANS", ADJ_RANS )
278-
MakePair("HEAT_EQUATION", HEAT_EQUATION)
279-
MakePair("ELASTICITY", FEM_ELASTICITY)
280-
MakePair("DISC_ADJ_EULER", DISC_ADJ_EULER)
281-
MakePair("DISC_ADJ_RANS", DISC_ADJ_RANS)
282-
MakePair("DISC_ADJ_NAVIERSTOKES", DISC_ADJ_NAVIER_STOKES)
283-
MakePair("DISC_ADJ_INC_EULER", DISC_ADJ_INC_EULER)
284-
MakePair("DISC_ADJ_INC_RANS", DISC_ADJ_INC_RANS)
285-
MakePair("DISC_ADJ_INC_NAVIERSTOKES", DISC_ADJ_INC_NAVIER_STOKES)
286-
MakePair("DISC_ADJ_HEAT_EQUATION", DISC_ADJ_HEAT)
287-
MakePair("DISC_ADJ_FEM_EULER", DISC_ADJ_FEM_EULER)
288-
MakePair("DISC_ADJ_FEM_RANS", DISC_ADJ_FEM_RANS)
289-
MakePair("DISC_ADJ_FEM_NS", DISC_ADJ_FEM_NS)
290-
MakePair("DISC_ADJ_FEM", DISC_ADJ_FEM)
291-
MakePair("TEMPLATE_SOLVER", TEMPLATE_SOLVER)
292-
MakePair("MULTIPHYSICS", MULTIPHYSICS)
228+
enum class MAIN_SOLVER {
229+
NONE, /*!< \brief Definition of no solver. */
230+
EULER, /*!< \brief Definition of the Euler's solver. */
231+
NAVIER_STOKES, /*!< \brief Definition of the Navier-Stokes' solver. */
232+
RANS, /*!< \brief Definition of the Reynolds-averaged Navier-Stokes' (RANS) solver. */
233+
INC_EULER, /*!< \brief Definition of the incompressible Euler's solver. */
234+
INC_NAVIER_STOKES, /*!< \brief Definition of the incompressible Navier-Stokes' solver. */
235+
INC_RANS, /*!< \brief Definition of the incompressible Reynolds-averaged Navier-Stokes' (RANS) solver. */
236+
HEAT_EQUATION, /*!< \brief Definition of the finite volume heat solver. */
237+
FEM_ELASTICITY, /*!< \brief Definition of a FEM solver. */
238+
ADJ_EULER, /*!< \brief Definition of the continuous adjoint Euler's solver. */
239+
ADJ_NAVIER_STOKES, /*!< \brief Definition of the continuous adjoint Navier-Stokes' solver. */
240+
ADJ_RANS, /*!< \brief Definition of the continuous adjoint Reynolds-averaged Navier-Stokes' (RANS) solver. */
241+
TEMPLATE_SOLVER, /*!< \brief Definition of template solver. */
242+
DISC_ADJ_EULER, /*!< \brief Definition of the discrete adjoint Euler solver. */
243+
DISC_ADJ_RANS, /*!< \brief Definition of the discrete adjoint Reynolds-averaged Navier-Stokes' (RANS) solver. */
244+
DISC_ADJ_NAVIER_STOKES, /*!< \brief Definition of the discrete adjoint Navier-Stokes' solver. */
245+
DISC_ADJ_INC_EULER, /*!< \brief Definition of the discrete adjoint incompressible Euler solver. */
246+
DISC_ADJ_INC_RANS, /*!< \brief Definition of the discrete adjoint incompressible Reynolds-averaged Navier-Stokes' (RANS) solver. */
247+
DISC_ADJ_INC_NAVIER_STOKES, /*!< \brief Definition of the discrete adjoint incompressible Navier-Stokes'. */
248+
DISC_ADJ_HEAT, /*!< \brief Definition of the discrete adjoint heat solver. */
249+
DISC_ADJ_FEM_EULER, /*!< \brief Definition of the discrete adjoint FEM Euler solver. */
250+
DISC_ADJ_FEM_RANS, /*!< \brief Definition of the discrete adjoint FEM Reynolds-averaged Navier-Stokes' (RANS) solver. */
251+
DISC_ADJ_FEM_NS, /*!< \brief Definition of the discrete adjoint FEM Navier-Stokes' solver. */
252+
DISC_ADJ_FEM, /*!< \brief Definition of the discrete adjoint FEM solver. */
253+
FEM_EULER, /*!< \brief Definition of the finite element Euler's solver. */
254+
FEM_NAVIER_STOKES, /*!< \brief Definition of the finite element Navier-Stokes' solver. */
255+
FEM_RANS, /*!< \brief Definition of the finite element Reynolds-averaged Navier-Stokes' (RANS) solver. */
256+
FEM_LES, /*!< \brief Definition of the finite element Large Eddy Simulation Navier-Stokes' (LES) solver. */
257+
MULTIPHYSICS,
258+
NEMO_EULER, /*!< \brief Definition of the NEMO Euler solver. */
259+
NEMO_NAVIER_STOKES, /*!< \brief Definition of the NEMO NS solver. */
260+
};
261+
static const MapType<std::string, MAIN_SOLVER> Solver_Map = {
262+
MakePair("NONE", MAIN_SOLVER::NONE)
263+
MakePair("EULER", MAIN_SOLVER::EULER)
264+
MakePair("NAVIER_STOKES", MAIN_SOLVER::NAVIER_STOKES)
265+
MakePair("RANS", MAIN_SOLVER::RANS)
266+
MakePair("INC_EULER", MAIN_SOLVER::INC_EULER)
267+
MakePair("INC_NAVIER_STOKES", MAIN_SOLVER::INC_NAVIER_STOKES)
268+
MakePair("INC_RANS", MAIN_SOLVER::INC_RANS)
269+
MakePair("FEM_EULER", MAIN_SOLVER::FEM_EULER)
270+
MakePair("FEM_NAVIER_STOKES", MAIN_SOLVER::FEM_NAVIER_STOKES)
271+
MakePair("FEM_RANS", MAIN_SOLVER::FEM_RANS)
272+
MakePair("FEM_LES", MAIN_SOLVER::FEM_LES)
273+
MakePair("NEMO_EULER",MAIN_SOLVER::NEMO_EULER)
274+
MakePair("NEMO_NAVIER_STOKES",MAIN_SOLVER::NEMO_NAVIER_STOKES)
275+
MakePair("ADJ_EULER", MAIN_SOLVER::ADJ_EULER)
276+
MakePair("ADJ_NAVIER_STOKES", MAIN_SOLVER::ADJ_NAVIER_STOKES)
277+
MakePair("ADJ_RANS", MAIN_SOLVER::ADJ_RANS )
278+
MakePair("HEAT_EQUATION", MAIN_SOLVER::HEAT_EQUATION)
279+
MakePair("ELASTICITY", MAIN_SOLVER::FEM_ELASTICITY)
280+
MakePair("DISC_ADJ_EULER", MAIN_SOLVER::DISC_ADJ_EULER)
281+
MakePair("DISC_ADJ_RANS", MAIN_SOLVER::DISC_ADJ_RANS)
282+
MakePair("DISC_ADJ_NAVIERSTOKES", MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES)
283+
MakePair("DISC_ADJ_INC_EULER", MAIN_SOLVER::DISC_ADJ_INC_EULER)
284+
MakePair("DISC_ADJ_INC_RANS", MAIN_SOLVER::DISC_ADJ_INC_RANS)
285+
MakePair("DISC_ADJ_INC_NAVIERSTOKES", MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES)
286+
MakePair("DISC_ADJ_HEAT_EQUATION", MAIN_SOLVER::DISC_ADJ_HEAT)
287+
MakePair("DISC_ADJ_FEM_EULER", MAIN_SOLVER::DISC_ADJ_FEM_EULER)
288+
MakePair("DISC_ADJ_FEM_RANS", MAIN_SOLVER::DISC_ADJ_FEM_RANS)
289+
MakePair("DISC_ADJ_FEM_NS", MAIN_SOLVER::DISC_ADJ_FEM_NS)
290+
MakePair("DISC_ADJ_FEM", MAIN_SOLVER::DISC_ADJ_FEM)
291+
MakePair("TEMPLATE_SOLVER", MAIN_SOLVER::TEMPLATE_SOLVER)
292+
MakePair("MULTIPHYSICS", MAIN_SOLVER::MULTIPHYSICS)
293293
};
294294

295295
/*!

Common/include/toolboxes/MMS/CVerificationSolution.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class CVerificationSolution {
4646
unsigned short nDim; /*!< \brief Number of dimension of the problem. */
4747
unsigned short nVar; /*!< \brief Number of variables of the problem */
4848

49-
unsigned short Kind_Solver; /*!< \brief The kind of solver we are running. */
49+
MAIN_SOLVER Kind_Solver; /*!< \brief The kind of solver we are running. */
5050

5151
private:
5252

0 commit comments

Comments
 (0)