64 LBFGS(
const LBFGS&) =
delete;
67 void operator=(
const LBFGS&) =
delete;
208 virtual ~LBFGS() =
default;
PtrList< scalarField > y_
The previous differences of derivatives. Holds nPrevSteps_ fields.
void pivotFields(PtrList< scalarField > &list, const scalarField &f)
Move pointers in PtrList to the left and replace last element with given field.
void applyDamping(scalarField &y, scalarField &s)
Use the damped version of s to ensure positive-definitiveness.
void updateVectors(const scalarField &derivatives, const scalarField &derivativesOld)
Update y and s vectors.
void allocateVectors()
Allocate matrices in the first optimisation cycle.
virtual tmp< scalarField > HessianVectorProduct(const scalarField &vector)
Compute the Hessian - vector product.
virtual tmp< scalarField > SR1HessianVectorProduct(const scalarField &vector)
Compute the Hessian - vector product.
virtual bool writeData(Ostream &os) const
Write useful quantities to files.
PtrList< scalarField > s_
The previous correction. Holds nPrevSteps_ fields.
tmp< scalarField > HessianDiag()
Return the diagonal of the Hessian.
bool useYDamping_
Use damping for s to ensure positive-definitiveness.
label nPrevSteps_
Number of old corrections and grad differences kept.
bool useSDamping_
Use damping for s to ensure positive-definitiveness.
virtual tmp< scalarField > invHessianVectorProduct(const scalarField &vector)
Compute the inverse Hessian - vector product.
virtual void update()
Update design variables.
tmp< scalarField > SR1HessianDiag()
Return the diagonal of the Hessian.
virtual ~LBFGS()=default
Destructor.
TypeName("LBFGS")
Runtime type information.
virtual void updateHessian()
Update the Hessian matrix by updating the base vectors.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
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,...
Mesh data needed to do the Finite Volume discretisation.
A class for managing references or pointers (no reference counting).
A class for managing temporary objects.
label nConstraints() const
Get the number of constraints.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
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))
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
void diag(pointPatchField< vector > &, const pointPatchField< tensor > &)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.