Skip to content

Commit 26d3581

Browse files
authored
Merge branch 'develop' into feature_NEMO_euler_implicit
2 parents 3ce0bad + 4e87793 commit 26d3581

22 files changed

Lines changed: 90 additions & 98 deletions

SU2_CFD/include/iteration/CDiscAdjFEAIteration.hpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -169,18 +169,6 @@ class CDiscAdjFEAIteration final : public CIteration {
169169
void InitializeAdjoint(CSolver***** solver, CGeometry**** geometry, CConfig** config, unsigned short iZone,
170170
unsigned short iInst) override;
171171

172-
/*!
173-
* \brief Record a single iteration of the direct FEM system.
174-
* \param[in] solver - Container vector with all the solutions.
175-
* \param[in] geometry - Geometrical definition of the problem.
176-
* \param[in] config - Definition of the particular problem.
177-
* \param[in] val_iZone - Index of the zone.
178-
* \param[in] val_iInst - Index of the instance.
179-
* \param[in] kind_recording - The kind of recording (geometry or flow).
180-
*/
181-
void SetRecording(CSolver***** solver, CGeometry**** geometry, CConfig** config, unsigned short val_iZone,
182-
unsigned short val_iInst, RECORDING kind_recording) override;
183-
184172
/*!
185173
* \brief Compute necessary variables that depend on the variables in the numerics (E, Nu...)
186174
* \param[in] solver - Container vector with all the solutions.

SU2_CFD/include/iteration/CDiscAdjFluidIteration.hpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -165,18 +165,6 @@ class CDiscAdjFluidIteration final : public CIteration {
165165
void RegisterOutput(CSolver***** solver, CGeometry**** geometry, CConfig** config,
166166
unsigned short iZone, unsigned short iInst) override;
167167

168-
/*!
169-
* \brief Record a single iteration of the direct mean flow system.
170-
* \param[in] solver - Container vector with all the solutions.
171-
* \param[in] geometry - Geometrical definition of the problem.
172-
* \param[in] config - Definition of the particular problem.
173-
* \param[in] val_iZone - Index of the zone.
174-
* \param[in] val_iInst - Index of the instance.
175-
* \param[in] kind_recording - The kind of recording (geometry or flow).
176-
*/
177-
void SetRecording(CSolver***** solver, CGeometry**** geometry, CConfig** config, unsigned short val_iZone,
178-
unsigned short val_iInst, RECORDING kind_recording) override;
179-
180168
/*!
181169
* \brief Compute necessary variables that depend on the conservative variables or the mesh node positions
182170
* (e.g. turbulent variables, normals, volumes).

SU2_CFD/include/iteration/CIteration.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,4 @@ class CIteration {
291291

292292
virtual void RegisterOutput(CSolver***** solver, CGeometry**** geometry, CConfig** config,
293293
unsigned short iZone, unsigned short iInst) {}
294-
295-
virtual void SetRecording(CSolver***** solver, CGeometry**** geometry, CConfig** config, unsigned short val_iZone,
296-
unsigned short val_iInst, RECORDING kind_recording) {}
297294
};

SU2_CFD/include/output/CAdjFlowCompOutput.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class CAdjFlowCompOutput final: public COutput {
3838
private:
3939

4040
bool cont_adj; /*!< \brief Boolean indicating whether we run a cont. adjoint problem */
41+
bool frozen_visc; /*!< \brief Boolean indicating whether frozen viscosity/turbulence is used. */
4142
unsigned short turb_model; /*!< \brief The kind of turbulence model*/
4243

4344
public:

SU2_CFD/include/output/CAdjFlowIncOutput.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ class CAdjFlowIncOutput final: public COutput {
4141
RADIATION_MODEL rad_model; /*!< \brief The kind of radiation model */
4242
bool heat; /*!< \brief Boolean indicating whether have a heat problem*/
4343
bool weakly_coupled_heat; /*!< \brief Boolean indicating whether have a weakly coupled heat equation*/
44+
bool cont_adj; /*!< \brief Boolean indicating whether we run a cont. adjoint problem */
45+
bool frozen_visc; /*!< \brief Boolean indicating whether frozen viscosity/turbulence is used. */
4446

4547
public:
4648

SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -569,13 +569,13 @@ void CDiscAdjMultizoneDriver::SetRecording(RECORDING kind_recording, Kind_Tape t
569569

570570
AD::Reset();
571571

572-
/*--- Prepare for recording by resetting the flow solution to the initial converged solution---*/
572+
/*--- Prepare for recording by resetting the solution to the initial converged solution. ---*/
573573

574574
for(iZone = 0; iZone < nZone; iZone++) {
575-
for (unsigned short iSol=0; iSol < MAX_SOLS; iSol++) {
576-
auto solver = solver_container[iZone][INST_0][MESH_0][iSol];
577-
if (solver && solver->GetAdjoint()) {
578-
for (unsigned short iMesh = 0; iMesh <= config_container[iZone]->GetnMGLevels(); iMesh++) {
575+
for (unsigned short iSol = 0; iSol < MAX_SOLS; iSol++) {
576+
for (unsigned short iMesh = 0; iMesh <= config_container[iZone]->GetnMGLevels(); iMesh++) {
577+
auto solver = solver_container[iZone][INST_0][iMesh][iSol];
578+
if (solver && solver->GetAdjoint()) {
579579
solver->SetRecording(geometry_container[iZone][INST_0][iMesh], config_container[iZone]);
580580
}
581581
}

SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,16 @@ void CDiscAdjSinglezoneDriver::SetRecording(RECORDING kind_recording){
240240

241241
AD::Reset();
242242

243-
/*--- Prepare for recording by resetting the solution to the initial converged solution---*/
243+
/*--- Prepare for recording by resetting the solution to the initial converged solution. ---*/
244244

245-
iteration->SetRecording(solver_container, geometry_container, config_container, ZONE_0, INST_0, kind_recording);
245+
for (unsigned short iSol=0; iSol < MAX_SOLS; iSol++) {
246+
for (unsigned short iMesh = 0; iMesh <= config_container[ZONE_0]->GetnMGLevels(); iMesh++) {
247+
auto solver = solver_container[ZONE_0][INST_0][iMesh][iSol];
248+
if (solver && solver->GetAdjoint()) {
249+
solver->SetRecording(geometry_container[ZONE_0][INST_0][iMesh], config_container[ZONE_0]);
250+
}
251+
}
252+
}
246253

247254
if (rank == MASTER_NODE) {
248255
cout << "\n-------------------------------------------------------------------------\n";

SU2_CFD/src/drivers/CDriver.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2675,6 +2675,7 @@ void CDriver::Print_DirectResidual(RECORDING kind_recording) {
26752675

26762676
const unsigned short fieldWidth = 15;
26772677
PrintingToolbox::CTablePrinter RMSTable(&std::cout);
2678+
RMSTable.SetPrecision(config_container[ZONE_0]->GetOutput_Precision());
26782679

26792680
/*--- The CTablePrinter requires two sweeps:
26802681
*--- 0. Add the colum names (addVals=0=false) plus CTablePrinter.PrintHeader()

SU2_CFD/src/iteration/CDiscAdjFEAIteration.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,6 @@ void CDiscAdjFEAIteration::IterateDiscAdj(CGeometry**** geometry, CSolver***** s
150150
solver[iZone][iInst][MESH_0][ADJFEA_SOL]->ExtractAdjoint_Variables(geometry[iZone][iInst][MESH_0], config[iZone]);
151151
}
152152

153-
void CDiscAdjFEAIteration::SetRecording(CSolver***** solver, CGeometry**** geometry, CConfig** config,
154-
unsigned short iZone, unsigned short iInst,
155-
RECORDING kind_recording) {
156-
/*--- Prepare for recording by resetting the solution to the initial converged solution ---*/
157-
158-
solver[iZone][iInst][MESH_0][ADJFEA_SOL]->SetRecording(geometry[iZone][iInst][MESH_0], config[iZone]);
159-
}
160-
161153
void CDiscAdjFEAIteration::RegisterInput(CSolver***** solver, CGeometry**** geometry, CConfig** config,
162154
unsigned short iZone, unsigned short iInst, RECORDING kind_recording) {
163155
if (kind_recording != RECORDING::MESH_COORDS) {

SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -470,30 +470,6 @@ void CDiscAdjFluidIteration::RegisterInput(CSolver***** solver, CGeometry**** ge
470470
END_SU2_OMP_PARALLEL
471471
}
472472

473-
void CDiscAdjFluidIteration::SetRecording(CSolver***** solver, CGeometry**** geometry, CConfig** config,
474-
unsigned short iZone, unsigned short iInst, RECORDING kind_recording) {
475-
476-
SU2_OMP_PARALLEL_(if(solver[iZone][iInst][MESH_0][ADJFLOW_SOL]->GetHasHybridParallel())) {
477-
478-
/*--- Prepare for recording by resetting the solution to the initial converged solution ---*/
479-
480-
for (auto iMesh = 0u; iMesh <= config[iZone]->GetnMGLevels(); iMesh++) {
481-
solver[iZone][iInst][iMesh][ADJFLOW_SOL]->SetRecording(geometry[iZone][iInst][iMesh], config[iZone]);
482-
}
483-
if (turbulent && !config[iZone]->GetFrozen_Visc_Disc()) {
484-
solver[iZone][iInst][MESH_0][ADJTURB_SOL]->SetRecording(geometry[iZone][iInst][MESH_0], config[iZone]);
485-
}
486-
if (config[iZone]->GetWeakly_Coupled_Heat()) {
487-
solver[iZone][iInst][MESH_0][ADJHEAT_SOL]->SetRecording(geometry[iZone][iInst][MESH_0], config[iZone]);
488-
}
489-
if (config[iZone]->AddRadiation()) {
490-
solver[iZone][INST_0][MESH_0][ADJRAD_SOL]->SetRecording(geometry[iZone][INST_0][MESH_0], config[iZone]);
491-
}
492-
493-
}
494-
END_SU2_OMP_PARALLEL
495-
}
496-
497473
void CDiscAdjFluidIteration::SetDependencies(CSolver***** solver, CGeometry**** geometry, CNumerics****** numerics,
498474
CConfig** config, unsigned short iZone, unsigned short iInst,
499475
RECORDING kind_recording) {

0 commit comments

Comments
 (0)