NOX  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
LOCA::MultiContinuation::CompositeConstraint Class Reference

Implementation of LOCA::MultiContinuation::ConstraintInterface for composite constraints, i.e., a constraint comprised of multiple, separate constraints. More...

#include <LOCA_MultiContinuation_CompositeConstraint.H>

Inheritance diagram for LOCA::MultiContinuation::CompositeConstraint:
Inheritance graph
[legend]
Collaboration diagram for LOCA::MultiContinuation::CompositeConstraint:
Collaboration graph
[legend]

Public Member Functions

 CompositeConstraint (const Teuchos::RCP< LOCA::GlobalData > &global_data, const std::vector< Teuchos::RCP< LOCA::MultiContinuation::ConstraintInterface > > &constraintObjects)
 Constructor.
 
 CompositeConstraint (const CompositeConstraint &source, NOX::CopyType type=NOX::DeepCopy)
 Copy constructor.
 
 ~CompositeConstraint ()
 Destructor.
 
Implementation of LOCA::MultiContinuation::ConstraintInterface

virtual methods

virtual void copy (const ConstraintInterface &source)
 Copy.
 
virtual Teuchos::RCP
< LOCA::MultiContinuation::ConstraintInterface
clone (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. More...
 
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::DenseMatrix
getConstraints () const
 Return constraint residuals.
 
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. More...
 
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. More...
 
virtual bool isDXZero () const
 Return true if solution component of constraint derivatives is zero.
 
virtual void preProcessContinuationStep (LOCA::Abstract::Iterator::StepStatus stepStatus)
 Perform any preprocessing before a continuation step starts. More...
 
virtual void postProcessContinuationStep (LOCA::Abstract::Iterator::StepStatus stepStatus)
 Perform any postprocessing after a continuation step finishes. More...
 
- Public Member Functions inherited from LOCA::MultiContinuation::ConstraintInterface
 ConstraintInterface ()
 Constructor.
 
virtual ~ConstraintInterface ()
 Destructor.
 

Protected Member Functions

 CompositeConstraint ()
 Default constructor. Used by derived classes.
 
virtual void init (const Teuchos::RCP< LOCA::GlobalData > &global_data, const std::vector< Teuchos::RCP< LOCA::MultiContinuation::ConstraintInterface > > &constraintObjects)
 Initialize object when using default constructor.
 

Protected Attributes

Teuchos::RCP< LOCA::GlobalDataglobalData
 LOCA global data object.
 
int numConstraintObjects
 Number of constraint objects.
 
std::vector< Teuchos::RCP
< LOCA::MultiContinuation::ConstraintInterface > > 
constraintPtrs
 Array of constraint pointers.
 
std::vector< std::vector< int > > indices
 Indices of each sub-constraint in the composite constraint.
 
int totalNumConstraints
 Total number of constraints.
 
NOX::Abstract::MultiVector::DenseMatrix constraints
 Constraint values.
 
bool isValidConstraints
 Flag indicating whether constraints are valid.
 
bool isValidDX
 Flag indicating whether dg/dx is valid.
 

Detailed Description

Implementation of LOCA::MultiContinuation::ConstraintInterface for composite constraints, i.e., a constraint comprised of multiple, separate constraints.

Member Function Documentation

NOX::Abstract::Group::ReturnType LOCA::MultiContinuation::CompositeConstraint::addDX ( Teuchos::ETransp  transb,
double  alpha,
const NOX::Abstract::MultiVector::DenseMatrix b,
double  beta,
NOX::Abstract::MultiVector result_x 
) const
virtual

Compute result_x = alpha * dg/dx^T * op(b) + beta * result_x.

Note that this should be equivalent to

result_x.update(transb, alpha, dgdx, b, beta);

Implements LOCA::MultiContinuation::ConstraintInterface.

Reimplemented in LOCA::MultiContinuation::CompositeConstraintMVDX.

References Teuchos::NO_TRANS, NOX::Abstract::MultiVector::numVectors(), NOX::Abstract::Group::Ok, Teuchos::rcp(), NOX::Abstract::MultiVector::scale(), and Teuchos::View.

NOX::Abstract::Group::ReturnType LOCA::MultiContinuation::CompositeConstraint::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.

References Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::numCols(), NOX::Abstract::Group::Ok, Teuchos::rcp(), and Teuchos::View.

NOX::Abstract::Group::ReturnType LOCA::MultiContinuation::CompositeConstraint::multiplyDX ( double  alpha,
const NOX::Abstract::MultiVector input_x,
NOX::Abstract::MultiVector::DenseMatrix result_p 
) const
virtual

Compute result_p = alpha * dg/dx * input_x.

Note that if there are n constraints and input_x has m columns, result_p should be a n by m matrix and is equivalent to

input_x.multiply(alpha, dgdx, result_p).

Implements LOCA::MultiContinuation::ConstraintInterface.

Reimplemented in LOCA::MultiContinuation::CompositeConstraintMVDX.

References Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::numCols(), NOX::Abstract::Group::Ok, Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >::putScalar(), Teuchos::rcp(), and Teuchos::View.

void LOCA::MultiContinuation::CompositeConstraint::postProcessContinuationStep ( LOCA::Abstract::Iterator::StepStatus  stepStatus)
virtual

Perform any postprocessing after a continuation step finishes.

The stepStatus argument indicates whether the step was successful. The default implementation is empty.

Reimplemented from LOCA::MultiContinuation::ConstraintInterface.

void LOCA::MultiContinuation::CompositeConstraint::preProcessContinuationStep ( LOCA::Abstract::Iterator::StepStatus  stepStatus)
virtual

Perform any preprocessing before a continuation step starts.

The stepStatus argument indicates whether the previous step was successful. The default implementation is empty.

Reimplemented from LOCA::MultiContinuation::ConstraintInterface.


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