Go to the documentation of this file.
20 #ifndef LIBMESH_RB_CONSTRUCTION_BASE_H
21 #define LIBMESH_RB_CONSTRUCTION_BASE_H
24 #include "libmesh/rb_parametrized.h"
25 #include "libmesh/rb_theta_expansion.h"
26 #include "libmesh/rb_theta.h"
29 #include "libmesh/system.h"
30 #include "libmesh/numeric_vector.h"
31 #include "libmesh/linear_solver.h"
32 #include "libmesh/perf_log.h"
63 const std::string &
name,
64 const unsigned int number);
85 virtual void clear ();
128 unsigned int n_training_parameters,
129 std::map<std::string, bool> log_param_scale,
130 bool deterministic=
true);
135 virtual void load_training_set(std::map<std::string, std::vector<Number>> & new_training_set);
206 std::pair<numeric_index_type, Real> & error_pair);
212 std::map<std::string, bool> log_param_scale,
214 unsigned int n_training_samples_in,
225 std::map<std::string, bool> log_param_scale,
227 unsigned int n_training_samples_in,
283 #endif // LIBMESH_RB_CONSTRUCTION_BASE_H
static void generate_training_parameters_random(const Parallel::Communicator &communicator, std::map< std::string, bool > log_param_scale, std::map< std::string, std::unique_ptr< NumericVector< Number >>> &training_parameters_in, unsigned int n_training_samples_in, const RBParameters &min_parameters, const RBParameters &max_parameters, int training_parameters_random_seed=-1, bool serial_training_set=false)
Static helper function for generating a randomized set of parameters.
virtual void clear()
Clear all the data structures associated with the system.
virtual ~RBConstructionBase()
Destructor.
numeric_index_type get_first_local_training_index() const
Get the first local index of the 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...
std::map< std::string, std::unique_ptr< NumericVector< Number > > > training_parameters
The training samples.
void set_training_random_seed(unsigned int seed)
Set the seed that is used to randomly generate training parameters.
bool training_parameters_initialized
Boolean flag to indicate whether or not the parameter ranges have been initialized.
The libMesh namespace provides an interface to certain functionality in the library.
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...
virtual void set_params_from_training_set_and_broadcast(unsigned int index)
Load the specified training parameter and then broadcast to all processors.
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.
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...
unsigned int get_deterministic_training_parameter_repeats() const
Get the number of times each sample of the deterministic training parameter is repeated.
void broadcast_parameters(unsigned int proc_id)
Broadcasts parameters on processor proc_id to all processors.
numeric_index_type get_n_training_samples() const
Get the total number of training samples.
RBParameters get_params_from_training_set(unsigned int index)
Return the RBParameters in index index of training set.
void set_params_from_training_set(unsigned int index)
Set parameters to the RBParameters stored in index index of the training set.
This class is part of the rbOOmit framework.
This class extends EigenSystem to allow a simple way of solving (standard or generalized) eigenvalue ...
RBConstructionBase< Base > sys_type
The type of system.
bool is_quiet() const
Is the system in quiet mode?
static void generate_training_parameters_deterministic(const Parallel::Communicator &communicator, std::map< std::string, bool > log_param_scale, std::map< std::string, std::unique_ptr< NumericVector< Number >>> &training_parameters_in, unsigned int n_training_samples_in, const RBParameters &min_parameters, const RBParameters &max_parameters, bool serial_training_set=false)
Static helper function for generating a deterministic set of parameters.
virtual void load_training_set(std::map< std::string, std::vector< Number >> &new_training_set)
Overwrite the training parameters with new_training_set.
RBConstructionBase(EquationSystems &es, const std::string &name, const unsigned int number)
Constructor.
dof_id_type numeric_index_type
This is the EquationSystems class.
void set_deterministic_training_parameter_repeats(unsigned int repeats)
Set the number of times each sample of the deterministic training parameter is repeated.
numeric_index_type get_last_local_training_index() const
Get the last local index of the training parameters.
void set_quiet_mode(bool quiet_mode_in)
Set the quiet_mode flag.
bool serial_training_set
This boolean flag indicates whether or not the training set should be the same on all processors.
int training_parameters_random_seed
If < 0, use std::time() * processor_id() to seed the random number generator for the training paramet...
This class is part of the rbOOmit framework.
bool quiet_mode
Flag to indicate whether we print out extra information during the Offline stage.
numeric_index_type get_local_n_training_samples() const
Get the total number of training samples local to this processor.
virtual void initialize_training_parameters(const RBParameters &mu_min, const RBParameters &mu_max, unsigned int n_training_parameters, std::map< std::string, bool > log_param_scale, bool deterministic=true)
Initialize the parameter ranges and indicate whether deterministic or random training parameters shou...
const std::string & get_deterministic_training_parameter_name() const
Get the name of the parameter that we will generate deterministic training parameters for.
std::string name(const ElemQuality q)
This function returns a string containing some name for q.