|
EpetraExt Development
|
00001 #ifndef GLP_APP_ADV_DIFF_REACT_OPT_MODEL_HPP 00002 #define GLP_APP_ADV_DIFF_REACT_OPT_MODEL_HPP 00003 00004 #include "EpetraExt_ModelEvaluator.h" 00005 #include "GLpApp_GLpYUEpetraDataPool.hpp" 00006 #include "Epetra_Map.h" 00007 #include "Epetra_Vector.h" 00008 #include "Epetra_Comm.h" 00009 #include "Epetra_CrsGraph.h" 00010 #include "Teuchos_VerboseObject.hpp" 00011 #include "Teuchos_Array.hpp" 00012 00013 namespace GLpApp { 00014 00119 class AdvDiffReactOptModel 00120 : public EpetraExt::ModelEvaluator 00121 , public Teuchos::VerboseObject<AdvDiffReactOptModel> 00122 { 00123 public: 00124 00126 AdvDiffReactOptModel( 00127 const Teuchos::RefCountPtr<const Epetra_Comm> &comm 00128 ,const double beta 00129 ,const double len_x // Ignored if meshFile is *not* empty 00130 ,const double len_y // Ignored if meshFile is *not* empty 00131 ,const int local_nx // Ignored if meshFile is *not* empty 00132 ,const int local_ny // Ignored if meshFile is *not* empty 00133 ,const char meshFile[] 00134 ,const int np 00135 ,const double x0 00136 ,const double p0 00137 ,const double reactionRate 00138 ,const bool normalizeBasis 00139 ,const bool supportDerivatives 00140 ); 00141 00143 void set_q( Teuchos::RefCountPtr<const Epetra_Vector> const& q ); 00144 00146 Teuchos::RefCountPtr<GLpApp::GLpYUEpetraDataPool> getDataPool(); 00147 00149 Teuchos::RefCountPtr<const Epetra_MultiVector> get_B_bar() const; 00150 00153 00155 Teuchos::RefCountPtr<const Epetra_Map> get_x_map() const; 00157 Teuchos::RefCountPtr<const Epetra_Map> get_f_map() const; 00159 Teuchos::RefCountPtr<const Epetra_Map> get_p_map(int l) const; 00161 Teuchos::RefCountPtr<const Epetra_Map> get_g_map(int j) const; 00163 Teuchos::RefCountPtr<const Epetra_Vector> get_x_init() const; 00165 Teuchos::RefCountPtr<const Epetra_Vector> get_p_init(int l) const; 00167 Teuchos::RefCountPtr<const Epetra_Vector> get_x_lower_bounds() const; 00169 Teuchos::RefCountPtr<const Epetra_Vector> get_x_upper_bounds() const; 00171 Teuchos::RefCountPtr<const Epetra_Vector> get_p_lower_bounds(int l) const; 00173 Teuchos::RefCountPtr<const Epetra_Vector> get_p_upper_bounds(int l) const; 00175 Teuchos::RefCountPtr<Epetra_Operator> create_W() const; 00177 Teuchos::RefCountPtr<Epetra_Operator> create_DfDp_op(int l) const; 00179 InArgs createInArgs() const; 00181 OutArgs createOutArgs() const; 00183 void evalModel( const InArgs& inArgs, const OutArgs& outArgs ) const; 00184 00186 00187 private: 00188 00189 // ///////////////////////////////////// 00190 // Private types 00191 00192 typedef Teuchos::Array<Teuchos::RefCountPtr<const Epetra_Map> > RCP_Eptra_Map_Array_t; 00193 typedef Teuchos::Array<Teuchos::RefCountPtr<Epetra_Vector> > RCP_Eptra_Vector_Array_t; 00194 00195 // ///////////////////////////////////// 00196 // Private member data 00197 00198 static const int Np_ = 2; // Number of axiliary parameters 00199 static const int p_bndy_idx = 0; // index for boundary flux parameters 00200 static const int p_rx_idx = 1; // index for reaction rate parameter 00201 00202 bool supportDerivatives_; 00203 00204 bool isInitialized_; 00205 00206 Teuchos::RefCountPtr<GLpApp::GLpYUEpetraDataPool> dat_; 00207 int np_; 00208 Teuchos::RefCountPtr<const Epetra_Vector> q_; 00209 00210 Teuchos::RefCountPtr<const Epetra_Map> map_p_bar_; 00211 Teuchos::RefCountPtr<Epetra_MultiVector> B_bar_; 00212 00213 Teuchos::RefCountPtr<const Epetra_Comm> epetra_comm_; 00214 Teuchos::RefCountPtr<const Epetra_Map> map_x_; 00215 RCP_Eptra_Map_Array_t map_p_; 00216 Teuchos::RefCountPtr<const Epetra_Map> map_f_; 00217 Teuchos::RefCountPtr<const Epetra_Map> map_g_; 00218 00219 Teuchos::RefCountPtr<Epetra_Vector> x0_; 00220 Teuchos::RefCountPtr<Epetra_Vector> xL_; 00221 Teuchos::RefCountPtr<Epetra_Vector> xU_; 00222 RCP_Eptra_Vector_Array_t p0_; 00223 RCP_Eptra_Vector_Array_t pL_; 00224 RCP_Eptra_Vector_Array_t pU_; 00225 Teuchos::RefCountPtr<Epetra_Vector> gL_; 00226 Teuchos::RefCountPtr<Epetra_Vector> gU_; 00227 00228 Teuchos::RefCountPtr<Epetra_CrsGraph> W_graph_; 00229 00230 }; 00231 00232 } // namespace GLpApp 00233 00234 #endif // GLP_APP_ADV_DIFF_REACT_OPT_MODEL_HPP
1.7.4