Loading...
Searching...
No Matches
adjointSensitivity Class Referenceabstract

Abstract base class for adjoint-based sensitivities. More...

#include <adjointSensitivity.H>

Inheritance diagram for adjointSensitivity:
Collaboration diagram for adjointSensitivity:

Public Member Functions

 TypeName ("adjointSensitivity")
 Runtime type information.
 declareRunTimeSelectionTable (autoPtr, adjointSensitivity, dictionary,(const fvMesh &mesh, const dictionary &dict, adjointSolver &adjointSolver),(mesh, dict, adjointSolver))
 adjointSensitivity (const fvMesh &mesh, const dictionary &dict, adjointSolver &adjointSolver)
 Construct from components.
virtual ~adjointSensitivity ()=default
 Destructor.
virtual bool readDict (const dictionary &dict)
 Read dictionary if changed.
const adjointSolvergetAdjointSolver () const
 Const access to adjoint solver.
adjointSolvergetAdjointSolver ()
 Non-const access to adjoint solver.
bool includeDistance () const
 Should the adjoint eikonal PDE should be solved.
autoPtr< adjointEikonalSolver > & getAdjointEikonalSolver ()
 Return the adjoint eikonal solver.
autoPtr< adjointMeshMovementSolver > & getAdjointMeshMovementSolver ()
 Return the adjoint eikonal solver.
void setSuffix (const word &suffix)
 Set suffix.
const wordgetSuffix () const
 Get suffix.
virtual bool computeDxDbInternalField () const
 Should the parameterization compute the internalField of dxdb.
virtual void accumulateIntegrand (const scalar dt)=0
 Accumulate sensitivity integrands.
virtual void assembleSensitivities (autoPtr< designVariables > &designVars)
 Assemble sensitivities.
virtual const scalarFieldcalculateSensitivities (autoPtr< designVariables > &designVars)
 Calculates and returns sensitivity fields.
const scalarFieldgetSensitivities () const
 Returns the sensitivity fields.
virtual void clearSensitivities ()
 Zero sensitivity fields and their constituents.
virtual void write (const word &baseName=word::null)
 Write sensitivity fields.
const autoPtr< volTensorField > & gradDxDbMult () const
autoPtr< volTensorField > & gradDxDbMult ()
const autoPtr< scalarField > & divDxDbMult () const
const autoPtr< boundaryVectorField > & dxdbMult () const
const autoPtr< boundaryVectorField > & dSfdbMult () const
const autoPtr< boundaryVectorField > & dnfdbMult () const
const autoPtr< boundaryVectorField > & dxdbDirectMult () const
const autoPtr< pointBoundaryVectorField > & pointDxDbDirectMult () const
const autoPtr< boundaryVectorField > & bcDxDbMult () const
const autoPtr< vectorField > & optionsDxDbMult () const
Public Member Functions inherited from sensitivity
 TypeName ("sensitivity")
 Runtime type information.
 sensitivity (const fvMesh &mesh, const dictionary &dict)
 Construct from components.
virtual ~sensitivity ()=default
 Destructor.
const fvMeshmesh () const
 Return reference to mesh.
const dictionarydict () const
 Return the construction dictionary.
const autoPtr< volScalarField > & fieldSensPtr () const
 Get the fieldSensPtr.

Static Public Member Functions

static autoPtr< adjointSensitivity > New (const fvMesh &mesh, const dictionary &dict, adjointSolver &adjointSolver)
 Return a reference to the selected turbulence model.

Protected Attributes

adjointSolveradjointSolver_
 Reference to the underlaying adjoint solver.
scalarField derivatives_
 The sensitivity derivative values.
word suffix_
 Append this word to files related to the sensitivities.
bool includeDistance_
 Include distance variation in sensitivity computations.
autoPtr< adjointEikonalSolvereikonalSolver_
 Adjoint eikonal equation solver.
autoPtr< adjointMeshMovementSolveradjointMeshMovementSolver_
 Adjoint grid displacement solver.
autoPtr< volTensorFieldgradDxDbMult_
 Multiplier of grad(dx/b).
autoPtr< scalarFielddivDxDbMult_
 Multiplier of div(dx/db).
