$extrastylesheet
derived_rb_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_DERIVED_RB_CONSTRUCTION_H
00021 #define LIBMESH_DERIVED_RB_CONSTRUCTION_H
00022 
00023 // Local includes
00024 #include "libmesh/dense_vector.h"
00025 #include "libmesh/dense_matrix.h"
00026 #include "libmesh/fem_context.h"
00027 #include "libmesh/linear_implicit_system.h"
00028 #include "libmesh/rb_construction.h"
00029 
00030 // C++ includes
00031 
00032 namespace libMesh
00033 {
00034 
00046 template<class Base>
00047 class DerivedRBConstruction : public Base
00048 {
00049 public:
00050 
00055   DerivedRBConstruction (EquationSystems& es,
00056                          const std::string& name,
00057                          const unsigned int number);
00058 
00062   typedef DerivedRBConstruction<Base> sys_type;
00063 
00067   sys_type & system () { return *this; }
00068 
00072   virtual std::string system_type () const;
00073 
00078   virtual Real truth_solve(int plot_solution);
00079 
00084   virtual Real train_reduced_basis(const std::string& directory_name = "offline_data",
00085                                    const bool resize_rb_eval_data=true);
00086 
00094   virtual void set_uber_current_parameters();
00095 
00099   virtual UniquePtr<RBEvaluation> build_rb_evaluation(const Parallel::Communicator &comm
00100                                                       LIBMESH_CAN_DEFAULT_TO_COMMWORLD);
00101 
00106   virtual void load_rb_solution();
00107 
00111   virtual void load_basis_function(unsigned int i);
00112 
00120   void generate_residual_terms_wrt_truth();
00121 
00122 
00123   //----------- PUBLIC DATA MEMBERS -----------//
00124 
00129   std::string uber_system_name;
00130 
00131 protected:
00132 
00136   DenseVector<Number> get_derived_basis_function(unsigned int i);
00137 
00144   virtual void enrich_RB_space();
00145 
00152   virtual void update_RB_system_matrices();
00153 
00159   virtual void compute_Fq_representor_innerprods(bool compute_inner_products=true);
00160 
00167   virtual void update_residual_terms(bool compute_inner_products=true);
00168 
00169 private:
00170 
00171 };
00172 
00173 // And introduce convenient typedefs
00174 typedef DerivedRBConstruction<RBConstruction> SteadyDerivedRBConstruction;
00175 
00176 } // namespace libMesh
00177 
00178 
00179 #endif // LIBMESH_DERIVED_RB_CONSTRUCTION_H