38#ifndef shapeDesignVariables_H
39#define shapeDesignVariables_H
54class shapeDesignVariables
56 public designVariables
144 shapeDesignVariables(
const shapeDesignVariables&) =
delete;
147 void operator=(
const shapeDesignVariables&) =
delete;
161 shapeDesignVariables,
Abstract base class for adjoint-based sensitivities.
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,...
A class for handling file names.
Mesh data needed to do the Finite Volume discretisation.
bool writeEachMesh_
Write the mesh points irrespective of whether this is a write time.
scalarField dSdbSens_
Term depending on delta(n dS)/delta b.
virtual tmp< vectorField > dSdb(const label patchI, const label varID) const
Get dSdb for a given design variable and patch.
virtual void resetDesignVariables()
Reset to starting point of line search.
declareRunTimeSelectionTable(autoPtr, shapeDesignVariables, dictionary,(fvMesh &mesh, const dictionary &dict),(mesh, dict))
virtual bool globalSum() const =0
Whether to use global sum when computing matrix-vector products in update methods.
scalarField dVdbSens_
Term depending on delta(V)/delta b.
void zeroSensFields()
Zero the fields assosiated with the computation of sensitivities.
virtual ~shapeDesignVariables()=default
Destructor.
scalarField optionsSens_
Term depending on fvOptions.
fileName derivativesFolder_
Name of the sensitivity derivatives folder.
virtual void moveMesh()
Move mesh based on displacementMethod.
TypeName("shape")
Runtime type information.
virtual tmp< volVectorField > solveMeshMovementEqn(const label patchI, const label varID) const
Compute dxdb at the mesh cell centers by solving a Laplace PDE.
virtual bool readDict(const dictionary &dict)
Read dictionary if changed.
autoPtr< displacementMethod > displMethodPtr_
Mesh movement mechanism.
void allocateSensFields()
Allocate the fields assosiated with the computation of sensitivities.
virtual void writeSensitivities(const scalarField &sens, const adjointSensitivity &adjointSens)
Write final sensitivity derivatives to files.
scalarField dxdbDirectSens_
Term depending on delta(x)/delta b for objectives that directly depend on x.
autoPtr< pointField > pointsInit_
Store old points. Useful for line search.
static autoPtr< shapeDesignVariables > New(fvMesh &mesh, const dictionary &dict)
Construct and return the selected shapeDesignVariables.
scalarField dxdbSurfSens_
Flow related term.
autoPtr< displacementMethod > & returnDisplacementMethod()
Return displacementMethod.
virtual void update(scalarField &correction)=0
Update design variables based on a given correction.
scalarField distanceSens_
Term depending on distance differentiation.
labelHashSet parametertisedPatches_
Patches to be moved by the design variables.
scalarField dxdbVolSens_
Flow related term.
const labelHashSet & getPatches() const
Patches affected by the parameterisation.
scalarField bcSens_
Term depending on the differenation of boundary conditions.
virtual void storeDesignVariables()
Store design variables, as the starting point for line search.
virtual tmp< vectorField > dxdbVol(const label varID) const
Get dxdb for all mesh points.
virtual const labelList & activeSensitivities() const
Active variables for which to compute sensitivities.
virtual label sensSize() const
Size of the sensitivity derivatives.
virtual tmp< vectorField > dxdbFace(const label patchI, const label varID) const
Get dxdb for a given design variable and patch.
virtual tmp< vectorField > dndb(const label patchI, const label varID) const
Get dndb for a given design variable and patch.
virtual tmp< volVectorField > dCdb(const label varID) const
Get dCdb for a given design variable.
virtual tmp< scalarField > assembleSensitivities(adjointSensitivity &adjointSens)
Add part of sensitivity derivatives related to geometry variations.
virtual scalar computeEta(scalarField &correction)=0
Compute eta if not set in the first step.
scalarField dndbSens_
Term depending on delta(n)/delta b.
A class for managing temporary objects.
List< label > labelList
A List of labels.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
tmp< fvMatrix< Type > > correction(const fvMatrix< Type > &)
Return the correction form of the given matrix by subtracting the matrix multiplied by the current fi...
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.