37 #ifndef adjointSolver_H 38 #define adjointSolver_H 277 autoPtr<boundaryVectorField>& dSfdbMult,
278 autoPtr<boundaryVectorField>& dnfdbMult,
279 autoPtr<boundaryVectorField>& dxdbDirectMult,
280 autoPtr<pointBoundaryVectorField>& pointDxDirectDbMult,
291 autoPtr<boundaryVectorField>& bcDxDbMult,
314 const word& designVariablesName,
bool computeSensitivities_
Are sensitivities computed.
virtual void preCalculateSensitivities()
Actions to be performed before calculating sensitivities.
const word primalSolverName_
Name of primal solver.
const word & primalSolverName() const
Return the primal solver name.
virtual void accumulateGeometryVariationsMultipliers(autoPtr< boundaryVectorField > &dSfdbMult, autoPtr< boundaryVectorField > &dnfdbMult, autoPtr< boundaryVectorField > &dxdbDirectMult, autoPtr< pointBoundaryVectorField > &pointDxDirectDbMult, const labelHashSet &sensitivityPatchIDs, const scalar dt)
Accumulate the multipliers of geometric quantities defined at the boundary, usually through an object...
virtual void accumulateOptionsDxDbMultiplier(vectorField &optionsDxDbMult, const scalar dt)
Contributions from fvOptions that inlcude geometric aspects in them and change when the geometry is d...
TypeName("adjointSolver")
Run-time type information.
bool isConstraint()
Is the solving referring to a constraint.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Base class for primal solvers.
const fvMesh & mesh() const
Return the solver mesh.
void allocateSensitivities()
Allocate the sensitivity derivatives.
Class for managing objective functions.
dictionary designVarsDict() const
Return the dictionary corresponding to the design variables.
virtual void accumulateGradDxDbMultiplier(volTensorField &gradDxDbMult, const scalar dt)
Compute the multiplier for grad(dxdb)
Base class for adjoint solvers.
autoPtr< adjointSensitivity > adjointSensitivity_
Sensitivity Derivatives engine.
bool isDoubleSidedConstraint()
Is the solving referring to a double-sided constraint.
virtual dimensionSet maDimensions() const
Return the dimensions of the adjoint grid displacement variable.
virtual void clearSensitivities()
Clears the sensitivity field known by the adjoint solver.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
static autoPtr< adjointSolver > New(fvMesh &mesh, const word &managerType, const dictionary &dict, const word &primalSolverName, const word &solverName)
Return a reference to the selected turbulence model.
virtual bool writeData(Ostream &os) const
Write the sensitivity derivatives.
const objectiveManager & getObjectiveManager() const
Return a const reference to the objective manager.
virtual void topOSensMultiplier(scalarField &betaMult, const word &designVariablesName, const scalar dt)
Compute the multiplier of beta.
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
bool isConstraint_
Is the adjoint solver used to tackle a constraint.
virtual void accumulateDivDxDbMultiplier(autoPtr< scalarField > &divDxDbMult, const scalar dt)
Compute the multiplier for div(dxdb)
virtual dimensionSet daDimensions() const
Return the dimensions of the adjoint distance field.
const word & managerType() const
Return the manager type.
declareRunTimeNewSelectionTable(autoPtr, adjointSolver, adjointSolver,(fvMesh &mesh, const word &managerType, const dictionary &dict, const word &primalSolverName, const word &solverName),(mesh, managerType, dict, primalSolverName, solverName))
const dictionary & dict() const
Return the solver dictionary.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
virtual tmp< volScalarField > adjointEikonalSource()
Return the source the adjoint eikonal equation.
OBJstream os(runTime.globalPath()/outputName)
virtual void computeObjectiveSensitivities(autoPtr< designVariables > &designVars)
Compute sensitivities of the underlaying objectives.
bool isDoubleSidedConstraint_
Is the adjoint solver used to tackle a double-sided constraint.
const primalSolver & getPrimalSolver() const
Return a const-reference to the primal solver corresponding to this adjoint solver.
virtual void updatePrimalBasedQuantities()
Update primal based quantities, e.g. the primal fields in adjoint turbulence models.
virtual void accumulateBCSensitivityIntegrand(autoPtr< boundaryVectorField > &bcDxDbMult, const labelHashSet &sensitivityPatchIDs, const scalar dt)
Contributions from boundary functions that inlcude geometric aspects in them and change when the geom...
Abstract base class for defining design variables.
const word & solverName() const
Return the solver name.
Mesh data needed to do the Finite Volume discretisation.
Field< vector > vectorField
Specialisation of Field<T> for vector.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
virtual bool readDict(const dictionary &dict)
Macros to ease declaration of run-time selection tables.
A class for managing temporary objects.
virtual tmp< volScalarField > yWall() const
Return the distance field, to be used in the solution of the adjoint eikonal PDE. ...
virtual ~adjointSolver()=default
Destructor.
objectiveManager objectiveManager_
Object to manage objective functions.
virtual const scalarField & getObjectiveSensitivities(autoPtr< designVariables > &designVars)
Grab a reference to the computed sensitivities.
virtual bool includeDistance() const
Does the adjoint to an equation computing distances need to taken into consideration.
tmp< scalarField > sensitivities_
Sensitivities field.