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);
This is the EquationSystems class.
This class is part of the rbOOmit framework.
virtual void init_data()
Initializes the member data fields associated with the system, so that, e.g., assemble() may be used.
RBParameters get_params_from_training_set(unsigned int global_index)
Return the RBParameters in index global_index of the global training set.
virtual void set_params_from_training_set_and_broadcast(unsigned int global_index)
Load the specified training parameter and then broadcast to all processors.
std::map< std::string, std::vector< RBParameter > > _training_parameters
The training samples for each parameter.
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...
RBConstructionBase(const RBConstructionBase &)=delete
bool _training_parameters_initialized
Boolean flag to indicate whether or not the parameter ranges have been initialized.
void set_training_random_seed(int seed)
Set the seed that is used to randomly generate training parameters.
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...
numeric_index_type _n_global_training_samples
virtual void clear()
Clear all the data structures associated with the system.
void set_quiet_mode(bool quiet_mode_in)
Set the quiet_mode flag.
virtual ~RBConstructionBase()
numeric_index_type _n_local_training_samples
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.
int _training_parameters_random_seed
If < 0, use std::time() * processor_id() to seed the random number generator for the training paramet...
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.
numeric_index_type get_first_local_training_index() const
Get the first 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.
RBConstructionBase(RBConstructionBase &&)=default
Special functions.
void broadcast_parameters(const unsigned int proc_id)
Broadcasts parameters from processor proc_id to all processors.
RBConstructionBase & operator=(RBConstructionBase &&)=delete
numeric_index_type get_n_training_samples() const
Get the number of global training samples.
void set_normalize_solution_snapshots(bool value)
Set the boolean option that indicates if we normalization solution snapshots or not.
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...
RBConstructionBase< Base > sys_type
The type of system.
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.
const std::string & get_deterministic_training_parameter_name() const
Get the name of the parameter that we will generate deterministic training parameters for.
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.
numeric_index_type get_last_local_training_index() const
Get the last local index of the training parameters.
bool serial_training_set
This boolean flag indicates whether or not the training set should be the same on all processors.
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...
bool _normalize_solution_snapshots
Set this boolean to true if we want to normalize solution snapshots used in training to have norm of ...
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...
This class is part of the rbOOmit framework.
This class is part of the rbOOmit framework.
The libMesh namespace provides an interface to certain functionality in the library.
dof_id_type numeric_index_type