rb_eim_evaluation.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_EVALUATION_H
21 #define LIBMESH_RB_EIM_EVALUATION_H
22 
23 // libMesh includes
24 #include "libmesh/auto_ptr.h" // deprecated
25 #include "libmesh/point.h"
26 #include "libmesh/rb_evaluation.h"
29 
30 // C++ includes
31 #include <memory>
32 
33 namespace libMesh
34 {
35 
36 class RBParameters;
37 class RBParametrizedFunction;
38 class Elem;
39 class RBTheta;
40 
53 {
54 public:
55 
60 
64  virtual ~RBEIMEvaluation ();
65 
70 
74  virtual void clear() override;
75 
80  virtual void resize_data_structures(const unsigned int Nmax,
81  bool resize_error_bound_data=true) override;
82 
88 
89 
94  unsigned int get_n_parametrized_functions() const;
95 
100 
108  Number evaluate_parametrized_function(unsigned int var_index,
109  const Point & p,
110  const Elem & elem);
111 
118  virtual Real rb_solve(unsigned int N) override;
119 
125  void rb_solve(DenseVector<Number> & EIM_rhs);
126 
131  virtual Real get_error_bound_normalization() override;
132 
139 
143  std::vector<std::unique_ptr<RBTheta>> & get_eim_theta_objects();
144 
150  virtual std::unique_ptr<RBTheta> build_eim_theta(unsigned int index);
151 
158  virtual void legacy_write_offline_data_to_files(const std::string & directory_name = "offline_data",
159  const bool write_binary_data=true) override;
160 
167  virtual void legacy_read_offline_data_from_files(const std::string & directory_name = "offline_data",
168  bool read_error_bound_data=true,
169  const bool read_binary_data=true) override;
170 
171  //----------- PUBLIC DATA MEMBERS -----------//
172 
178 
183  std::vector<Point> interpolation_points;
184 
189  std::vector<unsigned int> interpolation_points_var;
190 
195  std::vector<Elem *> interpolation_points_elem;
196 
197 private:
198 
203  void legacy_write_out_interpolation_points_elem(const std::string & directory_name);
204 
208  void legacy_read_in_interpolation_points_elem(const std::string & directory_name);
209 
214  std::vector<RBParametrizedFunction *> _parametrized_functions;
215 
220  std::vector<std::unique_ptr<RBTheta>> _rb_eim_theta_objects;
221 
227 
233 
238  unsigned int _previous_N;
239 
245 
251 
252 };
253 
254 }
255 
256 #endif // LIBMESH_RB_EIM_EVALUATION_H
DenseMatrix< Number > interpolation_matrix
virtual void clear() override
Mesh data structure replicated on all processors.
virtual void resize_data_structures(const unsigned int Nmax, bool resize_error_bound_data=true) override
virtual void legacy_write_offline_data_to_files(const std::string &directory_name="offline_data", const bool write_binary_data=true) override
Provides a reduced basis parameterized function.
unsigned int get_n_parametrized_functions() const
The base class for all geometric element types.
Definition: elem.h:100
ReplicatedMesh _interpolation_points_mesh
std::vector< std::unique_ptr< RBTheta > > _rb_eim_theta_objects
std::vector< std::unique_ptr< RBTheta > > & get_eim_theta_objects()
void attach_parametrized_function(RBParametrizedFunction *pf)
ReplicatedMesh & get_interpolation_points_mesh()
std::vector< unsigned int > interpolation_points_var
std::vector< Elem * > interpolation_points_elem
virtual Real get_error_bound_normalization() override
void legacy_read_in_interpolation_points_elem(const std::string &directory_name)
virtual Real rb_solve(unsigned int N) override
virtual std::unique_ptr< RBTheta > build_eim_theta(unsigned int index)
RBEIMEvaluation(const libMesh::Parallel::Communicator &comm_in)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< RBParametrizedFunction * > _parametrized_functions
void legacy_write_out_interpolation_points_elem(const std::string &directory_name)
RBThetaExpansion _empty_rb_theta_expansion
virtual void legacy_read_offline_data_from_files(const std::string &directory_name="offline_data", bool read_error_bound_data=true, const bool read_binary_data=true) override
Number evaluate_parametrized_function(unsigned int var_index, const Point &p, const Elem &elem)
std::vector< Point > interpolation_points
A geometric point in (x,y,z) space.
Definition: point.h:38