40#ifndef optimisationManager_H
41#define optimisationManager_H
59class optimisationManager
102 const label startTimeIndex,
131 optimisationManager(
const optimisationManager&) =
delete;
134 void operator=(
const optimisationManager&) =
delete;
208 virtual optimisationManager&
operator++() = 0;
211 virtual optimisationManager&
operator++(
int) = 0;
218 virtual bool end() = 0;
221 virtual bool update() = 0;
IOdictionary(const IOobject &io, const dictionary *fallback=nullptr)
Construct given an IOobject and optional fallback dictionary content.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Mesh data needed to do the Finite Volume discretisation.
virtual void clearSensitivities()
Clear all adjoint sensitivities.
virtual ~optimisationManager()=default
Destructor.
virtual bool end()=0
Return true if end of optimisation run.
virtual bool checkEndOfLoopAndUpdate()=0
Return true if end of optimisation run.
TypeName("optimisationManager")
Runtime type information.
virtual void initialize()
Initialization. Construct primal and adjoint solvers.
virtual void resetTime(const dimensionedScalar startTime, const label startTimeIndex, const scalar endTime)
Reset time.
virtual optimisationManager & operator++(int)=0
Postfix increment, this is identical to the prefix increment.
const word managerType_
Type of the optimisation manager (singleRun, (un)steadyOptimisation).
autoPtr< designVariablesUpdate > dvUpdate_
Helper class managing parts of the optimisation.
virtual void moveDesignVariables()
Update design variables.
autoPtr< designVariablesUpdate > & getOptimisationType()
Get the mechanism supporting the update of the design variables.
declareRunTimeSelectionTable(autoPtr, optimisationManager, dictionary,(fvMesh &mesh),(mesh))
virtual optimisationManager & operator++()=0
Prefix increment.
Switch shouldUpdateDesignVariables_
Switch defining if the design variables should be updated or not.
virtual bool update()=0
Whether to update the design variables.
virtual void solvePrimalEquations()
Solve all primal equations.
virtual void updateDesignVariables()
Update design variables.
virtual void updatePrimalBasedQuantities()
Solve all primal equations.
autoPtr< designVariables > designVars_
Design variables of the optimisation problem.
Time & time_
Reference to the time.
PtrList< adjointSolverManager > adjointSolverManagers_
List of adjoint solver managers to be included in the optimisation.
autoPtr< designVariables > & getDesignVariables()
Get the design variables.
virtual void solveAdjointEquations()
Solve all adjoint equations.
void lineSearchUpdate()
Update design variables using a line-search.
PtrList< primalSolver > primalSolvers_
List of primal solvers to be included in the optimisation.
static autoPtr< optimisationManager > New(fvMesh &mesh)
Return a reference to the selected turbulence model.
PtrList< adjointSolverManager > & adjointSolverManagers()
Get the adjoint solver managers.
fvMesh & mesh_
Reference to the mesh.
PtrList< primalSolver > & primalSolvers()
Get the primal solvers.
virtual void computeSensitivities()
Compute all adjoint sensitivities.
virtual bool read()
Changes in case of run-time update of optimisationDict.
void fixedStepUpdate()
Update design variables using a fixed step.
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes).
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.