50 if (adjointPorousIDs.
empty())
55 for (label cellI : zoneCells)
63 for (label cellI : zoneCells)
81 for (label cellI : zoneCells)
93 sensitivityTopO::sensitivityTopO
96 const dictionary&
dict,
97 adjointSolver& adjointSolver
100 adjointSensitivity(
mesh,
dict, adjointSolver),
102 designVariablesName_(
"beta")
108 new adjointEikonalSolver
120 createZeroFieldPtr<scalar>
123 "topologySens" + adjointSolver.solverName(),
202 const word& fieldName,
203 const word& designVariablesName
209 <<
"Computing SD contributions from the interpolation of " 210 << fieldName <<
endl;
211 fvOptions.postProcessSens(auxSens, fieldName, designVariablesName);
221 const word& fieldName
void size(const label n)
Older name for setAddressableSize.
adjointSolver & adjointSolver_
Reference to the underlaying adjoint solver.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Abstract base class for adjoint-based sensitivities.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
bool empty() const noexcept
True if List is empty (ie, size() is zero)
A class that holds the data needed to identify things (zones, patches) in a dynamic mesh...
Ostream & endl(Ostream &os)
Add newline and flush stream.
const cellZone & IOCells() const
Cells next to IO boundaries.
word designVariablesName_
Name used as the argument for the post-processing of the sensitivities through fvOptions.
virtual bool readDict(const dictionary &dict)
Read dictionary if changed.
dimensionedScalar pow5(const dimensionedScalar &ds)
conserve primitiveFieldRef()+
Macros for easy insertion into run-time selection tables.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
virtual void accumulateIntegrand(const scalar dt)
Accumulate sensitivity integrands.
topOZones zones_
Zones related to topology optimisation.
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.
const labelList & fixedZeroPorousZoneIDs() const
Cell zone IDs with fixed zero porosity values.
Calculation of adjoint based sensitivities for topology optimisation. This returns just the field par...
autoPtr< volScalarField > fieldSensPtr_
#define DebugInfo
Report an information message using Foam::Info.
virtual void assembleSensitivities(autoPtr< designVariables > &designVars)
Assemble sensitivities.
defineTypeNameAndDebug(combustionModel, 0)
DynamicID< cellZoneMesh > cellZoneID
Foam::cellZoneID.
static void postProcessSens(scalarField &sens, scalarField &auxSens, fv::options &fvOptions, const word &fieldName, const word &designVariablesName)
Add part of the sensitivities coming from fvOptions.
const dictionary & dict() const
Return the construction dictionary.
virtual bool readDict(const dictionary &dict)
Read dictionary if changed.
bool includeDistance_
Include distance variation in sensitivity computations.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
label nCells() const noexcept
Number of mesh cells.
scalarField derivatives_
The sensitivity derivative values.
const labelList & adjointPorousZoneIDs() const
Cell zone IDs in which porosity is allowed to change.
void zeroSensInFixedPorousZones(scalarField &sens)
Zero sensitivities in fixed porous zones.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
autoPtr< adjointEikonalSolver > eikonalSolver_
Adjoint eikonal equation solver.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
List< label > labelList
A List of labels.
static options & New(const fvMesh &mesh)
Construct fvOptions and register to database if not present.
Solver of the adjoint to the eikonal PDE.
virtual void assembleSensitivities(autoPtr< designVariables > &designVars)
Assemble sensitivities.
const labelList & fixedPorousZoneIDs() const
Cell zone IDs with fixed porosity values.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
static constexpr const zero Zero
Global zero (0)