Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions SU2_CFD/include/drivers/CDiscAdjMultizoneDriver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ class CDiscAdjMultizoneDriver : public CMultizoneDriver {
*/
void StartSolver() override;

protected:

/*!
* \brief Preprocess the multizone iteration
*/
Expand All @@ -153,6 +151,8 @@ class CDiscAdjMultizoneDriver : public CMultizoneDriver {
*/
void Run() override;

protected:

/*!
* \brief Run one inner iteration for a given zone.
* \return The result of "monitor".
Expand Down Expand Up @@ -272,7 +272,7 @@ class CDiscAdjMultizoneDriver : public CMultizoneDriver {
* \brief gets Convergence on physical time scale, (deactivated in adjoint case)
* \return false
*/
inline bool GetTimeConvergence() const override {return false;}
inline bool GetTimeConvergence() const override { return false; }

/*!
* \brief Get the external of all adjoint solvers in a zone.
Expand Down
69 changes: 34 additions & 35 deletions SU2_CFD/include/drivers/CDiscAdjSinglezoneDriver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,40 +57,6 @@ class CDiscAdjSinglezoneDriver : public CSinglezoneDriver {

COutputLegacy* output_legacy;

public:

/*!
* \brief Constructor of the class.
* \param[in] confFile - Configuration file name.
* \param[in] val_nZone - Total number of zones.
* \param[in] val_nDim - Total number of dimensions.
* \param[in] MPICommunicator - MPI communicator for SU2.
*/
CDiscAdjSinglezoneDriver(char* confFile,
unsigned short val_nZone,
SU2_Comm MPICommunicator);

/*!
* \brief Destructor of the class.
*/
~CDiscAdjSinglezoneDriver(void) override;

/*!
* \brief Preprocess the single-zone iteration
* \param[in] TimeIter - index of the current time-step.
*/
void Preprocess(unsigned long TimeIter) override;

/*!
* \brief Run a single iteration of the discrete adjoint solver with a single zone.
*/
void Run(void) override;

/*!
* \brief Postprocess the adjoint iteration for ZONE_0.
*/
void Postprocess(void) override;

/*!
* \brief Record one iteration of a flow iteration in within multiple zones.
* \param[in] kind_recording - Type of recording (full list in ENUM_RECORDING, option_structure.hpp)
Expand Down Expand Up @@ -127,6 +93,39 @@ class CDiscAdjSinglezoneDriver : public CSinglezoneDriver {
* \brief gets Convergence on physical time scale, (deactivated in adjoint case)
* \return false
*/
inline bool GetTimeConvergence() const override {return false;};
inline bool GetTimeConvergence() const override { return false; }

public:

/*!
* \brief Constructor of the class.
* \param[in] confFile - Configuration file name.
* \param[in] val_nZone - Total number of zones.
* \param[in] val_nDim - Total number of dimensions.
* \param[in] MPICommunicator - MPI communicator for SU2.
*/
CDiscAdjSinglezoneDriver(char* confFile,
unsigned short val_nZone,
SU2_Comm MPICommunicator);

/*!
* \brief Destructor of the class.
*/
~CDiscAdjSinglezoneDriver(void) override;

/*!
* \brief Preprocess the single-zone iteration
* \param[in] TimeIter - index of the current time-step.
*/
void Preprocess(unsigned long TimeIter) override;

/*!
* \brief Run a single iteration of the discrete adjoint solver with a single zone.
*/
void Run(void) override;

/*!
* \brief Postprocess the adjoint iteration for ZONE_0.
*/
void Postprocess(void) override;
};
145 changes: 59 additions & 86 deletions SU2_CFD/include/drivers/CDriver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class CDriver : public CDriverBase {

protected:
/*!
* \brief Initialize containers.
* \brief Initialize containers.
*/
void InitializeContainers();

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

/*!
* \brief Preprocess the inlets via file input for all solvers.
* \param[in] solver_container - Container vector with all the solutions.
* \param[in] geometry - Geometrical definition of the problem.
* \param[in] config - Definition of the particular problem.
*/
void PreprocessInlet(CSolver*** solver, CGeometry** geometry, CConfig* config) const;

/*!
* \brief Restart of the solvers from the restart files.
* \param[in] solver - Container vector with all the solutions.
Expand Down Expand Up @@ -335,21 +343,6 @@ class CDriver : public CDriverBase {
*/
virtual void RelaxationTractions(unsigned short donorZone, unsigned short targetZone, unsigned long iOuterIter) {}

/*!
* \brief A virtual member to run a Block Gauss-Seidel iteration in multi-zone problems.
*/
virtual void RunGaussSeidel() {}

/*!
* \brief A virtual member to run a Block-Jacobi iteration in multi-zone problems.
*/
virtual void RunJacobi() {}

/*!
* \brief A virtual member.
*/
void Update() override {}

/*!
* \brief Print out the direct residuals.
* \param[in] kind_recording - Type of recording (full list in ENUM_RECORDING, option_structure.hpp)
Expand Down Expand Up @@ -408,6 +401,21 @@ class CDriver : public CDriverBase {
}
}

/*!
* \brief Sum the number of primal or adjoint variables for all solvers in a given zone.
* \param[in] iZone - Index of the zone.
* \param[in] adjoint - True to consider adjoint solvers instead of primal.
* \return Total number of solution variables.
*/
unsigned short GetTotalNumberOfVariables(unsigned short iZone, bool adjoint) const {
unsigned short nVar = 0;
for (auto iSol = 0u; iSol < MAX_SOLS; iSol++) {
auto solver = solver_container[iZone][INST_0][MESH_0][iSol];
if (solver && (solver->GetAdjoint() == adjoint)) nVar += solver->GetnVar();
}
return nVar;
}

public:
/*!
* \brief Launch the computation for all zones and all physics.
Expand All @@ -419,11 +427,6 @@ class CDriver : public CDriverBase {
*/
void Finalize() override;

/*!
* \brief A virtual member.
*/
virtual void ResetConvergence();

/*!
* \brief Perform some pre-processing before an iteration of the physics.
*/
Expand All @@ -446,10 +449,9 @@ class CDriver : public CDriverBase {
virtual void DynamicMeshUpdate(unsigned long TimeIter) {}

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

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

/*!
* \brief Preprocess the inlets via file input for all solvers.
* \param[in] solver_container - Container vector with all the solutions.
* \param[in] geometry - Geometrical definition of the problem.
* \param[in] config - Definition of the particular problem.
*/
void PreprocessInlet(CSolver*** solver, CGeometry** geometry, CConfig* config) const;

/*!
* \brief Set the position of the heat source.
* \param[in] alpha - Angle of rotation respect to Z axis.
Expand All @@ -513,21 +507,6 @@ class CDriver : public CDriverBase {
void SetInletAngle(unsigned short iMarker, passivedouble alpha);

/// \}

/*!
* \brief Sum the number of primal or adjoint variables for all solvers in a given zone.
* \param[in] iZone - Index of the zone.
* \param[in] adjoint - True to consider adjoint solvers instead of primal.
* \return Total number of solution variables.
*/
unsigned short GetTotalNumberOfVariables(unsigned short iZone, bool adjoint) const {
unsigned short nVar = 0;
for (auto iSol = 0u; iSol < MAX_SOLS; iSol++) {
auto solver = solver_container[iZone][INST_0][MESH_0][iSol];
if (solver && (solver->GetAdjoint() == adjoint)) nVar += solver->GetnVar();
}
return nVar;
}
};

/*!
Expand All @@ -540,7 +519,6 @@ class CFluidDriver : public CDriver {
protected:
unsigned long Max_Iter;

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

/*!
* \brief Transfer data among different zones (multiple zone).
*/
void TransferData(unsigned short donorZone, unsigned short targetZone);

public:
/*!
* \brief Destructor of the class.
Expand Down Expand Up @@ -590,11 +573,6 @@ class CFluidDriver : public CDriver {
* structure (multiple zone).
*/
void DynamicMeshUpdate(unsigned long TimeIter) override;

/*!
* \brief Transfer data among different zones (multiple zone).
*/
void TransferData(unsigned short donorZone, unsigned short targetZone);
};

/*!
Expand All @@ -607,6 +585,16 @@ class CTurbomachineryDriver : public CFluidDriver {
private:
COutputLegacy* output_legacy;

/*!
* \brief Set Mixing Plane interface within multiple zones.
*/
void SetMixingPlane(unsigned short iZone);

/*!
* \brief Set Mixing Plane interface within multiple zones.
*/
void SetTurboPerformance(unsigned short targetZone);

public:
/*!
* \brief Constructor of the class.
Expand All @@ -627,16 +615,6 @@ class CTurbomachineryDriver : public CFluidDriver {

void Run() override;

/*!
* \brief Set Mixing Plane interface within multiple zones.
*/
void SetMixingPlane(unsigned short iZone);

/*!
* \brief Set Mixing Plane interface within multiple zones.
*/
void SetTurboPerformance(unsigned short targetZone);

/*!
* \brief Monitor the computation.
*/
Expand All @@ -655,25 +633,6 @@ class CHBDriver : public CFluidDriver {
unsigned short nInstHB;
su2double** D; /*!< \brief Harmonic Balance operator. */

public:
/*!
* \brief Constructor of the class.
* \param[in] confFile - Configuration file name.
* \param[in] val_nZone - Total number of zones.
* \param[in] MPICommunicator - MPI communicator for SU2.
*/
CHBDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunicator);

/*!
* \brief Destructor of the class.
*/
~CHBDriver(void) override;

/*!
* \brief Run a single iteration of a Harmonic Balance problem.
*/
void Run() override;

/*!
* \brief Computation and storage of the Harmonic Balance method source terms.
* \author T. Economon, K. Naik
Expand All @@ -693,13 +652,27 @@ class CHBDriver : public CFluidDriver {
*/
void ComputeHBOperator();

public:
/*!
* \brief Update the solution for the Harmonic Balance.
* \brief Constructor of the class.
* \param[in] confFile - Configuration file name.
* \param[in] val_nZone - Total number of zones.
* \param[in] MPICommunicator - MPI communicator for SU2.
*/
void Update() override;
CHBDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunicator);

/*!
* \brief Destructor of the class.
*/
~CHBDriver(void) override;

/*!
* \brief Run a single iteration of a Harmonic Balance problem.
*/
void Run() override;

/*!
* \brief Reset the convergence flag (set to false) of the solver for the Harmonic Balance.
* \brief Update the solution for the Harmonic Balance.
*/
void ResetConvergence() override;
void Update() override;
};
15 changes: 0 additions & 15 deletions SU2_CFD/include/drivers/CDriverBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,26 +92,11 @@ class CDriverBase {
*/
virtual ~CDriverBase(void);

/*!
* \brief A virtual member.
*/
virtual void Preprocessing(){}

/*!
* \brief A virtual member.
*/
virtual void Run(){}

/*!
* \brief A virtual member.
*/
virtual void Update(){}

/*!
* \brief A virtual member.
*/
virtual void Output(){}

/*!
* \brief A virtual member.
*/
Expand Down
Loading