#include <LOCA_StepSize_Constant.H>
Public Member Functions | |
Constant (const Teuchos::RCP< LOCA::GlobalData > &global_data, const Teuchos::RCP< LOCA::Parameter::SublistParser > &topParams, const Teuchos::RCP< Teuchos::ParameterList > &stepsizeParams) | |
Constructor. | |
virtual | ~Constant () |
Destructor. | |
virtual NOX::Abstract::Group::ReturnType | computeStepSize (LOCA::MultiContinuation::AbstractStrategy &curGroup, const LOCA::MultiContinuation::ExtendedVector &predictor, const NOX::Solver::Generic &solver, const LOCA::Abstract::Iterator::StepStatus &stepStatus, const LOCA::Stepper &stepper, double &stepSize) |
Compute the step size as described above. | |
virtual double | getPrevStepSize () const |
Returns previous step size. | |
virtual double | getStartStepSize () const |
Returns initial step size. | |
Protected Member Functions | |
virtual NOX::Abstract::Group::ReturnType | clipStepSize (double &stepSize) |
Clip the computed step size to the bounds given by the maximum and minimum step sizes. | |
Protected Attributes | |
Teuchos::RCP< LOCA::GlobalData > | globalData |
Global data. | |
double | maxStepSize |
Maximum step size. | |
double | minStepSize |
Minimum step size. | |
double | startStepSize |
Initial step size. | |
double | failedFactor |
Factor by which step size is reduced after a failed step. | |
double | successFactor |
Factor by which step size is increased after a successful step. | |
double | prevStepSize |
Previous step size. | |
bool | isFirstStep |
Flag indicating if this is the first step. |
This class implements a roughly constant step size control strategy. If the previous step was sucessful, the new step size is set equal to the old, otherwise the step size is cut by a supplied factor. Once a sucessful step is made, the step size is increased by a supplied factor until the initial step size is reached.
This class also incorporates rescaling of the continuation parameter when calculating a step size (common in arc-length continuation). For the first continuation step, the step size is chosen so that step size times the parameter component of the predictor is equal to the initial step size. From then on, the step size is multiplied by the step size scale factor (see ( LOCA::MultiContinuation::ArcLengthGroup) which incorporates rescaling of the continuation parameter.
The parameters used by this class supplied in the constructor are:
Definition at line 91 of file LOCA_StepSize_Constant.H.
LOCA::StepSize::Constant::Constant | ( | const Teuchos::RCP< LOCA::GlobalData > & | global_data, | |
const Teuchos::RCP< LOCA::Parameter::SublistParser > & | topParams, | |||
const Teuchos::RCP< Teuchos::ParameterList > & | stepsizeParams | |||
) |
Constructor.
Definition at line 50 of file LOCA_StepSize_Constant.C.
References failedFactor, maxStepSize, minStepSize, startStepSize, and successFactor.
LOCA::StepSize::Constant::~Constant | ( | ) | [virtual] |
NOX::Abstract::Group::ReturnType LOCA::StepSize::Constant::computeStepSize | ( | LOCA::MultiContinuation::AbstractStrategy & | curGroup, | |
const LOCA::MultiContinuation::ExtendedVector & | predictor, | |||
const NOX::Solver::Generic & | solver, | |||
const LOCA::Abstract::Iterator::StepStatus & | stepStatus, | |||
const LOCA::Stepper & | stepper, | |||
double & | stepSize | |||
) | [virtual] |
Compute the step size as described above.
curGroup | [in] Current continuation group | |
predictor | [in] Current predictor direction | |
solver | [in] Solver from previous step | |
stepStatus | [in] Status of previous step | |
stepper | [in] Stepper | |
stepSize | [out] Computed step size |
Implements LOCA::StepSize::AbstractStrategy.
Reimplemented in LOCA::StepSize::Adaptive.
Definition at line 77 of file LOCA_StepSize_Constant.C.
References clipStepSize(), failedFactor, LOCA::Extended::Vector::getScalar(), LOCA::MultiContinuation::AbstractStrategy::getStepSizeScaleFactor(), isFirstStep, maxStepSize, minStepSize, prevStepSize, startStepSize, successFactor, and LOCA::Abstract::Iterator::Unsuccessful.
double LOCA::StepSize::Constant::getPrevStepSize | ( | ) | const [virtual] |
Returns previous step size.
Implements LOCA::StepSize::AbstractStrategy.
Definition at line 166 of file LOCA_StepSize_Constant.C.
References prevStepSize.
double LOCA::StepSize::Constant::getStartStepSize | ( | ) | const [virtual] |
Returns initial step size.
Implements LOCA::StepSize::AbstractStrategy.
Definition at line 171 of file LOCA_StepSize_Constant.C.
References startStepSize.
NOX::Abstract::Group::ReturnType LOCA::StepSize::Constant::clipStepSize | ( | double & | stepSize | ) | [protected, virtual] |
Clip the computed step size to the bounds given by the maximum and minimum step sizes.
Returns NOX::Abstract::Group::Failed if the computed step size is smaller than the minimum step size
Definition at line 139 of file LOCA_StepSize_Constant.C.
References NOX::Utils::Error, NOX::Abstract::Group::Failed, globalData, maxStepSize, minStepSize, and NOX::Abstract::Group::Ok.
Referenced by computeStepSize(), and LOCA::StepSize::Adaptive::computeStepSize().
Teuchos::RCP<LOCA::GlobalData> LOCA::StepSize::Constant::globalData [protected] |
double LOCA::StepSize::Constant::maxStepSize [protected] |
Maximum step size.
Definition at line 149 of file LOCA_StepSize_Constant.H.
Referenced by clipStepSize(), computeStepSize(), LOCA::StepSize::Adaptive::computeStepSize(), and Constant().
double LOCA::StepSize::Constant::minStepSize [protected] |
Minimum step size.
Definition at line 152 of file LOCA_StepSize_Constant.H.
Referenced by clipStepSize(), computeStepSize(), LOCA::StepSize::Adaptive::computeStepSize(), and Constant().
double LOCA::StepSize::Constant::startStepSize [protected] |
Initial step size.
Definition at line 155 of file LOCA_StepSize_Constant.H.
Referenced by computeStepSize(), LOCA::StepSize::Adaptive::computeStepSize(), Constant(), and getStartStepSize().
double LOCA::StepSize::Constant::failedFactor [protected] |
Factor by which step size is reduced after a failed step.
Definition at line 158 of file LOCA_StepSize_Constant.H.
Referenced by computeStepSize(), LOCA::StepSize::Adaptive::computeStepSize(), and Constant().
double LOCA::StepSize::Constant::successFactor [protected] |
Factor by which step size is increased after a successful step.
Definition at line 161 of file LOCA_StepSize_Constant.H.
Referenced by computeStepSize(), and Constant().
double LOCA::StepSize::Constant::prevStepSize [protected] |
Previous step size.
Definition at line 164 of file LOCA_StepSize_Constant.H.
Referenced by computeStepSize(), LOCA::StepSize::Adaptive::computeStepSize(), and getPrevStepSize().
bool LOCA::StepSize::Constant::isFirstStep [protected] |
Flag indicating if this is the first step.
Definition at line 167 of file LOCA_StepSize_Constant.H.
Referenced by computeStepSize(), and LOCA::StepSize::Adaptive::computeStepSize().