46 const label nDVs(
designVars_().activeDesignVariables().size());
60 Foam::quasiNewton::quasiNewton
63 const dictionary&
dict,
64 autoPtr<designVariables>& designVars,
65 const label nConstraints,
69 updateMethod(
mesh,
dict, designVars, nConstraints,
type),
70 etaHessian_(coeffsDict(
type).getOrDefault<scalar>(
"etaHessian", 1)),
73 coeffsDict(
type).getOrDefault<label>(
"nSteepestDescent", 1)
77 coeffsDict(
type).getOrDefault<bool>(
"scaleFirstHessian", false)
82 readOrZeroField(
"derivativesOld", objectiveDerivatives_.size())
84 correctionOld_(readOrZeroField(
"correctionOld", correction_.size()))
106 correctionOld_ = oldCorrection;
116 forAll(designVars_().activeDesignVariables(), iDV)
123 correctionOld_.writeEntry(
"correctionOld",
os);
autoPtr< designVariables > & designVars_
Design variables.
void size(const label n)
Older name for setAddressableSize.
void writeEntry(const word &keyword, Ostream &os) const
Write the field as a dictionary entry.
virtual bool writeData(Ostream &os) const
Write useful quantities to files.
Macros for easy insertion into run-time selection tables.
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry (const access) with the given keyword.
#define forAll(list, i)
Loop across all elements in list.
void computeCorrection()
Compute design variables correction.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
const labelList & activeDesignVars_
Map to active design variables.
virtual void updateOldCorrection(const scalarField &oldCorrection)
Update old correction. Useful for quasi-newton methods coupled with line search.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
static const Identity< scalar > I
Base class for quasi-Newton methods.
autoPtr< SquareMatrix< scalar > > Hessian_
The Hessian or its inverse, depending on the deriving class.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
void allocateHessian()
Allocate the Hessian matrix.
OBJstream os(runTime.globalPath()/outputName)
defineTypeNameAndDebug(combustionModel, 0)
virtual void updateOldCorrection(const scalarField &oldCorrection)
Update old correction. Useful for quasi-Newton methods coupled with line search.
virtual bool writeData(Ostream &os) const
Write continuation data under uniform.