libMesh
transient_rb_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_TRANSIENT_RB_EVALUATION_H
21 #define LIBMESH_TRANSIENT_RB_EVALUATION_H
22 
23 // rbOOmit includes
24 #include "libmesh/rb_evaluation.h"
25 #include "libmesh/rb_temporal_discretization.h"
26 
27 // libMesh includes
28 
29 // C++ includes
30 
31 namespace libMesh
32 {
33 
34 class TransientRBThetaExpansion;
35 
51 {
52 public:
53 
57  TransientRBEvaluation (const Parallel::Communicator & comm_in);
58 
63 
68 
73  virtual void clear() override;
74 
82  virtual void resize_data_structures(const unsigned int Nmax,
83  bool resize_error_bound_data=true) override;
84 
90  virtual Real rb_solve(unsigned int N) override;
91 
97  virtual Real rb_solve_again();
98 
103  virtual Real get_error_bound_normalization() override;
104 
110  virtual Real residual_scaling_numer(Real alpha_LB);
111 
117  virtual Real compute_residual_dual_norm(const unsigned int N) override;
118 
125  virtual Real uncached_compute_residual_dual_norm(const unsigned int N);
126 
132  void cache_online_residual_terms(const unsigned int N);
133 
140  virtual void clear_riesz_representors() override;
141 
148  virtual void legacy_write_offline_data_to_files(const std::string & directory_name = "offline_data",
149  const bool write_binary_data=true) override;
150 
157  virtual void legacy_read_offline_data_from_files(const std::string & directory_name = "offline_data",
158  bool read_error_bound_data=true,
159  const bool read_binary_data=true) override;
160 
161  //----------- PUBLIC DATA MEMBERS -----------//
162 
167 
174 
178  std::vector<DenseMatrix<Number>> RB_M_q_vector;
179 
184  std::vector<std::vector<Number>> RB_outputs_all_k;
185 
190  std::vector<std::vector<Real>> RB_output_error_bounds_all_k;
191 
196 
200  std::vector<DenseVector<Number>> RB_temporal_solution_data;
201 
206  std::vector<Real > error_bound_all_k;
207 
212  std::vector<Real> initial_L2_error_all_N;
213 
218  std::vector<DenseVector<Number>> RB_initial_condition_all_N;
219 
224  std::vector<std::vector<std::vector<Number>>> Fq_Mq_representor_innerprods;
225  std::vector<std::vector<std::vector<Number>>> Mq_Mq_representor_innerprods;
226  std::vector<std::vector<std::vector<std::vector<Number>>>> Aq_Mq_representor_innerprods;
227 
228 
239 
244  std::vector<std::vector<std::unique_ptr<NumericVector<Number>>>> M_q_representor;
245 
250 };
251 
252 }
253 
254 #endif // LIBMESH_TRANSIENT_RB_EVALUATION_H
libMesh::Number
Real Number
Definition: libmesh_common.h:195
libMesh::TransientRBEvaluation::legacy_write_offline_data_to_files
virtual void legacy_write_offline_data_to_files(const std::string &directory_name="offline_data", const bool write_binary_data=true) override
Write out all the data to text files in order to segregate the Offline stage from the Online stage.
Definition: transient_rb_evaluation.C:741
libMesh::TransientRBEvaluation::get_error_bound_normalization
virtual Real get_error_bound_normalization() override
Definition: transient_rb_evaluation.C:406
libMesh::TransientRBEvaluation::M_q_representor
std::vector< std::vector< std::unique_ptr< NumericVector< Number > > > > M_q_representor
Vector storing the mass matrix representors.
Definition: transient_rb_evaluation.h:244
libMesh::TransientRBEvaluation::old_RB_solution
DenseVector< Number > old_RB_solution
The RB solution at the previous time-level.
Definition: transient_rb_evaluation.h:195
libMesh::TransientRBEvaluation::_rb_solve_data_cached
bool _rb_solve_data_cached
Check that the data has been cached in case of using rb_solve_again.
Definition: transient_rb_evaluation.h:249
libMesh::TransientRBEvaluation::clear
virtual void clear() override
Clear this TransientRBEvaluation object.
Definition: transient_rb_evaluation.C:53
libMesh::TransientRBEvaluation::RB_initial_condition_all_N
std::vector< DenseVector< Number > > RB_initial_condition_all_N
The RB initial conditions (i.e.
Definition: transient_rb_evaluation.h:218
libMesh
The libMesh namespace provides an interface to certain functionality in the library.
Definition: factoryfunction.C:55
libMesh::TransientRBEvaluation::rb_solve_again
virtual Real rb_solve_again()
If a solve has already been performed, then we cached some data and we can perform a new solve much m...
Definition: transient_rb_evaluation.C:362
libMesh::DenseMatrix< Number >
libMesh::TransientRBEvaluation::RB_L2_matrix
DenseMatrix< Number > RB_L2_matrix
Dense RB L2 matrix.
Definition: transient_rb_evaluation.h:166
libMesh::TransientRBEvaluation::TransientRBEvaluation
TransientRBEvaluation(const Parallel::Communicator &comm_in)
Constructor.
Definition: transient_rb_evaluation.C:39
libMesh::TransientRBEvaluation::cached_Fq_term
Number cached_Fq_term
Cached residual terms.
Definition: transient_rb_evaluation.h:233
libMesh::TransientRBEvaluation::Fq_Mq_representor_innerprods
std::vector< std::vector< std::vector< Number > > > Fq_Mq_representor_innerprods
Vectors storing the residual representor inner products to be used in computing the residuals online.
Definition: transient_rb_evaluation.h:224
libMesh::TransientRBEvaluation::cached_Fq_Aq_vector
DenseVector< Number > cached_Fq_Aq_vector
Definition: transient_rb_evaluation.h:234
libMesh::TransientRBEvaluation::error_bound_all_k
std::vector< Real > error_bound_all_k
The error bound data for all time-levels from the most recent rb_solve.
Definition: transient_rb_evaluation.h:206
libMesh::TransientRBEvaluation::~TransientRBEvaluation
~TransientRBEvaluation()
Destructor.
Definition: transient_rb_evaluation.C:48
libMesh::TransientRBEvaluation::RB_outputs_all_k
std::vector< std::vector< Number > > RB_outputs_all_k
The RB outputs for all time-levels from the most recent rb_solve.
Definition: transient_rb_evaluation.h:184
libMesh::TransientRBEvaluation::cached_Mq_Mq_matrix
DenseMatrix< Number > cached_Mq_Mq_matrix
Definition: transient_rb_evaluation.h:238
libMesh::TransientRBEvaluation::RB_output_error_bounds_all_k
std::vector< std::vector< Real > > RB_output_error_bounds_all_k
The error bounds for each RB output for all time-levels from the most recent rb_solve.
Definition: transient_rb_evaluation.h:190
libMesh::TransientRBEvaluation::RB_M_q_vector
std::vector< DenseMatrix< Number > > RB_M_q_vector
Dense matrices for the RB mass matrices.
Definition: transient_rb_evaluation.h:178
libMesh::TransientRBEvaluation::Mq_Mq_representor_innerprods
std::vector< std::vector< std::vector< Number > > > Mq_Mq_representor_innerprods
Definition: transient_rb_evaluation.h:225
libMesh::TransientRBEvaluation::uncached_compute_residual_dual_norm
virtual Real uncached_compute_residual_dual_norm(const unsigned int N)
Compute the dual norm of the residual for the solution saved in RB_solution.
Definition: transient_rb_evaluation.C:590
libMesh::TransientRBEvaluation::rb_solve
virtual Real rb_solve(unsigned int N) override
Perform online solve for current_params with the N basis functions.
Definition: transient_rb_evaluation.C:154
libMesh::TransientRBEvaluation::RB_temporal_solution_data
std::vector< DenseVector< Number > > RB_temporal_solution_data
Array storing the solution data at each time level from the most recent solve.
Definition: transient_rb_evaluation.h:200
libMesh::TransientRBEvaluation
This class is part of the rbOOmit framework.
Definition: transient_rb_evaluation.h:50
libMesh::TransientRBEvaluation::clear_riesz_representors
virtual void clear_riesz_representors() override
Clear all the Riesz representors that are used to compute the RB residual (and hence error bound).
Definition: transient_rb_evaluation.C:60
libMesh::TransientRBEvaluation::legacy_read_offline_data_from_files
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
Read in the saved Offline reduced basis data to initialize the system for Online solves.
Definition: transient_rb_evaluation.C:893
libMesh::TransientRBEvaluation::compute_residual_dual_norm
virtual Real compute_residual_dual_norm(const unsigned int N) override
Compute the dual norm of the residual for the solution saved in RB_solution.
Definition: transient_rb_evaluation.C:542
libMesh::TransientRBEvaluation::RB_RHS_save
DenseVector< Number > RB_RHS_save
Definition: transient_rb_evaluation.h:173
libMesh::TransientRBEvaluation::cache_online_residual_terms
void cache_online_residual_terms(const unsigned int N)
Helper function for caching the terms in the online residual assembly that do not change in time.
Definition: transient_rb_evaluation.C:420
libMesh::TransientRBEvaluation::Parent
RBEvaluation Parent
The type of the parent.
Definition: transient_rb_evaluation.h:67
libMesh::TransientRBEvaluation::Aq_Mq_representor_innerprods
std::vector< std::vector< std::vector< std::vector< Number > > > > Aq_Mq_representor_innerprods
Definition: transient_rb_evaluation.h:226
libMesh::RBEvaluation
This class is part of the rbOOmit framework.
Definition: rb_evaluation.h:50
libMesh::TransientRBEvaluation::cached_Fq_Mq_vector
DenseVector< Number > cached_Fq_Mq_vector
Definition: transient_rb_evaluation.h:236
libMesh::TransientRBEvaluation::initial_L2_error_all_N
std::vector< Real > initial_L2_error_all_N
Vector storing initial L2 error for all 1 <= N <= RB_size.
Definition: transient_rb_evaluation.h:212
libMesh::RBTemporalDiscretization
Define a class that encapsulates the details of a "generalized Euler" temporal discretization to be u...
Definition: rb_temporal_discretization.h:40
libMesh::TransientRBEvaluation::residual_scaling_numer
virtual Real residual_scaling_numer(Real alpha_LB)
Specifies the residual scaling on the numerator to be used in the a posteriori error bound.
Definition: transient_rb_evaluation.C:415
libMesh::TransientRBEvaluation::RB_LHS_matrix
DenseMatrix< Number > RB_LHS_matrix
Cached data for subsequent solves.
Definition: transient_rb_evaluation.h:171
libMesh::TransientRBEvaluation::cached_Aq_Aq_matrix
DenseMatrix< Number > cached_Aq_Aq_matrix
Definition: transient_rb_evaluation.h:235
libMesh::Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Definition: libmesh_common.h:121
libMesh::TransientRBEvaluation::RB_RHS_matrix
DenseMatrix< Number > RB_RHS_matrix
Definition: transient_rb_evaluation.h:172
libMesh::TransientRBEvaluation::resize_data_structures
virtual void resize_data_structures(const unsigned int Nmax, bool resize_error_bound_data=true) override
Resize and clear the data vectors corresponding to the value of Nmax.
Definition: transient_rb_evaluation.C:68
libMesh::TransientRBEvaluation::cached_Aq_Mq_matrix
DenseMatrix< Number > cached_Aq_Mq_matrix
Definition: transient_rb_evaluation.h:237
libMesh::DenseVector< Number >