autoPtr< boundaryVectorFielddxdbMult_
 Multiplier of face dx/db.
autoPtr< boundaryVectorFielddSfdbMult_
 Multiplier of dSf/db.
autoPtr< boundaryVectorFielddnfdbMult_
 Multiplier of dnf/db.
autoPtr< boundaryVectorFielddxdbDirectMult_
 Multiplier of dCf/db, found in the objective function.
autoPtr< pointBoundaryVectorFieldpointDxDbDirectMult_
 Multiplier of dx/db computed at points, found in the objective function.
autoPtr< boundaryVectorFieldbcDxDbMult_
 Multiplier of dx/db, coming from boundary conditions that depend on the geometry, like rotatingWallVelocity.
autoPtr< vectorFieldoptionsDxDbMult_
 dx/db multiplier coming from fvOptions
Protected Attributes inherited from sensitivity
const fvMeshmesh_
dictionary dict_
bool writeFieldSens_
autoPtr< volScalarFieldfieldSensPtr_

Detailed Description

Abstract base class for adjoint-based sensitivities.

Source files

Definition at line 56 of file adjointSensitivity.H.

Constructor & Destructor Documentation

◆ adjointSensitivity()

adjointSensitivity ( const fvMesh & mesh,
const dictionary & dict,
adjointSolver & adjointSolver )

◆ ~adjointSensitivity()

virtual ~adjointSensitivity ( )
virtualdefault

Destructor.

References sensitivity::dict().

Here is the call graph for this function:

Member Function Documentation

◆ TypeName()

TypeName ( "adjointSensitivity" )

Runtime type information.

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr ,
adjointSensitivity ,
dictionary ,
(const fvMesh &mesh, const dictionary &dict, adjointSolver &adjointSolver) ,
(mesh, dict, adjointSolver)  )

References sensitivity::dict(), and sensitivity::mesh().

Here is the call graph for this function:

◆ New()

autoPtr< adjointSensitivity > New ( const fvMesh & mesh,
const dictionary & dict,
adjointSolver & adjointSolver )
static

Return a reference to the selected turbulence model.

Definition at line 79 of file adjointSensitivity.C.

References sensitivity::dict(), Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInLookup, Foam::Info, and sensitivity::mesh().

Referenced by adjointSolver::allocateSensitivities(), and sensitivityMultiple::sensitivityMultiple().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readDict()

bool readDict ( const dictionary & dict)
virtual

Read dictionary if changed.

Reimplemented from sensitivity.

Reimplemented in sensitivityMultiple, sensitivityShapeESI, sensitivitySurfacePoints, sensitivityTopO, and ShapeSensitivitiesBase.

Definition at line 113 of file adjointSensitivity.C.

References adjointSolver_, sensitivity::dict(), dictionary::getOrDefault(), includeDistance_, and sensitivity::readDict().

Referenced by sensitivityMultiple::readDict(), sensitivityTopO::readDict(), and ShapeSensitivitiesBase::readDict().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAdjointSolver() [1/2]

const adjointSolver & getAdjointSolver ( ) const
inline

◆ getAdjointSolver() [2/2]

adjointSolver & getAdjointSolver ( )
inline

Non-const access to adjoint solver.

Definition at line 242 of file adjointSensitivity.H.

References adjointSolver_.

◆ includeDistance()

bool includeDistance ( ) const
inline

Should the adjoint eikonal PDE should be solved.

Definition at line 250 of file adjointSensitivity.H.

References includeDistance_.

Referenced by adjointSensitivity(), and shapeDesignVariables::assembleSensitivities().

Here is the caller graph for this function:

◆ getAdjointEikonalSolver()

autoPtr< adjointEikonalSolver > & getAdjointEikonalSolver ( )
inline

Return the adjoint eikonal solver.

Definition at line 258 of file adjointSensitivity.H.

References eikonalSolver_.

Referenced by shapeDesignVariables::assembleSensitivities().

Here is the caller graph for this function:

◆ getAdjointMeshMovementSolver()

autoPtr< adjointMeshMovementSolver > & getAdjointMeshMovementSolver ( )
inline

Return the adjoint eikonal solver.

Definition at line 267 of file adjointSensitivity.H.

