libMesh
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"
25 #include "libmesh/point.h"
26 #include "libmesh/rb_evaluation.h"
27 #include "libmesh/replicated_mesh.h"
28 #include "libmesh/rb_theta_expansion.h"
29 
30 // C++ includes
31 
32 namespace libMesh
33 {
34 
35 class RBParameters;
36 class RBParametrizedFunction;
37 class Elem;
38 class RBTheta;
39 
52 {
53 public:
54 
59  LIBMESH_CAN_DEFAULT_TO_COMMWORLD);
60 
64  virtual ~RBEIMEvaluation ();
65 
70 
74  virtual void clear() libmesh_override;
75 
80  virtual void resize_data_structures(const unsigned int Nmax,
81  bool resize_error_bound_data=true) libmesh_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) libmesh_override;
119 
125  void rb_solve(DenseVector<Number> & EIM_rhs);
126 
131  virtual Real get_error_bound_normalization() libmesh_override;
132 
139 
143  std::vector<RBTheta *> get_eim_theta_objects();
144 
150  virtual UniquePtr<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) libmesh_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) libmesh_override;
170 
171  //----------- PUBLIC DATA MEMBERS -----------//
172 
178 
184 
189  std::vector<unsigned int> interpolation_points_var;
190 
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 
215 
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
Dense matrix that stores the lower triangular interpolation matrix that can be used.
virtual void legacy_write_offline_data_to_files(const std::string &directory_name="offline_data", const bool write_binary_data=true) libmesh_override
Write out all the data to text files in order to segregate the Offline stage from the Online stage...
The ReplicatedMesh class is derived from the MeshBase class, and is used to store identical copies of...
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) libmesh_override
Read in the saved Offline reduced basis data to initialize the system for Online solves.
Encapsulates the MPI_Comm object.
Definition: parallel.h:657
std::vector< RBTheta * > get_eim_theta_objects()
std::vector< RBTheta * > _rb_eim_theta_objects
The vector of RBTheta objects that are created to point to this RBEIMEvaluation.
virtual void resize_data_structures(const unsigned int Nmax, bool resize_error_bound_data=true) libmesh_override
Resize the data structures for storing data associated with this object.
void legacy_read_in_interpolation_points_elem(const std::string &directory_name)
Read int interpolation_points_elem from a mesh.
A simple functor class that provides a RBParameter-dependent function.
ReplicatedMesh & get_interpolation_points_mesh()
Get a writable reference to the interpolation points mesh.
This is the base class from which all geometric element types are derived.
Definition: elem.h:89
virtual void clear() libmesh_override
Clear this object.
The libMesh namespace provides an interface to certain functionality in the library.
ReplicatedMesh _interpolation_points_mesh
Mesh object that we use to store copies of the elements associated with interpolation points...
void legacy_write_out_interpolation_points_elem(const std::string &directory_name)
Write out interpolation_points_elem by putting the elements into a mesh and writing out the mesh...
This class stores the set of RBTheta functor objects that define the "parameter-dependent expansion" ...
void initialize_eim_theta_objects()
Build a vector of RBTheta objects that accesses the components of the RB_solution member variable of ...
std::unique_ptr< T > UniquePtr
Definition: auto_ptr.h:46
virtual UniquePtr< RBTheta > build_eim_theta(unsigned int index)
Build a theta object corresponding to EIM index index.
virtual Real get_error_bound_normalization() libmesh_override
virtual Real rb_solve(unsigned int N) libmesh_override
Calculate the EIM approximation to parametrized_function using the first N EIM basis functions...
virtual ~RBEIMEvaluation()
Destructor.
std::vector< unsigned int > interpolation_points_var
The corresponding list of variables indices at which the interpolation points were identified...
This class is part of the rbOOmit framework.
Definition: rb_parameters.h:42
std::vector< Elem * > interpolation_points_elem
The corresponding list of elements at which the interpolation points were identified.
unsigned int _previous_N
Store the number of basis functions used for the previous solve (so we can avoid an unnecessary repea...
This class is part of the rbOOmit framework.
Definition: rb_evaluation.h:50
Number evaluate_parametrized_function(unsigned int var_index, const Point &p, const Elem &elem)
RBEIMEvaluation(const libMesh::Parallel::Communicator &comm_in LIBMESH_CAN_DEFAULT_TO_COMMWORLD)
Constructor.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
RBEvaluation Parent
The type of the parent.
std::vector< RBParametrizedFunction * > _parametrized_functions
This vector stores the parametrized functions that will be approximated in this EIM system...
RBThetaExpansion _empty_rb_theta_expansion
We initialize RBEIMEvaluation so that it has an "empty" RBThetaExpansion, because this isn&#39;t used at ...
Defines a dense vector for use in Finite Element-type computations.
This class is part of the rbOOmit framework.
Definition: rb_theta.h:46
std::vector< Point > interpolation_points
The list of interpolation points, i.e.
Real _previous_error_bound
Store the previous error bound returned by rb_solve (so we can return it if we are avoiding an unnece...
Defines a dense matrix for use in Finite Element-type computations.
Definition: dof_map.h:64
RBParameters _previous_parameters
Store the parameters at which the previous solve was performed (so we can avoid an unnecessary repeat...
This class is part of the rbOOmit framework.
void attach_parametrized_function(RBParametrizedFunction *pf)
Attach the parametrized function that we will approximate using the Empirical Interpolation Method...
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38
unsigned int get_n_parametrized_functions() const
Get the number of parametrized functions that have been attached to this system.