Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Examples  

RSQPSundanceInterface.h

Go to the documentation of this file.
00001 #ifndef RSQPSUNDANCEINTERFACE_H
00002 #define RSQPSUNDANCEINTERFACE_H
00003 
00004 #include "Sundance.h"
00005 
00006 namespace Sundance
00007 {
00008   using namespace NLPEpetraPack;
00009 
00010   /**
00011    * 
00012    */
00013 
00014   class RSQPSundanceInterface : public NLPEpetraSundance
00015     {
00016     public:
00017       /** */
00018       RSQPSundanceInterface();
00019 
00020       /** */
00021       virtual ~RSQPSundanceInterface();
00022 
00023       /** Create a state space vector */
00024       virtual const TSFSmartPtr<Epetra_Vector> space_u_create_hcl() const ;
00025       /** Create a design space vector */
00026       virtual const TSFSmartPtr<Epetra_Vector> space_d_create_hcl() const ;
00027       /** Create a vector in the constraint domain space */
00028       virtual const TSFSmartPtr<Epetra_Vector> space_c_create_hcl() const ;
00029 
00030       /** Return the initial guess for the state vector */
00031       virtual void get_u_0(const TSFSmartPtr<Epetra_Vector>& u0) const ;
00032 
00033       /** Return the initial guess for the design vector */
00034       virtual void get_d_0(const TSFSmartPtr<Epetra_Vector>& d0) const ;
00035 
00036       /** Compute the value of the objective function */
00037       virtual void calc_f(const TSFSmartPtr<Epetra_Vector>& uk,
00038                           const TSFSmartPtr<Epetra_Vector>& dk,
00039                           double* f_k) const ;
00040 
00041       /** Compute the constraint residual */
00042       virtual void calc_c(const TSFSmartPtr<Epetra_Vector>& uk
00043                           const TSFSmartPtr<Epetra_Vector>& dk
00044                           const TSFSmartPtr<Epetra_Vector>& ck) const ;
00045 
00046 
00047       /** Compute the gradient of the constraint wrt state vars */
00048       virtual void calc_g_u(const TSFSmartPtr<Epetra_Vector>& uk,
00049                             const TSFSmartPtr<Epetra_Vector>& dk,
00050                             const TSFSmartPtr<Epetra_Vector>& guk) const ;
00051 
00052       /** Compute the gradient of the constraint wrt design vars */
00053       virtual void calc_g_d(const TSFSmartPtr<Epetra_Vector>& uk,
00054                             const TSFSmartPtr<Epetra_Vector>& dk,
00055                             const TSFSmartPtr<Epetra_Vector>& gdk) const ;
00056       
00057     protected:
00058 
00059       /** Utility method to grab the petra vector underlying 
00060        a discrete function */
00061       TSFSmartPtr<Epetra_Vector> grabPetraVector(const Expr& e) const ;
00062 
00063       /** Utility method to set the state vector */
00064       void setStateVector(const TSFSmartPtr<Epetra_Vector>& vector) const ;
00065 
00066       /** Utility method to set the design vector */
00067       void setDesignVector(const TSFSmartPtr<Epetra_Vector>& vector) const ;
00068 
00069       //@{
00070       /** \name User-supplied methods */
00071       /** Compute the jacobian of the constraints wrt design vars */
00072       TSFVector computeDesignJacobian() const = 0;
00073 
00074       /** Compute the gradient of the obj func wrt design vars */
00075       TSFVector computeObjFunctionDesignGradient() const = 0 ;
00076       
00077 
00078       /** Compute the gradient of the obj func wrt state vars*/
00079       TSFVector computeObjFunctionStateGradient() const = 0 ;
00080 
00081       /** Compute the value of the objective function */
00082       double computeObjFunction() const = 0 ;
00083 
00084       //@}
00085       
00086 
00087       
00088       /* -------- data members ----------- */
00089 
00090       /** The linearized PDE constraint c(u,d)=0 */
00091       StaticLinearProblem linearizedPDEConstraint_;
00092 
00093       /** The solver to be used for the state space jacobian */
00094       TSFLinearSolver solver_;
00095 
00096       /** The state space */
00097       TSFVectorSpace stateSpace_;
00098 
00099       /** The design space */
00100       TSFVectorSpace designSpace_;
00101 
00102       /** The state vector in Expr form */
00103       Expr stateExpr_;
00104 
00105       /** The design vector in Expr form */
00106       Expr designExpr_;
00107 
00108       /** The state vector */
00109       TSFSmartPtr<Epetra_Vector> stateVector_;
00110 
00111       
00112 
00113     };
00114     
00115 }
00116 
00117 #endif

Contact:
Kevin Long (krlong@ca.sandia.gov)


Documentation generated by