126 lineSearch(
const lineSearch&) =
delete;
129 void operator=(
const lineSearch&) =
delete;
150 (
dict, time, UpdateMethod)
182 virtual void setDeriv(
const scalar deriv);
202 virtual void reset();
217 inline scalar
step()
const
230 virtual void updateStep(
const scalar newStep);
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
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,...
const dictionary & coeffsDict()
Optional coeffs dict.
virtual void setDeriv(const scalar deriv)
Set directional derivative.
scalar newMeritValue_
New merit value from this opt cycle.
scalar oldMeritValue_
Old merit value from this opt cycle.
bool extrapolateInitialStep_
Whether to extrapolate the correction multiplier for this optimisation cycle based on the previous on...
virtual void updateCorrection(scalarField &correction)
Update the correction.
TypeName("lineSearch")
Runtime type information.
static autoPtr< lineSearch > New(const dictionary &dict, const Time &time, updateMethod &UpdateMethod)
Return a reference to the selected turbulence model.
scalar step() const
Get current step.
virtual void postUpdate()
Execute steps at the end of the line search iterations.
updateMethod & updateMethod_
Reference to the update method related to the line search.
declareRunTimeSelectionTable(autoPtr, lineSearch, dictionary,(const dictionary &dict, const Time &time, updateMethod &UpdateMethod),(dict, time, UpdateMethod))
autoPtr< stepUpdate > stepUpdate_
Mechanism to update method if line search conditions are not set.
void setOldMeritValue(const scalar value)
Set old objective value.
void setNewMeritValue(const scalar value)
Set new objective value.
virtual bool converged()=0
Return the correction of the design variables.
const dictionary dict_
Subdict within updateMethod.
virtual void setNewDeriv(const scalar deriv)
Set new directional derivative.
virtual bool computeGradient() const
Does line search need to update the gradient?
virtual void updateStep()=0
Update the line search step based on the specific line search strategy, e.g. bisection,...
label iter_
Optimisation cycle.
scalarField direction_
Update direction.
scalar step_
Correction multiplier.
scalar directionalDeriv_
Directional derivative of the merit function.
virtual lineSearch & operator++()
Increment iteration number and store merit value corresponding to the previous optimisation cycle.
scalar minStep_
Minimum allowed correction multiplier.
label maxIters_
Maximum line search iterations.
virtual void reset()
Reset step to initial value.
IOdictionary lineSearchDict_
IOdictionary under time/uniform for continuation.
scalar initialStep_
Correction multiplier at the first step of line search.
virtual bool loop()
Return true if lineSearch should continue and if so increment inner.
scalar prevMeritDeriv_
Merit directional deriv from the previous opt cycle.
label innerIter() const
Get inner line search iteration.
label innerIter_
Inner line search iteration.
void setDirection(const scalarField &direction)
Set direction.
label maxIters() const
Get max number of iterations.
virtual ~lineSearch()=default
Destructor.
Abstract base class for optimisation methods.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
tmp< fvMatrix< Type > > correction(const fvMatrix< Type > &)
Return the correction form of the given matrix by subtracting the matrix multiplied by the current fi...
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes).
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.