Skip to content

Commit e303ace

Browse files
committed
Merge branch 'develop' into feature_clang-tidy
2 parents 0363953 + b159ff8 commit e303ace

26 files changed

Lines changed: 182 additions & 540 deletions

SU2_CFD/include/drivers/CDiscAdjMultizoneDriver.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,6 @@ class CDiscAdjMultizoneDriver : public CMultizoneDriver {
141141
*/
142142
void StartSolver() override;
143143

144-
protected:
145-
146144
/*!
147145
* \brief Preprocess the multizone iteration
148146
*/
@@ -153,6 +151,8 @@ class CDiscAdjMultizoneDriver : public CMultizoneDriver {
153151
*/
154152
void Run() override;
155153

154+
protected:
155+
156156
/*!
157157
* \brief Run one inner iteration for a given zone.
158158
* \return The result of "monitor".
@@ -272,7 +272,7 @@ class CDiscAdjMultizoneDriver : public CMultizoneDriver {
272272
* \brief gets Convergence on physical time scale, (deactivated in adjoint case)
273273
* \return false
274274
*/
275-
inline bool GetTimeConvergence() const override {return false;}
275+
inline bool GetTimeConvergence() const override { return false; }
276276

277277
/*!
278278
* \brief Get the external of all adjoint solvers in a zone.

SU2_CFD/include/drivers/CDiscAdjSinglezoneDriver.hpp

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -57,40 +57,6 @@ class CDiscAdjSinglezoneDriver : public CSinglezoneDriver {
5757

5858
COutputLegacy* output_legacy;
5959

60-
public:
61-
62-
/*!
63-
* \brief Constructor of the class.
64-
* \param[in] confFile - Configuration file name.
65-
* \param[in] val_nZone - Total number of zones.
66-
* \param[in] val_nDim - Total number of dimensions.
67-
* \param[in] MPICommunicator - MPI communicator for SU2.
68-
*/
69-
CDiscAdjSinglezoneDriver(char* confFile,
70-
unsigned short val_nZone,
71-
SU2_Comm MPICommunicator);
72-
73-
/*!
74-
* \brief Destructor of the class.
75-
*/
76-
~CDiscAdjSinglezoneDriver(void) override;
77-
78-
/*!
79-
* \brief Preprocess the single-zone iteration
80-
* \param[in] TimeIter - index of the current time-step.
81-
*/
82-
void Preprocess(unsigned long TimeIter) override;
83-
84-
/*!
85-
* \brief Run a single iteration of the discrete adjoint solver with a single zone.
86-
*/
87-
void Run(void) override;
88-
89-
/*!
90-
* \brief Postprocess the adjoint iteration for ZONE_0.
91-
*/
92-
void Postprocess(void) override;
93-
9460
/*!
9561
* \brief Record one iteration of a flow iteration in within multiple zones.
9662
* \param[in] kind_recording - Type of recording (full list in ENUM_RECORDING, option_structure.hpp)
@@ -127,6 +93,39 @@ class CDiscAdjSinglezoneDriver : public CSinglezoneDriver {
12793
* \brief gets Convergence on physical time scale, (deactivated in adjoint case)
12894
* \return false
12995
*/
130-
inline bool GetTimeConvergence() const override {return false;};
96+
inline bool GetTimeConvergence() const override { return false; }
13197

98+
public:
99+
100+
/*!
101+
* \brief Constructor of the class.
102+
* \param[in] confFile - Configuration file name.
103+
* \param[in] val_nZone - Total number of zones.
104+
* \param[in] val_nDim - Total number of dimensions.
105+
* \param[in] MPICommunicator - MPI communicator for SU2.
106+
*/
107+
CDiscAdjSinglezoneDriver(char* confFile,
108+
unsigned short val_nZone,
109+
SU2_Comm MPICommunicator);
110+
111+
/*!
112+
* \brief Destructor of the class.
113+
*/
114+
~CDiscAdjSinglezoneDriver(void) override;
115+
116+
/*!
117+
* \brief Preprocess the single-zone iteration
118+
* \param[in] TimeIter - index of the current time-step.
119+
*/
120+
void Preprocess(unsigned long TimeIter) override;
121+
122+
/*!
123+
* \brief Run a single iteration of the discrete adjoint solver with a single zone.
124+
*/
125+
void Run(void) override;
126+
127+
/*!
128+
* \brief Postprocess the adjoint iteration for ZONE_0.
129+
*/
130+
void Postprocess(void) override;
132131
};

SU2_CFD/include/drivers/CDriver.hpp

Lines changed: 59 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class CDriver : public CDriverBase {
106106

107107
protected:
108108
/*!
109-
* \brief Initialize containers.
109+
* \brief Initialize containers.
110110
*/
111111
void InitializeContainers();
112112

@@ -154,6 +154,14 @@ class CDriver : public CDriverBase {
154154
*/
155155
void InitializeSolver(CConfig* config, CGeometry** geometry, CSolver***& solver);
156156

157+
/*!
158+
* \brief Preprocess the inlets via file input for all solvers.
159+
* \param[in] solver_container - Container vector with all the solutions.
160+
* \param[in] geometry - Geometrical definition of the problem.
161+
* \param[in] config - Definition of the particular problem.
162+
*/
163+
void PreprocessInlet(CSolver*** solver, CGeometry** geometry, CConfig* config) const;
164+
157165
/*!
158166
* \brief Restart of the solvers from the restart files.
159167
* \param[in] solver - Container vector with all the solutions.
@@ -335,21 +343,6 @@ class CDriver : public CDriverBase {
335343
*/
336344
virtual void RelaxationTractions(unsigned short donorZone, unsigned short targetZone, unsigned long iOuterIter) {}
337345

338-
/*!
339-
* \brief A virtual member to run a Block Gauss-Seidel iteration in multi-zone problems.
340-
*/
341-
virtual void RunGaussSeidel() {}
342-
343-
/*!
344-
* \brief A virtual member to run a Block-Jacobi iteration in multi-zone problems.
345-
*/
346-
virtual void RunJacobi() {}
347-
348-
/*!
349-
* \brief A virtual member.
350-
*/
351-
void Update() override {}
352-
353346
/*!
354347
* \brief Print out the direct residuals.
355348
* \param[in] kind_recording - Type of recording (full list in ENUM_RECORDING, option_structure.hpp)
@@ -408,6 +401,21 @@ class CDriver : public CDriverBase {
408401
}
409402
}
410403

404+
/*!
405+
* \brief Sum the number of primal or adjoint variables for all solvers in a given zone.
406+
* \param[in] iZone - Index of the zone.
407+
* \param[in] adjoint - True to consider adjoint solvers instead of primal.
408+
* \return Total number of solution variables.
409+
*/
410+
unsigned short GetTotalNumberOfVariables(unsigned short iZone, bool adjoint) const {
411+
unsigned short nVar = 0;
412+
for (auto iSol = 0u; iSol < MAX_SOLS; iSol++) {
413+
auto solver = solver_container[iZone][INST_0][MESH_0][iSol];
414+
if (solver && (solver->GetAdjoint() == adjoint)) nVar += solver->GetnVar();
415+
}
416+
return nVar;
417+
}
418+
411419
public:
412420
/*!
413421
* \brief Launch the computation for all zones and all physics.
@@ -419,11 +427,6 @@ class CDriver : public CDriverBase {
419427
*/
420428
void Finalize() override;
421429

422-
/*!
423-
* \brief A virtual member.
424-
*/
425-
virtual void ResetConvergence();
426-
427430
/*!
428431
* \brief Perform some pre-processing before an iteration of the physics.
429432
*/
@@ -446,10 +449,9 @@ class CDriver : public CDriverBase {
446449
virtual void DynamicMeshUpdate(unsigned long TimeIter) {}
447450

448451
/*!
449-
* \brief Perform a dynamic mesh deformation, including grid velocity computation and update of the multi-grid
450-
* structure.
452+
* \brief Update the dual-time solution.
451453
*/
452-
virtual void DynamicMeshUpdate(unsigned short val_iZone, unsigned long TimeIter) {}
454+
virtual void Update() {}
453455

454456
/*!
455457
* \brief Perform a mesh deformation as initial condition.
@@ -488,14 +490,6 @@ class CDriver : public CDriverBase {
488490
*/
489491
string GetSurfaceFileName() const;
490492

491-
/*!
492-
* \brief Preprocess the inlets via file input for all solvers.
493-
* \param[in] solver_container - Container vector with all the solutions.
494-
* \param[in] geometry - Geometrical definition of the problem.
495-
* \param[in] config - Definition of the particular problem.
496-
*/
497-
void PreprocessInlet(CSolver*** solver, CGeometry** geometry, CConfig* config) const;
498-
499493
/*!
500494
* \brief Set the position of the heat source.
501495
* \param[in] alpha - Angle of rotation respect to Z axis.
@@ -513,21 +507,6 @@ class CDriver : public CDriverBase {
513507
void SetInletAngle(unsigned short iMarker, passivedouble alpha);
514508

515509
/// \}
516-
517-
/*!
518-
* \brief Sum the number of primal or adjoint variables for all solvers in a given zone.
519-
* \param[in] iZone - Index of the zone.
520-
* \param[in] adjoint - True to consider adjoint solvers instead of primal.
521-
* \return Total number of solution variables.
522-
*/
523-
unsigned short GetTotalNumberOfVariables(unsigned short iZone, bool adjoint) const {
524-
unsigned short nVar = 0;
525-
for (auto iSol = 0u; iSol < MAX_SOLS; iSol++) {
526-
auto solver = solver_container[iZone][INST_0][MESH_0][iSol];
527-
if (solver && (solver->GetAdjoint() == adjoint)) nVar += solver->GetnVar();
528-
}
529-
return nVar;
530-
}
531510
};
532511

533512
/*!
@@ -540,7 +519,6 @@ class CFluidDriver : public CDriver {
540519
protected:
541520
unsigned long Max_Iter;
542521

543-
protected:
544522
/*!
545523
* \brief Constructor of the class.
546524
* \param[in] confFile - Configuration file name.
@@ -549,6 +527,11 @@ class CFluidDriver : public CDriver {
549527
*/
550528
CFluidDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunicator);
551529

530+
/*!
531+
* \brief Transfer data among different zones (multiple zone).
532+
*/
533+
void TransferData(unsigned short donorZone, unsigned short targetZone);
534+
552535
public:
553536
/*!
554537
* \brief Destructor of the class.
@@ -590,11 +573,6 @@ class CFluidDriver : public CDriver {
590573
* structure (multiple zone).
591574
*/
592575
void DynamicMeshUpdate(unsigned long TimeIter) override;
593-
594-
/*!
595-
* \brief Transfer data among different zones (multiple zone).
596-
*/
597-
void TransferData(unsigned short donorZone, unsigned short targetZone);
598576
};
599577

600578
/*!
@@ -607,6 +585,16 @@ class CTurbomachineryDriver : public CFluidDriver {
607585
private:
608586
COutputLegacy* output_legacy;
609587

588+
/*!
589+
* \brief Set Mixing Plane interface within multiple zones.
590+
*/
591+
void SetMixingPlane(unsigned short iZone);
592+
593+
/*!
594+
* \brief Set Mixing Plane interface within multiple zones.
595+
*/
596+
void SetTurboPerformance(unsigned short targetZone);
597+
610598
public:
611599
/*!
612600
* \brief Constructor of the class.
@@ -627,16 +615,6 @@ class CTurbomachineryDriver : public CFluidDriver {
627615

628616
void Run() override;
629617

630-
/*!
631-
* \brief Set Mixing Plane interface within multiple zones.
632-
*/
633-
void SetMixingPlane(unsigned short iZone);
634-
635-
/*!
636-
* \brief Set Mixing Plane interface within multiple zones.
637-
*/
638-
void SetTurboPerformance(unsigned short targetZone);
639-
640618
/*!
641619
* \brief Monitor the computation.
642620
*/
@@ -655,25 +633,6 @@ class CHBDriver : public CFluidDriver {
655633
unsigned short nInstHB;
656634
su2double** D; /*!< \brief Harmonic Balance operator. */
657635

658-
public:
659-
/*!
660-
* \brief Constructor of the class.
661-
* \param[in] confFile - Configuration file name.
662-
* \param[in] val_nZone - Total number of zones.
663-
* \param[in] MPICommunicator - MPI communicator for SU2.
664-
*/
665-
CHBDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunicator);
666-
667-
/*!
668-
* \brief Destructor of the class.
669-
*/
670-
~CHBDriver(void) override;
671-
672-
/*!
673-
* \brief Run a single iteration of a Harmonic Balance problem.
674-
*/
675-
void Run() override;
676-
677636
/*!
678637
* \brief Computation and storage of the Harmonic Balance method source terms.
679638
* \author T. Economon, K. Naik
@@ -693,13 +652,27 @@ class CHBDriver : public CFluidDriver {
693652
*/
694653
void ComputeHBOperator();
695654

655+
public:
696656
/*!
697-
* \brief Update the solution for the Harmonic Balance.
657+
* \brief Constructor of the class.
658+
* \param[in] confFile - Configuration file name.
659+
* \param[in] val_nZone - Total number of zones.
660+
* \param[in] MPICommunicator - MPI communicator for SU2.
698661
*/
699-
void Update() override;
662+
CHBDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunicator);
663+
664+
/*!
665+
* \brief Destructor of the class.
666+
*/
667+
~CHBDriver(void) override;
668+
669+
/*!
670+
* \brief Run a single iteration of a Harmonic Balance problem.
671+
*/
672+
void Run() override;
700673

701674
/*!
702-
* \brief Reset the convergence flag (set to false) of the solver for the Harmonic Balance.
675+
* \brief Update the solution for the Harmonic Balance.
703676
*/
704-
void ResetConvergence() override;
677+
void Update() override;
705678
};

SU2_CFD/include/drivers/CDriverBase.hpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -92,26 +92,11 @@ class CDriverBase {
9292
*/
9393
virtual ~CDriverBase(void);
9494

95-
/*!
96-
* \brief A virtual member.
97-
*/
98-
virtual void Preprocessing(){}
99-
10095
/*!
10196
* \brief A virtual member.
10297
*/
10398
virtual void Run(){}
10499

105-
/*!
106-
* \brief A virtual member.
107-
*/
108-
virtual void Update(){}
109-
110-
/*!
111-
* \brief A virtual member.
112-
*/
113-
virtual void Output(){}
114-
115100
/*!
116101
* \brief A virtual member.
117102
*/

0 commit comments

Comments
 (0)