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
00024 virtual const TSFSmartPtr<Epetra_Vector> space_u_create_hcl() const ;
00025
00026 virtual const TSFSmartPtr<Epetra_Vector> space_d_create_hcl() const ;
00027
00028 virtual const TSFSmartPtr<Epetra_Vector> space_c_create_hcl() const ;
00029
00030
00031 virtual void get_u_0(const TSFSmartPtr<Epetra_Vector>& u0) const ;
00032
00033
00034 virtual void get_d_0(const TSFSmartPtr<Epetra_Vector>& d0) const ;
00035
00036
00037 virtual void calc_f(const TSFSmartPtr<Epetra_Vector>& uk,
00038 const TSFSmartPtr<Epetra_Vector>& dk,
00039 double* f_k) const ;
00040
00041
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
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
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
00060
00061 TSFSmartPtr<Epetra_Vector> grabPetraVector(const Expr& e) const ;
00062
00063
00064 void setStateVector(const TSFSmartPtr<Epetra_Vector>& vector) const ;
00065
00066
00067 void setDesignVector(const TSFSmartPtr<Epetra_Vector>& vector) const ;
00068
00069
00070
00071
00072 TSFVector computeDesignJacobian() const = 0;
00073
00074
00075 TSFVector computeObjFunctionDesignGradient() const = 0 ;
00076
00077
00078
00079 TSFVector computeObjFunctionStateGradient() const = 0 ;
00080
00081
00082 double computeObjFunction() const = 0 ;
00083
00084
00085
00086
00087
00088
00089
00090
00091 StaticLinearProblem linearizedPDEConstraint_;
00092
00093
00094 TSFLinearSolver solver_;
00095
00096
00097 TSFVectorSpace stateSpace_;
00098
00099
00100 TSFVectorSpace designSpace_;
00101
00102
00103 Expr stateExpr_;
00104
00105
00106 Expr designExpr_;
00107
00108
00109 TSFSmartPtr<Epetra_Vector> stateVector_;
00110
00111
00112
00113 };
00114
00115 }
00116
00117 #endif