67 void operator=(
const LBFGS&) =
delete;
208 virtual ~LBFGS() =
default;
TypeName("LBFGS")
Runtime type information.
virtual void update()
Update design variables.
label nConstraints() const
Get the number of constraints.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
tmp< scalarField > SR1HessianDiag()
Return the diagonal of the Hessian.
virtual tmp< scalarField > invHessianVectorProduct(const scalarField &vector)
Compute the inverse Hessian - vector product.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
void diag(pointPatchField< vector > &, const pointPatchField< tensor > &)
void pivotFields(PtrList< scalarField > &list, const scalarField &f)
Move pointers in PtrList to the left and replace last element with given field.
Base class for quasi-Newton methods.
virtual tmp< scalarField > HessianVectorProduct(const scalarField &vector)
Compute the Hessian - vector product.
A class for handling words, derived from Foam::string.
PtrList< scalarField > s_
The previous correction. Holds nPrevSteps_ fields.
void allocateVectors()
Allocate matrices in the first optimisation cycle.
label nPrevSteps_
Number of old corrections and grad differences kept.
virtual void updateHessian()
Update the Hessian matrix by updating the base vectors.
bool useSDamping_
Use damping for s to ensure positive-definitiveness.
virtual bool writeData(Ostream &os) const
Write useful quantities to files.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
OBJstream os(runTime.globalPath()/outputName)
bool useYDamping_
Use damping for s to ensure positive-definitiveness.
tmp< scalarField > HessianDiag()
Return the diagonal of the Hessian.
virtual tmp< scalarField > SR1HessianVectorProduct(const scalarField &vector)
Compute the Hessian - vector product.
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.
PtrList< scalarField > y_
The previous differences of derivatives. Holds nPrevSteps_ fields.
The quasi-Newton Limited-memory BFGS formula. Keeps nPrevSteps_ of the y and s vectors and approximat...
virtual ~LBFGS()=default
Destructor.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
A class for managing temporary objects.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
void updateVectors(const scalarField &derivatives, const scalarField &derivativesOld)
Update y and s vectors.
void applyDamping(scalarField &y, scalarField &s)
Use the damped version of s to ensure positive-definitiveness.