Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
conjugateGradient Class Reference

The Conjugate Gradient formula. More...

Inheritance diagram for conjugateGradient:
Inheritance graph
[legend]
Collaboration diagram for conjugateGradient:
Collaboration graph
[legend]

Public Member Functions

 TypeName ("conjugateGradient")
 
 conjugateGradient (const fvMesh &mesh, const dictionary &dict)
 
virtual ~conjugateGradient ()=default
 
void computeCorrection ()
 
virtual void updateOldCorrection (const scalarField &oldCorrection)
 
virtual void write ()
 
- Public Member Functions inherited from updateMethod
 TypeName ("updateMethod")
 
 declareRunTimeSelectionTable (autoPtr, updateMethod, dictionary,(const fvMesh &mesh, const dictionary &dict),(mesh, dict))
 
 updateMethod (const fvMesh &mesh, const dictionary &dict)
 
virtual ~updateMethod ()=default
 
void setObjectiveDeriv (const scalarField &derivs)
 
void setConstraintDeriv (const PtrList< scalarField > &derivs)
 
void setObjectiveValue (const scalar value)
 
void setConstraintValues (const scalarField &values)
 
void setStep (const scalar eta)
 
void setGlobalSum (const bool useGlobalSum)
 
scalarFieldreturnCorrection ()
 
void writeCorrection ()
 
virtual scalar computeMeritFunction ()
 
virtual scalar meritFunctionDirectionalDerivative ()
 
boolinitialEtaSet ()
 

Protected Member Functions

void allocateFields ()
 
void readFromDict ()
 
- Protected Member Functions inherited from updateMethod
const scalarField leftMult (const scalarField &, const SquareMatrix< scalar > &)
 
const scalarField rightMult (const SquareMatrix< scalar > &, const scalarField &)
 
SquareMatrix< scalar > outerProd (const scalarField &, const scalarField &)
 
SquareMatrix< scalar > inv (SquareMatrix< scalar > A)
 
scalar globalSum (const scalarField &field)
 
scalar globalSum (tmp< scalarField > &tfield)
 
dictionary coeffsDict ()
 

Protected Attributes

labelList activeDesignVars_
 
scalarField dxOld_
 
scalarField sOld_
 
label counter_
 
word betaType_
 
- Protected Attributes inherited from updateMethod
const fvMeshmesh_
 
const dictionary dict_
 
IOdictionary optMethodIODict_
 
scalarField objectiveDerivatives_
 
PtrList< scalarFieldconstraintDerivatives_
 
scalar objectiveValue_
 
scalarField cValues_
 
scalarField correction_
 
scalarField cumulativeCorrection_
 
scalar eta_
 
bool initialEtaSet_
 
word correctionFolder_
 
bool globalSum_
 

Additional Inherited Members

- Static Public Member Functions inherited from updateMethod
static autoPtr< updateMethodNew (const fvMesh &mesh, const dictionary &dict)
 

Detailed Description

The Conjugate Gradient formula.

Beta computed from Fletcher-Reeves or Polak-Ribiere approaches. Polak-Ribiere seems to misbehave. Not tested with line search.

Source files

Definition at line 53 of file conjugateGradient.H.

Constructor & Destructor Documentation

◆ conjugateGradient()

conjugateGradient ( const fvMesh mesh,
const dictionary dict 
)

Definition at line 79 of file conjugateGradient.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::Info, and Foam::nl.

Here is the call graph for this function:

◆ ~conjugateGradient()

virtual ~conjugateGradient ( )
virtualdefault

Member Function Documentation

◆ allocateFields()

void allocateFields ( )
protected

◆ readFromDict()

void readFromDict ( )
protected

Definition at line 56 of file conjugateGradient.C.

References Foam::identity(), and Foam::Zero.

Here is the call graph for this function:

◆ TypeName()

TypeName ( "conjugateGradient"  )

◆ computeCorrection()

void computeCorrection ( )
virtual

Implements updateMethod.

Definition at line 128 of file conjugateGradient.C.

References beta(), Foam::endl(), forAll, Foam::Info, Field::map(), Foam::max(), s, and Foam::Zero.

Here is the call graph for this function:

◆ updateOldCorrection()

void updateOldCorrection ( const scalarField oldCorrection)
virtual

Reimplemented from updateMethod.

Definition at line 186 of file conjugateGradient.C.

◆ write()

void write ( )
virtual

Reimplemented from updateMethod.

Definition at line 196 of file conjugateGradient.C.

References updateMethod::write().

Here is the call graph for this function:

Member Data Documentation

◆ activeDesignVars_

labelList activeDesignVars_
protected

Definition at line 61 of file conjugateGradient.H.

Referenced by conjugateGradient::allocateFields().

◆ dxOld_

scalarField dxOld_
protected

Definition at line 62 of file conjugateGradient.H.

Referenced by conjugateGradient::allocateFields().

◆ sOld_

scalarField sOld_
protected

Definition at line 63 of file conjugateGradient.H.

Referenced by conjugateGradient::allocateFields().

◆ counter_

label counter_
protected

Definition at line 64 of file conjugateGradient.H.

◆ betaType_

word betaType_
protected

Definition at line 65 of file conjugateGradient.H.


The documentation for this class was generated from the following files: