59 Foam::adjointNull::adjointNull
62 const word& managerType,
64 const word& primalSolverName,
65 const word& solverName
86 const word& managerType,
88 const word& primalSolverName,
89 const word& solverName
141 objectiveManager_.updateAndWrite();
158 mesh_.time().timeName(),
174 if (objI.hasGradDxDbMult())
176 sens += objI.weight()*objI.gradDxDbMultiplier();
181 gradDxDbMult += sens.
T()*dt;
194 if (func.hasDivDxDbMult())
197 func.weight()*func.divDxDbMultiplier().primitiveField()*dt;
205 autoPtr<boundaryVectorField>& dSfdbMult,
206 autoPtr<boundaryVectorField>& dnfdbMult,
207 autoPtr<boundaryVectorField>& dxdbDirectMult,
208 autoPtr<pointBoundaryVectorField>& pointDxDbDirectMult,
213 PtrList<objective>& functions = objectiveManager_.getObjectiveFunctions();
214 for (
const label patchI : sensitivityPatchIDs)
216 const scalarField magSfDt(mesh_.boundary()[patchI].magSf()*dt);
217 for (objective& func : functions)
219 const scalar wei(func.weight());
220 if (func.hasdSdbMult())
222 dSfdbMult()[patchI] += wei*func.dSdbMultiplier(patchI)*dt;
224 if (func.hasdndbMult())
226 dnfdbMult()[patchI] += wei*func.dndbMultiplier(patchI)*magSfDt;
228 if (func.hasdxdbDirectMult())
230 dxdbDirectMult()[patchI] +=
231 wei*func.dxdbDirectMultiplier(patchI)*magSfDt;
241 const word& designVariablesName,
246 PtrList<objective>& functions = objectiveManager_.getObjectiveFunctions();
247 for (objective& objI : functions)
249 const scalar weight = objI.weight();
252 betaMult += weight*objI.dJdb()*dt;
255 if (objI.hasdJdbField())
257 SubField<scalar> betaSens(objI.dJdbField(), mesh_.nCells(), 0);
258 betaMult += weight*betaSens*dt;
static const word & zeroGradientType() noexcept
The type name for zeroGradient patch fields.
virtual void accumulateGeometryVariationsMultipliers(autoPtr< boundaryVectorField > &dSfdbMult, autoPtr< boundaryVectorField > &dnfdbMult, autoPtr< boundaryVectorField > &dxdbDirectMult, autoPtr< pointBoundaryVectorField > &pointDxDirectDbMult, const labelHashSet &sensitivityPatchIDs, const scalar dt)
Accumulate the multipliers of geometric quantities defined at the boundary, usually through an object...
virtual void accumulateDivDxDbMultiplier(autoPtr< scalarField > &divDxDbMult, const scalar dt)
Compute the multiplier for div(dxdb)
static autoPtr< adjointNull > New(fvMesh &mesh, const word &managerType, const dictionary &dict, const word &primalSolverName, const word &solverName)
Return a reference to the selected turbulence model.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
virtual const word simulationType() const
Return the type of simulation this solver pertains to.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
void allocateSensitivities()
Allocate the sensitivity derivatives.
virtual void updatePrimalBasedQuantities()
Update primal based quantities related to the objective functions.
virtual void topOSensMultiplier(scalarField &betaMult, const word &designVariablesName, const scalar dt)
Compute the multiplier of beta.
Base class for adjoint solvers.
autoPtr< adjointSensitivity > adjointSensitivity_
Sensitivity Derivatives engine.
Ignore writing from objectRegistry::writeObject()
Find the reference cell nearest (in index) to the given cell but which is not on a cyclic...
Macros for easy insertion into run-time selection tables.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual void accumulateGradDxDbMultiplier(volTensorField &gradDxDbMult, const scalar dt)
Compute the multiplier for grad(dxdb)
dimensioned< tensor > dimensionedTensor
Dimensioned tensor obtained from generic dimensioned type.
virtual bool loop()
Looper (advances iters, time step)
Dummy adjoint solver. Used to add the derivatives of geometric constraints which do not require the s...
tmp< GeometricField< Type, PatchField, GeoMesh > > T() const
Return transpose (only if it is a tensor field)
Abstract base class for objective functions. No point in making this runTime selectable since its chi...
defineTypeNameAndDebug(combustionModel, 0)
dimensionedScalar pow3(const dimensionedScalar &ds)
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
virtual dimensionSet maDimensions() const
Return the dimensions of the adjoint grid displacement variable.
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.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
void correctBoundaryConditions()
Correct boundary field.
For cases which do no have a pressure boundary adjust the balance of fluxes to obey continuity...
Internal & ref(const bool updateAccessTime=true)
Same as internalFieldRef()
virtual void preCalculateSensitivities()
Accumulate the sensitivities integrand before calculating them.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
A class for managing temporary objects.
Defines the attributes of an object for which implicit objectRegistry management is supported...
virtual void solve()
Main control loop.
virtual void solveIter()
Execute one iteration of the solution algorithm.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
static constexpr const zero Zero
Global zero (0)