rb_eim_construction.h
Go to the documentation of this file.
1 // rbOOmit: An implementation of the Certified Reduced Basis method.
2 // Copyright (C) 2009, 2010 David J. Knezevic
3 
4 // This file is part of rbOOmit.
5 
6 // rbOOmit is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 
11 // rbOOmit is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
15 
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 
20 #ifndef LIBMESH_RB_EIM_CONSTRUCTION_H
21 #define LIBMESH_RB_EIM_CONSTRUCTION_H
22 
23 // rbOOmit includes
27 
28 // libMesh includes
29 #include "libmesh/mesh_function.h"
31 
32 // C++ includes
33 
34 namespace libMesh
35 {
36 
49 {
50 public:
51 
53 
59  const std::string & name,
60  const unsigned int number);
61 
65  virtual ~RBEIMConstruction ();
66 
71 
76 
80  virtual void clear() override;
81 
86  virtual void process_parameters_file (const std::string & parameters_filename) override;
87 
92  void set_best_fit_type_flag (const std::string & best_fit_type_string);
93 
97  virtual void print_info() override;
98 
103  virtual void initialize_rb_construction(bool skip_matrix_assembly=false,
104  bool skip_vector_assembly=false) override;
105 
109  virtual Real train_reduced_basis(const bool resize_rb_eval_data=true) override;
110 
119  virtual Real truth_solve(int plot_solution) override;
120 
128  virtual Real compute_best_fit_error();
129 
133  virtual void init_context_with_sys(FEMContext & c, System & sys);
134 
139  virtual void init_explicit_system() = 0;
140 
145  virtual void init_implicit_system() = 0;
146 
150  Number evaluate_mesh_function(unsigned int var_number,
151  Point p);
152 
157  void set_point_locator_tol(Real point_locator_tol);
158 
162  Real get_point_locator_tol() const;
163 
170  virtual void initialize_eim_assembly_objects();
171 
175  std::vector<std::unique_ptr<ElemAssembly>> & get_eim_assembly_objects();
176 
183  virtual std::unique_ptr<ElemAssembly> build_eim_assembly(unsigned int bf_index) = 0;
184 
189 
195  virtual void load_basis_function(unsigned int i) override;
196 
202  virtual void load_rb_solution() override;
203 
209  unsigned int var,
210  NumericVector<Number>& source);
211 
217  unsigned int var,
218  NumericVector<Number>& localized_source);
219 
224 
230  void plot_parametrized_functions_in_training_set(const std::string & pathname);
231 
232  //----------- PUBLIC DATA MEMBERS -----------//
233 
244 
245 protected:
246 
250  virtual void init_data() override;
251 
256  virtual void enrich_RB_space() override;
257 
262  virtual void update_system() override;
263 
269  virtual void update_RB_system_matrices() override;
270 
275  virtual Real get_RB_error_bound() override;
276 
282 
288 
293  std::vector<std::unique_ptr<NumericVector<Number>>> _parametrized_functions_in_training_set;
294 
295 private:
296 
300  std::unique_ptr<MeshFunction> _mesh_function;
301 
306  std::unique_ptr<NumericVector<Number>> _ghosted_meshfunction_vector;
307 
313 
318  std::vector<std::unique_ptr<ElemAssembly>> _rb_eim_assembly_objects;
319 
328 
332  std::vector<std::vector<dof_id_type>> _dof_map_between_systems;
333 
338  std::vector<std::unique_ptr<NumericVector<Number>>> _matrix_times_bfs;
339 
344 };
345 
346 } // namespace libMesh
347 
348 #endif // LIBMESH_RB_EIM_CONSTRUCTION_H
Real get_point_locator_tol() const
virtual void load_basis_function(unsigned int i) override
Manages multiples systems of equations.
virtual void initialize_rb_construction(bool skip_matrix_assembly=false, bool skip_vector_assembly=false) override
virtual void initialize_eim_assembly_objects()
virtual Real get_RB_error_bound() override
void plot_parametrized_functions_in_training_set(const std::string &pathname)
void set_best_fit_type_flag(const std::string &best_fit_type_string)
void get_explicit_sys_subvector(NumericVector< Number > &dest, unsigned int var, NumericVector< Number > &localized_source)
virtual void init_data() override
RBEIMConstruction(EquationSystems &es, const std::string &name, const unsigned int number)
virtual void init_context_with_sys(FEMContext &c, System &sys)
virtual void update_system() override
virtual Real train_reduced_basis(const bool resize_rb_eval_data=true) override
virtual void clear() override
virtual void init_explicit_system()=0
virtual void load_rb_solution() override
unsigned int number() const
Definition: system.h:2025
std::unique_ptr< MeshFunction > _mesh_function
virtual void init_implicit_system()=0
Manages consistently variables, degrees of freedom, and coefficient vectors.
Definition: system.h:92
void set_point_locator_tol(Real point_locator_tol)
std::vector< std::unique_ptr< ElemAssembly > > & get_eim_assembly_objects()
virtual std::unique_ptr< ElemAssembly > build_eim_assembly(unsigned int bf_index)=0
std::vector< std::unique_ptr< NumericVector< Number > > > _parametrized_functions_in_training_set
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real compute_best_fit_error()
virtual void enrich_RB_space() override
Number evaluate_mesh_function(unsigned int var_number, Point p)
void initialize_parametrized_functions_in_training_set()
std::vector< std::vector< dof_id_type > > _dof_map_between_systems
std::vector< std::unique_ptr< NumericVector< Number > > > _matrix_times_bfs
RBAssemblyExpansion _empty_rb_assembly_expansion
const std::string & name() const
Definition: system.h:2017
ExplicitSystem & get_explicit_system()
std::unique_ptr< NumericVector< Number > > _ghosted_meshfunction_vector
virtual void update_RB_system_matrices() override
std::vector< std::unique_ptr< ElemAssembly > > _rb_eim_assembly_objects
void set_explicit_sys_subvector(NumericVector< Number > &dest, unsigned int var, NumericVector< Number > &source)
virtual Real truth_solve(int plot_solution) override
A geometric point in (x,y,z) space.
Definition: point.h:38
virtual void process_parameters_file(const std::string &parameters_filename) override
Manages consistently variables, degrees of freedom, and coefficient vectors for explicit systems...
virtual void print_info() override