$extrastylesheet
rb_scm_evaluation.h
Go to the documentation of this file.
00001 
00002 // rbOOmit: An implementation of the Certified Reduced Basis method.
00003 // Copyright (C) 2009, 2010 David J. Knezevic
00004 
00005 // This file is part of rbOOmit.
00006 
00007 // rbOOmit is free software; you can redistribute it and/or
00008 // modify it under the terms of the GNU Lesser General Public
00009 // License as published by the Free Software Foundation; either
00010 // version 2.1 of the License, or (at your option) any later version.
00011 
00012 // rbOOmit is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 // Lesser General Public License for more details.
00016 
00017 // You should have received a copy of the GNU Lesser General Public
00018 // License along with this library; if not, write to the Free Software
00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 
00021 #ifndef LIBMESH_RB_SCM_EVALUATION_H
00022 #define LIBMESH_RB_SCM_EVALUATION_H
00023 
00024 // rbOOmit includes
00025 #include "libmesh/rb_parametrized.h"
00026 #include "libmesh/rb_theta_expansion.h"
00027 
00028 // libMesh includes
00029 #include "libmesh/parallel_object.h"
00030 
00031 // C++ includes
00032 
00033 namespace libMesh
00034 {
00035 
00046 // ------------------------------------------------------------
00047 // RBSCMEvaluation class definition
00048 
00049 class RBSCMEvaluation : public RBParametrized,
00050                         public ParallelObject
00051 {
00052 public:
00053 
00057   RBSCMEvaluation (const Parallel::Communicator &comm
00058                    LIBMESH_CAN_DEFAULT_TO_COMMWORLD);
00059 
00063   virtual ~RBSCMEvaluation ();
00064 
00068   void set_rb_theta_expansion(RBThetaExpansion& rb_theta_expansion_in);
00069 
00073   RBThetaExpansion& get_rb_theta_expansion();
00074 
00078   virtual Real get_SCM_LB();
00079 
00083   virtual Real get_SCM_UB();
00084 
00091   Real get_C_J_stability_constraint(unsigned int j) const;
00092 
00099   void set_C_J_stability_constraint(unsigned int j, Real stability_constraint_in);
00100 
00106   Real get_SCM_UB_vector(unsigned int j, unsigned int q);
00107 
00113   void set_SCM_UB_vector(unsigned int j, unsigned int q, Real y_q);
00114 
00118   unsigned int get_C_J_size()
00119   { return cast_int<unsigned int>(C_J.size()); }
00120 
00124   const RBParameters& get_C_J_entry(unsigned int j);
00125 
00129   Real get_C_J_stability_value(unsigned int j) { return C_J_stability_vector[j]; }
00130 
00134   Real get_B_min(unsigned int i) const;
00135   Real get_B_max(unsigned int i) const;
00136 
00140   void set_B_min(unsigned int i, Real B_min_val);
00141   void set_B_max(unsigned int i, Real B_max_val);
00142 
00147   virtual void save_current_parameters();
00148 
00153   virtual void reload_current_parameters();
00154 
00158   virtual void set_current_parameters_from_C_J(unsigned int C_J_index);
00159 
00164   virtual void write_offline_data_to_files(const std::string& directory_name = "offline_data",
00165                                            const bool write_binary_data = true);
00166 
00171   virtual void read_offline_data_from_files(const std::string& directory_name = "offline_data",
00172                                             const bool read_binary_data = true);
00173 
00174   //----------- PUBLIC DATA MEMBERS -----------//
00175 
00179   std::vector<Real> B_min;
00180   std::vector<Real> B_max;
00181 
00186   std::vector< RBParameters > C_J;
00187 
00192   std::vector<Real> C_J_stability_vector;
00193 
00200   std::vector< std::vector<Real> > SCM_UB_vectors;
00201 
00202 private:
00203 
00208   RBParameters saved_parameters;
00209 
00215   RBThetaExpansion* rb_theta_expansion;
00216 
00217 };
00218 
00219 }
00220 
00221 #endif // LIBMESH_RB_SCM_EVALUATION_H