50 if (adjointPorousIDs.
empty())
55 for (label cellI : zoneCells)
63 for (label cellI : zoneCells)
68 for (label cellI :
zones_.IOCells())
81 for (label cellI : zoneCells)
93sensitivityTopO::sensitivityTopO
97 adjointSolver& adjointSolver
100 adjointSensitivity(
mesh,
dict, adjointSolver),
102 designVariablesName_(
"beta")
108 new adjointEikonalSolver
123 "topologySens" + adjointSolver.solverName(),
149 new adjointEikonalSolver
182 autoPtr<designVariables>& designVars
202 const word& fieldName,
203 const word& designVariablesName
209 <<
"Computing SD contributions from the interpolation of "
211 fvOptions.postProcessSens(auxSens, fieldName, designVariablesName);
221 const word& fieldName
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
bool empty() const noexcept
True if List is empty (ie, size() is zero).
void size(const label n)
Older name for setAddressableSize.
Solver of the adjoint to the eikonal PDE.
Abstract base class for adjoint-based sensitivities.
bool includeDistance_
Include distance variation in sensitivity computations.
autoPtr< adjointEikonalSolver > eikonalSolver_
Adjoint eikonal equation solver.
adjointSolver & adjointSolver_
Reference to the underlaying adjoint solver.
virtual bool readDict(const dictionary &dict)
Read dictionary if changed.
scalarField derivatives_
The sensitivity derivative values.
virtual void assembleSensitivities(autoPtr< designVariables > &designVars)
Assemble sensitivities.
Base class for adjoint solvers.
virtual void topOSensMultiplier(scalarField &betaMult, const word &designVariablesName, const scalar dt)
Compute the multiplier of beta.
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,...
Mesh data needed to do the Finite Volume discretisation.
Finite-volume options, which is an IOdictionary of values and a fv::optionList.
static options & New(const fvMesh &mesh)
Construct fvOptions and register to database if not present otherwise lookup and return.
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
topOZones zones_
Zones related to topology optimisation.
virtual bool readDict(const dictionary &dict)
Read dictionary if changed.
word designVariablesName_
Name used as the argument for the post-processing of the sensitivities through fvOptions.
void zeroSensInFixedPorousZones(scalarField &sens)
Zero sensitivities in fixed porous zones.
virtual void accumulateIntegrand(const scalar dt)
Accumulate sensitivity integrands.
static void postProcessSens(scalarField &sens, scalarField &auxSens, fv::options &fvOptions, const word &fieldName, const word &designVariablesName)
Add part of the sensitivities coming from fvOptions.
virtual void assembleSensitivities(autoPtr< designVariables > &designVars)
Assemble sensitivities.
const fvMesh & mesh() const
Return reference to mesh.
const dictionary & dict() const
Return the construction dictionary.
autoPtr< volScalarField > fieldSensPtr_
const word & solverName() const
Return the solver name.
const labelList & fixedZeroPorousZoneIDs() const
Cell zone IDs with fixed zero porosity values.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define DebugInfo
Report an information message using Foam::Info.
dimensionedScalar pow5(const dimensionedScalar &ds)
List< label > labelList
A List of labels.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
DynamicID< cellZoneMesh > cellZoneID
Foam::cellZoneID.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static constexpr const zero Zero
Global zero (0).
autoPtr< GeometricField< Type, fvPatchField, volMesh > > createZeroFieldPtr(const fvMesh &mesh, const word &name, const dimensionSet dims, bool printAllocation=false)
Calculation of adjoint based sensitivities for topology optimisation. This returns just the field par...
conserve primitiveFieldRef()+