$extrastylesheet
rb_scm_construction.h
Go to the documentation of this file.
00001 // rbOOmit: An implementation of the Certified Reduced Basis method.
00002 // Copyright (C) 2009, 2010 David J. Knezevic
00003 
00004 // This file is part of rbOOmit.
00005 
00006 // rbOOmit is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License, or (at your option) any later version.
00010 
00011 // rbOOmit is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 
00020 #ifndef LIBMESH_RB_SCM_CONSTRUCTION_H
00021 #define LIBMESH_RB_SCM_CONSTRUCTION_H
00022 
00023 // Configuration data
00024 #include "libmesh/libmesh_config.h"
00025 
00026 // Currently, the RBSCMConstruction is only usable
00027 // if SLEPc is enabled.
00028 #if defined(LIBMESH_HAVE_SLEPC) && (LIBMESH_HAVE_GLPK)
00029 
00030 // rbOOmit includes
00031 #include "libmesh/rb_construction_base.h"
00032 #include "libmesh/rb_scm_evaluation.h"
00033 
00034 // libMesh includes
00035 #include "libmesh/condensed_eigen_system.h"
00036 
00037 // C++ includes
00038 
00039 namespace libMesh
00040 {
00041 
00051 // ------------------------------------------------------------
00052 // RBSCMConstruction class definition
00053 
00054 class RBSCMConstruction : public RBConstructionBase<CondensedEigenSystem>
00055 {
00056 public:
00057 
00062   RBSCMConstruction (EquationSystems& es,
00063                      const std::string& name_in,
00064                      const unsigned int number_in);
00065 
00069   virtual ~RBSCMConstruction ();
00070 
00074   typedef RBSCMConstruction sys_type;
00075 
00079   typedef RBConstructionBase<CondensedEigenSystem> Parent;
00080 
00085   virtual void clear ();
00086 
00090   void set_rb_scm_evaluation(RBSCMEvaluation& rb_scm_eval_in);
00091 
00095   RBSCMEvaluation& get_rb_scm_evaluation();
00096 
00100   RBThetaExpansion& get_rb_theta_expansion();
00101 
00106   virtual void resize_SCM_vectors ();
00107 
00112   virtual void process_parameters_file(const std::string& parameters_filename);
00113 
00117   virtual void print_info();
00118 
00128   virtual void set_eigensolver_properties(int ) { }
00129 
00134   void set_RB_system_name(const std::string& new_name)
00135   { RB_system_name = new_name; }
00136 
00140   Real get_SCM_training_tolerance() const                         { return SCM_training_tolerance; }
00141   void set_SCM_training_tolerance(Real SCM_training_tolerance_in) { this->SCM_training_tolerance = SCM_training_tolerance_in; }
00142 
00147   virtual void perform_SCM_greedy();
00148 
00157   virtual void attach_deflation_space() {}
00158 
00159 protected:
00160 
00165   virtual void add_scaled_symm_Aq(unsigned int q_a, Number scalar);
00166 
00172   virtual void load_matrix_B() ;
00173 
00177   virtual void compute_SCM_bounding_box();
00178 
00184   virtual void evaluate_stability_constant();
00185 
00190   virtual void enrich_C_J(unsigned int new_C_J_index);
00191 
00198   virtual std::pair<unsigned int,Real> compute_SCM_bounds_on_training_set();
00199 
00204   Number B_inner_product(const NumericVector<Number>& v, const NumericVector<Number>& w) const;
00205 
00210   Number Aq_inner_product(unsigned int q,
00211                           const NumericVector<Number>& v,
00212                           const NumericVector<Number>& w);
00213 
00219   virtual Real SCM_greedy_error_indicator(Real LB, Real UB) { return fabs(UB-LB)/fabs(UB); }
00220 
00221   //----------- PROTECTED DATA MEMBERS -----------//
00222 
00226   Real SCM_training_tolerance;
00227 
00231   std::string RB_system_name;
00232 
00233 private:
00234 
00239   RBSCMEvaluation* rb_scm_eval;
00240 
00241 };
00242 
00243 } // namespace libMesh
00244 
00245 #endif // LIBMESH_HAVE_SLEPC && LIBMESH_HAVE_GLPK
00246 
00247 #endif // LIBMESH_RB_SCM_CONSTRUCTION_H