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 
58  LIBMESH_CAN_DEFAULT_TO_COMMWORLD);
59 
64 
69 
74  virtual void clear() libmesh_override;
75 
83  virtual void resize_data_structures(const unsigned int Nmax,
84  bool resize_error_bound_data=true) libmesh_override;
85 
91  virtual Real rb_solve(unsigned int N) libmesh_override;
92 
98  virtual Real rb_solve_again();
99 
104  virtual Real get_error_bound_normalization() libmesh_override;
105 
111  virtual Real residual_scaling_numer(Real alpha_LB);
112 
118  virtual Real compute_residual_dual_norm(const unsigned int N) libmesh_override;
119 
126  virtual Real uncached_compute_residual_dual_norm(const unsigned int N);
127 
133  void cache_online_residual_terms(const unsigned int N);
134 
141  virtual void clear_riesz_representors() libmesh_override;
142 
149  virtual void legacy_write_offline_data_to_files(const std::string & directory_name = "offline_data",
150  const bool write_binary_data=true) libmesh_override;
151 
158  virtual void legacy_read_offline_data_from_files(const std::string & directory_name = "offline_data",
159  bool read_error_bound_data=true,
160  const bool read_binary_data=true) libmesh_override;
161 
162  //----------- PUBLIC DATA MEMBERS -----------//
163 
168 
175 
180 
185  std::vector<std::vector<Number>> RB_outputs_all_k;
186 
192 
197 
202 
208 
214 
220 
225  std::vector<std::vector<std::vector<Number>>> Fq_Mq_representor_innerprods;
226  std::vector<std::vector<std::vector<Number>>> Mq_Mq_representor_innerprods;
227  std::vector<std::vector<std::vector<std::vector<Number>>>> Aq_Mq_representor_innerprods;
228 
229 
240 
245  std::vector<std::vector<NumericVector<Number> * >> M_q_representor;
246 
251 };
252 
253 }
254 
255 #endif // LIBMESH_TRANSIENT_RB_EVALUATION_H
TransientRBEvaluation(const Parallel::Communicator &comm_in LIBMESH_CAN_DEFAULT_TO_COMMWORLD)
Constructor.
std::vector< std::vector< std::vector< Number > > > Mq_Mq_representor_innerprods
virtual void clear_riesz_representors() libmesh_override
Clear all the Riesz representors that are used to compute the RB residual (and hence error bound)...
Encapsulates the MPI_Comm object.
Definition: parallel.h:657
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.
Number cached_Fq_term
Cached residual terms.
DenseMatrix< Number > RB_LHS_matrix
Cached data for subsequent solves.
std::vector< DenseMatrix< Number > > RB_M_q_vector
Dense matrices for the RB mass matrices.
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...
DenseVector< Number > old_RB_solution
The RB solution at the previous time-level.
virtual Real compute_residual_dual_norm(const unsigned int N) libmesh_override
Compute the dual norm of the residual for the solution saved in RB_solution.
Numeric vector.
Definition: dof_map.h:66
This class is part of the rbOOmit framework.
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.
The libMesh namespace provides an interface to certain functionality in the library.
std::vector< std::vector< NumericVector< Number > * > > M_q_representor
Vector storing the mass matrix representors.
bool _rb_solve_data_cached
Check that the data has been cached in case of using rb_solve_again.
std::vector< Real > initial_L2_error_all_N
Vector storing initial L2 error for all 1 <= N <= RB_size.
virtual Real residual_scaling_numer(Real alpha_LB)
Specifies the residual scaling on the numerator to be used in the a posteriori error bound...
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...
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.
std::vector< Real > error_bound_all_k
The error bound data for all time-levels from the most recent rb_solve.
RBEvaluation Parent
The type of the parent.
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...
std::vector< DenseVector< Number > > RB_initial_condition_all_N
The RB initial conditions (i.e.
This class is part of the rbOOmit framework.
Definition: rb_evaluation.h:50
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real get_error_bound_normalization() libmesh_override
std::vector< DenseVector< Number > > RB_temporal_solution_data
Array storing the solution data at each time level from the most recent solve.
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...
virtual void resize_data_structures(const unsigned int Nmax, bool resize_error_bound_data=true) libmesh_override
Resize and clear the data vectors corresponding to the value of Nmax.
std::vector< std::vector< Number > > RB_outputs_all_k
The RB outputs for all time-levels from the most recent rb_solve.
Define a class that encapsulates the details of a "generalized Euler" temporal discretization to be u...
std::vector< std::vector< std::vector< std::vector< Number > > > > Aq_Mq_representor_innerprods
virtual Real rb_solve(unsigned int N) libmesh_override
Perform online solve for current_params with the N basis functions.
Defines a dense vector for use in Finite Element-type computations.
Defines a dense matrix for use in Finite Element-type computations.
Definition: dof_map.h:64
DenseMatrix< Number > RB_L2_matrix
Dense RB L2 matrix.
virtual void clear() libmesh_override
Clear this TransientRBEvaluation object.