shapeOptimisation Class Reference

Calculates shape sensitivities using the adjoint approach, computes boundaryMesh movement and propagates it to the volume mesh. More...

Inheritance diagram for shapeOptimisation:
[legend]
Collaboration diagram for shapeOptimisation:
[legend]

Public Member Functions

 TypeName ("shapeOptimisation")
 Runtime type information. More...
 
 shapeOptimisation (fvMesh &mesh, const dictionary &dict, PtrList< adjointSolverManager > &adjointSolverManagers)
 Construct from components. More...
 
virtual ~shapeOptimisation ()=default
 Destructor. More...
 
virtual void storeDesignVariables ()
 Store design variables, as the starting point for line search. More...
 
virtual void resetDesignVariables ()
 Store design variables, as the starting point for line search. More...
 
virtual void write ()
 Write useful quantities to files. More...
 
- Public Member Functions inherited from optimisationType
 TypeName ("optimisationType")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, optimisationType, dictionary,(fvMesh &mesh, const dictionary &dict, PtrList< adjointSolverManager > &adjointSolverManagers),(mesh, dict, adjointSolverManagers))
 
 optimisationType (fvMesh &mesh, const dictionary &dict, PtrList< adjointSolverManager > &adjointSolverManagers)
 Construct from components. More...
 
virtual ~optimisationType ()=default
 
virtual void update ()
 Update design variables. More...
 
virtual void update (scalarField &correction)
 Update design variables based on a given correction. More...
 
virtual void storeDesignVariables ()=0
 Store design variables, as the starting point for line search. More...
 
virtual void resetDesignVariables ()=0
 Reset to starting point of line search. More...
 
virtual tmp< scalarFieldcomputeDirection ()
 Compute update direction. More...
 
virtual void updateGradientsAndValues (scalarField &objectiveSens, PtrList< scalarField > &constraintSens, scalar &objectiveValue, scalarField &constraintValues)
 Compute cumulative objective and constraint gradients. More...
 
virtual scalar computeMeritFunction ()
 Compute the merit function of the optimisation problem. More...
 
virtual scalar meritFunctionDirectionalDerivative ()
 Derivative of the merit function. More...
 
virtual void updateOldCorrection (const scalarField &)
 Update old correction. Needed for quasi-Newton Methods. More...
 
virtual void write ()
 Write useful quantities to files. More...
 
const autoPtr< volScalarField > & sourcePtr ()
 Get source term. More...
 
autoPtr< lineSearch > & getLineSearch ()
 Get a reference to the line search object. More...
 

Protected Member Functions

virtual void updateDesignVariables (scalarField &correction)
 Update the design variables given their correction. More...
 
virtual void computeEta (scalarField &correction)
 Compute eta if not set in the first step. More...
 
virtual void updateDesignVariables (scalarField &correction)=0
 Update the design variables given their correction. More...
 
virtual void computeEta (scalarField &correction)=0
 Compute eta if not set in the first step. More...
 

Protected Attributes

autoPtr< optMeshMovementoptMeshMovement_
 
bool writeEachMesh_
 
bool updateGeometry_
 
- Protected Attributes inherited from optimisationType
fvMeshmesh_
 
const dictionary dict_
 
PtrList< adjointSolverManager > & adjointSolvManagers_
 
autoPtr< updateMethodupdateMethod_
 
autoPtr< volScalarFieldsourcePtr_
 
autoPtr< lineSearchlineSearch_
 

Additional Inherited Members

- Static Public Member Functions inherited from optimisationType
static autoPtr< optimisationTypeNew (fvMesh &mesh, const dictionary &dict, PtrList< adjointSolverManager > &adjointSolverManagers)
 Return a reference to the selected turbulence model. More...
 

Detailed Description

Calculates shape sensitivities using the adjoint approach, computes boundaryMesh movement and propagates it to the volume mesh.

Source files

Definition at line 62 of file shapeOptimisationIncompressible.H.

Constructor & Destructor Documentation

◆ shapeOptimisation()

shapeOptimisation ( fvMesh mesh,
const dictionary dict,
PtrList< adjointSolverManager > &  adjointSolverManagers 
)

Construct from components.

Definition at line 119 of file shapeOptimisationIncompressible.C.

References polyMesh::boundaryMesh(), optimisationType::dict_, UPtrList< T >::empty(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, dictionary::get(), optimisationType::mesh_, Time::New(), Foam::nl, shapeOptimisation::optMeshMovement_, patches, polyBoundaryMesh::patchSet(), dictionary::subDict(), optimisationType::updateMethod_, and WarningInFunction.

Here is the call graph for this function:

◆ ~shapeOptimisation()

virtual ~shapeOptimisation ( )
virtualdefault

Destructor.

Member Function Documentation

◆ updateDesignVariables()

void updateDesignVariables ( scalarField correction)
protectedvirtual

Update the design variables given their correction.

Implements optimisationType.

Definition at line 53 of file shapeOptimisationIncompressible.C.

References Foam::correction(), Foam::endl(), Foam::Info, optimisationType::mesh_, polyMesh::meshSubDir, IOobject::NO_READ, IOobject::NO_WRITE, shapeOptimisation::optMeshMovement_, points, polyMesh::points(), polyMesh::pointsInstance(), shapeOptimisation::updateGeometry_, and shapeOptimisation::writeEachMesh_.

Here is the call graph for this function:

◆ computeEta()

void computeEta ( scalarField correction)
protectedvirtual

Compute eta if not set in the first step.

Implements optimisationType.

Definition at line 86 of file shapeOptimisationIncompressible.C.

References Foam::correction(), shapeOptimisation::optMeshMovement_, and optimisationType::updateMethod_.

Here is the call graph for this function:

◆ TypeName()

TypeName ( "shapeOptimisation"  )

Runtime type information.

◆ storeDesignVariables()

void storeDesignVariables ( )
virtual

Store design variables, as the starting point for line search.

Implements optimisationType.

Definition at line 183 of file shapeOptimisationIncompressible.C.

References shapeOptimisation::optMeshMovement_.

◆ resetDesignVariables()

void resetDesignVariables ( )
virtual

Store design variables, as the starting point for line search.

Implements optimisationType.

Definition at line 189 of file shapeOptimisationIncompressible.C.

References shapeOptimisation::optMeshMovement_.

◆ write()

void write ( )
virtual

Write useful quantities to files.

Reimplemented from optimisationType.

Definition at line 195 of file shapeOptimisationIncompressible.C.

References optimisationType::updateMethod_, and optimisationType::write().

Here is the call graph for this function:

Member Data Documentation

◆ optMeshMovement_

◆ writeEachMesh_

bool writeEachMesh_
protected

◆ updateGeometry_

bool updateGeometry_
protected

The documentation for this class was generated from the following files: