rb_eim_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_EIM_CONSTRUCTION_H 00021 #define LIBMESH_RB_EIM_CONSTRUCTION_H 00022 00023 // rbOOmit includes 00024 #include "libmesh/rb_construction.h" 00025 #include "libmesh/rb_assembly_expansion.h" 00026 #include "libmesh/rb_eim_assembly.h" 00027 00028 // libMesh includes 00029 #include "libmesh/mesh_function.h" 00030 #include "libmesh/coupling_matrix.h" 00031 00032 // C++ includes 00033 00034 namespace libMesh 00035 { 00036 00048 // ------------------------------------------------------------ 00049 // RBEIMConstruction class definition 00050 00051 class RBEIMConstruction : public RBConstruction 00052 { 00053 public: 00054 00055 enum BEST_FIT_TYPE { PROJECTION_BEST_FIT, EIM_BEST_FIT }; 00056 00061 RBEIMConstruction (EquationSystems& es, 00062 const std::string& name, 00063 const unsigned int number); 00064 00068 virtual ~RBEIMConstruction (); 00069 00073 typedef RBEIMConstruction sys_type; 00074 00078 typedef RBConstruction Parent; 00079 00083 virtual void clear(); 00084 00089 virtual void process_parameters_file (const std::string& parameters_filename); 00090 00094 virtual void print_info(); 00095 00100 virtual void initialize_rb_construction(); 00101 00105 virtual Real train_reduced_basis(const std::string& directory_name = "offline_data", 00106 const bool resize_rb_eval_data=true); 00107 00116 virtual Real truth_solve(int plot_solution); 00117 00125 virtual Real compute_best_fit_error(); 00126 00132 virtual void init_context(FEMContext &c); 00133 00137 Number evaluate_mesh_function(unsigned int var_number, 00138 Point p); 00139 00146 virtual void initialize_eim_assembly_objects(); 00147 00151 std::vector<ElemAssembly*> get_eim_assembly_objects(); 00152 00159 virtual AutoPtr<ElemAssembly> build_eim_assembly(unsigned int bf_index) = 0; 00160 00161 //----------- PUBLIC DATA MEMBERS -----------// 00162 00172 BEST_FIT_TYPE best_fit_type_flag; 00173 00174 00180 CouplingMatrix _coupling_matrix; 00181 00182 protected: 00183 00187 virtual void init_data(); 00188 00193 virtual void enrich_RB_space(); 00194 00199 virtual void update_system(); 00200 00206 virtual void update_RB_system_matrices(); 00207 00212 virtual Real get_RB_error_bound(); 00213 00218 virtual bool greedy_termination_test(Real training_greedy_error, int count); 00219 00224 void initialize_parametrized_functions_in_training_set(); 00225 00230 bool _parametrized_functions_in_training_set_initialized; 00231 00236 std::vector< NumericVector<Number>* > _parametrized_functions_in_training_set; 00237 00238 private: 00239 00243 MeshFunction* _mesh_function; 00244 00251 bool _performing_extra_greedy_step; 00252 00257 AutoPtr< NumericVector<Number> > _ghosted_meshfunction_vector; 00258 00263 RBAssemblyExpansion _empty_rb_assembly_expansion; 00264 00269 std::vector<ElemAssembly*> _rb_eim_assembly_objects; 00270 00271 }; 00272 00273 } // namespace libMesh 00274 00275 #endif // LIBMESH_RB_EIM_CONSTRUCTION_H
Site Created By: libMesh Developers
Last modified: February 05 2013 19:54:48 UTC
Hosted By: