NOX Development
Loading...
Searching...
No Matches
LOCA::TurningPoint::MinimallyAugmented::Constraint Class Reference

Implementation of LOCA::MultiContinuation::ConstraintInterfaceMVDX for computing turning points for the minimally augmented turning point formulation. More...

#include <LOCA_TurningPoint_MinimallyAugmented_Constraint.H>

Inheritance diagram for LOCA::TurningPoint::MinimallyAugmented::Constraint:
Collaboration diagram for LOCA::TurningPoint::MinimallyAugmented::Constraint:

Public Member Functions

 Constraint (const Teuchos::RCP< LOCA::GlobalData > &global_data, const Teuchos::RCP< LOCA::Parameter::SublistParser > &topParams, const Teuchos::RCP< Teuchos::ParameterList > &tpParams, const Teuchos::RCP< LOCA::TurningPoint::MinimallyAugmented::AbstractGroup > &g, int bif_param)
 Constructor.
 Constraint (const Constraint &source, NOX::CopyType type=NOX::DeepCopy)
 Copy constructor.
virtual ~Constraint ()
 Destructor.
virtual void setGroup (const Teuchos::RCP< LOCA::TurningPoint::MinimallyAugmented::AbstractGroup > &g)
 Set the group pointer.
virtual Teuchos::RCP< const NOX::Abstract::VectorgetLeftNullVec () const
 Returns left null vector w.
virtual Teuchos::RCP< const NOX::Abstract::VectorgetRightNullVec () const
 Returns right null vector v.
virtual Teuchos::RCP< const NOX::Abstract::VectorgetAVec () const
 Returns a vector.
virtual Teuchos::RCP< const NOX::Abstract::VectorgetBVec () const
 Returns b vector.
virtual double getSigma () const
 Returns sigma.
Public Member Functions inherited from LOCA::MultiContinuation::ConstraintInterfaceMVDX
 ConstraintInterfaceMVDX ()
 Constructor.
virtual ~ConstraintInterfaceMVDX ()
 Destructor.
virtual NOX::Abstract::Group::ReturnType multiplyDX (double alpha, const NOX::Abstract::MultiVector &input_x, NOX::Abstract::MultiVector::DenseMatrix &result_p) const
 Compute result_p = alpha * dg/dx * input_x.
virtual NOX::Abstract::Group::ReturnType addDX (Teuchos::ETransp transb, double alpha, const NOX::Abstract::MultiVector::DenseMatrix &b, double beta, NOX::Abstract::MultiVector &result_x) const
 Compute result_x = alpha * dg/dx^T * op(b) + beta * result_x.
Public Member Functions inherited from LOCA::MultiContinuation::ConstraintInterface
 ConstraintInterface ()
 Constructor.
virtual ~ConstraintInterface ()
 Destructor.
virtual void preProcessContinuationStep (LOCA::Abstract::Iterator::StepStatus)
 Perform any preprocessing before a continuation step starts.

Implementation of LOCA::MultiContinuation::ConstraintInterface

virtual methods

enum  NullVectorScaling { NVS_None , NVS_OrderOne , NVS_OrderN }
 Enumerated type determining type of scaling. More...
Teuchos::RCP< LOCA::GlobalDataglobalData
 Pointer LOCA global data object.
Teuchos::RCP< LOCA::Parameter::SublistParserparsedParams
 Parsed top-level parameters.
Teuchos::RCP< Teuchos::ParameterList > turningPointParams
 Bifurcation parameter list.
Teuchos::RCP< LOCA::TurningPoint::MinimallyAugmented::AbstractGroupgrpPtr
 Pointer to base group that defines $F$.
Teuchos::RCP< NOX::Abstract::MultiVectora_vector
 Vector for $a$.
Teuchos::RCP< NOX::Abstract::MultiVectorb_vector
 Vector for $b$.
Teuchos::RCP< NOX::Abstract::MultiVectorw_vector
 Stores left null vector.
Teuchos::RCP< NOX::Abstract::MultiVectorv_vector
 Stores right null vector.
Teuchos::RCP< NOX::Abstract::MultiVectorJv_vector
 Stores J*v.
Teuchos::RCP< NOX::Abstract::MultiVectorJtw_vector
 Stores J^T*w.
Teuchos::RCP< NOX::Abstract::MultiVectorsigma_x
 Stores sigma_x.
NOX::Abstract::MultiVector::DenseMatrix constraints
 Constraint values.
Teuchos::RCP< LOCA::BorderedSolver::AbstractStrategyborderedSolver
 Stores bordered solver strategy.
double dn
 Stores vector length as a double.
double sigma_scale
 Stores scale factor on sigma.
bool isSymmetric
 Flag indicating whether Jacobian is symmetric.
bool isValidConstraints
 Flag indicating whether constraints are valid.
bool isValidDX
 Flag indicating whether sigma_x is valid.
std::vector< int > bifParamID
 Stores the bifurcation parameter index.
bool updateVectorsEveryContinuationStep
 Flag indicating whether to update $a$ and $b$ every continuation step.
bool updateVectorsEveryIteration
 Flag indicating whether to update $a$ and $b$ every nonlinear iteration.
NullVectorScaling nullVecScaling
 Null vector scaling method.
bool multiplyMass
 Multiply null vectors by mass matrix.
Teuchos::RCP< LOCA::TimeDependent::AbstractGrouptdGrp
 Time dependent group interface for multiplying by mass matrix.
Teuchos::RCP< NOX::Abstract::Vectortmp_mass
 Temporary vector for mulplying null vectors by mass matrix.
virtual void copy (const LOCA::MultiContinuation::ConstraintInterface &source)
 Copy.
virtual Teuchos::RCP< LOCA::MultiContinuation::ConstraintInterfaceclone (NOX::CopyType type=NOX::DeepCopy) const
 Cloning function.
virtual int numConstraints () const
 Return number of constraints.
virtual void setX (const NOX::Abstract::Vector &y)
 Set the solution vector to y.
virtual void setParam (int paramID, double val)
 Sets parameter indexed by paramID.
virtual void setParams (const std::vector< int > &paramIDs, const NOX::Abstract::MultiVector::DenseMatrix &vals)
 Sets parameters indexed by paramIDs.
virtual NOX::Abstract::Group::ReturnType computeConstraints ()
 Compute continuation constraint equations.
virtual NOX::Abstract::Group::ReturnType computeDX ()
 Compute derivative of constraints w.r.t. solution vector x.
virtual NOX::Abstract::Group::ReturnType computeDP (const std::vector< int > &paramIDs, NOX::Abstract::MultiVector::DenseMatrix &dgdp, bool isValidG)
 Compute derivative of constraints w.r.t. supplied parameters.
virtual bool isConstraints () const
 Return true if constraint residuals are valid.
virtual bool isDX () const
 Return true if derivatives of constraints w.r.t. x are valid.
virtual const NOX::Abstract::MultiVector::DenseMatrixgetConstraints () const
 Return constraint residuals.
virtual const NOX::Abstract::MultiVectorgetDX () const
 Return solution component of constraint derivatives.
virtual bool isDXZero () const
 Return true if solution component of constraint derivatives is zero.
virtual void postProcessContinuationStep (LOCA::Abstract::Iterator::StepStatus stepStatus)
 Perform any postprocessing after a continuation step finishes.
virtual void scaleNullVectors (NOX::Abstract::Vector &a, NOX::Abstract::Vector &b)
 Scale a & b vectors.
virtual void getInitialVectors (NOX::Abstract::Vector &a, NOX::Abstract::Vector &b)
 Get initial a & b vectors.

Detailed Description

Implementation of LOCA::MultiContinuation::ConstraintInterfaceMVDX for computing turning points for the minimally augmented turning point formulation.

This class implements the turning point constraint equation $\sigma(x,p) = 0$ for the minimally augmented turning point formulation where $\sigma$ is defined via

\‍[    \begin{bmatrix}
      J   & a \\
      b^T & 0
    \end{bmatrix}
    \begin{bmatrix}
      v \\
      \sigma_1
    \end{bmatrix} =
    \begin{bmatrix}
      0 \\
      n
    \end{bmatrix},
\‍]

\‍[    \begin{bmatrix}
      J^T & b \\
      a^T & 0
    \end{bmatrix}
    \begin{bmatrix}
      w \\
      \sigma_2
    \end{bmatrix} =
    \begin{bmatrix}
      0 \\
      n
    \end{bmatrix},
\‍]

\‍[    \sigma = -w^T J v/n
\‍]

for any vectors $a$ and $b$ in $\Re^n$. Using these relationships, it is easy to show

\‍[    \begin{split}
       \sigma_x &= -(w^T J v)_x/n = -w^T J_x v/n \\
       \sigma_p &= -(w^T J v)_p/n = -w^T J_p v/n
    \end{split}
\‍]

The class is intialized via the tpParams parameter list argument to the constructor. The parameters this class recognizes are:

  • "Symmetric Jacobian" – [bool] (default: false) - Flag indicating whether Jacobian matrix $J$ is symmetric, in which case we force $a = b$ and therefore the second tranpose solve for $w$ is unnecessary
  • "Initial Null Vector Compuation" – [string] (default: "User Provided") - Method to compute initial $a$ and $b$ vectors. Valid choices are:
    • "User Provided" - Initial vectors are provided in the parameter list, in which case the following parameters are relevant:
      • "Initial A Vector" – [Teuchos::RCP<NOX::Abstract::Vector>] (Must be supplied) - Vector storing initial value for $a$ vector
      • "Initial B Vector" – [Teuchos::RCP<NOX::Abstract::Vector>] (Must be supplied for nonsymmetric Jacobians) - Vector storing initial value for $b$ vector
    • "Solve df/dp" - Compute $a = J^{-T}df/dp$ and $b = J^{-1} df/dp$ where $p$ is the bifurcation parameter.
    • "Constant" - Entries of $a$ and $b$ are set to 1.0
  • "Null Vector Scaling" – [string] (default: "Order N") - Method to scale $a$ and $b$. This determines the norm of these vectors and the scaling of $\sigma$. Valid choices are:
    • "None" – Use initial scaling
    • "Order 1" – Scale to unit norm
    • "Order N" – Use vector length scaling
  • "Update Null Vectors Every Continuation Step" – [bool] (default: true) - Flag indicating whether to update $a$ and $b$ vectors via $a = w$ and $b = v$ every continuation step
  • "Update Null Vectors Every Nonlinear Iteration" – [bool] (default: false) - Flag indicating whether to update $a$ and $b$ vectors via $a = w$ and $b = v$ every nonlinear iteration
  • "Multiply Null Vectors by Mass Matrix" – [bool] (default: false) - Flag indicating whether to multiply $a$ and $b$ vectors by the mass matrix $M = \partial f/\partial\dot{x}$ at the strart of a turning point calculation, and each time $a$ and $b$ are updated. This can improve the scaling of these vectors, and may orthogonalize them against structural null spaces (i.e., pressure null space for incompressible Navier-Stokes).

Member Enumeration Documentation

◆ NullVectorScaling

Enumerated type determining type of scaling.

Enumerator
NVS_OrderOne 

No scaling.

NVS_OrderN 

Scale to O(1).

Scale to O(N) when N is the vector length

Constructor & Destructor Documentation

◆ ~Constraint()

LOCA::TurningPoint::MinimallyAugmented::Constraint::~Constraint ( )
virtual

Destructor.

Reimplemented in LOCA::Pitchfork::MinimallyAugmented::Constraint.

Member Function Documentation

◆ clone()

Teuchos::RCP< LOCA::MultiContinuation::ConstraintInterface > LOCA::TurningPoint::MinimallyAugmented::Constraint::clone ( NOX::CopyType type = NOX::DeepCopy) const
virtual

◆ computeConstraints()

◆ computeDP()

NOX::Abstract::Group::ReturnType LOCA::TurningPoint::MinimallyAugmented::Constraint::computeDP ( const std::vector< int > & paramIDs,
NOX::Abstract::MultiVector::DenseMatrix & dgdp,
bool isValidG )
virtual

Compute derivative of constraints w.r.t. supplied parameters.

The first column of dgdp should be filled with the constraint residuals $g$ if isValidG is false. If isValidG is true, then the dgdp contains $g$ on input.

Implements LOCA::MultiContinuation::ConstraintInterface.

Reimplemented in LOCA::Pitchfork::MinimallyAugmented::Constraint.

References computeConstraints(), constraints, globalData, grpPtr, isValidConstraints, NOX::Abstract::Group::Ok, sigma_scale, v_vector, and w_vector.

Referenced by LOCA::Pitchfork::MinimallyAugmented::Constraint::computeDP().

◆ computeDX()

NOX::Abstract::Group::ReturnType LOCA::TurningPoint::MinimallyAugmented::Constraint::computeDX ( )
virtual

◆ copy()

◆ getConstraints()

const NOX::Abstract::MultiVector::DenseMatrix & LOCA::TurningPoint::MinimallyAugmented::Constraint::getConstraints ( ) const
virtual

Return constraint residuals.

Implements LOCA::MultiContinuation::ConstraintInterface.

Reimplemented in LOCA::Pitchfork::MinimallyAugmented::Constraint.

References constraints.

◆ getDX()

const NOX::Abstract::MultiVector * LOCA::TurningPoint::MinimallyAugmented::Constraint::getDX ( ) const
virtual

Return solution component of constraint derivatives.

Implements LOCA::MultiContinuation::ConstraintInterfaceMVDX.

Reimplemented in LOCA::Pitchfork::MinimallyAugmented::Constraint.

References sigma_x.

◆ isConstraints()

bool LOCA::TurningPoint::MinimallyAugmented::Constraint::isConstraints ( ) const
virtual

Return true if constraint residuals are valid.

Implements LOCA::MultiContinuation::ConstraintInterface.

References isValidConstraints.

◆ isDX()

bool LOCA::TurningPoint::MinimallyAugmented::Constraint::isDX ( ) const
virtual

Return true if derivatives of constraints w.r.t. x are valid.

Implements LOCA::MultiContinuation::ConstraintInterface.

References isValidDX.

◆ isDXZero()

bool LOCA::TurningPoint::MinimallyAugmented::Constraint::isDXZero ( ) const
virtual

Return true if solution component of constraint derivatives is zero.

Implements LOCA::MultiContinuation::ConstraintInterface.

◆ numConstraints()

int LOCA::TurningPoint::MinimallyAugmented::Constraint::numConstraints ( ) const
virtual

Return number of constraints.

Implements LOCA::MultiContinuation::ConstraintInterface.

Reimplemented in LOCA::Pitchfork::MinimallyAugmented::Constraint.

◆ postProcessContinuationStep()

void LOCA::TurningPoint::MinimallyAugmented::Constraint::postProcessContinuationStep ( LOCA::Abstract::Iterator::StepStatus stepStatus)
virtual

Perform any postprocessing after a continuation step finishes.

The stepStatus argument indicates whether the step was successful. Here we update the $a$ and $b$ vectors to $w$ and $v$ respectively if requested.

Reimplemented from LOCA::MultiContinuation::ConstraintInterface.

Reimplemented in LOCA::TurningPoint::MinimallyAugmented::ModifiedConstraint.

References a_vector, b_vector, globalData, scaleNullVectors(), NOX::Utils::StepperDetails, LOCA::Abstract::Iterator::Successful, updateVectorsEveryContinuationStep, v_vector, and w_vector.

Referenced by LOCA::TurningPoint::MinimallyAugmented::ModifiedConstraint::postProcessContinuationStep().

◆ setGroup()

void LOCA::TurningPoint::MinimallyAugmented::Constraint::setGroup ( const Teuchos::RCP< LOCA::TurningPoint::MinimallyAugmented::AbstractGroup > & g)
virtual

Set the group pointer.

This method should be called when ever the constrained group is copied, since we don't explicitly copy the underlying group here.

References grpPtr.

Referenced by LOCA::Pitchfork::MinimallyAugmented::Constraint::setGroup().

◆ setParam()

void LOCA::TurningPoint::MinimallyAugmented::Constraint::setParam ( int paramID,
double val )
virtual

Sets parameter indexed by paramID.

Implements LOCA::MultiContinuation::ConstraintInterface.

References grpPtr, isValidConstraints, and isValidDX.

◆ setParams()

void LOCA::TurningPoint::MinimallyAugmented::Constraint::setParams ( const std::vector< int > & paramIDs,
const NOX::Abstract::MultiVector::DenseMatrix & vals )
virtual

Sets parameters indexed by paramIDs.

Implements LOCA::MultiContinuation::ConstraintInterface.

References grpPtr, isValidConstraints, and isValidDX.

◆ setX()

void LOCA::TurningPoint::MinimallyAugmented::Constraint::setX ( const NOX::Abstract::Vector & y)
virtual

Set the solution vector to y.

Implements LOCA::MultiContinuation::ConstraintInterface.

References grpPtr, isValidConstraints, and isValidDX.


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