20 #ifndef LIBMESH_RB_CONSTRUCTION_BASE_H    21 #define LIBMESH_RB_CONSTRUCTION_BASE_H    24 #include "libmesh/id_types.h"    25 #include "libmesh/rb_parametrized.h"    26 #include "libmesh/rb_theta_expansion.h"    27 #include "libmesh/rb_theta.h"    30 #include "libmesh/system.h"    31 #include "libmesh/numeric_vector.h"    32 #include "libmesh/linear_solver.h"    33 #include "libmesh/perf_log.h"    63                       const std::string & 
name,
    64                       const unsigned int number);
    93   virtual void clear ();
   144                                               const unsigned int n_global_training_samples,
   145                                               const std::map<std::string, bool> & log_param_scale,
   146                                               const bool deterministic=
true);
   152   virtual void load_training_set(
const std::map<std::string, std::vector<RBParameter>> & new_training_set);
   198   static std::pair<std::size_t, std::size_t>
   200                                       const std::map<std::string, bool> & log_param_scale,
   201                                       std::map<std::string, std::vector<RBParameter>> & local_training_parameters_in,
   202                                       const unsigned int n_global_training_samples_in,
   205                                       const int training_parameters_random_seed=-1,
   216   static std::pair<std::size_t, std::size_t>
   218                                              const std::map<std::string, bool> & log_param_scale,
   219                                              std::map<std::string, std::vector<RBParameter>> & local_training_parameters_in,
   220                                              const unsigned int n_global_training_samples_in,
   256                                         std::pair<numeric_index_type, Real> & error_pair);
   329 #endif // LIBMESH_RB_CONSTRUCTION_BASE_H std::string name(const ElemQuality q)
This function returns a string containing some name for q. 
numeric_index_type get_first_local_training_index() const
Get the first local index of the training parameters. 
This is the EquationSystems class. 
static std::pair< std::size_t, std::size_t > generate_training_parameters_random(const Parallel::Communicator &communicator, const std::map< std::string, bool > &log_param_scale, std::map< std::string, std::vector< RBParameter >> &local_training_parameters_in, const unsigned int n_global_training_samples_in, const RBParameters &min_parameters, const RBParameters &max_parameters, const int training_parameters_random_seed=-1, const bool serial_training_set=false)
Static helper function for generating a randomized set of parameters. 
bool quiet_mode
Flag to indicate whether we print out extra information during the Offline stage. ...
bool _normalize_solution_snapshots
Set this boolean to true if we want to normalize solution snapshots used in training to have norm of ...
static std::pair< std::size_t, std::size_t > generate_training_parameters_deterministic(const Parallel::Communicator &communicator, const std::map< std::string, bool > &log_param_scale, std::map< std::string, std::vector< RBParameter >> &local_training_parameters_in, const unsigned int n_global_training_samples_in, const RBParameters &min_parameters, const RBParameters &max_parameters, const bool serial_training_set=false)
Static helper function for generating a deterministic set of parameters. 
void set_quiet_mode(bool quiet_mode_in)
Set the quiet_mode flag. 
bool is_quiet() const
Is the system in quiet mode? 
static void get_global_max_error_pair(const Parallel::Communicator &communicator, std::pair< numeric_index_type, Real > &error_pair)
Static function to return the error pair (index,error) that is corresponds to the largest error on al...
void set_training_parameter_values(const std::string ¶m_name, const std::vector< RBParameter > &values)
Overwrite the local training samples for param_name using values. 
The libMesh namespace provides an interface to certain functionality in the library. 
void broadcast_parameters(const unsigned int proc_id)
Broadcasts parameters from processor proc_id to all processors. 
std::unique_ptr< NumericVector< Number > > inner_product_storage_vector
We keep an extra temporary vector that is useful for performing inner products (avoids unnecessary me...
RBConstructionBase< Base > sys_type
The type of system. 
virtual void load_training_set(const std::map< std::string, std::vector< RBParameter >> &new_training_set)
Overwrite the training parameters with new_training_set. 
numeric_index_type _first_local_index
The first sample-vector index from the global vector which is stored in the _training_parameters on t...
virtual void initialize_training_parameters(const RBParameters &mu_min, const RBParameters &mu_max, const unsigned int n_global_training_samples, const std::map< std::string, bool > &log_param_scale, const bool deterministic=true)
Initialize the parameter ranges and indicate whether deterministic or random training parameters shou...
void set_training_random_seed(int seed)
Set the seed that is used to randomly generate training parameters. 
dof_id_type numeric_index_type
numeric_index_type _n_local_training_samples
RBConstructionBase(EquationSystems &es, const std::string &name, const unsigned int number)
Constructor. 
numeric_index_type get_last_local_training_index() const
Get the last local index of the training parameters. 
numeric_index_type get_local_n_training_samples() const
Get the total number of training samples local to this processor. 
This class is part of the rbOOmit framework. 
numeric_index_type get_n_training_samples() const
Get the number of global training samples. 
This class extends EigenSystem to allow a simple way of solving (standard or generalized) eigenvalue ...
void set_params_from_training_set(unsigned int global_index)
Set parameters to the RBParameters stored in index global_index of the global training set...
void set_deterministic_training_parameter_name(const std::string &name)
In some cases we only want to allow discrete parameter values, instead of parameters that may take an...
void set_normalize_solution_snapshots(bool value)
Set the boolean option that indicates if we normalization solution snapshots or not. 
This class is part of the rbOOmit framework. 
RBConstructionBase & operator=(RBConstructionBase &&)=delete
const std::string & get_deterministic_training_parameter_name() const
Get the name of the parameter that we will generate deterministic training parameters for...
virtual ~RBConstructionBase()
bool serial_training_set
This boolean flag indicates whether or not the training set should be the same on all processors...
RBParameters get_params_from_training_set(unsigned int global_index)
Return the RBParameters in index global_index of the global training set. 
This class is part of the rbOOmit framework. 
int _training_parameters_random_seed
If < 0, use std::time() * processor_id() to seed the random number generator for the training paramet...
std::map< std::string, std::vector< RBParameter > > _training_parameters
The training samples for each parameter. 
virtual void init_data()
Initializes the member data fields associated with the system, so that, e.g., assemble() may be used...
numeric_index_type _n_global_training_samples
virtual void set_params_from_training_set_and_broadcast(unsigned int global_index)
Load the specified training parameter and then broadcast to all processors. 
bool _training_parameters_initialized
Boolean flag to indicate whether or not the parameter ranges have been initialized. 
virtual void clear()
Clear all the data structures associated with the system.