References adjointMeshMovementSolver_.

◆ setSuffix()

void setSuffix ( const word & suffix)
inline

Set suffix.

Definition at line 275 of file adjointSensitivity.H.

References suffix_.

Referenced by sensitivitySurfacePoints::setSuffixName().

Here is the caller graph for this function:

◆ getSuffix()

const word & getSuffix ( ) const
inline

Get suffix.

Definition at line 283 of file adjointSensitivity.H.

References suffix_.

Referenced by shapeDesignVariables::writeSensitivities().

Here is the caller graph for this function:

◆ computeDxDbInternalField()

bool computeDxDbInternalField ( ) const
virtual

Should the parameterization compute the internalField of dxdb.

Reimplemented in sensitivityShapeFI.

Definition at line 133 of file adjointSensitivity.C.

Referenced by shapeDesignVariables::assembleSensitivities().

Here is the caller graph for this function:

◆ accumulateIntegrand()

virtual void accumulateIntegrand ( const scalar dt)
pure virtual

Accumulate sensitivity integrands.

Corresponds to the flow and adjoint part of the sensitivities

Implemented in sensitivityMultiple, sensitivityTopO, and ShapeSensitivitiesBase.

References word::null.

◆ assembleSensitivities()

void assembleSensitivities ( autoPtr< designVariables > & designVars)
virtual

◆ calculateSensitivities()

const scalarField & calculateSensitivities ( autoPtr< designVariables > & designVars)
virtual

Calculates and returns sensitivity fields.

Used with optimisation libraries

Implements sensitivity.

Reimplemented in sensitivityMultiple.

Definition at line 148 of file adjointSensitivity.C.

References assembleSensitivities(), derivatives_, Foam::type(), and write().

Here is the call graph for this function:

◆ getSensitivities()

const scalarField & getSensitivities ( ) const

Returns the sensitivity fields.

Assumes it has already been updated/computed

Definition at line 159 of file adjointSensitivity.C.

References derivatives_.

◆ clearSensitivities()

void clearSensitivities ( )
virtual

Zero sensitivity fields and their constituents.

Reimplemented in sensitivityMultiple, and ShapeSensitivitiesBase.

Definition at line 165 of file adjointSensitivity.C.

References adjointMeshMovementSolver_, derivatives_, eikonalSolver_, sensitivity::fieldSensPtr_, and Foam::Zero.

Referenced by ShapeSensitivitiesBase::clearSensitivities().

Here is the caller graph for this function:

◆ write()

void write ( const word & baseName = word::null)
virtual

Write sensitivity fields.

If valid, copies boundaryFields to volFields and writes them. Virtual to be reimplemented by control points-based methods (Bezier, RBF) which do not need to write fields

Reimplemented from sensitivity.

Reimplemented in sensitivityMultiple, sensitivitySurfacePoints, and ShapeSensitivitiesBase.

Definition at line 183 of file adjointSensitivity.C.

References sensitivity::write().

Referenced by sensitivitySurfacePoints::write(), and ShapeSensitivitiesBase::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gradDxDbMult() [1/2]

const Foam::autoPtr< Foam::volTensorField > & gradDxDbMult ( ) const
inline

Definition at line 25 of file adjointSensitivityI.H.

References gradDxDbMult_.

Referenced by shapeDesignVariables::assembleSensitivities().

Here is the caller graph for this function:

◆ gradDxDbMult() [2/2]

Foam::autoPtr< Foam::volTensorField > & gradDxDbMult ( )
inline

Definition at line 32 of file adjointSensitivityI.H.

References gradDxDbMult_.

◆ divDxDbMult()

const Foam::autoPtr< Foam::scalarField > & divDxDbMult ( ) const
inline

Definition at line 38 of file adjointSensitivityI.H.

References divDxDbMult_.

Referenced by shapeDesignVariables::assembleSensitivities().

Here is the caller graph for this function:

◆ dxdbMult()

const Foam::autoPtr< Foam::boundaryVectorField > & dxdbMult ( ) const
inline

Definition at line 45 of file adjointSensitivityI.H.

References dxdbMult_.

Referenced by shapeDesignVariables::assembleSensitivities().

