55Foam::constraintProjection::constraintProjection
60 const label nConstraints,
101 constraintContribution +=
109 nonLinearContribution +=
134 return objectiveValue_ + delta_*
sum(
mag(cValues_));
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
void size(const label n)
Older name for setAddressableSize.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Abstract base class for optimisation methods supporting constraints. Does not add functionality to up...
Update design variables using Rosen's projection method.
void computeCorrection()
Compute design variables correction.
bool useCorrection_
Correct for non-linearities.
virtual scalar computeMeritFunction()
Compute merit function. Could be different than the objective in the presence of constraints.
scalar delta_
Weight of the aggregated constraint values in the merit function.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
Mesh data needed to do the Finite Volume discretisation.
Abstract base class for optimisation methods.
scalarField objectiveDerivatives_
Derivatives of the objective functions.
scalarField correction_
Design variables correction.
dictionary coeffsDict(const word &type) const
Return optional dictionary with parameters specific to each method.
scalar globalSum(const scalarField &field)
Compute either global or local sum, based on globalSum flag.
scalarField cValues_
Constraint values.
scalar objectiveValue_
Objective value.
PtrList< scalarField > constraintDerivatives_
Derivatives of the constraints.
SquareMatrix< scalar > inv(SquareMatrix< scalar > A)
const labelList & activeDesignVars_
Map to active design variables.
label nConstraints() const
Get the number of constraints.
scalar eta_
Step multiplying the correction.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
SquareMatrix< scalar > scalarSquareMatrix
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1, const label comm)
static constexpr const zero Zero
Global zero (0).
tmp< fvMatrix< Type > > correction(const fvMatrix< Type > &)
Return the correction form of the given matrix by subtracting the matrix multiplied by the current fi...
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
#define forAll(list, i)
Loop across all elements in list.