Continuum Membrane 719025a62b1e384a6ff80e2f2a223ef4012153dc
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
OptimizationAlgorithm Class Reference

A class that defines an optimization algorithm and its settings. This class defines the settings for an optimization algorithm, including whether to use nonlinear conjugate gradient (NCG), whether NCG has gotten stuck and cannot further minimize, and whether to use R-pi adaptive method for regularization energy. These settings can be accessed and modified using the public member variables of the class. More...

#include <Model.hpp>

Public Member Functions

 OptimizationAlgorithm ()
 Constructor for the OptimizationAlgorithm class.
 
 OptimizationAlgorithm (const int trialIterationInterval, const double c1, const double c2, const double stepThreshold)
 Constructor for the OptimizationAlgorithm class.
 
void reset_NCG_Rpi ()
 Reset NCG and Rpi to default.
 
bool disable_NCG_if_stuck_consecutively ()
 Disables the use of NCG if it has been stuck consecutively over a threshold.
 

Public Attributes

bool usingNCG = false
 Flag indicating whether to use the nonlinear conjugate gradient optimizer.
 
bool isNCGstuck = false
 Flag indicating whether the NCG optimizer has gotten stuck and cannot further minimize.
 
bool usingRpi = false
 Flag indicating whether to use the R-pi adaptive method for regularization energy.
 
bool isCriteriaSatisfied = false
 Flag indicating whether the optimization criteria have been met.
 
double trialStepSize = 0.0
 The step size used in the optimization algorithm.
 
int trialIterationInterval = 300
 The number of iterations between trial step size adjustments.
 
double c1 = 1e-6
 The c1 parameter in the NCG Wolfe condition.
 
double c2 = 0.001
 The c2 parameter in the NCG Wolfe condition.
 
double stepThreshold = 1e-15
 The lower bound for the step size in NCG.
 
int nConsecutiveNcgStuck = 0
 The number of consecutive times the NCG optimizer has gotten stuck.
 
int nConsecutiveNcgStuckThreshold = 3
 The threshold of consecutive NCG stuck iterations before disabling it.
 
double energyDiffThreshold = 1e-5
 The energy difference threshold for convergence checking.
 
double forceDiffThreshold = 1e-4
 The mean force difference threshold for convergence checking.
 

Detailed Description

A class that defines an optimization algorithm and its settings. This class defines the settings for an optimization algorithm, including whether to use nonlinear conjugate gradient (NCG), whether NCG has gotten stuck and cannot further minimize, and whether to use R-pi adaptive method for regularization energy. These settings can be accessed and modified using the public member variables of the class.

Constructor & Destructor Documentation

◆ OptimizationAlgorithm() [1/2]

OptimizationAlgorithm::OptimizationAlgorithm ( )

Constructor for the OptimizationAlgorithm class.

Initializes an instance of the OptimizationAlgorithm class with default settings. Sets usingNCG to true, isNCGstuck to false, and usingRpi to true.

◆ OptimizationAlgorithm() [2/2]

OptimizationAlgorithm::OptimizationAlgorithm ( const int  trialIterationInterval,
const double  c1,
const double  c2,
const double  stepThreshold 
)

Constructor for the OptimizationAlgorithm class.

Initializes an instance of the OptimizationAlgorithm class with default settings. Customize iteration interval, c1, c2, and step threshold. Sets usingNCG to true, isNCGstuck to false, and usingRpi to true.

Member Function Documentation

◆ disable_NCG_if_stuck_consecutively()

bool OptimizationAlgorithm::disable_NCG_if_stuck_consecutively ( )

Disables the use of NCG if it has been stuck consecutively over a threshold.

If the NCG optimizer has been stuck for too many consecutive iterations (as determined by the isNCGstuck flag), this function will increment a counter nConsecutiveNcgStuck. If that counter exceeds a threshold of nConsecutiveNcgStuckThreshold, the usingNCG flag will be set to false, indicating that NCG should not be used. Otherwise, usingNCG remains true.

If the NCG optimizer is not currently stuck, the nConsecutiveNcgStuck counter is reset to 0 and usingNCG is set to true.

Returns
True if NCG should be used, false otherwise.

◆ reset_NCG_Rpi()

void OptimizationAlgorithm::reset_NCG_Rpi ( )

Reset NCG and Rpi to default.

Sets usingNCG to true, isNCGstuck to false, and usingRpi to true.

Member Data Documentation

◆ c1

double OptimizationAlgorithm::c1 = 1e-6

The c1 parameter in the NCG Wolfe condition.

◆ c2

double OptimizationAlgorithm::c2 = 0.001

The c2 parameter in the NCG Wolfe condition.

◆ energyDiffThreshold

double OptimizationAlgorithm::energyDiffThreshold = 1e-5

The energy difference threshold for convergence checking.

◆ forceDiffThreshold

double OptimizationAlgorithm::forceDiffThreshold = 1e-4

The mean force difference threshold for convergence checking.

◆ isCriteriaSatisfied

bool OptimizationAlgorithm::isCriteriaSatisfied = false

Flag indicating whether the optimization criteria have been met.

◆ isNCGstuck

bool OptimizationAlgorithm::isNCGstuck = false

Flag indicating whether the NCG optimizer has gotten stuck and cannot further minimize.

◆ nConsecutiveNcgStuck

int OptimizationAlgorithm::nConsecutiveNcgStuck = 0

The number of consecutive times the NCG optimizer has gotten stuck.

◆ nConsecutiveNcgStuckThreshold

int OptimizationAlgorithm::nConsecutiveNcgStuckThreshold = 3

The threshold of consecutive NCG stuck iterations before disabling it.

◆ stepThreshold

double OptimizationAlgorithm::stepThreshold = 1e-15

The lower bound for the step size in NCG.

◆ trialIterationInterval

int OptimizationAlgorithm::trialIterationInterval = 300

The number of iterations between trial step size adjustments.

◆ trialStepSize

double OptimizationAlgorithm::trialStepSize = 0.0

The step size used in the optimization algorithm.

◆ usingNCG

bool OptimizationAlgorithm::usingNCG = false

Flag indicating whether to use the nonlinear conjugate gradient optimizer.

◆ usingRpi

bool OptimizationAlgorithm::usingRpi = false

Flag indicating whether to use the R-pi adaptive method for regularization energy.


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