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