#include <LOCA_MultiPredictor_Secant.H>
Public Member Functions | |
Secant (const Teuchos::RCP< LOCA::GlobalData > &global_data, const Teuchos::RCP< LOCA::Parameter::SublistParser > &topParams, const Teuchos::RCP< Teuchos::ParameterList > &predParams) | |
Constructor. | |
virtual | ~Secant () |
Destructor. | |
Secant (const Secant &source, NOX::CopyType type=NOX::DeepCopy) | |
Copy constructor. | |
virtual LOCA::MultiPredictor::AbstractStrategy & | operator= (const LOCA::MultiPredictor::AbstractStrategy &source) |
Assignment operator. | |
virtual Teuchos::RCP < LOCA::MultiPredictor::AbstractStrategy > | clone (NOX::CopyType type=NOX::DeepCopy) const |
Clone function. | |
virtual NOX::Abstract::Group::ReturnType | compute (bool baseOnSecant, const vector< double > &stepSize, LOCA::MultiContinuation::ExtendedGroup &grp, const LOCA::MultiContinuation::ExtendedVector &prevXVec, const LOCA::MultiContinuation::ExtendedVector &xVec) |
Compute the predictor given the current and previous solution vectors. Set baseOnSecant to false if the predictor orientation should not be based on the secant vector (first or last steps of a continuation run). | |
virtual NOX::Abstract::Group::ReturnType | evaluate (const vector< double > &stepSize, const LOCA::MultiContinuation::ExtendedVector &xVec, LOCA::MultiContinuation::ExtendedMultiVector &result) const |
Evaluate predictor with step size stepSize . | |
virtual NOX::Abstract::Group::ReturnType | computeTangent (LOCA::MultiContinuation::ExtendedMultiVector &tangent) |
Compute tangent to predictor and store in tangent . | |
virtual bool | isTangentScalable () const |
Is the tangent vector for this predictor scalable. | |
Protected Attributes | |
Teuchos::RCP< LOCA::GlobalData > | globalData |
LOCA global data object. | |
Teuchos::RCP < LOCA::MultiPredictor::AbstractStrategy > | firstStepPredictor |
First step predictor. | |
bool | isFirstStep |
Flag indicating whether this is the first step. | |
bool | isFirstStepComputed |
Flag indicating whether first step predictor has been computed. | |
Teuchos::RCP < LOCA::MultiContinuation::ExtendedMultiVector > | predictor |
Stores predictor vector. | |
Teuchos::RCP < LOCA::MultiContinuation::ExtendedVector > | secant |
Stores secant vector for setting orientation. | |
bool | initialized |
Flag indicating whether vectors have been initialized. |
This class implements a predictor strategy based on computing the secant vector to the continuation curve given by
where is the current solution vector and
is the previous solution vector. Note that for multi-parameter continuation, the solution component for each secant direction is given as above, with the parameter components given by the identity matrix.
For the first step of a continuation run, is not defined, and so a different predictor is used for this step. This predictor is specified via the "First Step Predictor" sublist of the "Predictor" sublist. This predictor is instantiated using the LOCA::Factory as usual.
The parameters used by this class supplied in the constructor are:
Definition at line 83 of file LOCA_MultiPredictor_Secant.H.
LOCA::MultiPredictor::Secant::Secant | ( | const Teuchos::RCP< LOCA::GlobalData > & | global_data, | |
const Teuchos::RCP< LOCA::Parameter::SublistParser > & | topParams, | |||
const Teuchos::RCP< Teuchos::ParameterList > & | predParams | |||
) |
Constructor.
global_data | [in] Global data object used for LOCA::Factory | |
topParams | [in] Parsed top-level parameter list used when creating first step predictor | |
predParams | [in] Predictor parameters used to obtain "First Step Predictor" as described above. |
Definition at line 52 of file LOCA_MultiPredictor_Secant.C.
References firstStepPredictor, and globalData.
Referenced by clone().
LOCA::MultiPredictor::Secant::~Secant | ( | ) | [virtual] |
LOCA::MultiPredictor::Secant::Secant | ( | const Secant & | source, | |
NOX::CopyType | type = NOX::DeepCopy | |||
) |
Copy constructor.
Definition at line 77 of file LOCA_MultiPredictor_Secant.C.
References initialized, predictor, and secant.
LOCA::MultiPredictor::AbstractStrategy & LOCA::MultiPredictor::Secant::operator= | ( | const LOCA::MultiPredictor::AbstractStrategy & | source | ) | [virtual] |
Assignment operator.
Implements LOCA::MultiPredictor::AbstractStrategy.
Definition at line 96 of file LOCA_MultiPredictor_Secant.C.
References NOX::DeepCopy, firstStepPredictor, globalData, initialized, isFirstStep, isFirstStepComputed, predictor, and secant.
Teuchos::RCP< LOCA::MultiPredictor::AbstractStrategy > LOCA::MultiPredictor::Secant::clone | ( | NOX::CopyType | type = NOX::DeepCopy |
) | const [virtual] |
Clone function.
Implements LOCA::MultiPredictor::AbstractStrategy.
Definition at line 120 of file LOCA_MultiPredictor_Secant.C.
References Secant().
NOX::Abstract::Group::ReturnType LOCA::MultiPredictor::Secant::compute | ( | bool | baseOnSecant, | |
const vector< double > & | stepSize, | |||
LOCA::MultiContinuation::ExtendedGroup & | grp, | |||
const LOCA::MultiContinuation::ExtendedVector & | prevXVec, | |||
const LOCA::MultiContinuation::ExtendedVector & | xVec | |||
) | [virtual] |
Compute the predictor given the current and previous solution vectors. Set baseOnSecant to false if the predictor orientation should not be based on the secant vector (first or last steps of a continuation run).
This method actually implements the secant calculation described above
Implements LOCA::MultiPredictor::AbstractStrategy.
Definition at line 126 of file LOCA_MultiPredictor_Secant.C.
References LOCA::MultiContinuation::ExtendedVector::clone(), LOCA::Extended::Vector::createMultiVector(), firstStepPredictor, globalData, initialized, isFirstStep, isFirstStepComputed, NOX::Abstract::Group::Ok, predictor, secant, LOCA::MultiPredictor::AbstractStrategy::setPredictorOrientation(), NOX::ShapeCopy, and NOX::Utils::StepperDetails.
NOX::Abstract::Group::ReturnType LOCA::MultiPredictor::Secant::evaluate | ( | const vector< double > & | stepSize, | |
const LOCA::MultiContinuation::ExtendedVector & | xVec, | |||
LOCA::MultiContinuation::ExtendedMultiVector & | result | |||
) | const [virtual] |
Evaluate predictor with step size stepSize
.
This method computes result
[i] = xVec
[i] + stepSize
[i] * v[i] for each i, where v
[i] is the ith predictor direction.
Implements LOCA::MultiPredictor::AbstractStrategy.
Definition at line 184 of file LOCA_MultiPredictor_Secant.C.
References firstStepPredictor, isFirstStep, NOX::Abstract::Group::Ok, and predictor.
NOX::Abstract::Group::ReturnType LOCA::MultiPredictor::Secant::computeTangent | ( | LOCA::MultiContinuation::ExtendedMultiVector & | tangent | ) | [virtual] |
Compute tangent to predictor and store in tangent
.
Implements LOCA::MultiPredictor::AbstractStrategy.
Definition at line 204 of file LOCA_MultiPredictor_Secant.C.
References firstStepPredictor, isFirstStep, NOX::Abstract::Group::Ok, and predictor.
bool LOCA::MultiPredictor::Secant::isTangentScalable | ( | ) | const [virtual] |
Is the tangent vector for this predictor scalable.
For the secant predictor, this always returns true.
Implements LOCA::MultiPredictor::AbstractStrategy.
Definition at line 218 of file LOCA_MultiPredictor_Secant.C.
References firstStepPredictor, and isFirstStep.
Teuchos::RCP<LOCA::GlobalData> LOCA::MultiPredictor::Secant::globalData [protected] |
LOCA global data object.
Definition at line 153 of file LOCA_MultiPredictor_Secant.H.
Referenced by compute(), operator=(), and Secant().
Teuchos::RCP<LOCA::MultiPredictor::AbstractStrategy> LOCA::MultiPredictor::Secant::firstStepPredictor [protected] |
First step predictor.
Definition at line 156 of file LOCA_MultiPredictor_Secant.H.
Referenced by compute(), computeTangent(), evaluate(), isTangentScalable(), operator=(), and Secant().
bool LOCA::MultiPredictor::Secant::isFirstStep [protected] |
Flag indicating whether this is the first step.
Definition at line 159 of file LOCA_MultiPredictor_Secant.H.
Referenced by compute(), computeTangent(), evaluate(), isTangentScalable(), and operator=().
bool LOCA::MultiPredictor::Secant::isFirstStepComputed [protected] |
Flag indicating whether first step predictor has been computed.
Definition at line 162 of file LOCA_MultiPredictor_Secant.H.
Referenced by compute(), and operator=().
Teuchos::RCP<LOCA::MultiContinuation::ExtendedMultiVector> LOCA::MultiPredictor::Secant::predictor [protected] |
Stores predictor vector.
Definition at line 165 of file LOCA_MultiPredictor_Secant.H.
Referenced by compute(), computeTangent(), evaluate(), operator=(), and Secant().
Teuchos::RCP<LOCA::MultiContinuation::ExtendedVector> LOCA::MultiPredictor::Secant::secant [protected] |
Stores secant vector for setting orientation.
Definition at line 168 of file LOCA_MultiPredictor_Secant.H.
Referenced by compute(), operator=(), and Secant().
bool LOCA::MultiPredictor::Secant::initialized [protected] |
Flag indicating whether vectors have been initialized.
Definition at line 171 of file LOCA_MultiPredictor_Secant.H.
Referenced by compute(), operator=(), and Secant().