59Foam::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
158 mesh_.time().timeName(),
174 if (objI.hasGradDxDbMult())
176 sens += objI.weight()*objI.gradDxDbMultiplier();
181 gradDxDbMult += sens.
T()*dt;
187 autoPtr<scalarField>& divDxDbMult,
191 PtrList<objective>& functions = objectiveManager_.getObjectiveFunctions();
192 for (objective& func : functions)
194 if (func.hasDivDxDbMult())
197 func.weight()*func.divDxDbMultiplier().primitiveField()*dt;
214 for (
const label patchI : sensitivityPatchIDs)
216 const scalarField magSfDt(mesh_.boundary()[patchI].magSf()*dt);
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,
249 const scalar weight = objI.weight();
252 betaMult += weight*objI.dJdb()*dt;
255 if (objI.hasdJdbField())
258 betaMult += weight*betaSens*dt;
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
For cases which do no have a pressure boundary adjust the balance of fluxes to obey continuity....
tmp< GeometricField< Type, PatchField, GeoMesh > > T() const
Return transpose (only if it is a tensor field).
void correctBoundaryConditions()
Correct boundary field.
@ NO_READ
Nothing to be read.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
SubField is a Field obtained as a section of another Field, without its own allocation....
Dummy adjoint solver. Used to add the derivatives of geometric constraints which do not require the s...
virtual const word simulationType() const
Return the type of simulation this solver pertains to.
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).
virtual void updatePrimalBasedQuantities()
Update primal based quantities related to the objective functions.
virtual void preCalculateSensitivities()
Accumulate the sensitivities integrand before calculating them.
virtual void accumulateGradDxDbMultiplier(volTensorField &gradDxDbMult, const scalar dt)
Compute the multiplier for grad(dxdb).
virtual void topOSensMultiplier(scalarField &betaMult, const word &designVariablesName, const scalar dt)
Compute the multiplier of beta.
virtual bool loop()
Looper (advances iters, time step).
virtual dimensionSet maDimensions() const
Return the dimensions of the adjoint grid displacement variable.
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.
virtual void solveIter()
Execute one iteration of the solution algorithm.
virtual void solve()
Main control loop.
Base class for adjoint solvers.
objectiveManager objectiveManager_
Object to manage objective functions.
void allocateSensitivities()
Allocate the sensitivity derivatives.
autoPtr< adjointSensitivity > adjointSensitivity_
Sensitivity Derivatives engine.
const word & primalSolverName() const
Return the primal solver name.
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,...
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Mesh data needed to do the Finite Volume discretisation.
static const word & zeroGradientType() noexcept
The type name for zeroGradient patch fields.
Abstract base class for objective functions. No point in making this runTime selectable since its chi...
const word & managerType() const
Return the manager type.
const dictionary & dict() const
Return the solver dictionary.
const fvMesh & mesh() const
Return the solver mesh.
const word & solverName() const
Return the solver name.
fvMesh & mesh_
Reference to the mesh database.
A class for managing temporary objects.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Find the reference cell nearest (in index) to the given cell but which is not on a cyclic,...
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.
dimensionedScalar pow3(const dimensionedScalar &ds)
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
GeometricField< tensor, fvPatchField, volMesh > volTensorField
static constexpr const zero Zero
Global zero (0).
dimensioned< tensor > dimensionedTensor
Dimensioned tensor obtained from generic dimensioned type.