00001 //*****************************************************************// 00002 // Albany 2.0: Copyright 2012 Sandia Corporation // 00003 // This Software is released under the BSD license detailed // 00004 // in the file "license.txt" in the top-level Albany directory // 00005 //*****************************************************************// 00006 #ifndef MOR_REDUCEDORDERMODELEVALUATOR_HPP 00007 #define MOR_REDUCEDORDERMODELEVALUATOR_HPP 00008 00009 #include "EpetraExt_ModelEvaluator.h" 00010 00011 #include "Teuchos_RCP.hpp" 00012 00013 namespace MOR { 00014 00015 class ReducedSpace; 00016 class ReducedOperatorFactory; 00017 00018 class ReducedOrderModelEvaluator : public EpetraExt::ModelEvaluator { 00019 public: 00020 ReducedOrderModelEvaluator(const Teuchos::RCP<EpetraExt::ModelEvaluator> &fullOrderModel, 00021 const Teuchos::RCP<const ReducedSpace> &solutionSpace, 00022 const Teuchos::RCP<ReducedOperatorFactory> &reducedOpFactory); 00023 00024 // Overridden functions 00025 virtual Teuchos::RCP<const Epetra_Map> get_x_map() const; 00026 virtual Teuchos::RCP<const Epetra_Map> get_f_map() const; 00027 virtual Teuchos::RCP<const Epetra_Map> get_p_map(int l) const; 00028 virtual Teuchos::RCP<const Teuchos::Array<std::string> > get_p_names(int l) const; 00029 virtual Teuchos::RCP<const Epetra_Map> get_g_map(int j) const; 00030 00031 virtual Teuchos::RCP<const Epetra_Vector> get_x_init() const; 00032 virtual Teuchos::RCP<const Epetra_Vector> get_x_dot_init() const; 00033 virtual Teuchos::RCP<const Epetra_Vector> get_p_init(int l) const; 00034 virtual double get_t_init() const; 00035 00036 virtual double getInfBound() const; 00037 virtual Teuchos::RCP<const Epetra_Vector> get_p_lower_bounds(int l) const; 00038 virtual Teuchos::RCP<const Epetra_Vector> get_p_upper_bounds(int l) const; 00039 virtual double get_t_upper_bound() const; 00040 virtual double get_t_lower_bound() const; 00041 00042 virtual Teuchos::RCP<Epetra_Operator> create_W() const; 00043 virtual Teuchos::RCP<Epetra_Operator> create_DgDp_op(int j, int l) const; 00044 00045 virtual InArgs createInArgs() const; 00046 virtual OutArgs createOutArgs() const; 00047 00048 virtual void evalModel(const InArgs &inArgs, const OutArgs &outArgs) const; 00049 00050 // Additional functions 00051 Teuchos::RCP<const EpetraExt::ModelEvaluator> getFullOrderModel() const; 00052 Teuchos::RCP<const ReducedSpace> getSolutionSpace() const; 00053 00054 void reset_x_and_x_dot_init(); 00055 void reset_x_init(); 00056 void reset_x_dot_init(); 00057 00058 private: 00059 Teuchos::RCP<EpetraExt::ModelEvaluator> fullOrderModel_; 00060 Teuchos::RCP<const ReducedSpace> solutionSpace_; 00061 00062 Teuchos::RCP<ReducedOperatorFactory> reducedOpFactory_; 00063 00064 const Epetra_Map &componentMap() const; 00065 Teuchos::RCP<const Epetra_Map> componentMapRCP() const; 00066 00067 Teuchos::RCP<Epetra_Vector> x_init_; 00068 Teuchos::RCP<Epetra_Vector> x_dot_init_; 00069 00070 // Disallow copy and assignment 00071 ReducedOrderModelEvaluator(const ReducedOrderModelEvaluator &); 00072 ReducedOrderModelEvaluator &operator=(const ReducedOrderModelEvaluator &); 00073 }; 00074 00075 } // namespace MOR 00076 00077 #endif /* MOR_REDUCEDORDERMODELEVALUATOR_HPP */