Here is the caller graph for this function:

◆ dSfdbMult()

const Foam::autoPtr< Foam::boundaryVectorField > & dSfdbMult ( ) const
inline

Definition at line 52 of file adjointSensitivityI.H.

References dSfdbMult_.

Referenced by shapeDesignVariables::assembleSensitivities().

Here is the caller graph for this function:

◆ dnfdbMult()

const Foam::autoPtr< Foam::boundaryVectorField > & dnfdbMult ( ) const
inline

Definition at line 58 of file adjointSensitivityI.H.

References dnfdbMult_.

Referenced by shapeDesignVariables::assembleSensitivities().

Here is the caller graph for this function:

◆ dxdbDirectMult()

const Foam::autoPtr< Foam::boundaryVectorField > & dxdbDirectMult ( ) const
inline

Definition at line 64 of file adjointSensitivityI.H.

References dxdbDirectMult_.

Referenced by shapeDesignVariables::assembleSensitivities().

Here is the caller graph for this function:

◆ pointDxDbDirectMult()

const Foam::autoPtr< Foam::pointBoundaryVectorField > & pointDxDbDirectMult ( ) const
inline

Definition at line 70 of file adjointSensitivityI.H.

References pointDxDbDirectMult_.

◆ bcDxDbMult()

const Foam::autoPtr< Foam::boundaryVectorField > & bcDxDbMult ( ) const
inline

Definition at line 76 of file adjointSensitivityI.H.

References bcDxDbMult_.

Referenced by shapeDesignVariables::assembleSensitivities().

Here is the caller graph for this function:

◆ optionsDxDbMult()

const Foam::autoPtr< Foam::vectorField > & optionsDxDbMult ( ) const
inline

Definition at line 82 of file adjointSensitivityI.H.

References optionsDxDbMult_.

Referenced by shapeDesignVariables::assembleSensitivities().

Here is the caller graph for this function:

Member Data Documentation

◆ adjointSolver_

◆ derivatives_

◆ suffix_

◆ includeDistance_

bool includeDistance_
protected

◆ eikonalSolver_

◆ adjointMeshMovementSolver_

◆ gradDxDbMult_

◆ divDxDbMult_

◆ dxdbMult_

autoPtr<boundaryVectorField> dxdbMult_
protected

Multiplier of face dx/db.

The term that multiplies the adjoint-related part of the sensitivities in the (E)SI approach

Definition at line 115 of file adjointSensitivity.H.

Referenced by adjointSensitivity(), ShapeSensitivitiesBase::clearMultipliers(), sensitivityShapeESI::computeDxDbMult(), dxdbMult(), sensitivitySurfacePoints::finalisePointSensitivities(), and sensitivityShapeESI::sensitivityShapeESI().

◆ dSfdbMult_

◆ dnfdbMult_

◆ dxdbDirectMult_

◆ pointDxDbDirectMult_

autoPtr<pointBoundaryVectorField> pointDxDbDirectMult_
protected

Multiplier of dx/db computed at points, found in the objective function.

Definition at line 136 of file adjointSensitivity.H.

Referenced by ShapeSensitivitiesBase::accumulateIntegrand(), adjointSensitivity(), ShapeSensitivitiesBase::clearMultipliers(), and pointDxDbDirectMult().

◆ bcDxDbMult_

autoPtr<boundaryVectorField> bcDxDbMult_
protected

Multiplier of dx/db, coming from boundary conditions that depend on the geometry, like rotatingWallVelocity.

Definition at line 142 of file adjointSensitivity.H.

Referenced by ShapeSensitivitiesBase::accumulateIntegrand(), adjointSensitivity(), ShapeSensitivitiesBase::allocateMultipliers(), bcDxDbMult(), ShapeSensitivitiesBase::clearMultipliers(), and sensitivitySurfacePoints::finalisePointSensitivities().

◆ optionsDxDbMult_


The documentation for this class was generated from the following files:
  • src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/adjointSensitivity/adjointSensitivity/adjointSensitivity.H
  • src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/adjointSensitivity/adjointSensitivity/adjointSensitivity.C
  • src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/adjointSensitivity/adjointSensitivity/adjointSensitivityI.H