Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dividing Iteration Classes #1015

Merged
merged 18 commits into from
Jun 18, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace CInterpolatorFactory {
* \param[in] verbose - If true, print information to screen.
* \return Pointer to interpolator on the heap, caller is responsible for deletion.
*/
CInterpolator* createInterpolator(CGeometry ****geometry_container,
CInterpolator* CreateInterpolator(CGeometry ****geometry_container,
const CConfig* const* config,
unsigned iZone, unsigned jZone,
bool verbose = true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "../../include/interface_interpolation/CSlidingMesh.hpp"

namespace CInterpolatorFactory {
CInterpolator* createInterpolator(CGeometry ****geometry_container,
CInterpolator* CreateInterpolator(CGeometry ****geometry_container,
const CConfig* const* config,
unsigned iZone, unsigned jZone, bool verbose) {

Expand Down
1 change: 0 additions & 1 deletion SU2_CFD/include/SU2_CFD.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
#include "../../Common/include/grid_movement_structure.hpp"
#include "../../Common/include/CConfig.hpp"
#include "../include/definition_structure.hpp"
#include "../include/iteration_structure.hpp"
#include "../include/interfaces/CInterface.hpp"

using namespace std;
3 changes: 2 additions & 1 deletion SU2_CFD/include/drivers/CDriver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

#include "../../../Common/include/mpi_structure.hpp"

#include "../iteration_structure.hpp"
#include "../integration/CIntegration.hpp"
#include "../solvers/CSolver.hpp"
#include "../interfaces/CInterface.hpp"
Expand All @@ -42,6 +41,8 @@ using namespace std;

class COutputLegacy;
class CInterpolator;
class CIteration;
class COutput;

/*!
* \class CDriver
Expand Down
4 changes: 1 addition & 3 deletions SU2_CFD/include/drivers/CMultizoneDriver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,5 @@ class CMultizoneDriver : public CDriver {
* \brief Returns whether all specified windowed-time-averaged ouputs have been converged
* \return Boolean indicating whether the problem is converged.
*/
inline virtual bool GetTimeConvergence() const{
return driver_output->GetTimeConvergence();
}
virtual bool GetTimeConvergence() const;
};
5 changes: 1 addition & 4 deletions SU2_CFD/include/drivers/CSinglezoneDriver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,7 @@ class CSinglezoneDriver : public CDriver {
* \brief Returns whether all specified windowed-time-averaged ouputs have been converged
* \return Boolean indicating whether the problem is converged.
*/
inline virtual bool GetTimeConvergence() const{
return output_container[ZONE_0]->GetTimeConvergence();
}

virtual bool GetTimeConvergence() const;

/*!
* \brief Runtime_Parsing
Expand Down
4 changes: 2 additions & 2 deletions SU2_CFD/include/integration/CIntegrationFactory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ class CIntegrationFactory{
* \param[in] solver_container - The solver container
* \return - Pointer to the allocated integration container
*/
static CIntegration** createIntegrationContainer(ENUM_MAIN_SOLVER kindSolver, const CSolver * const *solver_container);
static CIntegration** CreateIntegrationContainer(ENUM_MAIN_SOLVER kindSolver, const CSolver * const *solver_container);

/*!
* \brief Create a new integration instance based on the current sub solver
* \param[in] integrationType - The integration type
* \return - Pointer to the allocated integration instance
*/
static CIntegration* createIntegration(INTEGRATION_TYPE integrationType);
static CIntegration* CreateIntegration(INTEGRATION_TYPE integrationType);

};
81 changes: 81 additions & 0 deletions SU2_CFD/include/iteration/CAdjFluidIteration.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*!
* \file CAdjFluidIteration.hpp
* \brief Headers of the iteration classes used by SU2_CFD.
* Each CIteration class represents an available physics package.
* \author F. Palacios, T. Economon
* \version 7.0.5 "Blackbird"
*
* SU2 Project Website: https://su2code.github.io
*
* The SU2 Project is maintained by the SU2 Foundation
* (http://su2foundation.org)
*
* Copyright 2012-2020, SU2 Contributors (cf. AUTHORS.md)
*
* SU2 is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* SU2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with SU2. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include "CFluidIteration.hpp"

/*!
* \class CAdjFluidIteration
* \brief Class for driving an iteration of the adjoint fluid system.
* \author T. Economon
*/
class CAdjFluidIteration : public CFluidIteration {
public:
/*!
* \brief Constructor of the class.
* \param[in] config - Definition of the particular problem.
*/
explicit CAdjFluidIteration(const CConfig *config) : CFluidIteration(config) {}

/*!
* \brief Preprocessing to prepare for an iteration of the physics.
* \param[in] ??? - Description here.
*/
void Preprocess(COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver,
CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement,
CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone,
unsigned short val_iInst) override;

/*!
* \brief Perform a single iteration of the adjoint fluid system.
* \param[in] output - Pointer to the COutput class.
* \param[in] integration - Container vector with all the integration methods.
* \param[in] geometry - Geometrical definition of the problem.
* \param[in] solver - Container vector with all the solutions.
* \param[in] numerics - Description of the numerical method (the way in which the equations are solved).
* \param[in] config - Definition of the particular problem.
* \param[in] surface_movement - Surface movement classes of the problem.
* \param[in] grid_movement - Volume grid movement classes of the problem.
* \param[in] FFDBox - FFD FFDBoxes of the problem.
*/
void Iterate(COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver,
CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement,
CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone,
unsigned short val_iInst) override;

/*!
* \brief Updates the containers for the adjoint fluid system.
* \param[in] ??? - Description here.
*/
void Update(COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver,
CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement,
CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone,
unsigned short val_iInst) override;
};

Loading