59 #ifndef topODesignVariables_H 60 #define topODesignVariables_H 108 const label fluidID = 0
117 const label fluidID = 0,
118 const bool activeIO =
false 126 const label fluidID = 0,
127 const bool setIOValues =
false 191 const word& interpolationFieldName =
"beta" 202 const word& interpolationFieldName =
"beta" 214 const word& designVariablesName,
215 const word& interpolationFieldName =
"beta" 230 const word& designVariablesName
236 const word& interpolationFieldName,
243 const word& interpolationFieldName,
tmp< fvMatrix< Type > > correction(const fvMatrix< Type > &)
Return the correction form of the given matrix by subtracting the matrix multiplied by the current fi...
virtual tmp< scalarField > assembleSensitivities(adjointSensitivity &sens)
Assemble sensitivity derivatives, by combining the part related to the primal and adjoint solution wi...
virtual void interpolationSensitivities(scalarField &sens, const topOInterpolationFunction &interpolationFunc, const FieldField< Field, scalar > &fluidValues, const scalarField &solidValues, const label fieldi, const word &designVariablesName, const word &interpolationFieldName="beta") const
Post-processing sensitivities due to interpolations based on the indicator fields.
virtual tmp< scalarField > penaltySensitivities(const word &interpolationFieldName, const topOInterpolationFunction &interpolationFunc) const
Return the penalty term derivative.
bool addFvOptions_
Add the fvOptions necessary for topO automatically.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Abstract base class for adjoint-based sensitivities.
Base class for primal solvers.
virtual void interpolate(volScalarField &field, const topOInterpolationFunction &interpolationFunc, const FieldField< Field, scalar > &fluidValues, const scalarField &solidValues, const label fieldi, const word &interpolationFieldName="beta") const
Interpolate between the given field and solid values.
Design variables for porosity-based topology optimisation (topO) problems.
virtual const volScalarField & beta() const
Get the indicator field.
A field of fields is a PtrList of fields with reference counting.
virtual ~topODesignVariables()=default
Destructor.
virtual scalar computeEta(scalarField &correction)
Compute eta if not set in the first step.
fieldRegularisation & getRegularisation()
Get access to the regularisation object.
virtual const scalarField & interpolationField(const word &interpolationFieldName="beta") const
Return interpolant.
A class for handling words, derived from Foam::string.
virtual void writeDesignVars()
Write porosity field to file.
virtual void nullifyInSolidSensitivities(scalarField &sens, const topOInterpolationFunction &interpolationFunc, const word &designVariablesName) const
Nullify given field in the solid domain.
static autoPtr< topODesignVariables > New(fvMesh &mesh, const dictionary &dict)
Construct and return the selected design variables.
const word & name() const
Name function is needed to disambiguate those inherited from regIOobject and dictionary.
fieldRegularisation regularisation_
Mechanism to regularise the field of design variables.
virtual void setActiveDesignVariables(const label fluidID=0, const bool activeIO=false)
Set active design variables.
SubField< scalar > alpha_
A subfield of the design variables corresponding to the porosity field.
virtual void update(scalarField &correction)
Update design variables based on a given correction.
virtual bool writeData(Ostream &) const
The writeData function required by the regIOobject write operation.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
label size() const noexcept
The number of elements in the container.
void applyFixedValues()
Apply fixed values in certain zones.
virtual void nullifyInSolid(scalarField &field, const topOInterpolationFunction &interpolationFunc) const
Nullify given field in the solid domain.
virtual void setInitialValues()
Set initial values of the design variables.
virtual void updateField(const scalarField &correction, const label fluidID=0)
Update the design variables given their correction.
TypeName("topO")
Runtime type information.
Abstract base class for defining design variables.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Mesh data needed to do the Finite Volume discretisation.
virtual tmp< scalarField > penalty(const word &interpolationFieldName, const topOInterpolationFunction &interpolationFunc) const
Return the Brinkman penalisation term.
bool writeAllFields_
Write all fields related to imposition of the Brinkman penalisation (i.e. design variables, regularised design variables and the indicator field)
virtual void initialize()
Part of the constructor initialisation.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
virtual void addFvOptions(const PtrList< primalSolver > &primalSolver, const PtrList< adjointSolverManager > &adjointSolverManagers)
Automatically add fvOptions depending on the design variables to the primal and adjoint solvers...
A class for managing temporary objects.
Base class for all design variables related to topology optimisation (topO). Provides the lookup func...
PtrList< adjointSolverManager > & adjointSolverManagers
virtual bool globalSum() const
Whether to use global sum when computing matrix-vector products in update methods.
void readField(const word &name, const label fluidID=0, const bool setIOValues=false)
Read field with (path of) the design variables and store input in the design variables list with opti...