Go to the documentation of this file.
20 #ifndef LIBMESH_RB_EVALUATION_H
21 #define LIBMESH_RB_EVALUATION_H
24 #include "libmesh/rb_parametrized.h"
27 #include "libmesh/dense_matrix.h"
28 #include "libmesh/dense_vector.h"
29 #include "libmesh/parallel_object.h"
38 template <
typename T>
class NumericVector;
39 class RBThetaExpansion;
69 virtual void clear()
override;
93 bool resize_error_bound_data=
true);
168 const bool write_binary_data=
true);
177 bool read_error_bound_data=
true,
178 const bool read_binary_data=
true);
188 const std::string & directory_name =
"offline_data",
189 const bool write_binary_basis_functions =
true);
197 const std::string & directory_name =
"offline_data",
198 const std::string & data_name =
"bf",
199 const bool write_binary_basis_functions =
true);
209 const std::string & directory_name =
"offline_data",
210 const bool read_binary_basis_functions =
true);
219 const std::string & directory_name,
220 const std::string & data_name,
221 const bool read_binary_vectors);
231 const std::vector<std::string> & multiple_directory_names,
232 const std::vector<std::string> & multiple_data_names,
233 const bool read_binary_vectors);
350 #endif // LIBMESH_RB_EVALUATION_H
Manages consistently variables, degrees of freedom, and coefficient vectors.
virtual unsigned int get_n_basis_functions() const
Get the current number of basis functions.
std::vector< DenseMatrix< Number > > RB_Aq_vector
Dense matrices for the RB computations.
virtual void set_n_basis_functions(unsigned int n_bfs)
Set the number of basis functions.
virtual ~RBEvaluation()
Destructor.
virtual void write_out_basis_functions(System &sys, const std::string &directory_name="offline_data", const bool write_binary_basis_functions=true)
Write out all the basis functions to file.
bool is_rb_theta_expansion_initialized() const
virtual Real rb_solve(unsigned int N)
Perform online solve with the N RB basis functions, for the set of parameters in current_params,...
The libMesh namespace provides an interface to certain functionality in the library.
std::vector< std::vector< Number > > output_dual_innerprods
The vector storing the dual norm inner product terms for each output.
const Parallel::Communicator & comm() const
virtual void read_in_basis_functions(System &sys, const std::string &directory_name="offline_data", const bool read_binary_basis_functions=true)
Read in all the basis functions from file.
This class is part of the rbOOmit framework.
virtual void clear() override
Clear this RBEvaluation object.
void set_rb_theta_expansion(RBThetaExpansion &rb_theta_expansion_in)
Set the RBThetaExpansion object.
void assert_file_exists(const std::string &file_name)
Helper function that checks if file_name exists.
RBEvaluation(const Parallel::Communicator &comm)
Constructor.
std::vector< Number > RB_outputs
The vectors storing the RB output values and corresponding error bounds.
virtual Real residual_scaling_denom(Real alpha_LB)
Specifies the residual scaling on the denominator to be used in the a posteriori error bound.
bool evaluate_RB_error_bound
Boolean to indicate whether we evaluate a posteriori error bounds when rb_solve is called.
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)
Read in the saved Offline reduced basis data to initialize the system for Online solves.
DenseVector< Number > RB_solution
The RB solution vector.
std::vector< Number > Fq_representor_innerprods
Vectors storing the residual representor inner products to be used in computing the residuals online.
void read_in_vectors(System &sys, std::vector< std::unique_ptr< NumericVector< Number >>> &vectors, const std::string &directory_name, const std::string &data_name, const bool read_binary_vectors)
Same as read_in_basis_functions, except in this case we pass in the vectors to be written.
std::vector< std::vector< std::vector< Number > > > Fq_Aq_representor_innerprods
Vectors storing the residual representor inner products to be used in computing the residuals online.
virtual void clear_riesz_representors()
Clear all the Riesz representors that are used to compute the RB residual (and hence error bound).
RBThetaExpansion * rb_theta_expansion
A pointer to to the object that stores the theta expansion.
void read_in_vectors_from_multiple_files(System &sys, std::vector< std::vector< std::unique_ptr< NumericVector< Number >>> * > multiple_vectors, const std::vector< std::string > &multiple_directory_names, const std::vector< std::string > &multiple_data_names, const bool read_binary_vectors)
Performs read_in_vectors for a list of directory names and data names.
virtual Real get_stability_lower_bound()
Get a lower bound for the stability constant (e.g.
virtual Real compute_residual_dual_norm(const unsigned int N)
Compute the dual norm of the residual for the solution saved in RB_solution_vector.
virtual void write_out_vectors(System &sys, std::vector< NumericVector< Number > * > &vectors, const std::string &directory_name="offline_data", const std::string &data_name="bf", const bool write_binary_basis_functions=true)
Same as write_out_basis_functions, except in this case we pass in the vectors to be written.
std::vector< std::vector< std::vector< Number > > > Aq_Aq_representor_innerprods
virtual void legacy_write_offline_data_to_files(const std::string &directory_name="offline_data", const bool write_binary_data=true)
Write out all the data to text files in order to segregate the Offline stage from the Online stage.
std::vector< std::vector< DenseVector< Number > > > RB_output_vectors
The vectors storing the RB output vectors.
Real eval_output_dual_norm(unsigned int n, const RBParameters &mu)
Evaluate the dual norm of output n for the current parameters.
bool compute_RB_inner_product
Boolean flag to indicate whether we compute the RB_inner_product_matrix.
DenseMatrix< Number > RB_inner_product_matrix
The inner product matrix.
virtual Real get_error_bound_normalization()
This class is part of the rbOOmit framework.
std::vector< std::vector< std::unique_ptr< NumericVector< Number > > > > Aq_representor
Vector storing the residual representors associated with the left-hand side.
This class is part of the rbOOmit framework.
std::vector< Real > RB_output_error_bounds
virtual void resize_data_structures(const unsigned int Nmax, bool resize_error_bound_data=true)
Resize and clear the data vectors corresponding to the value of Nmax.
RBThetaExpansion & get_rb_theta_expansion()
Get a reference to the rb_theta_expansion.
std::vector< std::unique_ptr< NumericVector< Number > > > basis_functions
The libMesh vectors storing the finite element coefficients of the RB basis functions.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
An object whose state is distributed along a set of processors.
std::vector< DenseVector< Number > > RB_Fq_vector
Dense vector for the RHS.
This class stores the set of RBTheta functor objects that define the "parameter-dependent expansion" ...
NumericVector< Number > & get_basis_function(unsigned int i)
Get a reference to the i^th basis function.
std::vector< RBParameters > greedy_param_list
The list of parameters selected by the Greedy algorithm in generating the Reduced Basis associated wi...