#include <LOCA_MultiPredictor_Random.H>
Public Member Functions | |
Random (const Teuchos::RCP< LOCA::GlobalData > &global_data, const Teuchos::RCP< Teuchos::ParameterList > &predParams) | |
Constructor. | |
virtual | ~Random () |
Destructor. | |
Random (const Random &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::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. | |
double | epsilon |
Size of random value. |
This class computes the predictor direction where the solution component is filled with random values and the parameter component equal to 1. Each componenet of the solution vector of the predictor is given by
where
is a random value between -1 and 1,
is the corresponding component of the solution vector, and
is a parameter.
The parameters used by this class supplied in the constructor are:
Definition at line 71 of file LOCA_MultiPredictor_Random.H.
LOCA::MultiPredictor::Random::Random | ( | const Teuchos::RCP< LOCA::GlobalData > & | global_data, | |
const Teuchos::RCP< Teuchos::ParameterList > & | predParams | |||
) |
Constructor.
global_data | [in] Global data object | |
predParams | [in] Predictor parameters as described above. |
Definition at line 49 of file LOCA_MultiPredictor_Random.C.
Referenced by clone().
LOCA::MultiPredictor::Random::~Random | ( | ) | [virtual] |
LOCA::MultiPredictor::Random::Random | ( | const Random & | source, | |
NOX::CopyType | type = NOX::DeepCopy | |||
) |
Copy constructor.
Definition at line 64 of file LOCA_MultiPredictor_Random.C.
References initialized, predictor, and secant.
LOCA::MultiPredictor::AbstractStrategy & LOCA::MultiPredictor::Random::operator= | ( | const LOCA::MultiPredictor::AbstractStrategy & | source | ) | [virtual] |
Assignment operator.
Implements LOCA::MultiPredictor::AbstractStrategy.
Definition at line 81 of file LOCA_MultiPredictor_Random.C.
References NOX::DeepCopy, epsilon, globalData, initialized, predictor, and secant.
Teuchos::RCP< LOCA::MultiPredictor::AbstractStrategy > LOCA::MultiPredictor::Random::clone | ( | NOX::CopyType | type = NOX::DeepCopy |
) | const [virtual] |
Clone function.
Implements LOCA::MultiPredictor::AbstractStrategy.
Definition at line 103 of file LOCA_MultiPredictor_Random.C.
References Random().
NOX::Abstract::Group::ReturnType LOCA::MultiPredictor::Random::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 predictor computation described above
Implements LOCA::MultiPredictor::AbstractStrategy.
Definition at line 109 of file LOCA_MultiPredictor_Random.C.
References LOCA::MultiContinuation::ExtendedVector::clone(), LOCA::Extended::Vector::createMultiVector(), epsilon, LOCA::MultiContinuation::ExtendedVector::getXVec(), globalData, initialized, NOX::Abstract::Group::Ok, predictor, secant, LOCA::MultiPredictor::AbstractStrategy::setPredictorOrientation(), NOX::ShapeCopy, and NOX::Utils::StepperDetails.
NOX::Abstract::Group::ReturnType LOCA::MultiPredictor::Random::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 166 of file LOCA_MultiPredictor_Random.C.
References NOX::Abstract::Group::Ok, and predictor.
NOX::Abstract::Group::ReturnType LOCA::MultiPredictor::Random::computeTangent | ( | LOCA::MultiContinuation::ExtendedMultiVector & | tangent | ) | [virtual] |
Compute tangent to predictor and store in tangent
.
Implements LOCA::MultiPredictor::AbstractStrategy.
Definition at line 181 of file LOCA_MultiPredictor_Random.C.
References NOX::Abstract::Group::Ok, and predictor.
bool LOCA::MultiPredictor::Random::isTangentScalable | ( | ) | const [virtual] |
Is the tangent vector for this predictor scalable.
For the random predictor, this always returns false.
Implements LOCA::MultiPredictor::AbstractStrategy.
Definition at line 190 of file LOCA_MultiPredictor_Random.C.
Teuchos::RCP<LOCA::GlobalData> LOCA::MultiPredictor::Random::globalData [protected] |
LOCA global data object.
Definition at line 137 of file LOCA_MultiPredictor_Random.H.
Referenced by compute(), and operator=().
Teuchos::RCP<LOCA::MultiContinuation::ExtendedMultiVector> LOCA::MultiPredictor::Random::predictor [protected] |
Stores predictor vector.
Definition at line 140 of file LOCA_MultiPredictor_Random.H.
Referenced by compute(), computeTangent(), evaluate(), operator=(), and Random().
Teuchos::RCP<LOCA::MultiContinuation::ExtendedVector> LOCA::MultiPredictor::Random::secant [protected] |
Stores secant vector for setting orientation.
Definition at line 143 of file LOCA_MultiPredictor_Random.H.
Referenced by compute(), operator=(), and Random().
bool LOCA::MultiPredictor::Random::initialized [protected] |
Flag indicating whether vectors have been initialized.
Definition at line 146 of file LOCA_MultiPredictor_Random.H.
Referenced by compute(), operator=(), and Random().
double LOCA::MultiPredictor::Random::epsilon [protected] |
Size of random value.
Definition at line 149 of file LOCA_MultiPredictor_Random.H.
Referenced by compute(), and operator=().