libMesh
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
libMesh::TransientRBEvaluation Class Reference

This class is part of the rbOOmit framework. More...

#include <transient_rb_evaluation.h>

Inheritance diagram for libMesh::TransientRBEvaluation:
[legend]

Public Types

typedef RBEvaluation Parent
 The type of the parent. More...
 

Public Member Functions

 TransientRBEvaluation (const Parallel::Communicator &comm_in)
 Constructor. More...
 
 ~TransientRBEvaluation ()
 Destructor. More...
 
virtual void clear () override
 Clear this TransientRBEvaluation object. More...
 
virtual void resize_data_structures (const unsigned int Nmax, bool resize_error_bound_data=true) override
 Resize and clear the data vectors corresponding to the value of Nmax. More...
 
virtual Real rb_solve (unsigned int N) override
 Perform online solve for current_params with the N basis functions. More...
 
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 more rapidly (with the same parameters but a possibly different initial condition/rhs control). More...
 
virtual Real get_error_bound_normalization () override
 
virtual Real residual_scaling_numer (Real alpha_LB)
 Specifies the residual scaling on the numerator to be used in the a posteriori error bound. More...
 
virtual Real compute_residual_dual_norm (const unsigned int N) override
 Compute the dual norm of the residual for the solution saved in RB_solution. More...
 
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. More...
 
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. More...
 
virtual void clear_riesz_representors () override
 Clear all the Riesz representors that are used to compute the RB residual (and hence error bound). More...
 
virtual void legacy_write_offline_data_to_files (const std::string &directory_name="offline_data", const bool write_binary_data=true) override
 Write out all the data to text files in order to segregate the Offline stage from the Online stage. More...
 
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) override
 Read in the saved Offline reduced basis data to initialize the system for Online solves. More...
 
void set_rb_theta_expansion (RBThetaExpansion &rb_theta_expansion_in)
 Set the RBThetaExpansion object. More...
 
RBThetaExpansionget_rb_theta_expansion ()
 Get a reference to the rb_theta_expansion. More...
 
bool is_rb_theta_expansion_initialized () const
 
NumericVector< Number > & get_basis_function (unsigned int i)
 Get a reference to the i^th basis function. More...
 
virtual Real residual_scaling_denom (Real alpha_LB)
 Specifies the residual scaling on the denominator to be used in the a posteriori error bound. More...
 
Real eval_output_dual_norm (unsigned int n, const RBParameters &mu)
 Evaluate the dual norm of output n for the current parameters. More...
 
virtual Real get_stability_lower_bound ()
 Get a lower bound for the stability constant (e.g. More...
 
virtual unsigned int get_n_basis_functions () const
 Get the current number of basis functions. More...
 
virtual void set_n_basis_functions (unsigned int n_bfs)
 Set the number of basis functions. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
void initialize_parameters (const RBParameters &mu_min_in, const RBParameters &mu_max_in, const std::map< std::string, std::vector< Real >> &discrete_parameter_values)
 Initialize the parameter ranges and set current_parameters. More...
 
void initialize_parameters (const RBParametrized &rb_parametrized)
 Initialize the parameter ranges and set current_parameters. More...
 
unsigned int get_n_params () const
 Get the number of parameters. More...
 
unsigned int get_n_continuous_params () const
 Get the number of continuous parameters. More...
 
unsigned int get_n_discrete_params () const
 Get the number of discrete parameters. More...
 
std::set< std::string > get_parameter_names () const
 Get a set that stores the parameter names. More...
 
const RBParametersget_parameters () const
 Get the current parameters. More...
 
void set_parameters (const RBParameters &params)
 Set the current parameters to params. More...
 
const RBParametersget_parameters_min () const
 Get an RBParameters object that specifies the minimum allowable value for each parameter. More...
 
const RBParametersget_parameters_max () const
 Get an RBParameters object that specifies the maximum allowable value for each parameter. More...
 
Real get_parameter_min (const std::string &param_name) const
 Get minimum allowable value of parameter param_name. More...
 
Real get_parameter_max (const std::string &param_name) const
 Get maximum allowable value of parameter param_name. More...
 
void print_parameters () const
 Print the current parameters. More...
 
void write_parameter_data_to_files (const std::string &continuous_param_file_name, const std::string &discrete_param_file_name, const bool write_binary_data)
 Write out the parameter ranges to files. More...
 
void read_parameter_data_from_files (const std::string &continuous_param_file_name, const std::string &discrete_param_file_name, const bool read_binary_data)
 Read in the parameter ranges from files. More...
 
bool is_discrete_parameter (const std::string &mu_name) const
 Is parameter mu_name discrete? More...
 
const std::map< std::string, std::vector< Real > > & get_discrete_parameter_values () const
 Get a const reference to the discrete parameter values. More...
 
void print_discrete_parameter_values () const
 Print out all the discrete parameter values. More...
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 
Real get_delta_t () const
 Get/set delta_t, the time-step size. More...
 
void set_delta_t (const Real delta_t_in)
 
Real get_euler_theta () const
 Get/set euler_theta, parameter that determines the temporal discretization. More...
 
void set_euler_theta (const Real euler_theta_in)
 
unsigned int get_time_step () const
 Get/set the current time-step. More...
 
void set_time_step (const unsigned int k)
 
unsigned int get_n_time_steps () const
 Get/set the total number of time-steps. More...
 
void set_n_time_steps (const unsigned int K)
 
Real get_control (const unsigned int k) const
 Get/set the RHS control. More...
 
void set_control (const std::vector< Real > &control)
 
void process_temporal_parameters_file (const std::string &parameters_filename)
 Read in and initialize parameters from parameters_filename. More...
 
void pull_temporal_discretization_data (RBTemporalDiscretization &other)
 Pull the temporal discretization data from other. More...
 

Static Public Member Functions

static Real get_closest_value (Real value, const std::vector< Real > &list_of_values)
 
static std::string get_info ()
 Gets a string containing the reference information. More...
 
static void print_info (std::ostream &out=libMesh::out)
 Prints the reference information, by default to libMesh::out. More...
 
static unsigned int n_objects ()
 Prints the number of outstanding (created, but not yet destroyed) objects. More...
 
static void enable_print_counter_info ()
 Methods to enable/disable the reference counter output from print_info() More...
 
static void disable_print_counter_info ()
 

Public Attributes

DenseMatrix< NumberRB_L2_matrix
 Dense RB L2 matrix. More...
 
DenseMatrix< NumberRB_LHS_matrix
 Cached data for subsequent solves. More...
 
DenseMatrix< NumberRB_RHS_matrix
 
DenseVector< NumberRB_RHS_save
 
std::vector< DenseMatrix< Number > > RB_M_q_vector
 Dense matrices for the RB mass matrices. More...
 
std::vector< std::vector< Number > > RB_outputs_all_k
 The RB outputs for all time-levels from the most recent rb_solve. More...
 
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. More...
 
DenseVector< Numberold_RB_solution
 The RB solution at the previous time-level. More...
 
std::vector< DenseVector< Number > > RB_temporal_solution_data
 Array storing the solution data at each time level from the most recent solve. More...
 
std::vector< Realerror_bound_all_k
 The error bound data for all time-levels from the most recent rb_solve. More...
 
std::vector< Realinitial_L2_error_all_N
 Vector storing initial L2 error for all 1 <= N <= RB_size. More...
 
std::vector< DenseVector< Number > > RB_initial_condition_all_N
 The RB initial conditions (i.e. More...
 
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. More...
 
std::vector< std::vector< std::vector< Number > > > Mq_Mq_representor_innerprods
 
std::vector< std::vector< std::vector< std::vector< Number > > > > Aq_Mq_representor_innerprods
 
Number cached_Fq_term
 Cached residual terms. More...
 
DenseVector< Numbercached_Fq_Aq_vector
 
DenseMatrix< Numbercached_Aq_Aq_matrix
 
DenseVector< Numbercached_Fq_Mq_vector
 
DenseMatrix< Numbercached_Aq_Mq_matrix
 
DenseMatrix< Numbercached_Mq_Mq_matrix
 
std::vector< std::vector< std::unique_ptr< NumericVector< Number > > > > M_q_representor
 Vector storing the mass matrix representors. More...
 
bool _rb_solve_data_cached
 Check that the data has been cached in case of using rb_solve_again. More...
 
std::vector< std::unique_ptr< NumericVector< Number > > > basis_functions
 The libMesh vectors storing the finite element coefficients of the RB basis functions. More...
 
std::vector< RBParametersgreedy_param_list
 The list of parameters selected by the Greedy algorithm in generating the Reduced Basis associated with this RBEvaluation object. More...
 
DenseMatrix< NumberRB_inner_product_matrix
 The inner product matrix. More...
 
std::vector< DenseMatrix< Number > > RB_Aq_vector
 Dense matrices for the RB computations. More...
 
std::vector< DenseVector< Number > > RB_Fq_vector
 Dense vector for the RHS. More...
 
DenseVector< NumberRB_solution
 The RB solution vector. More...
 
std::vector< std::vector< DenseVector< Number > > > RB_output_vectors
 The vectors storing the RB output vectors. More...
 
std::vector< NumberRB_outputs
 The vectors storing the RB output values and corresponding error bounds. More...
 
std::vector< RealRB_output_error_bounds
 
std::vector< NumberFq_representor_innerprods
 Vectors storing the residual representor inner products to be used in computing the residuals online. More...
 
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. More...
 
std::vector< std::vector< std::vector< Number > > > Aq_Aq_representor_innerprods
 
std::vector< std::vector< Number > > output_dual_innerprods
 The vector storing the dual norm inner product terms for each output. More...
 
std::vector< std::vector< std::unique_ptr< NumericVector< Number > > > > Aq_representor
 Vector storing the residual representors associated with the left-hand side. More...
 
bool evaluate_RB_error_bound
 Boolean to indicate whether we evaluate a posteriori error bounds when rb_solve is called. More...
 
bool compute_RB_inner_product
 Boolean flag to indicate whether we compute the RB_inner_product_matrix. More...
 
bool verbose_mode
 Public boolean to toggle verbose mode. More...
 

Protected Types

typedef std::map< std::string, std::pair< unsigned int, unsigned int > > Counts
 Data structure to log the information. More...
 

Protected Member Functions

void assert_file_exists (const std::string &file_name)
 Helper function that checks if file_name exists. More...
 
void increment_constructor_count (const std::string &name)
 Increments the construction counter. More...
 
void increment_destructor_count (const std::string &name)
 Increments the destruction counter. More...
 

Protected Attributes

const Parallel::Communicator & _communicator
 

Static Protected Attributes

static Counts _counts
 Actually holds the data. More...
 
static Threads::atomic< unsigned int_n_objects
 The number of objects. More...
 
static Threads::spin_mutex _mutex
 Mutual exclusion object to enable thread-safe reference counting. More...
 
static bool _enable_print_counter = true
 Flag to control whether reference count information is printed when print_info is called. More...
 

Private Member Functions

void write_parameter_ranges_to_file (const std::string &file_name, const bool write_binary)
 Write out the parameter ranges to file. More...
 
void write_discrete_parameter_values_to_file (const std::string &file_name, const bool write_binary_data)
 Write out the discrete parameter values to file. More...
 
void read_parameter_ranges_from_file (const std::string &file_name, const bool read_binary, RBParameters &param_min, RBParameters &param_max)
 Read in the parameter ranges from file. More...
 
void read_discrete_parameter_values_from_file (const std::string &file_name, const bool read_binary_data, std::map< std::string, std::vector< Real >> &discrete_parameter_values_in)
 Read in the discrete parameter values from file, if we have any. More...
 
bool valid_params (const RBParameters &params)
 Helper function to check that params is valid. More...
 

Static Private Member Functions

static bool is_value_in_list (Real value, const std::vector< Real > &list_of_values, Real tol)
 Helper function to check if the specified value is in the list of values (within a tolerance given by tol). More...
 

Private Attributes

RBThetaExpansionrb_theta_expansion
 A pointer to to the object that stores the theta expansion. More...
 
bool parameters_initialized
 Flag indicating whether the parameters have been initialized. More...
 
RBParameters parameters
 Vector storing the current parameters. More...
 
RBParameters parameters_min
 Vectors that define the ranges (min and max) for the parameters. More...
 
RBParameters parameters_max
 
std::map< std::string, std::vector< Real > > _discrete_parameter_values
 Map that defines the allowable values of any discrete parameters. More...
 
Real _delta_t
 The time-step size. More...
 
Real _euler_theta
 The parameter that determines the generalized Euler scheme discretization that we employ. More...
 
unsigned int _current_time_step
 The current time-step. More...
 
unsigned int _n_time_steps
 The number of time-steps. More...
 
std::vector< Real_control
 The RHS control (scalar function of time). More...
 

Detailed Description

This class is part of the rbOOmit framework.

TransientRBEvaluation extends RBEvaluation to encapsulate the code and data required to perform "online" RB evaluations for Linear Time Invariant (LTI) transient problems.

We can handle time controls on the RHS as h(t)*f(x, \( \mu \)). See Martin Grepl's thesis for more details.

Author
David J. Knezevic
Date
2011

Definition at line 50 of file transient_rb_evaluation.h.

Member Typedef Documentation

◆ Counts

typedef std::map<std::string, std::pair<unsigned int, unsigned int> > libMesh::ReferenceCounter::Counts
protectedinherited

Data structure to log the information.

The log is identified by the class name.

Definition at line 117 of file reference_counter.h.

◆ Parent

The type of the parent.

Definition at line 67 of file transient_rb_evaluation.h.

Constructor & Destructor Documentation

◆ TransientRBEvaluation()

TransientRBEvaluation::TransientRBEvaluation ( const Parallel::Communicator &  comm_in)

Constructor.

Definition at line 39 of file transient_rb_evaluation.C.

39  :
40  RBEvaluation(comm_in),
42 {
43  // Indicate that we need to compute the RB
44  // inner product matrix in this case
46 }

References libMesh::RBEvaluation::compute_RB_inner_product.

◆ ~TransientRBEvaluation()

TransientRBEvaluation::~TransientRBEvaluation ( )

Destructor.

Definition at line 48 of file transient_rb_evaluation.C.

49 {
50  clear();
51 }

References clear().

Member Function Documentation

◆ assert_file_exists()

void libMesh::RBEvaluation::assert_file_exists ( const std::string &  file_name)
protectedinherited

Helper function that checks if file_name exists.

Definition at line 874 of file rb_evaluation.C.

875 {
876  if (!std::ifstream(file_name.c_str()))
877  libmesh_error_msg("File missing: " + file_name);
878 }

Referenced by legacy_read_offline_data_from_files(), libMesh::RBEIMEvaluation::legacy_read_offline_data_from_files(), libMesh::RBEvaluation::legacy_read_offline_data_from_files(), and libMesh::RBEvaluation::read_in_vectors_from_multiple_files().

◆ cache_online_residual_terms()

void TransientRBEvaluation::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.

(This is only useful when the parameter is fixed in time.)

Definition at line 420 of file transient_rb_evaluation.C.

421 {
422  LOG_SCOPE("cache_online_residual_terms()", "TransientRBEvaluation");
423 
424  const RBParameters mu = get_parameters();
425 
426  TransientRBThetaExpansion & trans_theta_expansion =
427  cast_ref<TransientRBThetaExpansion &>(get_rb_theta_expansion());
428  const unsigned int Q_m = trans_theta_expansion.get_n_M_terms();
429  const unsigned int Q_a = trans_theta_expansion.get_n_A_terms();
430  const unsigned int Q_f = trans_theta_expansion.get_n_F_terms();
431 
432  cached_Fq_term = 0.;
433  unsigned int q=0;
434  for (unsigned int q_f1=0; q_f1<Q_f; q_f1++)
435  {
436  Number cached_theta_q_f1 = trans_theta_expansion.eval_F_theta(q_f1,mu);
437  for (unsigned int q_f2=q_f1; q_f2<Q_f; q_f2++)
438  {
439  Real delta = (q_f1==q_f2) ? 1. : 2.;
440  cached_Fq_term += delta*cached_theta_q_f1*trans_theta_expansion.eval_F_theta(q_f2,mu) *
442 
443  q++;
444  }
445  }
446 
448  for (unsigned int q_f=0; q_f<Q_f; q_f++)
449  {
450  Number cached_theta_q_f = trans_theta_expansion.eval_F_theta(q_f,mu);
451  for (unsigned int q_a=0; q_a<Q_a; q_a++)
452  {
453  Number cached_theta_q_a = trans_theta_expansion.eval_A_theta(q_a,mu);
454  for (unsigned int i=0; i<N; i++)
455  {
456  cached_Fq_Aq_vector(i) += 2.*cached_theta_q_f*cached_theta_q_a*
457  Fq_Aq_representor_innerprods[q_f][q_a][i];
458  }
459  }
460  }
461 
463  q=0;
464  for (unsigned int q_a1=0; q_a1<Q_a; q_a1++)
465  {
466  Number cached_theta_q_a1 = trans_theta_expansion.eval_A_theta(q_a1,mu);
467  for (unsigned int q_a2=q_a1; q_a2<Q_a; q_a2++)
468  {
469  Number cached_theta_q_a2 = trans_theta_expansion.eval_A_theta(q_a2,mu);
470  Real delta = (q_a1==q_a2) ? 1. : 2.;
471 
472  for (unsigned int i=0; i<N; i++)
473  {
474  for (unsigned int j=0; j<N; j++)
475  {
476  cached_Aq_Aq_matrix(i,j) += delta*
477  cached_theta_q_a1*cached_theta_q_a2*
479  }
480  }
481  q++;
482  }
483  }
484 
486  for (unsigned int q_f=0; q_f<Q_f; q_f++)
487  {
488  Number cached_theta_q_f = trans_theta_expansion.eval_F_theta(q_f,mu);
489  for (unsigned int q_m=0; q_m<Q_m; q_m++)
490  {
491  Number cached_theta_q_m = trans_theta_expansion.eval_M_theta(q_m,mu);
492  for (unsigned int i=0; i<N; i++)
493  {
494  cached_Fq_Mq_vector(i) += 2.*cached_theta_q_f * cached_theta_q_m * Fq_Mq_representor_innerprods[q_f][q_m][i];
495  }
496  }
497  }
498 
500  for (unsigned int q_a=0; q_a<Q_a; q_a++)
501  {
502  Number cached_theta_q_a = trans_theta_expansion.eval_A_theta(q_a,mu);
503 
504  for (unsigned int q_m=0; q_m<Q_m; q_m++)
505  {
506  Number cached_theta_q_m = trans_theta_expansion.eval_M_theta(q_m,mu);
507 
508  for (unsigned int i=0; i<N; i++)
509  {
510  for (unsigned int j=0; j<N; j++)
511  {
512  cached_Aq_Mq_matrix(i,j) += 2.*cached_theta_q_a*cached_theta_q_m*Aq_Mq_representor_innerprods[q_a][q_m][i][j];
513  }
514  }
515  }
516  }
517 
519  q=0;
520  for (unsigned int q_m1=0; q_m1<Q_m; q_m1++)
521  {
522  Number cached_theta_q_m1 = trans_theta_expansion.eval_M_theta(q_m1,mu);
523  for (unsigned int q_m2=q_m1; q_m2<Q_m; q_m2++)
524  {
525  Number cached_theta_q_m2 = trans_theta_expansion.eval_M_theta(q_m2,mu);
526  Real delta = (q_m1==q_m2) ? 1. : 2.;
527 
528  for (unsigned int i=0; i<N; i++)
529  {
530  for (unsigned int j=0; j<N; j++)
531  {
532  cached_Mq_Mq_matrix(i,j) += delta*
533  cached_theta_q_m1*cached_theta_q_m2*
535  }
536  }
537  q++;
538  }
539  }
540 }

References libMesh::RBEvaluation::Aq_Aq_representor_innerprods, Aq_Mq_representor_innerprods, cached_Aq_Aq_matrix, cached_Aq_Mq_matrix, cached_Fq_Aq_vector, cached_Fq_Mq_vector, cached_Fq_term, cached_Mq_Mq_matrix, libMesh::RBThetaExpansion::eval_A_theta(), libMesh::RBThetaExpansion::eval_F_theta(), libMesh::TransientRBThetaExpansion::eval_M_theta(), libMesh::RBEvaluation::Fq_Aq_representor_innerprods, Fq_Mq_representor_innerprods, libMesh::RBEvaluation::Fq_representor_innerprods, libMesh::RBThetaExpansion::get_n_A_terms(), libMesh::RBThetaExpansion::get_n_F_terms(), libMesh::TransientRBThetaExpansion::get_n_M_terms(), libMesh::RBParametrized::get_parameters(), libMesh::RBEvaluation::get_rb_theta_expansion(), Mq_Mq_representor_innerprods, libMesh::Real, libMesh::DenseVector< T >::resize(), and libMesh::DenseMatrix< T >::resize().

Referenced by rb_solve().

◆ clear()

void TransientRBEvaluation::clear ( )
overridevirtual

Clear this TransientRBEvaluation object.

Override to also clear the M_q representors

Reimplemented from libMesh::RBEvaluation.

Definition at line 53 of file transient_rb_evaluation.C.

54 {
55  Parent::clear();
56 
58 }

References libMesh::RBEvaluation::clear(), and clear_riesz_representors().

Referenced by ~TransientRBEvaluation().

◆ clear_riesz_representors()

void TransientRBEvaluation::clear_riesz_representors ( )
overridevirtual

Clear all the Riesz representors that are used to compute the RB residual (and hence error bound).

This is useful since once we complete the Greedy we may not need the representors any more. Override to clear the M_q representors.

Reimplemented from libMesh::RBEvaluation.

Definition at line 60 of file transient_rb_evaluation.C.

61 {
63 
64  // Delete the M_q representors
65  M_q_representor.clear();
66 }

References libMesh::RBEvaluation::clear_riesz_representors(), and M_q_representor.

Referenced by clear().

◆ comm()

const Parallel::Communicator& libMesh::ParallelObject::comm ( ) const
inlineinherited
Returns
A reference to the Parallel::Communicator object used by this mesh.

Definition at line 94 of file parallel_object.h.

95  { return _communicator; }

References libMesh::ParallelObject::_communicator.

Referenced by libMesh::__libmesh_petsc_diff_solver_jacobian(), libMesh::__libmesh_petsc_diff_solver_monitor(), libMesh::__libmesh_petsc_diff_solver_residual(), libMesh::__libmesh_tao_equality_constraints(), libMesh::__libmesh_tao_equality_constraints_jacobian(), libMesh::__libmesh_tao_gradient(), libMesh::__libmesh_tao_hessian(), libMesh::__libmesh_tao_inequality_constraints(), libMesh::__libmesh_tao_inequality_constraints_jacobian(), libMesh::__libmesh_tao_objective(), libMesh::MeshRefinement::_coarsen_elements(), libMesh::ExactSolution::_compute_error(), libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::PetscLinearSolver< Number >::_petsc_shell_matrix_get_diagonal(), libMesh::SlepcEigenSolver< libMesh::Number >::_petsc_shell_matrix_get_diagonal(), libMesh::PetscLinearSolver< Number >::_petsc_shell_matrix_mult(), libMesh::SlepcEigenSolver< libMesh::Number >::_petsc_shell_matrix_mult(), libMesh::PetscLinearSolver< Number >::_petsc_shell_matrix_mult_add(), libMesh::EquationSystems::_read_impl(), libMesh::MeshRefinement::_refine_elements(), libMesh::MeshRefinement::_smooth_flags(), libMesh::DofMap::add_constraints_to_send_list(), add_cube_convex_hull_to_mesh(), libMesh::PetscDMWrapper::add_dofs_helper(), libMesh::PetscDMWrapper::add_dofs_to_section(), libMesh::TransientRBConstruction::add_IC_to_RB_space(), libMesh::ImplicitSystem::add_matrix(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::DynaIO::add_spline_constraints(), libMesh::System::add_vector(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::LaplaceMeshSmoother::allgather_graph(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::TransientRBConstruction::allocate_data_structures(), libMesh::RBConstruction::allocate_data_structures(), libMesh::TransientRBConstruction::assemble_affine_expansion(), libMesh::FEMSystem::assemble_qoi(), libMesh::MeshCommunication::assign_global_indices(), libMesh::DofMap::attach_matrix(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::EquationSystems::build_parallel_elemental_solution_vector(), libMesh::EquationSystems::build_parallel_solution_vector(), libMesh::PetscDMWrapper::build_section(), libMesh::PetscDMWrapper::build_sf(), libMesh::System::calculate_norm(), libMesh::DofMap::check_dirichlet_bcid_consistency(), libMesh::RBConstruction::compute_Fq_representor_innerprods(), libMesh::RBConstruction::compute_max_error_bound(), libMesh::Nemesis_IO_Helper::compute_num_global_elem_blocks(), libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), libMesh::RBConstruction::compute_output_dual_innerprods(), libMesh::RBConstruction::compute_residual_dual_norm_slow(), libMesh::RBSCMConstruction::compute_SCM_bounds_on_training_set(), libMesh::Problem_Interface::computeF(), libMesh::Problem_Interface::computeJacobian(), libMesh::Problem_Interface::computePreconditioner(), libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::ExodusII_IO::copy_scalar_solution(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::MeshTools::create_bounding_box(), libMesh::DofMap::create_dof_constraints(), libMesh::MeshTools::create_nodal_bounding_box(), libMesh::MeshRefinement::create_parent_error_vector(), libMesh::MeshTools::create_processor_bounding_box(), libMesh::MeshTools::create_subdomain_bounding_box(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::DofMap::distribute_dofs(), DMlibMeshFunction(), DMlibMeshJacobian(), DMlibMeshSetSystem_libMesh(), DMVariableBounds_libMesh(), libMesh::DTKSolutionTransfer::DTKSolutionTransfer(), libMesh::MeshRefinement::eliminate_unrefined_patches(), libMesh::RBEIMConstruction::enrich_RB_space(), libMesh::TransientRBConstruction::enrich_RB_space(), libMesh::RBConstruction::enrich_RB_space(), libMesh::EpetraVector< T >::EpetraVector(), AssembleOptimization::equality_constraints(), libMesh::WeightedPatchRecoveryErrorEstimator::estimate_error(), libMesh::PatchRecoveryErrorEstimator::estimate_error(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::RBEIMConstruction::evaluate_mesh_function(), libMesh::MeshRefinement::flag_elements_by_elem_fraction(), libMesh::MeshRefinement::flag_elements_by_error_fraction(), libMesh::MeshRefinement::flag_elements_by_error_tolerance(), libMesh::MeshRefinement::flag_elements_by_mean_stddev(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::DofMap::gather_constraints(), libMesh::MeshfreeInterpolation::gather_remote_data(), libMesh::CondensedEigenSystem::get_eigenpair(), libMesh::DofMap::get_info(), libMesh::ImplicitSystem::get_linear_solver(), AssembleOptimization::inequality_constraints(), AssembleOptimization::inequality_constraints_jacobian(), libMesh::LocationMap< T >::init(), libMesh::TimeSolver::init(), libMesh::SystemSubsetBySubdomain::init(), libMesh::PetscDMWrapper::init_and_attach_petscdm(), libMesh::EigenSystem::init_matrices(), libMesh::OptimizationSystem::initialize_equality_constraints_storage(), libMesh::OptimizationSystem::initialize_inequality_constraints_storage(), libMesh::RBEIMConstruction::initialize_rb_construction(), integrate_function(), libMesh::MeshTools::libmesh_assert_consistent_distributed(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::MeshTools::libmesh_assert_contiguous_dof_ids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_new_node_procids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_valid_boundary_ids(), libMesh::MeshTools::libmesh_assert_valid_dof_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_flags(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_p_levels(), libMesh::MeshTools::libmesh_assert_valid_refinement_flags(), libMesh::MeshTools::libmesh_assert_valid_unique_ids(), libMesh::libmesh_petsc_preconditioner_apply(), libMesh::libmesh_petsc_snes_fd_residual(), libMesh::libmesh_petsc_snes_jacobian(), libMesh::libmesh_petsc_snes_mffd_residual(), libMesh::libmesh_petsc_snes_postcheck(), libMesh::libmesh_petsc_snes_residual(), libMesh::libmesh_petsc_snes_residual_helper(), libMesh::MeshRefinement::limit_level_mismatch_at_edge(), libMesh::MeshRefinement::limit_level_mismatch_at_node(), libMesh::MeshRefinement::limit_overrefined_boundary(), libMesh::MeshRefinement::limit_underrefined_boundary(), main(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshCommunication::make_elems_parallel_consistent(), libMesh::MeshRefinement::make_flags_parallel_consistent(), libMesh::MeshCommunication::make_new_node_proc_ids_parallel_consistent(), libMesh::MeshCommunication::make_new_nodes_parallel_consistent(), libMesh::MeshCommunication::make_node_ids_parallel_consistent(), libMesh::MeshCommunication::make_node_proc_ids_parallel_consistent(), libMesh::MeshCommunication::make_node_unique_ids_parallel_consistent(), libMesh::MeshCommunication::make_nodes_parallel_consistent(), libMesh::MeshCommunication::make_p_levels_parallel_consistent(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::TransientRBConstruction::mass_matrix_scaled_matvec(), libMesh::FEMSystem::mesh_position_set(), LinearElasticityWithContact::move_mesh(), libMesh::DistributedMesh::n_active_elem(), libMesh::MeshTools::n_active_levels(), libMesh::BoundaryInfo::n_boundary_conds(), libMesh::DofMap::n_constrained_dofs(), libMesh::BoundaryInfo::n_edge_conds(), libMesh::CondensedEigenSystem::n_global_non_condensed_dofs(), libMesh::MeshTools::n_levels(), libMesh::BoundaryInfo::n_nodeset_conds(), libMesh::MeshTools::n_p_levels(), libMesh::BoundaryInfo::n_shellface_conds(), libMesh::DistributedMesh::parallel_max_elem_id(), libMesh::DistributedMesh::parallel_max_node_id(), libMesh::ReplicatedMesh::parallel_max_unique_id(), libMesh::DistributedMesh::parallel_max_unique_id(), libMesh::DistributedMesh::parallel_n_elem(), libMesh::DistributedMesh::parallel_n_nodes(), libMesh::SparsityPattern::Build::parallel_sync(), libMesh::MeshTools::paranoid_n_levels(), libMesh::petsc_auto_fieldsplit(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::DofMap::print_dof_constraints(), FEMParameters::read(), libMesh::Nemesis_IO::read(), libMesh::XdrIO::read(), libMesh::CheckpointIO::read_header(), libMesh::XdrIO::read_header(), libMesh::System::read_header(), libMesh::RBEvaluation::read_in_vectors_from_multiple_files(), libMesh::System::read_legacy_data(), libMesh::TransientRBConstruction::read_riesz_representors_from_files(), libMesh::RBConstruction::read_riesz_representors_from_files(), libMesh::System::read_SCALAR_dofs(), libMesh::XdrIO::read_serialized_bc_names(), libMesh::XdrIO::read_serialized_bcs_helper(), libMesh::System::read_serialized_blocked_dof_objects(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::XdrIO::read_serialized_nodes(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::XdrIO::read_serialized_subdomain_names(), libMesh::System::read_serialized_vector(), libMesh::MeshRefinement::refine_and_coarsen_elements(), libMesh::DistributedMesh::renumber_dof_objects(), LinearElasticityWithContact::residual_and_jacobian(), OverlappingAlgebraicGhostingTest::run_ghosting_test(), OverlappingCouplingGhostingTest::run_sparsity_pattern_test(), libMesh::DofMap::scatter_constraints(), libMesh::CheckpointIO::select_split_config(), libMesh::TransientRBConstruction::set_error_temporal_data(), libMesh::RBEIMConstruction::set_explicit_sys_subvector(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::PetscDMWrapper::set_point_range_in_section(), libMesh::PetscDiffSolver::setup_petsc_data(), libMesh::LaplaceMeshSmoother::smooth(), libMesh::split_mesh(), libMesh::BoundaryInfo::sync(), libMesh::MeshRefinement::test_level_one(), MeshfunctionDFEM::test_mesh_function_dfem(), MeshfunctionDFEM::test_mesh_function_dfem_grad(), MeshFunctionTest::test_p_level(), libMesh::MeshRefinement::test_unflagged(), SystemsTest::testBlockRestrictedVarNDofs(), PointLocatorTest::testLocator(), BoundaryInfoTest::testMesh(), SystemsTest::testProjectCubeWithMeshFunction(), CheckpointIOTest::testSplitter(), libMesh::MeshTools::total_weight(), libMesh::MeshFunctionSolutionTransfer::transfer(), libMesh::MeshfreeSolutionTransfer::transfer(), libMesh::TransientRBConstruction::truth_assembly(), libMesh::RBConstruction::truth_assembly(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::TransientRBConstruction::update_RB_initial_condition_all_N(), libMesh::RBEIMConstruction::update_RB_system_matrices(), libMesh::TransientRBConstruction::update_RB_system_matrices(), libMesh::RBConstruction::update_RB_system_matrices(), libMesh::TransientRBConstruction::update_residual_terms(), libMesh::RBConstruction::update_residual_terms(), libMesh::NameBasedIO::write(), libMesh::XdrIO::write(), libMesh::VTKIO::write_nodal_data(), libMesh::RBEvaluation::write_out_vectors(), libMesh::TransientRBConstruction::write_riesz_representors_to_files(), libMesh::RBConstruction::write_riesz_representors_to_files(), libMesh::System::write_SCALAR_dofs(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::System::write_serialized_blocked_dof_objects(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), libMesh::XdrIO::write_serialized_nodesets(), libMesh::RBDataSerialization::RBEvaluationSerialization::write_to_file(), libMesh::RBDataSerialization::TransientRBEvaluationSerialization::write_to_file(), libMesh::RBDataSerialization::RBEIMEvaluationSerialization::write_to_file(), and libMesh::RBDataSerialization::RBSCMEvaluationSerialization::write_to_file().

◆ compute_residual_dual_norm()

Real TransientRBEvaluation::compute_residual_dual_norm ( const unsigned int  N)
overridevirtual

Compute the dual norm of the residual for the solution saved in RB_solution.

This function uses the cached time-independent data.

Reimplemented from libMesh::RBEvaluation.

Definition at line 542 of file transient_rb_evaluation.C.

543 {
544  LOG_SCOPE("compute_residual_dual_norm()", "TransientRBEvaluation");
545 
546  // This assembly assumes we have already called cache_online_residual_terms
547  // and that the rb_solve parameter is constant in time
548 
549  const Real dt = get_delta_t();
550  const Real euler_theta = get_euler_theta();
551  const Real current_control = get_control(get_time_step());
552 
553  DenseVector<Number> RB_u_euler_theta(N);
554  DenseVector<Number> mass_coeffs(N);
555  for (unsigned int i=0; i<N; i++)
556  {
557  RB_u_euler_theta(i) = euler_theta*RB_solution(i) +
558  (1.-euler_theta)*old_RB_solution(i);
559  mass_coeffs(i) = -(RB_solution(i) - old_RB_solution(i))/dt;
560  }
561 
562  Number residual_norm_sq = current_control*current_control*cached_Fq_term;
563 
564  residual_norm_sq += current_control*RB_u_euler_theta.dot(cached_Fq_Aq_vector);
565  residual_norm_sq += current_control*mass_coeffs.dot(cached_Fq_Mq_vector);
566 
567  for (unsigned int i=0; i<N; i++)
568  for (unsigned int j=0; j<N; j++)
569  {
570  residual_norm_sq += RB_u_euler_theta(i)*RB_u_euler_theta(j)*cached_Aq_Aq_matrix(i,j);
571  residual_norm_sq += mass_coeffs(i)*mass_coeffs(j)*cached_Mq_Mq_matrix(i,j);
572  residual_norm_sq += RB_u_euler_theta(i)*mass_coeffs(j)*cached_Aq_Mq_matrix(i,j);
573  }
574 
575 
576  if (libmesh_real(residual_norm_sq) < 0)
577  {
578  libMesh::out << "Warning: Square of residual norm is negative "
579  << "in TransientRBEvaluation::compute_residual_dual_norm()" << std::endl;
580 
581  // Sometimes this is negative due to rounding error,
582  // but error is on the order of 1.e-10, so shouldn't
583  // affect result
584  residual_norm_sq = std::abs(residual_norm_sq);
585  }
586 
587  return libmesh_real(std::sqrt( residual_norm_sq ));
588 }

References std::abs(), cached_Aq_Aq_matrix, cached_Aq_Mq_matrix, cached_Fq_Aq_vector, cached_Fq_Mq_vector, cached_Fq_term, cached_Mq_Mq_matrix, libMesh::DenseVector< T >::dot(), libMesh::RBTemporalDiscretization::get_control(), libMesh::RBTemporalDiscretization::get_delta_t(), libMesh::RBTemporalDiscretization::get_euler_theta(), libMesh::RBTemporalDiscretization::get_time_step(), libMesh::libmesh_real(), old_RB_solution, libMesh::out, libMesh::RBEvaluation::RB_solution, libMesh::Real, and std::sqrt().

Referenced by rb_solve().

◆ disable_print_counter_info()

void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 106 of file reference_counter.C.

107 {
108  _enable_print_counter = false;
109  return;
110 }

References libMesh::ReferenceCounter::_enable_print_counter.

Referenced by libMesh::LibMeshInit::LibMeshInit().

◆ enable_print_counter_info()

void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

Methods to enable/disable the reference counter output from print_info()

Definition at line 100 of file reference_counter.C.

101 {
102  _enable_print_counter = true;
103  return;
104 }

References libMesh::ReferenceCounter::_enable_print_counter.

◆ eval_output_dual_norm()

Real libMesh::RBEvaluation::eval_output_dual_norm ( unsigned int  n,
const RBParameters mu 
)
inherited

Evaluate the dual norm of output n for the current parameters.

Definition at line 392 of file rb_evaluation.C.

393 {
394  Number output_bound_sq = 0.;
395  unsigned int q=0;
396  for (unsigned int q_l1=0; q_l1<rb_theta_expansion->get_n_output_terms(n); q_l1++)
397  {
398  for (unsigned int q_l2=q_l1; q_l2<rb_theta_expansion->get_n_output_terms(n); q_l2++)
399  {
400  Real delta = (q_l1==q_l2) ? 1. : 2.;
401  output_bound_sq += delta * libmesh_real(
404  q++;
405  }
406  }
407 
408  return libmesh_real(std::sqrt( output_bound_sq ));
409 }

References libMesh::RBThetaExpansion::eval_output_theta(), libMesh::RBThetaExpansion::get_n_output_terms(), libMesh::libmesh_conj(), libMesh::libmesh_real(), libMesh::RBEvaluation::output_dual_innerprods, libMesh::RBEvaluation::rb_theta_expansion, libMesh::Real, and std::sqrt().

Referenced by rb_solve(), and libMesh::RBEvaluation::rb_solve().

◆ get_basis_function()

NumericVector< Number > & libMesh::RBEvaluation::get_basis_function ( unsigned int  i)
inherited

◆ get_closest_value()

Real libMesh::RBParametrized::get_closest_value ( Real  value,
const std::vector< Real > &  list_of_values 
)
staticinherited
Returns
The closest entry to value from list_of_values.

Definition at line 433 of file rb_parametrized.C.

434 {
435  if (list_of_values.empty())
436  libmesh_error_msg("Error: list_of_values is empty.");
437 
438  Real min_distance = std::numeric_limits<Real>::max();
439  Real closest_val = 0.;
440  for (const auto & current_value : list_of_values)
441  {
442  Real distance = std::abs(value - current_value);
443  if (distance < min_distance)
444  {
445  min_distance = distance;
446  closest_val = current_value;
447  }
448  }
449 
450  return closest_val;
451 }

References std::abs(), distance(), libMesh::Real, and value.

Referenced by libMesh::RBParametrized::is_value_in_list().

◆ get_control()

Real libMesh::RBTemporalDiscretization::get_control ( const unsigned int  k) const
inherited

Get/set the RHS control.

Definition at line 79 of file rb_temporal_discretization.C.

80 {
81  libmesh_assert_less_equal (k, get_n_time_steps());
82  return _control[k];
83 }

References libMesh::RBTemporalDiscretization::_control, and libMesh::RBTemporalDiscretization::get_n_time_steps().

Referenced by compute_residual_dual_norm(), rb_solve(), rb_solve_again(), and libMesh::TransientRBConstruction::truth_assembly().

◆ get_delta_t()

Real libMesh::RBTemporalDiscretization::get_delta_t ( ) const
inherited

◆ get_discrete_parameter_values()

const std::map< std::string, std::vector< Real > > & libMesh::RBParametrized::get_discrete_parameter_values ( ) const
inherited

◆ get_error_bound_normalization()

Real TransientRBEvaluation::get_error_bound_normalization ( )
overridevirtual
Returns
A scaling factor that we can use to provide a consistent scaling of the RB error bound across different parameter values.

Reimplemented from libMesh::RBEvaluation.

Definition at line 406 of file transient_rb_evaluation.C.

407 {
408  // Just set the normalization factor to 1 in this case.
409  // Users can override this method if specific behavior
410  // is required.
411 
412  return 1.;
413 }

◆ get_euler_theta()

Real libMesh::RBTemporalDiscretization::get_euler_theta ( ) const
inherited

◆ get_info()

std::string libMesh::ReferenceCounter::get_info ( )
staticinherited

Gets a string containing the reference information.

Definition at line 47 of file reference_counter.C.

48 {
49 #if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
50 
51  std::ostringstream oss;
52 
53  oss << '\n'
54  << " ---------------------------------------------------------------------------- \n"
55  << "| Reference count information |\n"
56  << " ---------------------------------------------------------------------------- \n";
57 
58  for (const auto & pr : _counts)
59  {
60  const std::string name(pr.first);
61  const unsigned int creations = pr.second.first;
62  const unsigned int destructions = pr.second.second;
63 
64  oss << "| " << name << " reference count information:\n"
65  << "| Creations: " << creations << '\n'
66  << "| Destructions: " << destructions << '\n';
67  }
68 
69  oss << " ---------------------------------------------------------------------------- \n";
70 
71  return oss.str();
72 
73 #else
74 
75  return "";
76 
77 #endif
78 }

References libMesh::ReferenceCounter::_counts, and libMesh::Quality::name().

Referenced by libMesh::ReferenceCounter::print_info().

◆ get_n_basis_functions()

virtual unsigned int libMesh::RBEvaluation::get_n_basis_functions ( ) const
inlinevirtualinherited

Get the current number of basis functions.

Definition at line 145 of file rb_evaluation.h.

146  { return cast_int<unsigned int>(basis_functions.size()); }

References libMesh::RBEvaluation::basis_functions.

Referenced by libMesh::RBDataSerialization::add_rb_eim_evaluation_data_to_builder(), libMesh::RBDataSerialization::add_rb_evaluation_data_to_builder(), libMesh::RBDataSerialization::add_transient_rb_evaluation_data_to_builder(), libMesh::TransientRBConstruction::assemble_affine_expansion(), libMesh::RBEIMConstruction::compute_best_fit_error(), libMesh::RBEIMConstruction::enrich_RB_space(), libMesh::RBConstruction::enrich_RB_space(), libMesh::RBEIMTheta::evaluate(), libMesh::RBConstruction::greedy_termination_test(), libMesh::RBEIMConstruction::initialize_eim_assembly_objects(), libMesh::RBEIMEvaluation::initialize_eim_theta_objects(), libMesh::RBEIMEvaluation::legacy_read_in_interpolation_points_elem(), legacy_read_offline_data_from_files(), libMesh::RBEIMEvaluation::legacy_read_offline_data_from_files(), legacy_write_offline_data_to_files(), libMesh::RBEIMEvaluation::legacy_write_offline_data_to_files(), libMesh::RBEvaluation::legacy_write_offline_data_to_files(), libMesh::RBDataDeserialization::load_rb_eim_evaluation_data(), libMesh::RBEIMConstruction::load_rb_solution(), libMesh::RBConstruction::load_rb_solution(), libMesh::TransientRBConstruction::load_rb_solution(), libMesh::RBConstruction::print_basis_function_orthogonality(), rb_solve(), libMesh::RBEvaluation::rb_solve(), libMesh::RBEIMEvaluation::rb_solve(), libMesh::RBConstruction::read_riesz_representors_from_files(), libMesh::RBConstruction::recompute_all_residual_terms(), libMesh::RBEvaluation::resize_data_structures(), libMesh::TransientRBConstruction::set_error_temporal_data(), libMesh::RBConstruction::train_reduced_basis(), libMesh::TransientRBConstruction::update_RB_initial_condition_all_N(), libMesh::RBEIMConstruction::update_RB_system_matrices(), libMesh::TransientRBConstruction::update_RB_system_matrices(), libMesh::RBConstruction::update_RB_system_matrices(), libMesh::TransientRBConstruction::update_residual_terms(), libMesh::RBConstruction::update_residual_terms(), libMesh::TransientRBConstruction::write_riesz_representors_to_files(), and libMesh::RBConstruction::write_riesz_representors_to_files().

◆ get_n_continuous_params()

unsigned int libMesh::RBParametrized::get_n_continuous_params ( ) const
inherited

Get the number of continuous parameters.

Definition at line 125 of file rb_parametrized.C.

126 {
128  libmesh_error_msg("Error: parameters not initialized in RBParametrized::get_n_continuous_params");
129 
131 
132  return static_cast<unsigned int>(get_n_params() - get_n_discrete_params());
133 }

References libMesh::RBParametrized::get_n_discrete_params(), libMesh::RBParametrized::get_n_params(), libMesh::libmesh_assert(), and libMesh::RBParametrized::parameters_initialized.

Referenced by libMesh::RBDataSerialization::add_parameter_ranges_to_builder(), and libMesh::RBParametrized::write_parameter_ranges_to_file().

◆ get_n_discrete_params()

unsigned int libMesh::RBParametrized::get_n_discrete_params ( ) const
inherited

Get the number of discrete parameters.

Definition at line 135 of file rb_parametrized.C.

136 {
138  libmesh_error_msg("Error: parameters not initialized in RBParametrized::get_n_discrete_params");
139 
140  return cast_int<unsigned int>
142 }

References libMesh::RBParametrized::get_discrete_parameter_values(), and libMesh::RBParametrized::parameters_initialized.

Referenced by libMesh::RBDataSerialization::add_parameter_ranges_to_builder(), libMesh::RBParametrized::get_n_continuous_params(), and libMesh::RBParametrized::write_discrete_parameter_values_to_file().

◆ get_n_params()

unsigned int libMesh::RBParametrized::get_n_params ( ) const
inherited

◆ get_n_time_steps()

unsigned int libMesh::RBTemporalDiscretization::get_n_time_steps ( ) const
inherited

◆ get_parameter_max()

Real libMesh::RBParametrized::get_parameter_max ( const std::string &  param_name) const
inherited

Get maximum allowable value of parameter param_name.

Definition at line 198 of file rb_parametrized.C.

199 {
201  libmesh_error_msg("Error: parameters not initialized in RBParametrized::get_parameter_max");
202 
203  return parameters_max.get_value(param_name);
204 }

References libMesh::RBParameters::get_value(), libMesh::RBParametrized::parameters_initialized, and libMesh::RBParametrized::parameters_max.

Referenced by libMesh::RBSCMConstruction::print_info(), libMesh::RBConstruction::print_info(), and libMesh::RBParametrized::valid_params().

◆ get_parameter_min()

Real libMesh::RBParametrized::get_parameter_min ( const std::string &  param_name) const
inherited

Get minimum allowable value of parameter param_name.

Definition at line 190 of file rb_parametrized.C.

191 {
193  libmesh_error_msg("Error: parameters not initialized in RBParametrized::get_parameter_min");
194 
195  return parameters_min.get_value(param_name);
196 }

References libMesh::RBParameters::get_value(), libMesh::RBParametrized::parameters_initialized, and libMesh::RBParametrized::parameters_min.

Referenced by libMesh::RBSCMConstruction::print_info(), libMesh::RBConstruction::print_info(), and libMesh::RBParametrized::valid_params().

◆ get_parameter_names()

std::set< std::string > libMesh::RBParametrized::get_parameter_names ( ) const
inherited

Get a set that stores the parameter names.

Definition at line 144 of file rb_parametrized.C.

145 {
147  libmesh_error_msg("Error: parameters not initialized in RBParametrized::get_parameter_names");
148 
149  std::set<std::string> parameter_names;
150  parameters_min.get_parameter_names(parameter_names);
151 
152  return parameter_names;
153 }

References libMesh::RBParameters::get_parameter_names(), libMesh::RBParametrized::parameters_initialized, and libMesh::RBParametrized::parameters_min.

Referenced by libMesh::RBDataSerialization::add_parameter_ranges_to_builder().

◆ get_parameters()

const RBParameters & libMesh::RBParametrized::get_parameters ( ) const
inherited

Get the current parameters.

Definition at line 166 of file rb_parametrized.C.

167 {
169  libmesh_error_msg("Error: parameters not initialized in RBParametrized::get_current_parameters");
170 
171  return parameters;
172 }

References libMesh::RBParametrized::parameters, and libMesh::RBParametrized::parameters_initialized.

Referenced by libMesh::TransientRBConstruction::add_scaled_mass_matrix(), cache_online_residual_terms(), libMesh::RBEIMConstruction::compute_best_fit_error(), libMesh::RBEvaluation::compute_residual_dual_norm(), libMesh::RBSCMConstruction::compute_SCM_bounds_on_training_set(), libMesh::RBSCMConstruction::enrich_C_J(), libMesh::RBEIMConstruction::enrich_RB_space(), libMesh::RBEIMTheta::evaluate(), libMesh::RBEIMEvaluation::evaluate_parametrized_function(), libMesh::RBSCMConstruction::evaluate_stability_constant(), libMesh::RBConstruction::get_RB_error_bound(), libMesh::RBSCMEvaluation::get_SCM_LB(), libMesh::RBSCMEvaluation::get_SCM_UB(), SimpleRBEvaluation::get_stability_lower_bound(), libMesh::RBConstruction::greedy_termination_test(), libMesh::RBSCMEvaluation::legacy_read_offline_data_from_files(), libMesh::TransientRBConstruction::mass_matrix_scaled_matvec(), libMesh::RBSCMConstruction::print_info(), libMesh::RBConstruction::print_info(), libMesh::RBParametrized::print_parameters(), libMesh::RBSCMConstruction::process_parameters_file(), rb_solve(), libMesh::RBEvaluation::rb_solve(), libMesh::RBEIMEvaluation::rb_solve(), libMesh::RBSCMEvaluation::save_current_parameters(), libMesh::TransientRBConstruction::truth_assembly(), libMesh::RBConstruction::truth_assembly(), libMesh::TransientRBConstruction::truth_solve(), libMesh::RBEIMConstruction::truth_solve(), libMesh::RBConstruction::truth_solve(), uncached_compute_residual_dual_norm(), and libMesh::RBConstruction::update_greedy_param_list().

◆ get_parameters_max()

const RBParameters & libMesh::RBParametrized::get_parameters_max ( ) const
inherited

Get an RBParameters object that specifies the maximum allowable value for each parameter.

Definition at line 182 of file rb_parametrized.C.

183 {
185  libmesh_error_msg("Error: parameters not initialized in RBParametrized::get_parameters_max");
186 
187  return parameters_max;
188 }

References libMesh::RBParametrized::parameters_initialized, and libMesh::RBParametrized::parameters_max.

Referenced by libMesh::RBDataSerialization::add_parameter_ranges_to_builder(), libMesh::RBParametrized::initialize_parameters(), libMesh::RBSCMConstruction::process_parameters_file(), libMesh::RBConstruction::set_rb_construction_parameters(), and libMesh::RBParametrized::write_parameter_ranges_to_file().

◆ get_parameters_min()

const RBParameters & libMesh::RBParametrized::get_parameters_min ( ) const
inherited

Get an RBParameters object that specifies the minimum allowable value for each parameter.

Definition at line 174 of file rb_parametrized.C.

175 {
177  libmesh_error_msg("Error: parameters not initialized in RBParametrized::get_parameters_min");
178 
179  return parameters_min;
180 }

References libMesh::RBParametrized::parameters_initialized, and libMesh::RBParametrized::parameters_min.

Referenced by libMesh::RBDataSerialization::add_parameter_ranges_to_builder(), libMesh::RBParametrized::initialize_parameters(), libMesh::RBSCMConstruction::process_parameters_file(), libMesh::RBConstruction::set_rb_construction_parameters(), and libMesh::RBParametrized::write_parameter_ranges_to_file().

◆ get_rb_theta_expansion()

RBThetaExpansion & libMesh::RBEvaluation::get_rb_theta_expansion ( )
inherited

◆ get_stability_lower_bound()

Real libMesh::RBEvaluation::get_stability_lower_bound ( )
virtualinherited

Get a lower bound for the stability constant (e.g.

coercivity constant or inf-sup constant) at the current parameter value.

Reimplemented in SimpleRBEvaluation, SimpleRBEvaluation, SimpleRBEvaluation, SimpleRBEvaluation, SimpleRBEvaluation, and ElasticityRBEvaluation.

Definition at line 377 of file rb_evaluation.C.

378 {
379  // Return a default value of 1, this function should
380  // be overloaded to specify a problem-dependent stability
381  // factor lower bound
382  return 1.;
383 }

Referenced by rb_solve(), and libMesh::RBEvaluation::rb_solve().

◆ get_time_step()

unsigned int libMesh::RBTemporalDiscretization::get_time_step ( ) const
inherited

◆ increment_constructor_count()

void libMesh::ReferenceCounter::increment_constructor_count ( const std::string &  name)
inlineprotectedinherited

Increments the construction counter.

Should be called in the constructor of any derived class that will be reference counted.

Definition at line 181 of file reference_counter.h.

182 {
183  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
184  std::pair<unsigned int, unsigned int> & p = _counts[name];
185 
186  p.first++;
187 }

References libMesh::ReferenceCounter::_counts, libMesh::Quality::name(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCountedObject< RBParametrized >::ReferenceCountedObject().

◆ increment_destructor_count()

void libMesh::ReferenceCounter::increment_destructor_count ( const std::string &  name)
inlineprotectedinherited

Increments the destruction counter.

Should be called in the destructor of any derived class that will be reference counted.

Definition at line 194 of file reference_counter.h.

195 {
196  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
197  std::pair<unsigned int, unsigned int> & p = _counts[name];
198 
199  p.second++;
200 }

References libMesh::ReferenceCounter::_counts, libMesh::Quality::name(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCountedObject< RBParametrized >::~ReferenceCountedObject().

◆ initialize_parameters() [1/2]

void libMesh::RBParametrized::initialize_parameters ( const RBParameters mu_min_in,
const RBParameters mu_max_in,
const std::map< std::string, std::vector< Real >> &  discrete_parameter_values 
)
inherited

Initialize the parameter ranges and set current_parameters.

Definition at line 60 of file rb_parametrized.C.

63 {
64  // Check that the min/max vectors are valid
65  {
66  const std::string err_string = "Error: Invalid mu_min/mu_max in RBParameters constructor.";
67  bool valid_min_max = (mu_min_in.n_parameters() == mu_max_in.n_parameters());
68  if (!valid_min_max)
69  libmesh_error_msg(err_string);
70 
71  else
72  {
73  for (const auto & pr : mu_min_in)
74  {
75  const std::string & param_name = pr.first;
76  if (mu_min_in.get_value(param_name) > mu_max_in.get_value(param_name))
77  libmesh_error_msg(err_string);
78  }
79  }
80  }
81 
82  parameters_min = mu_min_in;
83  parameters_max = mu_max_in;
84 
85  // Add in min/max values due to the discrete parameters
86  for (const auto & pr : discrete_parameter_values)
87  {
88  if (pr.second.empty())
89  libmesh_error_msg("Error: List of discrete parameters for " << pr.first << " is empty.");
90 
91  Real min_val = *std::min_element(pr.second.begin(), pr.second.end());
92  Real max_val = *std::max_element(pr.second.begin(), pr.second.end());
93 
94  libmesh_assert_less_equal(min_val,max_val);
95 
96  parameters_min.set_value(pr.first, min_val);
97  parameters_max.set_value(pr.first, max_val);
98  }
99 
100  _discrete_parameter_values = discrete_parameter_values;
101 
102  parameters_initialized = true;
103 
104  // Initialize the current parameters to parameters_min
106 }

References libMesh::RBParametrized::_discrete_parameter_values, libMesh::RBParameters::get_value(), libMesh::RBParameters::n_parameters(), libMesh::RBParametrized::parameters_initialized, libMesh::RBParametrized::parameters_max, libMesh::RBParametrized::parameters_min, libMesh::Real, libMesh::RBParametrized::set_parameters(), and libMesh::RBParameters::set_value().

Referenced by libMesh::RBConstruction::enrich_basis_from_rhs_terms(), libMesh::RBParametrized::initialize_parameters(), libMesh::RBEIMConstruction::initialize_parametrized_functions_in_training_set(), libMesh::RBDataDeserialization::load_parameter_ranges(), libMesh::RBSCMConstruction::perform_SCM_greedy(), libMesh::RBSCMConstruction::process_parameters_file(), libMesh::RBParametrized::read_parameter_data_from_files(), libMesh::RBConstruction::set_rb_construction_parameters(), and libMesh::RBConstruction::train_reduced_basis().

◆ initialize_parameters() [2/2]

void libMesh::RBParametrized::initialize_parameters ( const RBParametrized rb_parametrized)
inherited

Initialize the parameter ranges and set current_parameters.

Definition at line 108 of file rb_parametrized.C.

109 {
110  initialize_parameters(rb_parametrized.get_parameters_min(),
111  rb_parametrized.get_parameters_max(),
112  rb_parametrized.get_discrete_parameter_values());
113 }

References libMesh::RBParametrized::get_discrete_parameter_values(), libMesh::RBParametrized::get_parameters_max(), libMesh::RBParametrized::get_parameters_min(), and libMesh::RBParametrized::initialize_parameters().

◆ is_discrete_parameter()

bool libMesh::RBParametrized::is_discrete_parameter ( const std::string &  mu_name) const
inherited

Is parameter mu_name discrete?

Definition at line 373 of file rb_parametrized.C.

374 {
376  libmesh_error_msg("Error: parameters not initialized in RBParametrized::is_discrete_parameter");
377 
378  return (_discrete_parameter_values.find(mu_name) != _discrete_parameter_values.end());
379 }

References libMesh::RBParametrized::_discrete_parameter_values, and libMesh::RBParametrized::parameters_initialized.

Referenced by libMesh::RBDataSerialization::add_parameter_ranges_to_builder(), libMesh::RBConstruction::print_info(), libMesh::RBParametrized::valid_params(), and libMesh::RBParametrized::write_parameter_ranges_to_file().

◆ is_rb_theta_expansion_initialized()

bool libMesh::RBEvaluation::is_rb_theta_expansion_initialized ( ) const
inherited
Returns
true if the theta expansion has been initialized.

Definition at line 96 of file rb_evaluation.C.

97 {
99  {
100  return true;
101  }
102  else
103  {
104  return false;
105  }
106 }

References libMesh::RBEvaluation::rb_theta_expansion.

Referenced by libMesh::RBEvaluation::get_rb_theta_expansion().

◆ is_value_in_list()

bool libMesh::RBParametrized::is_value_in_list ( Real  value,
const std::vector< Real > &  list_of_values,
Real  tol 
)
staticprivateinherited

Helper function to check if the specified value is in the list of values (within a tolerance given by tol).

Definition at line 453 of file rb_parametrized.C.

454 {
455  Real closest_value = get_closest_value(value, list_of_values);
456 
457  // Check if relative tolerance is satisfied
458  Real rel_error = std::abs(value - closest_value) / std::abs(value);
459  if (rel_error <= tol)
460  {
461  return true;
462  }
463 
464  // If relative tolerance isn't satisfied, we should still check an absolute
465  // error, since relative tolerance can be misleading if value is close to zero
466  Real abs_error = std::abs(value - closest_value);
467  return (abs_error <= tol);
468 }

References std::abs(), libMesh::RBParametrized::get_closest_value(), libMesh::Real, and value.

Referenced by libMesh::RBParametrized::valid_params().

◆ legacy_read_offline_data_from_files()

void TransientRBEvaluation::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 
)
overridevirtual

Read in the saved Offline reduced basis data to initialize the system for Online solves.

Note
This is a legacy method, use RBDataSerialization instead.

Reimplemented from libMesh::RBEvaluation.

Definition at line 893 of file transient_rb_evaluation.C.

896 {
897  LOG_SCOPE("legacy_read_offline_data_from_files()", "TransientRBEvaluation");
898 
900 
901  TransientRBThetaExpansion & trans_theta_expansion =
902  cast_ref<TransientRBThetaExpansion &>(get_rb_theta_expansion());
903  const unsigned int Q_m = trans_theta_expansion.get_n_M_terms();
904  const unsigned int Q_a = trans_theta_expansion.get_n_A_terms();
905  const unsigned int Q_f = trans_theta_expansion.get_n_F_terms();
906 
907  // First, find out how many basis functions we had when Greedy terminated
908  // This was set in RBSystem::read_offline_data_from_files
909  unsigned int n_bfs = this->get_n_basis_functions();
910 
911  // The reading mode: DECODE for binary, READ for ASCII
912  XdrMODE mode = read_binary_data ? DECODE : READ;
913 
914  // The suffix to use for all the files that are written out
915  const std::string suffix = read_binary_data ? ".xdr" : ".dat";
916 
917  // The string stream we'll use to make the file names
918  std::ostringstream file_name;
919 
920  // Write out the temporal discretization data
921  file_name.str("");
922  file_name << directory_name << "/temporal_discretization_data" << suffix;
923  assert_file_exists(file_name.str());
924 
925  Xdr temporal_discretization_data_in(file_name.str(), mode);
926 
927  Real real_value; unsigned int int_value;
928  temporal_discretization_data_in >> real_value; set_delta_t(real_value);
929  temporal_discretization_data_in >> real_value; set_euler_theta(real_value);
930  temporal_discretization_data_in >> int_value; set_n_time_steps(int_value);
931  temporal_discretization_data_in >> int_value; set_time_step(int_value);
932  temporal_discretization_data_in.close();
933 
934  file_name.str("");
935  file_name << directory_name << "/RB_L2_matrix" << suffix;
936  assert_file_exists(file_name.str());
937 
938  Xdr RB_L2_matrix_in(file_name.str(), mode);
939 
940  for (unsigned int i=0; i<n_bfs; i++)
941  {
942  for (unsigned int j=0; j<n_bfs; j++)
943  {
944  Number value;
945  RB_L2_matrix_in >> value;
946  RB_L2_matrix(i,j) = value;
947  }
948  }
949  RB_L2_matrix_in.close();
950 
951  // Read in the M_q matrices
952  for (unsigned int q_m=0; q_m<Q_m; q_m++)
953  {
954  file_name.str("");
955  file_name << directory_name << "/RB_M_";
956  file_name << std::setw(3)
957  << std::setprecision(0)
958  << std::setfill('0')
959  << std::right
960  << q_m;
961 
962  file_name << suffix;
963  assert_file_exists(file_name.str());
964 
965  Xdr RB_M_q_m_in(file_name.str(), mode);
966 
967  for (unsigned int i=0; i<n_bfs; i++)
968  {
969  for (unsigned int j=0; j<n_bfs; j++)
970  {
971  Number value;
972  RB_M_q_m_in >> value;
973  RB_M_q_vector[q_m](i,j) = value;
974  }
975  }
976  RB_M_q_m_in.close();
977  }
978 
979 
980  // Read in the initial condition data
981  // and the initial L2 error for all N
982  file_name.str("");
983  file_name << directory_name << "/initial_conditions" << suffix;
984  assert_file_exists(file_name.str());
985 
986  Xdr initial_conditions_in(file_name.str(), mode);
987 
988  file_name.str("");
989  file_name << directory_name << "/initial_L2_error" << suffix;
990  assert_file_exists(file_name.str());
991 
992  Xdr initial_L2_error_in(file_name.str(), mode);
993 
994  for (unsigned int i=0; i<n_bfs; i++)
995  {
996  initial_L2_error_in >> initial_L2_error_all_N[i];
997  for (unsigned int j=0; j<=i; j++)
998  {
999  initial_conditions_in >> RB_initial_condition_all_N[i](j);
1000  }
1001  }
1002  initial_conditions_in.close();
1003  initial_L2_error_in.close();
1004 
1005 
1006  if (read_error_bound_data)
1007  {
1008  // Next read in the Fq_Mq representor norm data
1009  file_name.str("");
1010  file_name << directory_name << "/Fq_Mq_terms" << suffix;
1011  assert_file_exists(file_name.str());
1012 
1013  Xdr RB_Fq_Mq_terms_in(file_name.str(), mode);
1014 
1015  for (unsigned int q_f=0; q_f<Q_f; q_f++)
1016  {
1017  for (unsigned int q_m=0; q_m<Q_m; q_m++)
1018  {
1019  for (unsigned int i=0; i<n_bfs; i++)
1020  {
1021  RB_Fq_Mq_terms_in >> Fq_Mq_representor_innerprods[q_f][q_m][i];
1022  }
1023  }
1024  }
1025  RB_Fq_Mq_terms_in.close();
1026 
1027  // Next read in the Mq_Mq representor norm data
1028  file_name.str("");
1029  file_name << directory_name << "/Mq_Mq_terms" << suffix;
1030  assert_file_exists(file_name.str());
1031 
1032  Xdr RB_Mq_Mq_terms_in(file_name.str(), mode);
1033 
1034  unsigned int Q_m_hat = Q_m*(Q_m+1)/2;
1035  for (unsigned int q=0; q<Q_m_hat; q++)
1036  {
1037  for (unsigned int i=0; i<n_bfs; i++)
1038  {
1039  for (unsigned int j=0; j<n_bfs; j++)
1040  {
1041  RB_Mq_Mq_terms_in >> Mq_Mq_representor_innerprods[q][i][j];
1042  }
1043  }
1044  }
1045  RB_Mq_Mq_terms_in.close();
1046 
1047  // Next read in the Aq_Mq representor norm data
1048  file_name.str("");
1049  file_name << directory_name << "/Aq_Mq_terms" << suffix;
1050  assert_file_exists(file_name.str());
1051 
1052  Xdr RB_Aq_Mq_terms_in(file_name.str(), mode);
1053 
1054  for (unsigned int q_a=0; q_a<Q_a; q_a++)
1055  {
1056  for (unsigned int q_m=0; q_m<Q_m; q_m++)
1057  {
1058  for (unsigned int i=0; i<n_bfs; i++)
1059  {
1060  for (unsigned int j=0; j<n_bfs; j++)
1061  {
1062  RB_Aq_Mq_terms_in >> Aq_Mq_representor_innerprods[q_a][q_m][i][j];
1063  }
1064  }
1065  }
1066  }
1067  RB_Aq_Mq_terms_in.close();
1068  }
1069 }

References Aq_Mq_representor_innerprods, libMesh::RBEvaluation::assert_file_exists(), libMesh::DECODE, Fq_Mq_representor_innerprods, libMesh::RBThetaExpansion::get_n_A_terms(), libMesh::RBEvaluation::get_n_basis_functions(), libMesh::RBThetaExpansion::get_n_F_terms(), libMesh::TransientRBThetaExpansion::get_n_M_terms(), libMesh::RBEvaluation::get_rb_theta_expansion(), initial_L2_error_all_N, libMesh::RBEvaluation::legacy_read_offline_data_from_files(), Mq_Mq_representor_innerprods, RB_initial_condition_all_N, RB_L2_matrix, RB_M_q_vector, libMesh::READ, libMesh::Real, libMesh::RBTemporalDiscretization::set_delta_t(), libMesh::RBTemporalDiscretization::set_euler_theta(), libMesh::RBTemporalDiscretization::set_n_time_steps(), libMesh::RBTemporalDiscretization::set_time_step(), and value.

◆ legacy_write_offline_data_to_files()

void TransientRBEvaluation::legacy_write_offline_data_to_files ( const std::string &  directory_name = "offline_data",
const bool  write_binary_data = true 
)
overridevirtual

Write out all the data to text files in order to segregate the Offline stage from the Online stage.

Note
This is a legacy method, use RBDataSerialization instead.

Reimplemented from libMesh::RBEvaluation.

Definition at line 741 of file transient_rb_evaluation.C.

743 {
744  LOG_SCOPE("legacy_write_offline_data_to_files()", "TransientRBEvaluation");
745 
747 
748  TransientRBThetaExpansion & trans_theta_expansion =
749  cast_ref<TransientRBThetaExpansion &>(get_rb_theta_expansion());
750  const unsigned int Q_m = trans_theta_expansion.get_n_M_terms();
751  const unsigned int Q_a = trans_theta_expansion.get_n_A_terms();
752  const unsigned int Q_f = trans_theta_expansion.get_n_F_terms();
753 
754  const unsigned int n_bfs = get_n_basis_functions();
755 
756  // The writing mode: ENCODE for binary, WRITE for ASCII
757  XdrMODE mode = write_binary_data ? ENCODE : WRITE;
758 
759  // The suffix to use for all the files that are written out
760  const std::string suffix = write_binary_data ? ".xdr" : ".dat";
761 
762  if (this->processor_id() == 0)
763  {
764  std::ostringstream file_name;
765 
766  // Write out the temporal discretization data
767  file_name.str("");
768  file_name << directory_name << "/temporal_discretization_data" << suffix;
769  Xdr temporal_discretization_data_out(file_name.str(), mode);
770 
771  Real real_value; unsigned int int_value;
772  real_value = get_delta_t(); temporal_discretization_data_out << real_value;
773  real_value = get_euler_theta(); temporal_discretization_data_out << real_value;
774  int_value = get_n_time_steps(); temporal_discretization_data_out << int_value;
775  int_value = get_time_step(); temporal_discretization_data_out << int_value;
776  temporal_discretization_data_out.close();
777 
778 
779  // Write out the L2 matrix
780  file_name.str("");
781  file_name << directory_name << "/RB_L2_matrix" << suffix;
782  Xdr RB_L2_matrix_out(file_name.str(), mode);
783 
784  for (unsigned int i=0; i<n_bfs; i++)
785  {
786  for (unsigned int j=0; j<n_bfs; j++)
787  {
788  RB_L2_matrix_out << RB_L2_matrix(i,j);
789  }
790  }
791  RB_L2_matrix_out.close();
792 
793  // Write out the M_q matrices
794  for (unsigned int q_m=0; q_m<Q_m; q_m++)
795  {
796  file_name.str("");
797  file_name << directory_name << "/RB_M_";
798  file_name << std::setw(3)
799  << std::setprecision(0)
800  << std::setfill('0')
801  << std::right
802  << q_m;
803  file_name << suffix;
804  Xdr RB_M_q_m_out(file_name.str(), mode);
805 
806  for (unsigned int i=0; i<n_bfs; i++)
807  {
808  for (unsigned int j=0; j<n_bfs; j++)
809  {
810  RB_M_q_m_out << RB_M_q_vector[q_m](i,j);
811  }
812  }
813  RB_M_q_m_out.close();
814  }
815 
816  // Write out the initial condition data
817  // and the initial L2 error for all N
818  file_name.str("");
819  file_name << directory_name << "/initial_conditions" << suffix;
820  Xdr initial_conditions_out(file_name.str(), mode);
821  file_name.str("");
822  file_name << directory_name << "/initial_L2_error" << suffix;
823  Xdr initial_L2_error_out(file_name.str(), mode);
824 
825  for (unsigned int i=0; i<n_bfs; i++)
826  {
827  initial_L2_error_out << initial_L2_error_all_N[i];
828  for (unsigned int j=0; j<=i; j++)
829  {
830  initial_conditions_out << RB_initial_condition_all_N[i](j);
831  }
832  }
833  initial_conditions_out.close();
834  initial_L2_error_out.close();
835 
836  // Next write out the Fq_Mq representor norm data
837  file_name.str("");
838  file_name << directory_name << "/Fq_Mq_terms" << suffix;
839  Xdr RB_Fq_Mq_terms_out(file_name.str(), mode);
840 
841  for (unsigned int q_f=0; q_f<Q_f; q_f++)
842  {
843  for (unsigned int q_m=0; q_m<Q_m; q_m++)
844  {
845  for (unsigned int i=0; i<n_bfs; i++)
846  {
847  RB_Fq_Mq_terms_out << Fq_Mq_representor_innerprods[q_f][q_m][i];
848  }
849  }
850  }
851  RB_Fq_Mq_terms_out.close();
852 
853  // Next write out the Mq_Mq representor norm data
854  file_name.str("");
855  file_name << directory_name << "/Mq_Mq_terms" << suffix;
856  Xdr RB_Mq_Mq_terms_out(file_name.str(), mode);
857 
858  unsigned int Q_m_hat = Q_m*(Q_m+1)/2;
859  for (unsigned int q=0; q<Q_m_hat; q++)
860  {
861  for (unsigned int i=0; i<n_bfs; i++)
862  {
863  for (unsigned int j=0; j<n_bfs; j++)
864  {
865  RB_Mq_Mq_terms_out << Mq_Mq_representor_innerprods[q][i][j];
866  }
867  }
868  }
869  RB_Mq_Mq_terms_out.close();
870 
871  // Next write out the Aq_Mq representor norm data
872  file_name.str("");
873  file_name << directory_name << "/Aq_Mq_terms" << suffix;
874  Xdr RB_Aq_Mq_terms_out(file_name.str(), mode);
875 
876  for (unsigned int q_a=0; q_a<Q_a; q_a++)
877  {
878  for (unsigned int q_m=0; q_m<Q_m; q_m++)
879  {
880  for (unsigned int i=0; i<n_bfs; i++)
881  {
882  for (unsigned int j=0; j<n_bfs; j++)
883  {
884  RB_Aq_Mq_terms_out << Aq_Mq_representor_innerprods[q_a][q_m][i][j];
885  }
886  }
887  }
888  }
889  RB_Aq_Mq_terms_out.close();
890  }
891 }

References Aq_Mq_representor_innerprods, libMesh::ENCODE, Fq_Mq_representor_innerprods, libMesh::RBTemporalDiscretization::get_delta_t(), libMesh::RBTemporalDiscretization::get_euler_theta(), libMesh::RBThetaExpansion::get_n_A_terms(), libMesh::RBEvaluation::get_n_basis_functions(), libMesh::RBThetaExpansion::get_n_F_terms(), libMesh::TransientRBThetaExpansion::get_n_M_terms(), libMesh::RBTemporalDiscretization::get_n_time_steps(), libMesh::RBEvaluation::get_rb_theta_expansion(), libMesh::RBTemporalDiscretization::get_time_step(), initial_L2_error_all_N, libMesh::RBEvaluation::legacy_write_offline_data_to_files(), Mq_Mq_representor_innerprods, libMesh::ParallelObject::processor_id(), RB_initial_condition_all_N, RB_L2_matrix, RB_M_q_vector, libMesh::Real, and libMesh::WRITE.

◆ n_objects()

static unsigned int libMesh::ReferenceCounter::n_objects ( )
inlinestaticinherited

Prints the number of outstanding (created, but not yet destroyed) objects.

Definition at line 83 of file reference_counter.h.

84  { return _n_objects; }

References libMesh::ReferenceCounter::_n_objects.

◆ n_processors()

processor_id_type libMesh::ParallelObject::n_processors ( ) const
inlineinherited
Returns
The number of processors in the group.

Definition at line 100 of file parallel_object.h.

101  { return cast_int<processor_id_type>(_communicator.size()); }

References libMesh::ParallelObject::_communicator.

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::DofMap::add_constraints_to_send_list(), libMesh::PetscDMWrapper::add_dofs_to_section(), libMesh::DistributedMesh::add_elem(), libMesh::DofMap::add_neighbors_to_send_list(), libMesh::DistributedMesh::add_node(), libMesh::LaplaceMeshSmoother::allgather_graph(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::FEMSystem::assembly(), libMesh::AztecLinearSolver< T >::AztecLinearSolver(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::EquationSystems::build_parallel_elemental_solution_vector(), libMesh::DistributedMesh::clear(), libMesh::Nemesis_IO_Helper::compute_border_node_ids(), libMesh::Nemesis_IO_Helper::construct_nemesis_filename(), libMesh::ExodusII_IO::copy_scalar_solution(), libMesh::UnstructuredMesh::create_pid_mesh(), libMesh::MeshTools::create_processor_bounding_box(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::EnsightIO::EnsightIO(), libMesh::SystemSubsetBySubdomain::init(), libMesh::PetscDMWrapper::init_and_attach_petscdm(), libMesh::Nemesis_IO_Helper::initialize(), libMesh::DistributedMesh::insert_elem(), libMesh::MeshTools::libmesh_assert_contiguous_dof_ids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_new_node_procids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_valid_boundary_ids(), libMesh::MeshTools::libmesh_assert_valid_dof_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::MeshTools::libmesh_assert_valid_refinement_flags(), libMesh::DofMap::local_variable_indices(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshBase::partition(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::DofMap::prepare_send_list(), libMesh::DofMap::print_dof_constraints(), libMesh::NameBasedIO::read(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::XdrIO::read_header(), libMesh::CheckpointIO::read_nodes(), libMesh::System::read_parallel_data(), libMesh::System::read_SCALAR_dofs(), libMesh::System::read_serialized_blocked_dof_objects(), libMesh::System::read_serialized_vector(), libMesh::DistributedMesh::renumber_dof_objects(), OverlappingFunctorTest::run_partitioner_test(), libMesh::DofMap::scatter_constraints(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::PetscDMWrapper::set_point_range_in_section(), CheckpointIOTest::testSplitter(), WriteVecAndScalar::testWrite(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::DistributedMesh::update_parallel_id_counts(), libMesh::GMVIO::write_binary(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::VTKIO::write_nodal_data(), libMesh::System::write_parallel_data(), libMesh::System::write_SCALAR_dofs(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::System::write_serialized_blocked_dof_objects(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), and libMesh::XdrIO::write_serialized_nodesets().

◆ print_discrete_parameter_values()

void libMesh::RBParametrized::print_discrete_parameter_values ( ) const
inherited

Print out all the discrete parameter values.

Definition at line 389 of file rb_parametrized.C.

390 {
391  for (const auto & pr : get_discrete_parameter_values())
392  {
393  libMesh::out << "Discrete parameter " << pr.first << ", values: ";
394 
395  const std::vector<Real> & values = pr.second;
396  for (const auto & value : values)
397  libMesh::out << value << " ";
398  libMesh::out << std::endl;
399  }
400 }

References libMesh::RBParametrized::get_discrete_parameter_values(), libMesh::out, and value.

Referenced by libMesh::RBSCMConstruction::print_info(), and libMesh::RBConstruction::print_info().

◆ print_info()

void libMesh::ReferenceCounter::print_info ( std::ostream &  out = libMesh::out)
staticinherited

Prints the reference information, by default to libMesh::out.

Definition at line 87 of file reference_counter.C.

88 {
90  out_stream << ReferenceCounter::get_info();
91 }

References libMesh::ReferenceCounter::_enable_print_counter, and libMesh::ReferenceCounter::get_info().

◆ print_parameters()

void libMesh::RBParametrized::print_parameters ( ) const
inherited

Print the current parameters.

Definition at line 206 of file rb_parametrized.C.

207 {
209  libmesh_error_msg("Error: parameters not initialized in RBParametrized::print_current_parameters");
210 
211  get_parameters().print();
212 }

References libMesh::RBParametrized::get_parameters(), libMesh::RBParametrized::parameters_initialized, and libMesh::RBParameters::print().

Referenced by libMesh::RBConstruction::train_reduced_basis().

◆ process_temporal_parameters_file()

void libMesh::RBTemporalDiscretization::process_temporal_parameters_file ( const std::string &  parameters_filename)
inherited

Read in and initialize parameters from parameters_filename.

Definition at line 93 of file rb_temporal_discretization.C.

94 {
95  // Read in data from parameters_filename
96  GetPot infile(parameters_filename);
97 
98  // Read in parameters related to temporal discretization
99  unsigned int n_time_steps_in = infile("n_time_steps", get_n_time_steps());
100  const Real delta_t_in = infile("delta_t", get_delta_t());
101  const Real euler_theta_in = infile("euler_theta", get_euler_theta());
102 
103  // and set the relevant member variables
104  set_n_time_steps(n_time_steps_in);
105  set_delta_t(delta_t_in);
106  set_euler_theta(euler_theta_in);
107  set_time_step(0);
108 }

References libMesh::RBTemporalDiscretization::get_delta_t(), libMesh::RBTemporalDiscretization::get_euler_theta(), libMesh::RBTemporalDiscretization::get_n_time_steps(), libMesh::Real, libMesh::RBTemporalDiscretization::set_delta_t(), libMesh::RBTemporalDiscretization::set_euler_theta(), libMesh::RBTemporalDiscretization::set_n_time_steps(), and libMesh::RBTemporalDiscretization::set_time_step().

Referenced by libMesh::TransientRBConstruction::process_parameters_file().

◆ processor_id()

processor_id_type libMesh::ParallelObject::processor_id ( ) const
inlineinherited
Returns
The rank of this processor in the group.

Definition at line 106 of file parallel_object.h.

107  { return cast_int<processor_id_type>(_communicator.rank()); }

References libMesh::ParallelObject::_communicator.

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::EquationSystems::_read_impl(), libMesh::PetscDMWrapper::add_dofs_to_section(), libMesh::DistributedMesh::add_elem(), libMesh::BoundaryInfo::add_elements(), libMesh::DofMap::add_neighbors_to_send_list(), libMesh::DistributedMesh::add_node(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::FEMSystem::assembly(), libMesh::Nemesis_IO_Helper::build_element_and_node_maps(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::EquationSystems::build_parallel_elemental_solution_vector(), libMesh::DistributedMesh::clear(), libMesh::ExodusII_IO_Helper::close(), libMesh::Nemesis_IO_Helper::compute_border_node_ids(), libMesh::Nemesis_IO_Helper::compute_communication_map_parameters(), libMesh::Nemesis_IO_Helper::compute_internal_and_border_elems_and_internal_nodes(), libMesh::RBConstruction::compute_max_error_bound(), libMesh::Nemesis_IO_Helper::compute_node_communication_maps(), libMesh::Nemesis_IO_Helper::compute_num_global_elem_blocks(), libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), libMesh::Nemesis_IO_Helper::construct_nemesis_filename(), libMesh::ExodusII_IO::copy_scalar_solution(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::ExodusII_IO_Helper::create(), libMesh::DistributedMesh::delete_elem(), libMesh::DistributedMesh::delete_node(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DistributedMesh::DistributedMesh(), libMesh::DofMap::end_dof(), libMesh::DofMap::end_old_dof(), libMesh::EnsightIO::EnsightIO(), libMesh::RBEIMConstruction::evaluate_mesh_function(), libMesh::MeshFunction::find_element(), libMesh::MeshFunction::find_elements(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::DofMap::first_dof(), libMesh::DofMap::first_old_dof(), libMesh::Nemesis_IO_Helper::get_cmap_params(), libMesh::Nemesis_IO_Helper::get_eb_info_global(), libMesh::Nemesis_IO_Helper::get_elem_cmap(), libMesh::Nemesis_IO_Helper::get_elem_map(), libMesh::DofMap::get_info(), libMesh::Nemesis_IO_Helper::get_init_global(), libMesh::Nemesis_IO_Helper::get_init_info(), libMesh::Nemesis_IO_Helper::get_loadbal_param(), libMesh::DofMap::get_local_constraints(), libMesh::Nemesis_IO_Helper::get_node_cmap(), libMesh::Nemesis_IO_Helper::get_node_map(), libMesh::Nemesis_IO_Helper::get_ns_param_global(), libMesh::Nemesis_IO_Helper::get_ss_param_global(), libMesh::SparsityPattern::Build::handle_vi_vj(), libMesh::SystemSubsetBySubdomain::init(), libMesh::PetscDMWrapper::init_and_attach_petscdm(), HeatSystem::init_data(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::ExodusII_IO_Helper::initialize_element_variables(), libMesh::ExodusII_IO_Helper::initialize_global_variables(), libMesh::ExodusII_IO_Helper::initialize_nodal_variables(), libMesh::DistributedMesh::insert_elem(), libMesh::DofMap::is_evaluable(), libMesh::SparsityPattern::Build::join(), libMesh::DofMap::last_dof(), legacy_write_offline_data_to_files(), libMesh::RBEIMEvaluation::legacy_write_offline_data_to_files(), libMesh::RBEvaluation::legacy_write_offline_data_to_files(), libMesh::RBSCMEvaluation::legacy_write_offline_data_to_files(), libMesh::RBEIMEvaluation::legacy_write_out_interpolation_points_elem(), libMesh::MeshTools::libmesh_assert_consistent_distributed(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::MeshTools::libmesh_assert_contiguous_dof_ids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::DofMap::local_variable_indices(), main(), libMesh::MeshRefinement::make_coarsening_compatible(), AugmentSparsityOnInterface::mesh_reinit(), libMesh::MeshBase::n_active_local_elem(), libMesh::BoundaryInfo::n_boundary_conds(), libMesh::BoundaryInfo::n_edge_conds(), libMesh::DofMap::n_local_dofs(), libMesh::System::n_local_dofs(), libMesh::MeshBase::n_local_elem(), libMesh::MeshBase::n_local_nodes(), libMesh::BoundaryInfo::n_nodeset_conds(), libMesh::BoundaryInfo::n_shellface_conds(), libMesh::SparsityPattern::Build::operator()(), libMesh::DistributedMesh::own_node(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::DofMap::print_dof_constraints(), libMesh::Nemesis_IO_Helper::put_cmap_params(), libMesh::Nemesis_IO_Helper::put_elem_cmap(), libMesh::Nemesis_IO_Helper::put_elem_map(), libMesh::Nemesis_IO_Helper::put_loadbal_param(), libMesh::Nemesis_IO_Helper::put_node_cmap(), libMesh::Nemesis_IO_Helper::put_node_map(), libMesh::NameBasedIO::read(), libMesh::Nemesis_IO::read(), libMesh::XdrIO::read(), libMesh::CheckpointIO::read(), libMesh::ExodusII_IO_Helper::read_elem_num_map(), libMesh::ExodusII_IO_Helper::read_global_values(), libMesh::CheckpointIO::read_header(), libMesh::XdrIO::read_header(), libMesh::System::read_header(), libMesh::RBEvaluation::read_in_vectors_from_multiple_files(), libMesh::System::read_legacy_data(), libMesh::ExodusII_IO_Helper::read_node_num_map(), libMesh::System::read_parallel_data(), libMesh::TransientRBConstruction::read_riesz_representors_from_files(), libMesh::RBConstruction::read_riesz_representors_from_files(), libMesh::System::read_SCALAR_dofs(), libMesh::XdrIO::read_serialized_bc_names(), libMesh::XdrIO::read_serialized_bcs_helper(), libMesh::System::read_serialized_blocked_dof_objects(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::System::read_serialized_data(), libMesh::XdrIO::read_serialized_nodes(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::XdrIO::read_serialized_subdomain_names(), libMesh::System::read_serialized_vector(), libMesh::System::read_serialized_vectors(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::DofMap::scatter_constraints(), libMesh::CheckpointIO::select_split_config(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::PetscDMWrapper::set_point_range_in_section(), libMesh::LaplaceMeshSmoother::smooth(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), MeshInputTest::testDynaReadElem(), MeshInputTest::testDynaReadPatch(), MeshInputTest::testExodusCopyElementSolution(), MeshInputTest::testExodusWriteElementDataFromDiscontinuousNodalData(), SystemsTest::testProjectMatrix1D(), SystemsTest::testProjectMatrix2D(), SystemsTest::testProjectMatrix3D(), BoundaryInfoTest::testShellFaceConstraints(), CheckpointIOTest::testSplitter(), WriteVecAndScalar::testWrite(), libMesh::MeshTools::total_weight(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::Parallel::Packing< Node * >::unpack(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::DistributedMesh::update_parallel_id_counts(), libMesh::DTKAdapter::update_variable_values(), libMesh::NameBasedIO::write(), libMesh::XdrIO::write(), libMesh::CheckpointIO::write(), libMesh::EquationSystems::write(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::ExodusII_IO::write_element_data(), libMesh::ExodusII_IO_Helper::write_element_values(), libMesh::ExodusII_IO_Helper::write_element_values_element_major(), libMesh::ExodusII_IO_Helper::write_elements(), libMesh::ExodusII_IO::write_global_data(), libMesh::ExodusII_IO_Helper::write_global_values(), libMesh::System::write_header(), libMesh::ExodusII_IO::write_information_records(), libMesh::ExodusII_IO_Helper::write_information_records(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), libMesh::VTKIO::write_nodal_data(), libMesh::UCDIO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data_discontinuous(), libMesh::ExodusII_IO_Helper::write_nodal_values(), libMesh::Nemesis_IO_Helper::write_nodesets(), libMesh::ExodusII_IO_Helper::write_nodesets(), libMesh::RBEvaluation::write_out_vectors(), write_output_solvedata(), libMesh::System::write_parallel_data(), libMesh::RBConstruction::write_riesz_representors_to_files(), libMesh::System::write_SCALAR_dofs(), libMesh::XdrIO::write_serialized_bc_names(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::System::write_serialized_blocked_dof_objects(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::System::write_serialized_data(), libMesh::XdrIO::write_serialized_nodes(), libMesh::XdrIO::write_serialized_nodesets(), libMesh::XdrIO::write_serialized_subdomain_names(), libMesh::System::write_serialized_vector(), libMesh::System::write_serialized_vectors(), libMesh::ExodusII_IO_Helper::write_sideset_data(), libMesh::Nemesis_IO_Helper::write_sidesets(), libMesh::ExodusII_IO_Helper::write_sidesets(), libMesh::ExodusII_IO::write_timestep(), libMesh::ExodusII_IO_Helper::write_timestep(), and libMesh::ExodusII_IO::write_timestep_discontinuous().

◆ pull_temporal_discretization_data()

void libMesh::RBTemporalDiscretization::pull_temporal_discretization_data ( RBTemporalDiscretization other)
inherited

◆ rb_solve()

Real TransientRBEvaluation::rb_solve ( unsigned int  N)
overridevirtual

Perform online solve for current_params with the N basis functions.

Overridden to perform a time-dependent solve.

Reimplemented from libMesh::RBEvaluation.

Definition at line 154 of file transient_rb_evaluation.C.

155 {
156  LOG_SCOPE("rb_solve()", "TransientRBEvaluation");
157 
158  if (N > get_n_basis_functions())
159  libmesh_error_msg("ERROR: N cannot be larger than the number of basis functions in rb_solve");
160 
161  const RBParameters & mu = get_parameters();
162 
163  TransientRBThetaExpansion & trans_theta_expansion =
164  cast_ref<TransientRBThetaExpansion &>(get_rb_theta_expansion());
165  const unsigned int Q_m = trans_theta_expansion.get_n_M_terms();
166  const unsigned int Q_a = trans_theta_expansion.get_n_A_terms();
167  const unsigned int Q_f = trans_theta_expansion.get_n_F_terms();
168 
169  const unsigned int n_time_steps = get_n_time_steps();
170  const Real dt = get_delta_t();
171  const Real euler_theta = get_euler_theta();
172 
173  // Resize the RB and error bound vectors
174  error_bound_all_k.resize(n_time_steps+1);
175  RB_outputs_all_k.resize(trans_theta_expansion.get_n_outputs());
176  RB_output_error_bounds_all_k.resize(trans_theta_expansion.get_n_outputs());
177  for (unsigned int n=0; n<trans_theta_expansion.get_n_outputs(); n++)
178  {
179  RB_outputs_all_k[n].resize(n_time_steps+1, 0.);
180  RB_output_error_bounds_all_k[n].resize(n_time_steps+1, 0.);
181  }
182 
183  // First assemble the mass matrix
184  DenseMatrix<Number> RB_mass_matrix_N(N,N);
185  RB_mass_matrix_N.zero();
186  DenseMatrix<Number> RB_M_q_m;
187  for (unsigned int q_m=0; q_m<Q_m; q_m++)
188  {
189  RB_M_q_vector[q_m].get_principal_submatrix(N, RB_M_q_m);
190  RB_mass_matrix_N.add(trans_theta_expansion.eval_M_theta(q_m, mu), RB_M_q_m);
191  }
192 
193  RB_LHS_matrix.resize(N,N);
195 
196  RB_RHS_matrix.resize(N,N);
198 
199  RB_LHS_matrix.add(1./dt, RB_mass_matrix_N);
200  RB_RHS_matrix.add(1./dt, RB_mass_matrix_N);
201 
202  DenseMatrix<Number> RB_Aq_a;
203  for (unsigned int q_a=0; q_a<Q_a; q_a++)
204  {
205  RB_Aq_vector[q_a].get_principal_submatrix(N, RB_Aq_a);
206 
207  RB_LHS_matrix.add( euler_theta*trans_theta_expansion.eval_A_theta(q_a,mu), RB_Aq_a);
208  RB_RHS_matrix.add( -(1.-euler_theta)*trans_theta_expansion.eval_A_theta(q_a,mu), RB_Aq_a);
209  }
210 
211  // Add forcing terms
212  DenseVector<Number> RB_Fq_f;
213  RB_RHS_save.resize(N);
214  RB_RHS_save.zero();
215  for (unsigned int q_f=0; q_f<Q_f; q_f++)
216  {
217  RB_Fq_vector[q_f].get_principal_subvector(N, RB_Fq_f);
218  RB_RHS_save.add(trans_theta_expansion.eval_F_theta(q_f,mu), RB_Fq_f);
219  }
220 
221  // Set system time level to 0
222  set_time_step(0);
223 
224  // Resize/clear the solution vector
225  RB_solution.resize(N);
226 
227  // Load the initial condition into RB_solution
228  if (N > 0)
229  {
231  }
232 
233  // Resize/clear the old solution vector
235 
236  // Initialize the RB rhs
237  DenseVector<Number> RB_rhs(N);
238  RB_rhs.zero();
239 
240  // Initialize the vectors storing solution data
241  RB_temporal_solution_data.resize(n_time_steps+1);
242  for (unsigned int time_level=0; time_level<=n_time_steps; time_level++)
243  {
244  RB_temporal_solution_data[time_level].resize(N);
245  }
246  // and load the initial data
248 
249  // Set outputs at initial time
250  {
251  DenseVector<Number> RB_output_vector_N;
252  for (unsigned int n=0; n<trans_theta_expansion.get_n_outputs(); n++)
253  {
254  RB_outputs_all_k[n][0] = 0.;
255  for (unsigned int q_l=0; q_l<trans_theta_expansion.get_n_output_terms(n); q_l++)
256  {
257  RB_output_vectors[n][q_l].get_principal_subvector(N, RB_output_vector_N);
258  RB_outputs_all_k[n][0] += trans_theta_expansion.eval_output_theta(n,q_l,mu)*RB_output_vector_N.dot(RB_solution);
259  }
260  }
261  }
262 
263  // Initialize error bounds, if necessary
264  Real error_bound_sum = 0.;
265  Real alpha_LB = 0.;
267  {
268  if (N > 0)
269  {
270  error_bound_sum += pow( initial_L2_error_all_N[N-1], 2.);
271  }
272 
273  // Set error bound at the initial time
274  error_bound_all_k[get_time_step()] = std::sqrt(error_bound_sum);
275 
276  // Compute the outputs and associated error bounds at the initial time
277  DenseVector<Number> RB_output_vector_N;
278  for (unsigned int n=0; n<trans_theta_expansion.get_n_outputs(); n++)
279  {
280  RB_outputs_all_k[n][0] = 0.;
281  for (unsigned int q_l=0; q_l<trans_theta_expansion.get_n_output_terms(n); q_l++)
282  {
283  RB_output_vectors[n][q_l].get_principal_subvector(N, RB_output_vector_N);
284  RB_outputs_all_k[n][0] += trans_theta_expansion.eval_output_theta(n,q_l,mu)*RB_output_vector_N.dot(RB_solution);
285  }
286 
288  }
289 
290  alpha_LB = get_stability_lower_bound();
291 
292  // Precompute time-invariant parts of the dual norm of the residual.
294  }
295 
296  for (unsigned int time_level=1; time_level<=n_time_steps; time_level++)
297  {
298  set_time_step(time_level);
300 
301  // Compute RB_rhs, as RB_LHS_matrix x old_RB_solution
303 
304  // Add forcing terms
305  RB_rhs.add(get_control(time_level), RB_RHS_save);
306 
307  if (N > 0)
308  {
310  }
311 
312  // Save RB_solution for current time level
314 
315  // Evaluate outputs
316  DenseVector<Number> RB_output_vector_N;
317  for (unsigned int n=0; n<trans_theta_expansion.get_n_outputs(); n++)
318  {
319  RB_outputs_all_k[n][time_level] = 0.;
320  for (unsigned int q_l=0; q_l<trans_theta_expansion.get_n_output_terms(n); q_l++)
321  {
322  RB_output_vectors[n][q_l].get_principal_subvector(N, RB_output_vector_N);
323  RB_outputs_all_k[n][time_level] += trans_theta_expansion.eval_output_theta(n,q_l,mu)*
324  RB_output_vector_N.dot(RB_solution);
325  }
326  }
327 
328  // Calculate RB error bounds
330  {
331  // Evaluate the dual norm of the residual for RB_solution_vector
332  // Real epsilon_N = uncached_compute_residual_dual_norm(N);
333  Real epsilon_N = compute_residual_dual_norm(N);
334 
335  error_bound_sum += residual_scaling_numer(alpha_LB) * pow(epsilon_N, 2.);
336 
337  // store error bound at time-level _k
338  error_bound_all_k[time_level] = std::sqrt(error_bound_sum/residual_scaling_denom(alpha_LB));
339 
340  // Now evaluated output error bounds
341  for (unsigned int n=0; n<trans_theta_expansion.get_n_outputs(); n++)
342  {
343  RB_output_error_bounds_all_k[n][time_level] = error_bound_all_k[time_level] *
344  eval_output_dual_norm(n,mu);
345  }
346  }
347  }
348 
349  _rb_solve_data_cached = true ;
350 
351  if (evaluate_RB_error_bound) // Calculate the error bounds
352  {
353  return error_bound_all_k[n_time_steps];
354  }
355  else // Don't calculate the error bounds
356  {
357  // Just return -1. if we did not compute the error bound
358  return -1.;
359  }
360 }

References _rb_solve_data_cached, libMesh::DenseVector< T >::add(), libMesh::DenseMatrix< T >::add(), cache_online_residual_terms(), compute_residual_dual_norm(), libMesh::DenseVector< T >::dot(), error_bound_all_k, libMesh::RBThetaExpansion::eval_A_theta(), libMesh::RBThetaExpansion::eval_F_theta(), libMesh::TransientRBThetaExpansion::eval_M_theta(), libMesh::RBEvaluation::eval_output_dual_norm(), libMesh::RBThetaExpansion::eval_output_theta(), libMesh::RBEvaluation::evaluate_RB_error_bound, libMesh::RBTemporalDiscretization::get_control(), libMesh::RBTemporalDiscretization::get_delta_t(), libMesh::RBTemporalDiscretization::get_euler_theta(), libMesh::RBThetaExpansion::get_n_A_terms(), libMesh::RBEvaluation::get_n_basis_functions(), libMesh::RBThetaExpansion::get_n_F_terms(), libMesh::TransientRBThetaExpansion::get_n_M_terms(), libMesh::RBThetaExpansion::get_n_output_terms(), libMesh::RBThetaExpansion::get_n_outputs(), libMesh::RBTemporalDiscretization::get_n_time_steps(), libMesh::RBParametrized::get_parameters(), libMesh::RBEvaluation::get_rb_theta_expansion(), libMesh::RBEvaluation::get_stability_lower_bound(), libMesh::RBTemporalDiscretization::get_time_step(), initial_L2_error_all_N, libMesh::DenseMatrix< T >::lu_solve(), old_RB_solution, std::pow(), libMesh::RBEvaluation::RB_Aq_vector, libMesh::RBEvaluation::RB_Fq_vector, RB_initial_condition_all_N, RB_LHS_matrix, RB_M_q_vector, RB_output_error_bounds_all_k, libMesh::RBEvaluation::RB_output_vectors, RB_outputs_all_k, RB_RHS_matrix, RB_RHS_save, libMesh::RBEvaluation::RB_solution, RB_temporal_solution_data, libMesh::Real, libMesh::RBEvaluation::residual_scaling_denom(), residual_scaling_numer(), libMesh::DenseVector< T >::resize(), libMesh::DenseMatrix< T >::resize(), libMesh::RBTemporalDiscretization::set_time_step(), std::sqrt(), libMesh::DenseMatrix< T >::vector_mult(), libMesh::DenseMatrix< T >::zero(), and libMesh::DenseVector< T >::zero().

◆ rb_solve_again()

Real TransientRBEvaluation::rb_solve_again ( )
virtual

If a solve has already been performed, then we cached some data and we can perform a new solve much more rapidly (with the same parameters but a possibly different initial condition/rhs control).

Definition at line 362 of file transient_rb_evaluation.C.

363 {
365 
366  const unsigned int n_time_steps = get_n_time_steps();
367  // Set system time level to 0
368  set_time_step(0);
369 
370  // Resize/clear the solution vector
371  const unsigned int N = RB_RHS_save.size();
372  RB_solution.resize(N);
373 
374  // Load the initial condition into RB_solution
375  if (N > 0)
377 
378  // Resize/clear the old solution vector
380 
381  // Initialize the RB rhs
382  DenseVector<Number> RB_rhs(N);
383  RB_rhs.zero();
384 
385  for (unsigned int time_level=1; time_level<=n_time_steps; time_level++)
386  {
387  set_time_step(time_level);
389 
390  // Compute RB_rhs, as *RB_lhs_matrix x old_RB_solution
392 
393  // Add forcing terms
394  RB_rhs.add(get_control(time_level), RB_RHS_save);
395 
396  if (N > 0)
398  }
399 
400  {
401  // Just return -1. We did not compute the error bound
402  return -1.;
403  }
404 }

References _rb_solve_data_cached, libMesh::DenseVector< T >::add(), libMesh::RBTemporalDiscretization::get_control(), libMesh::RBTemporalDiscretization::get_n_time_steps(), libMesh::libmesh_assert(), libMesh::DenseMatrix< T >::lu_solve(), old_RB_solution, RB_initial_condition_all_N, RB_LHS_matrix, RB_RHS_matrix, RB_RHS_save, libMesh::RBEvaluation::RB_solution, libMesh::DenseVector< T >::resize(), libMesh::RBTemporalDiscretization::set_time_step(), libMesh::DenseVector< T >::size(), libMesh::DenseMatrix< T >::vector_mult(), and libMesh::DenseVector< T >::zero().

◆ read_discrete_parameter_values_from_file()

void libMesh::RBParametrized::read_discrete_parameter_values_from_file ( const std::string &  file_name,
const bool  read_binary_data,
std::map< std::string, std::vector< Real >> &  discrete_parameter_values_in 
)
privateinherited

Read in the discrete parameter values from file, if we have any.

Definition at line 340 of file rb_parametrized.C.

343 {
344  // read in the discrete parameters, if we have any
345  std::ifstream check_if_file_exists(file_name.c_str());
346  if (check_if_file_exists.good())
347  {
348  // The reading mode: DECODE for binary, READ for ASCII
349  XdrMODE mode = read_binary_data ? DECODE : READ;
350 
351  // Read in the parameter ranges
352  Xdr discrete_parameter_values_in(file_name, mode);
353  unsigned int n_discrete_params;
354  discrete_parameter_values_in >> n_discrete_params;
355 
356  for (unsigned int i=0; i<n_discrete_params; i++)
357  {
358  std::string param_name;
359  discrete_parameter_values_in >> param_name;
360 
361  unsigned int n_discrete_values;
362  discrete_parameter_values_in >> n_discrete_values;
363 
364  std::vector<Real> discrete_values(n_discrete_values);
365  for (auto & val : discrete_values)
366  discrete_parameter_values_in >> val;
367 
368  discrete_parameter_values[param_name] = discrete_values;
369  }
370  }
371 }

References libMesh::DECODE, and libMesh::READ.

Referenced by libMesh::RBParametrized::read_parameter_data_from_files().

◆ read_in_basis_functions()

void libMesh::RBEvaluation::read_in_basis_functions ( System sys,
const std::string &  directory_name = "offline_data",
const bool  read_binary_basis_functions = true 
)
virtualinherited

Read in all the basis functions from file.

Parameters
sysUsed for file IO.
directory_nameSpecifies which directory to write files to.
read_binary_basis_functionsIndicates whether to expect binary or ASCII data.

Definition at line 958 of file rb_evaluation.C.

961 {
962  LOG_SCOPE("read_in_basis_functions()", "RBEvaluation");
963 
964  read_in_vectors(sys,
966  directory_name,
967  "bf",
968  read_binary_basis_functions);
969 }

References libMesh::RBEvaluation::basis_functions, and libMesh::RBEvaluation::read_in_vectors().

◆ read_in_vectors()

void libMesh::RBEvaluation::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 
)
inherited

Same as read_in_basis_functions, except in this case we pass in the vectors to be written.

We assume that the size of vectors indicates the number of vectors that need to be read in.

Definition at line 971 of file rb_evaluation.C.

976 {
977  std::vector<std::vector<std::unique_ptr<NumericVector<Number>>> *> vectors_vec;
978  vectors_vec.push_back(&vectors);
979 
980  std::vector<std::string> directory_name_vec;
981  directory_name_vec.push_back(directory_name);
982 
983  std::vector<std::string> data_name_vec;
984  data_name_vec.push_back(data_name);
985 
987  vectors_vec,
988  directory_name_vec,
989  data_name_vec,
990  read_binary_vectors);
991 }

References libMesh::RBEvaluation::read_in_vectors_from_multiple_files().

Referenced by libMesh::RBEvaluation::read_in_basis_functions().

◆ read_in_vectors_from_multiple_files()

void libMesh::RBEvaluation::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 
)
inherited

Performs read_in_vectors for a list of directory names and data names.

Reading in vectors requires us to renumber the dofs in a partition-independent way. This function only renumbers the dofs once at the start (and reverts it at the end), which can save a lot of work compared to renumbering on every read.

Definition at line 993 of file rb_evaluation.C.

998 {
999  LOG_SCOPE("read_in_vectors_from_multiple_files()", "RBEvaluation");
1000 
1001  std::size_t n_files = multiple_vectors.size();
1002  std::size_t n_directories = multiple_directory_names.size();
1003  libmesh_assert((n_files == n_directories) && (n_files == multiple_data_names.size()));
1004 
1005  if (n_files == 0)
1006  return;
1007 
1008  // Make sure processors are synced up before we begin
1009  this->comm().barrier();
1010 
1011  std::ostringstream file_name;
1012  const std::string basis_function_suffix = (read_binary_vectors ? ".xdr" : ".dat");
1013 
1014  // Following EquationSystemsIO::read, we use a temporary numbering (node major)
1015  // before writing out the data. For the sake of efficiency, we do this once for
1016  // all the vectors that we read in.
1018 
1019  for (std::size_t data_index=0; data_index<n_directories; data_index++)
1020  {
1021  std::vector<std::unique_ptr<NumericVector<Number>>> & vectors = *multiple_vectors[data_index];
1022 
1023  // Allocate storage for each vector
1024  for (auto & vec : vectors)
1025  {
1026  // vectors should all be nullptr, otherwise we get a memory leak when
1027  // we create the new vectors in RBEvaluation::read_in_vectors.
1028  if (vec)
1029  libmesh_error_msg("Non-nullptr vector passed to read_in_vectors_from_multiple_files");
1030 
1031  vec = NumericVector<Number>::build(sys.comm());
1032 
1033  vec->init (sys.n_dofs(),
1034  sys.n_local_dofs(),
1035  false,
1036  PARALLEL);
1037  }
1038 
1039  file_name.str("");
1040  file_name << multiple_directory_names[data_index]
1041  << "/" << multiple_data_names[data_index]
1042  << "_data" << basis_function_suffix;
1043 
1044  // On processor zero check to be sure the file exists
1045  if (this->processor_id() == 0)
1046  {
1047  struct stat stat_info;
1048  int stat_result = stat(file_name.str().c_str(), &stat_info);
1049 
1050  if (stat_result != 0)
1051  libmesh_error_msg("File does not exist: " << file_name.str());
1052  }
1053 
1054  assert_file_exists(file_name.str());
1055  Xdr vector_data(file_name.str(),
1056  read_binary_vectors ? DECODE : READ);
1057 
1058  // Read the header data. This block of code is based on EquationSystems::_read_impl.
1059  {
1060  std::string version;
1061  vector_data.data(version);
1062 
1063  const std::string libMesh_label = "libMesh-";
1064  std::string::size_type lm_pos = version.find(libMesh_label);
1065  if (lm_pos==std::string::npos)
1066  libmesh_error_msg("version info missing in Xdr header");
1067 
1068  std::istringstream iss(version.substr(lm_pos + libMesh_label.size()));
1069  int ver_major = 0, ver_minor = 0, ver_patch = 0;
1070  char dot;
1071  iss >> ver_major >> dot >> ver_minor >> dot >> ver_patch;
1072  vector_data.set_version(LIBMESH_VERSION_ID(ver_major, ver_minor, ver_patch));
1073 
1074  // Actually read the header data. When we do this, set read_header=false
1075  // so taht we do not reinit sys, since we assume that it has already been
1076  // set up properly (e.g. the appropriate variables have already been added).
1077  sys.read_header(vector_data, version, /*read_header=*/false, /*read_additional_data=*/false);
1078  }
1079 
1080  // Comply with the System::read_serialized_vectors() interface which uses dumb pointers.
1081  std::vector<NumericVector<Number> *> vec_in;
1082  for (auto & vec : vectors)
1083  vec_in.push_back(vec.get());
1084 
1085  sys.read_serialized_vectors (vector_data, vec_in);
1086  }
1087 
1088  // Undo the temporary renumbering
1089  sys.get_mesh().fix_broken_node_and_element_numbering();
1090 }

References libMesh::RBEvaluation::assert_file_exists(), libMesh::NumericVector< T >::build(), libMesh::ParallelObject::comm(), libMesh::Xdr::data(), libMesh::DECODE, libMesh::MeshBase::fix_broken_node_and_element_numbering(), libMesh::System::get_mesh(), libMesh::MeshTools::Private::globally_renumber_nodes_and_elements(), libMesh::libmesh_assert(), libMesh::System::n_dofs(), libMesh::System::n_local_dofs(), libMesh::PARALLEL, libMesh::ParallelObject::processor_id(), libMesh::READ, libMesh::System::read_header(), and libMesh::System::read_serialized_vectors().

Referenced by libMesh::RBEvaluation::read_in_vectors().

◆ read_parameter_data_from_files()

void libMesh::RBParametrized::read_parameter_data_from_files ( const std::string &  continuous_param_file_name,
const std::string &  discrete_param_file_name,
const bool  read_binary_data 
)
inherited

Read in the parameter ranges from files.

Definition at line 284 of file rb_parametrized.C.

287 {
288  RBParameters param_min;
289  RBParameters param_max;
290  read_parameter_ranges_from_file(continuous_param_file_name,
291  read_binary_data,
292  param_min,
293  param_max);
294 
295  std::map<std::string, std::vector<Real>> discrete_parameter_values_in;
296  read_discrete_parameter_values_from_file(discrete_param_file_name,
297  read_binary_data,
298  discrete_parameter_values_in);
299 
300  initialize_parameters(param_min, param_max, discrete_parameter_values_in);
301 }

References libMesh::RBParametrized::initialize_parameters(), libMesh::RBParametrized::read_discrete_parameter_values_from_file(), and libMesh::RBParametrized::read_parameter_ranges_from_file().

Referenced by libMesh::RBEvaluation::legacy_read_offline_data_from_files(), and libMesh::RBSCMEvaluation::legacy_read_offline_data_from_files().

◆ read_parameter_ranges_from_file()

void libMesh::RBParametrized::read_parameter_ranges_from_file ( const std::string &  file_name,
const bool  read_binary,
RBParameters param_min,
RBParameters param_max 
)
privateinherited

Read in the parameter ranges from file.

Initialize parameters to the "minimum" parameter values.

Definition at line 303 of file rb_parametrized.C.

307 {
308  // The reading mode: DECODE for binary, READ for ASCII
309  XdrMODE mode = read_binary_data ? DECODE : READ;
310 
311  // Read in the parameter ranges
312  Xdr parameter_ranges_in(file_name, mode);
313  unsigned int n_continuous_params;
314  parameter_ranges_in >> n_continuous_params;
315 
316  for (unsigned int i=0; i<n_continuous_params; i++)
317  {
318  std::string param_name;
319  Real param_value;
320 
321  parameter_ranges_in >> param_name;
322  parameter_ranges_in >> param_value;
323 
324  param_min.set_value(param_name, param_value);
325  }
326  for (unsigned int i=0; i<n_continuous_params; i++)
327  {
328  std::string param_name;
329  Real param_value;
330 
331  parameter_ranges_in >> param_name;
332  parameter_ranges_in >> param_value;
333 
334  param_max.set_value(param_name, param_value);
335  }
336 
337  parameter_ranges_in.close();
338 }

References libMesh::Xdr::close(), libMesh::DECODE, libMesh::READ, libMesh::Real, and libMesh::RBParameters::set_value().

Referenced by libMesh::RBParametrized::read_parameter_data_from_files().

◆ residual_scaling_denom()

Real libMesh::RBEvaluation::residual_scaling_denom ( Real  alpha_LB)
virtualinherited

Specifies the residual scaling on the denominator to be used in the a posteriori error bound.

Override in subclass in order to obtain the desired error bound.

Definition at line 385 of file rb_evaluation.C.

386 {
387  // Here we implement the residual scaling for a coercive
388  // problem.
389  return alpha_LB;
390 }

Referenced by rb_solve(), and libMesh::RBEvaluation::rb_solve().

◆ residual_scaling_numer()

Real TransientRBEvaluation::residual_scaling_numer ( Real  alpha_LB)
virtual

Specifies the residual scaling on the numerator to be used in the a posteriori error bound.

Override in subclass in order to obtain the desired error bound.

Definition at line 415 of file transient_rb_evaluation.C.

416 {
417  return get_delta_t();
418 }

References libMesh::RBTemporalDiscretization::get_delta_t().

Referenced by rb_solve().

◆ resize_data_structures()

void TransientRBEvaluation::resize_data_structures ( const unsigned int  Nmax,
bool  resize_error_bound_data = true 
)
overridevirtual

Resize and clear the data vectors corresponding to the value of Nmax.

Optionally resize the data structures required for the error bound. Overridden to resize data relevant in the time-dependent case.

Reimplemented from libMesh::RBEvaluation.

Definition at line 68 of file transient_rb_evaluation.C.

70 {
71  LOG_SCOPE("resize_data_structures()", "TransientRBEvaluation");
72 
73  Parent::resize_data_structures(Nmax, resize_error_bound_data);
74 
75  RB_L2_matrix.resize(Nmax,Nmax);
76  RB_LHS_matrix.resize(Nmax,Nmax);
77  RB_RHS_matrix.resize(Nmax,Nmax);
78  RB_RHS_save.resize(Nmax);
79 
80  TransientRBThetaExpansion & trans_theta_expansion =
81  cast_ref<TransientRBThetaExpansion &>(get_rb_theta_expansion());
82  const unsigned int Q_m = trans_theta_expansion.get_n_M_terms();
83  const unsigned int Q_a = trans_theta_expansion.get_n_A_terms();
84  const unsigned int Q_f = trans_theta_expansion.get_n_F_terms();
85 
86  // Allocate dense matrices for RB solves
87  RB_M_q_vector.resize(Q_m);
88  for (unsigned int q=0; q<Q_m; q++)
89  {
90  // Initialize the memory for the RB matrices
91  RB_M_q_vector[q].resize(Nmax,Nmax);
92  }
93 
94  // Initialize the initial condition storage
95  RB_initial_condition_all_N.resize(Nmax);
96  for (auto i : IntRange<unsigned int>(0, RB_initial_condition_all_N.size()))
97  {
98  // The i^th row holds a vector of lenght i+1
99  RB_initial_condition_all_N[i].resize(i+1);
100  }
101 
102  initial_L2_error_all_N.resize(Nmax, 0.);
103 
104 
105  if (resize_error_bound_data)
106  {
107  // Initialize vectors for the norms of the representors
108  Fq_Mq_representor_innerprods.resize(Q_f);
109  for (unsigned int i=0; i<Q_f; i++)
110  {
111  Fq_Mq_representor_innerprods[i].resize(Q_m);
112  for (unsigned int j=0; j<Q_m; j++)
113  {
114  Fq_Mq_representor_innerprods[i][j].resize(Nmax, 0.);
115  }
116  }
117 
118  unsigned int Q_m_hat = Q_m*(Q_m+1)/2;
119  Mq_Mq_representor_innerprods.resize(Q_m_hat);
120  for (unsigned int i=0; i<Q_m_hat; i++)
121  {
122  Mq_Mq_representor_innerprods[i].resize(Nmax);
123  for (unsigned int j=0; j<Nmax; j++)
124  {
125  Mq_Mq_representor_innerprods[i][j].resize(Nmax, 0.);
126  }
127  }
128 
129  Aq_Mq_representor_innerprods.resize(Q_a);
130  for (unsigned int i=0; i<Q_a; i++)
131  {
132  Aq_Mq_representor_innerprods[i].resize(Q_m);
133  for (unsigned int j=0; j<Q_m; j++)
134  {
135  Aq_Mq_representor_innerprods[i][j].resize(Nmax);
136  for (unsigned int k=0; k<Nmax; k++)
137  {
138  Aq_Mq_representor_innerprods[i][j][k].resize(Nmax, 0.);
139  }
140  }
141  }
142 
143  // Resize M_q_representor
144  // This is cleared in the call to clear_riesz_representors
145  // in Parent::resize_RB_data, so just resize here
146  M_q_representor.resize(Q_m);
147  for (unsigned int q_m=0; q_m<Q_m; q_m++)
148  {
149  M_q_representor[q_m].resize(Nmax);
150  }
151  }
152 }

References Aq_Mq_representor_innerprods, Fq_Mq_representor_innerprods, libMesh::RBThetaExpansion::get_n_A_terms(), libMesh::RBThetaExpansion::get_n_F_terms(), libMesh::TransientRBThetaExpansion::get_n_M_terms(), libMesh::RBEvaluation::get_rb_theta_expansion(), initial_L2_error_all_N, M_q_representor, Mq_Mq_representor_innerprods, RB_initial_condition_all_N, RB_L2_matrix, RB_LHS_matrix, RB_M_q_vector, RB_RHS_matrix, RB_RHS_save, libMesh::DenseVector< T >::resize(), libMesh::DenseMatrix< T >::resize(), and libMesh::RBEvaluation::resize_data_structures().

◆ set_control()

void libMesh::RBTemporalDiscretization::set_control ( const std::vector< Real > &  control)
inherited

Definition at line 85 of file rb_temporal_discretization.C.

86 {
87  libmesh_assert_less_equal(control.size(),_n_time_steps+1);
88  _control = control;
89  // If the input vector is smaller than the number of time steps (+1), we complete it with zeros
90  _control.resize(_n_time_steps+1);
91 }

References libMesh::RBTemporalDiscretization::_control, and libMesh::RBTemporalDiscretization::_n_time_steps.

Referenced by libMesh::RBTemporalDiscretization::pull_temporal_discretization_data().

◆ set_delta_t()

void libMesh::RBTemporalDiscretization::set_delta_t ( const Real  delta_t_in)
inherited

◆ set_euler_theta()

void libMesh::RBTemporalDiscretization::set_euler_theta ( const Real  euler_theta_in)
inherited

◆ set_n_basis_functions()

void libMesh::RBEvaluation::set_n_basis_functions ( unsigned int  n_bfs)
virtualinherited

Set the number of basis functions.

Useful when reading in stored data.

Definition at line 78 of file rb_evaluation.C.

79 {
80  basis_functions.resize(n_bfs);
81 }

References libMesh::RBEvaluation::basis_functions.

Referenced by libMesh::RBEvaluation::clear(), libMesh::RBEvaluation::legacy_read_offline_data_from_files(), and libMesh::RBDataDeserialization::load_rb_evaluation_data().

◆ set_n_time_steps()

void libMesh::RBTemporalDiscretization::set_n_time_steps ( const unsigned int  K)
inherited

◆ set_parameters()

void libMesh::RBParametrized::set_parameters ( const RBParameters params)
inherited

Set the current parameters to params.

Definition at line 155 of file rb_parametrized.C.

156 {
158  libmesh_error_msg("Error: parameters not initialized in RBParametrized::set_current_parameters");
159 
160  valid_params(params); // Terminates if params has the wrong number of parameters
161 
162  // Make a copy of params (default assignment operator just does memberwise copy, which is sufficient here)
163  this->parameters = params;
164 }

References libMesh::RBParametrized::parameters, libMesh::RBParametrized::parameters_initialized, and libMesh::RBParametrized::valid_params().

Referenced by libMesh::RBEIMConstruction::compute_best_fit_error(), libMesh::RBSCMConstruction::compute_SCM_bounds_on_training_set(), libMesh::RBEIMConstruction::enrich_RB_space(), libMesh::RBEIMTheta::evaluate(), libMesh::RBConstruction::get_RB_error_bound(), SimpleRBEvaluation::get_stability_lower_bound(), libMesh::RBParametrized::initialize_parameters(), libMesh::RBSCMEvaluation::reload_current_parameters(), libMesh::RBSCMEvaluation::set_current_parameters_from_C_J(), and libMesh::RBEIMConstruction::truth_solve().

◆ set_rb_theta_expansion()

void libMesh::RBEvaluation::set_rb_theta_expansion ( RBThetaExpansion rb_theta_expansion_in)
inherited

Set the RBThetaExpansion object.

Definition at line 83 of file rb_evaluation.C.

84 {
85  rb_theta_expansion = &rb_theta_expansion_in;
86 }

References libMesh::RBEvaluation::rb_theta_expansion.

Referenced by libMesh::RBEIMEvaluation::RBEIMEvaluation(), and SimpleRBEvaluation::SimpleRBEvaluation().

◆ set_time_step()

void libMesh::RBTemporalDiscretization::set_time_step ( const unsigned int  k)
inherited

◆ uncached_compute_residual_dual_norm()

Real TransientRBEvaluation::uncached_compute_residual_dual_norm ( const unsigned int  N)
virtual

Compute the dual norm of the residual for the solution saved in RB_solution.

This function does not used the cached data and therefore also works when the parameter changes as a function of time.

Definition at line 590 of file transient_rb_evaluation.C.

591 {
592  LOG_SCOPE("uncached_compute_residual_dual_norm()", "TransientRBEvaluation");
593 
594  // Use the stored representor inner product values
595  // to evaluate the residual norm
596 
597  const RBParameters & mu = get_parameters();
598 
599  TransientRBThetaExpansion & trans_theta_expansion =
600  cast_ref<TransientRBThetaExpansion &>(get_rb_theta_expansion());
601  const unsigned int Q_m = trans_theta_expansion.get_n_M_terms();
602  const unsigned int Q_a = trans_theta_expansion.get_n_A_terms();
603  const unsigned int Q_f = trans_theta_expansion.get_n_F_terms();
604 
605  const Real dt = get_delta_t();
606  const Real euler_theta = get_euler_theta();
607 
608  std::vector<Number> RB_u_euler_theta(N);
609  std::vector<Number> mass_coeffs(N);
610  for (unsigned int i=0; i<N; i++)
611  {
612  RB_u_euler_theta[i] = euler_theta*RB_solution(i) +
613  (1.-euler_theta)*old_RB_solution(i);
614  mass_coeffs[i] = -(RB_solution(i) - old_RB_solution(i))/dt;
615  }
616 
617  Number residual_norm_sq = 0.;
618 
619  unsigned int q=0;
620  for (unsigned int q_f1=0; q_f1<Q_f; q_f1++)
621  {
622  Number cached_theta_q_f1 = trans_theta_expansion.eval_F_theta(q_f1,mu);
623  for (unsigned int q_f2=q_f1; q_f2<Q_f; q_f2++)
624  {
625  Real delta = (q_f1==q_f2) ? 1. : 2.;
626  residual_norm_sq += delta*cached_theta_q_f1*trans_theta_expansion.eval_F_theta(q_f2,mu) * Fq_representor_innerprods[q];
627 
628  q++;
629  }
630  }
631 
632  for (unsigned int q_f=0; q_f<Q_f; q_f++)
633  {
634  Number cached_theta_q_f = trans_theta_expansion.eval_F_theta(q_f,mu);
635  for (unsigned int q_a=0; q_a<Q_a; q_a++)
636  {
637  Number cached_theta_q_a = trans_theta_expansion.eval_A_theta(q_a,mu);
638  for (unsigned int i=0; i<N; i++)
639  {
640  residual_norm_sq += 2.*RB_u_euler_theta[i]*cached_theta_q_f*cached_theta_q_a*
641  Fq_Aq_representor_innerprods[q_f][q_a][i];
642  }
643  }
644  }
645 
646  q=0;
647  for (unsigned int q_a1=0; q_a1<Q_a; q_a1++)
648  {
649  Number cached_theta_q_a1 = trans_theta_expansion.eval_A_theta(q_a1,mu);
650  for (unsigned int q_a2=q_a1; q_a2<Q_a; q_a2++)
651  {
652  Number cached_theta_q_a2 = trans_theta_expansion.eval_A_theta(q_a2,mu);
653  Real delta = (q_a1==q_a2) ? 1. : 2.;
654 
655  for (unsigned int i=0; i<N; i++)
656  {
657  for (unsigned int j=0; j<N; j++)
658  {
659  residual_norm_sq += delta*RB_u_euler_theta[i]*RB_u_euler_theta[j]*
660  cached_theta_q_a1*cached_theta_q_a2*
662  }
663  }
664  q++;
665  }
666  }
667 
668  // Now add the terms due to the time-derivative
669  q=0;
670  for (unsigned int q_m1=0; q_m1<Q_m; q_m1++)
671  {
672  Number cached_theta_q_m1 = trans_theta_expansion.eval_M_theta(q_m1,mu);
673  for (unsigned int q_m2=q_m1; q_m2<Q_m; q_m2++)
674  {
675  Number cached_theta_q_m2 = trans_theta_expansion.eval_M_theta(q_m2,mu);
676  Real delta = (q_m1==q_m2) ? 1. : 2.;
677 
678  for (unsigned int i=0; i<N; i++)
679  {
680  for (unsigned int j=0; j<N; j++)
681  {
682  residual_norm_sq += delta*mass_coeffs[i]*mass_coeffs[j]*
683  cached_theta_q_m1*cached_theta_q_m2*
685  }
686  }
687  q++;
688  }
689  }
690 
691  for (unsigned int q_f=0; q_f<Q_f; q_f++)
692  {
693  Number cached_theta_q_f = trans_theta_expansion.eval_F_theta(q_f,mu);
694  for (unsigned int q_m=0; q_m<Q_m; q_m++)
695  {
696  Number cached_theta_q_m = trans_theta_expansion.eval_M_theta(q_m,mu);
697  for (unsigned int i=0; i<N; i++)
698  {
699  residual_norm_sq += 2.*mass_coeffs[i]*cached_theta_q_f * cached_theta_q_m * Fq_Mq_representor_innerprods[q_f][q_m][i];
700  }
701  }
702  }
703 
704  for (unsigned int q_a=0; q_a<Q_a; q_a++)
705  {
706  Number cached_theta_q_a = trans_theta_expansion.eval_A_theta(q_a,mu);
707 
708  for (unsigned int q_m=0; q_m<Q_m; q_m++)
709  {
710  Number cached_theta_q_m = trans_theta_expansion.eval_M_theta(q_m,mu);
711 
712  for (unsigned int i=0; i<N; i++)
713  {
714  for (unsigned int j=0; j<N; j++)
715  {
716  residual_norm_sq += 2.*RB_u_euler_theta[i]*mass_coeffs[j]*
717  cached_theta_q_a*cached_theta_q_m*
718  Aq_Mq_representor_innerprods[q_a][q_m][i][j];
719  }
720  }
721  }
722  }
723 
724  if (libmesh_real(residual_norm_sq) < 0)
725  {
726  libMesh::out << "Warning: Square of residual norm is negative "
727  << "in TransientRBEvaluation::compute_residual_dual_norm()" << std::endl;
728 
729  // Sometimes this is negative due to rounding error,
730  // but error is on the order of 1.e-10, so shouldn't
731  // affect result
732  residual_norm_sq = std::abs(residual_norm_sq);
733  }
734 
735  // libMesh::out << "slow residual_sq = " << slow_residual_norm_sq
736  // << ", fast residual_sq = " << residual_norm_sq << std::endl;
737 
738  return libmesh_real(std::sqrt( residual_norm_sq ));
739 }

References std::abs(), libMesh::RBEvaluation::Aq_Aq_representor_innerprods, Aq_Mq_representor_innerprods, libMesh::RBThetaExpansion::eval_A_theta(), libMesh::RBThetaExpansion::eval_F_theta(), libMesh::TransientRBThetaExpansion::eval_M_theta(), libMesh::RBEvaluation::Fq_Aq_representor_innerprods, Fq_Mq_representor_innerprods, libMesh::RBEvaluation::Fq_representor_innerprods, libMesh::RBTemporalDiscretization::get_delta_t(), libMesh::RBTemporalDiscretization::get_euler_theta(), libMesh::RBThetaExpansion::get_n_A_terms(), libMesh::RBThetaExpansion::get_n_F_terms(), libMesh::TransientRBThetaExpansion::get_n_M_terms(), libMesh::RBParametrized::get_parameters(), libMesh::RBEvaluation::get_rb_theta_expansion(), libMesh::libmesh_real(), Mq_Mq_representor_innerprods, old_RB_solution, libMesh::out, libMesh::RBEvaluation::RB_solution, libMesh::Real, and std::sqrt().

◆ valid_params()

bool libMesh::RBParametrized::valid_params ( const RBParameters params)
privateinherited

Helper function to check that params is valid.

Definition at line 402 of file rb_parametrized.C.

403 {
404  if (params.n_parameters() != get_n_params())
405  libmesh_error_msg("Error: Number of parameters don't match");
406 
407  else
408  {
409  bool valid = true;
410  for (const auto & pr : params)
411  {
412  const std::string & param_name = pr.first;
413  valid = valid && ( (get_parameter_min(param_name) <= params.get_value(param_name)) &&
414  (params.get_value(param_name) <= get_parameter_max(param_name)) );
415 
416  if (is_discrete_parameter(param_name))
417  {
418  // make sure params.get_value(param_name) is sufficiently close
419  // to one of the discrete parameter values
420  valid = valid && is_value_in_list(params.get_value(param_name),
421  get_discrete_parameter_values().find(param_name)->second,
422  TOLERANCE);
423  }
424  }
425 
426  if (!valid && verbose_mode)
427  libMesh::out << "Warning: parameter is outside parameter range" << std::endl;
428 
429  return valid;
430  }
431 }

References libMesh::RBParametrized::get_discrete_parameter_values(), libMesh::RBParametrized::get_n_params(), libMesh::RBParametrized::get_parameter_max(), libMesh::RBParametrized::get_parameter_min(), libMesh::RBParametrized::is_discrete_parameter(), libMesh::RBParametrized::is_value_in_list(), libMesh::RBParameters::n_parameters(), libMesh::out, libMesh::TOLERANCE, libMesh::Quality::valid(), and libMesh::RBParametrized::verbose_mode.

Referenced by libMesh::RBParametrized::set_parameters().

◆ write_discrete_parameter_values_to_file()

void libMesh::RBParametrized::write_discrete_parameter_values_to_file ( const std::string &  file_name,
const bool  write_binary_data 
)
privateinherited

Write out the discrete parameter values to file.

Definition at line 255 of file rb_parametrized.C.

257 {
258  // write out the discrete parameters, if we have any
259  if (get_n_discrete_params() > 0)
260  {
261  // The writing mode: ENCODE for binary, WRITE for ASCII
262  XdrMODE mode = write_binary_data ? ENCODE : WRITE;
263 
264  Xdr discrete_parameters_out(file_name, mode);
265  unsigned int n_discrete_params = get_n_discrete_params();
266  discrete_parameters_out << n_discrete_params;
267 
268  for (const auto & pr : get_discrete_parameter_values())
269  {
270  std::string param_name = pr.first;
271  unsigned int n_discrete_values = cast_int<unsigned int>
272  (pr.second.size());
273  discrete_parameters_out << param_name << n_discrete_values;
274 
275  for (unsigned int i=0; i<n_discrete_values; i++)
276  {
277  Real discrete_value = pr.second[i];
278  discrete_parameters_out << discrete_value;
279  }
280  }
281  }
282 }

References libMesh::ENCODE, libMesh::RBParametrized::get_discrete_parameter_values(), libMesh::RBParametrized::get_n_discrete_params(), libMesh::Real, and libMesh::WRITE.

Referenced by libMesh::RBParametrized::write_parameter_data_to_files().

◆ write_out_basis_functions()

void libMesh::RBEvaluation::write_out_basis_functions ( System sys,
const std::string &  directory_name = "offline_data",
const bool  write_binary_basis_functions = true 
)
virtualinherited

Write out all the basis functions to file.

sys is used for file IO directory_name specifies which directory to write files to read_binary_basis_functions indicates whether to expect binary or ASCII data

Definition at line 880 of file rb_evaluation.C.

883 {
884  LOG_SCOPE("write_out_basis_functions()", "RBEvaluation");
885 
886  std::vector<NumericVector<Number>*> basis_functions_ptrs;
887  for(std::size_t i=0; i<basis_functions.size(); i++)
888  {
889  basis_functions_ptrs.push_back(basis_functions[i].get());
890  }
891 
892  write_out_vectors(sys,
893  basis_functions_ptrs,
894  directory_name,
895  "bf",
896  write_binary_basis_functions);
897 }

References libMesh::RBEvaluation::basis_functions, libMesh::ReferenceElem::get(), and libMesh::RBEvaluation::write_out_vectors().

Referenced by main().

◆ write_out_vectors()

void libMesh::RBEvaluation::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 
)
virtualinherited

Same as write_out_basis_functions, except in this case we pass in the vectors to be written.

Definition at line 899 of file rb_evaluation.C.

904 {
905  LOG_SCOPE("write_out_vectors()", "RBEvaluation");
906 
907  if (this->processor_id() == 0)
908  {
909  // Make a directory to store all the data files
910  Utility::mkdir(directory_name.c_str());
911  }
912 
913  // Make sure processors are synced up before we begin
914  this->comm().barrier();
915 
916  std::ostringstream file_name;
917  const std::string basis_function_suffix = (write_binary_vectors ? ".xdr" : ".dat");
918 
919  file_name << directory_name << "/" << data_name << "_data" << basis_function_suffix;
920  Xdr bf_data(file_name.str(),
921  write_binary_vectors ? ENCODE : WRITE);
922 
923  std::string version("libMesh-" + libMesh::get_io_compatibility_version());
924 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
925  version += " with infinite elements";
926 #endif
927  bf_data.data(version ,"# File Format Identifier");
928 
929  sys.write_header(bf_data, /*(unused arg)*/ version, /*write_additional_data=*/false);
930 
931  // Following EquationSystemsIO::write, we use a temporary numbering (node major)
932  // before writing out the data
934 
935  // Write all vectors at once.
936  {
937  // Note the API wants pointers to constant vectors, hence this...
938  std::vector<const NumericVector<Number> *> bf_out;
939  for (const auto & vec : vectors)
940  bf_out.push_back(vec);
941 
942  // for (auto & val : vectors)
943  // bf_out.push_back(val);
944  sys.write_serialized_vectors (bf_data, bf_out);
945  }
946 
947 
948  // set the current version
949  bf_data.set_version(LIBMESH_VERSION_ID(LIBMESH_MAJOR_VERSION,
950  LIBMESH_MINOR_VERSION,
951  LIBMESH_MICRO_VERSION));
952 
953 
954  // Undo the temporary renumbering
955  sys.get_mesh().fix_broken_node_and_element_numbering();
956 }

References libMesh::ParallelObject::comm(), libMesh::ENCODE, libMesh::MeshBase::fix_broken_node_and_element_numbering(), libMesh::get_io_compatibility_version(), libMesh::System::get_mesh(), libMesh::MeshTools::Private::globally_renumber_nodes_and_elements(), libMesh::Utility::mkdir(), libMesh::ParallelObject::processor_id(), libMesh::WRITE, libMesh::System::write_header(), and libMesh::System::write_serialized_vectors().

Referenced by libMesh::RBEvaluation::write_out_basis_functions().

◆ write_parameter_data_to_files()

void libMesh::RBParametrized::write_parameter_data_to_files ( const std::string &  continuous_param_file_name,
const std::string &  discrete_param_file_name,
const bool  write_binary_data 
)
inherited

Write out the parameter ranges to files.

Definition at line 214 of file rb_parametrized.C.

217 {
218  write_parameter_ranges_to_file(continuous_param_file_name, write_binary_data);
219  write_discrete_parameter_values_to_file(discrete_param_file_name, write_binary_data);
220 }

References libMesh::RBParametrized::write_discrete_parameter_values_to_file(), and libMesh::RBParametrized::write_parameter_ranges_to_file().

Referenced by libMesh::RBEvaluation::legacy_write_offline_data_to_files(), and libMesh::RBSCMEvaluation::legacy_write_offline_data_to_files().

◆ write_parameter_ranges_to_file()

void libMesh::RBParametrized::write_parameter_ranges_to_file ( const std::string &  file_name,
const bool  write_binary 
)
privateinherited

Write out the parameter ranges to file.

Definition at line 222 of file rb_parametrized.C.

224 {
225  // The writing mode: ENCODE for binary, WRITE for ASCII
226  XdrMODE mode = write_binary_data ? ENCODE : WRITE;
227 
228  // Write out the parameter ranges
229  Xdr parameter_ranges_out(file_name, mode);
230  unsigned int n_continuous_params = get_n_continuous_params();
231  parameter_ranges_out << n_continuous_params;
232 
233  for (const auto & pr : get_parameters_min())
234  {
235  std::string param_name = pr.first;
236  if (!is_discrete_parameter(param_name))
237  {
238  Real param_value = pr.second;
239  parameter_ranges_out << param_name << param_value;
240  }
241  }
242 
243  for (const auto & pr : get_parameters_max())
244  {
245  std::string param_name = pr.first;
246  if (!is_discrete_parameter(param_name))
247  {
248  Real param_value = pr.second;
249  parameter_ranges_out << param_name << param_value;
250  }
251  }
252  parameter_ranges_out.close();
253 }

References libMesh::Xdr::close(), libMesh::ENCODE, libMesh::RBParametrized::get_n_continuous_params(), libMesh::RBParametrized::get_parameters_max(), libMesh::RBParametrized::get_parameters_min(), libMesh::RBParametrized::is_discrete_parameter(), libMesh::Real, and libMesh::WRITE.

Referenced by libMesh::RBParametrized::write_parameter_data_to_files().

Member Data Documentation

◆ _communicator

const Parallel::Communicator& libMesh::ParallelObject::_communicator
protectedinherited

◆ _control

std::vector<Real> libMesh::RBTemporalDiscretization::_control
privateinherited

The RHS control (scalar function of time).

A function h(t) that is used in the RHS as h(t)*f(x, \( \mu \)). See Martin Grepl's thesis

Definition at line 121 of file rb_temporal_discretization.h.

Referenced by libMesh::RBTemporalDiscretization::get_control(), libMesh::RBTemporalDiscretization::pull_temporal_discretization_data(), libMesh::RBTemporalDiscretization::set_control(), and libMesh::RBTemporalDiscretization::set_n_time_steps().

◆ _counts

ReferenceCounter::Counts libMesh::ReferenceCounter::_counts
staticprotectedinherited

◆ _current_time_step

unsigned int libMesh::RBTemporalDiscretization::_current_time_step
privateinherited

◆ _delta_t

Real libMesh::RBTemporalDiscretization::_delta_t
privateinherited

◆ _discrete_parameter_values

std::map<std::string, std::vector<Real> > libMesh::RBParametrized::_discrete_parameter_values
privateinherited

Map that defines the allowable values of any discrete parameters.

Definition at line 235 of file rb_parametrized.h.

Referenced by libMesh::RBParametrized::get_discrete_parameter_values(), libMesh::RBParametrized::initialize_parameters(), and libMesh::RBParametrized::is_discrete_parameter().

◆ _enable_print_counter

bool libMesh::ReferenceCounter::_enable_print_counter = true
staticprotectedinherited

Flag to control whether reference count information is printed when print_info is called.

Definition at line 141 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::disable_print_counter_info(), libMesh::ReferenceCounter::enable_print_counter_info(), and libMesh::ReferenceCounter::print_info().

◆ _euler_theta

Real libMesh::RBTemporalDiscretization::_euler_theta
privateinherited

The parameter that determines the generalized Euler scheme discretization that we employ.

euler_theta = 0 —> Forward Euler euler_theta = 0.5 —> Crank-Nicolson euler_theta = 1 —> Backward Euler

Definition at line 104 of file rb_temporal_discretization.h.

Referenced by libMesh::RBTemporalDiscretization::get_euler_theta(), and libMesh::RBTemporalDiscretization::set_euler_theta().

◆ _mutex

Threads::spin_mutex libMesh::ReferenceCounter::_mutex
staticprotectedinherited

Mutual exclusion object to enable thread-safe reference counting.

Definition at line 135 of file reference_counter.h.

◆ _n_objects

Threads::atomic< unsigned int > libMesh::ReferenceCounter::_n_objects
staticprotectedinherited

The number of objects.

Print the reference count information when the number returns to 0.

Definition at line 130 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::n_objects(), libMesh::ReferenceCounter::ReferenceCounter(), and libMesh::ReferenceCounter::~ReferenceCounter().

◆ _n_time_steps

unsigned int libMesh::RBTemporalDiscretization::_n_time_steps
privateinherited

◆ _rb_solve_data_cached

bool libMesh::TransientRBEvaluation::_rb_solve_data_cached

Check that the data has been cached in case of using rb_solve_again.

Definition at line 249 of file transient_rb_evaluation.h.

Referenced by rb_solve(), and rb_solve_again().

◆ Aq_Aq_representor_innerprods

std::vector<std::vector<std::vector<Number> > > libMesh::RBEvaluation::Aq_Aq_representor_innerprods
inherited

◆ Aq_Mq_representor_innerprods

std::vector<std::vector<std::vector<std::vector<Number> > > > libMesh::TransientRBEvaluation::Aq_Mq_representor_innerprods

◆ Aq_representor

std::vector<std::vector<std::unique_ptr<NumericVector<Number> > > > libMesh::RBEvaluation::Aq_representor
inherited

Vector storing the residual representors associated with the left-hand side.

These are basis dependent and hence stored here, whereas the Fq_representors are stored in RBSystem.

Definition at line 316 of file rb_evaluation.h.

Referenced by libMesh::RBEvaluation::clear_riesz_representors(), libMesh::RBConstruction::read_riesz_representors_from_files(), libMesh::RBEvaluation::resize_data_structures(), libMesh::TransientRBConstruction::update_residual_terms(), libMesh::RBConstruction::update_residual_terms(), and libMesh::RBConstruction::write_riesz_representors_to_files().

◆ basis_functions

std::vector<std::unique_ptr<NumericVector<Number> > > libMesh::RBEvaluation::basis_functions
inherited

◆ cached_Aq_Aq_matrix

DenseMatrix<Number> libMesh::TransientRBEvaluation::cached_Aq_Aq_matrix

◆ cached_Aq_Mq_matrix

DenseMatrix<Number> libMesh::TransientRBEvaluation::cached_Aq_Mq_matrix

◆ cached_Fq_Aq_vector

DenseVector<Number> libMesh::TransientRBEvaluation::cached_Fq_Aq_vector

◆ cached_Fq_Mq_vector

DenseVector<Number> libMesh::TransientRBEvaluation::cached_Fq_Mq_vector

◆ cached_Fq_term

Number libMesh::TransientRBEvaluation::cached_Fq_term

Cached residual terms.

These can be used to accelerate residual calculations when we have an LTI system.

Definition at line 233 of file transient_rb_evaluation.h.

Referenced by cache_online_residual_terms(), and compute_residual_dual_norm().

◆ cached_Mq_Mq_matrix

DenseMatrix<Number> libMesh::TransientRBEvaluation::cached_Mq_Mq_matrix

◆ compute_RB_inner_product

bool libMesh::RBEvaluation::compute_RB_inner_product
inherited

◆ error_bound_all_k

std::vector<Real > libMesh::TransientRBEvaluation::error_bound_all_k

The error bound data for all time-levels from the most recent rb_solve.

Definition at line 206 of file transient_rb_evaluation.h.

Referenced by rb_solve().

◆ evaluate_RB_error_bound

bool libMesh::RBEvaluation::evaluate_RB_error_bound
inherited

Boolean to indicate whether we evaluate a posteriori error bounds when rb_solve is called.

Definition at line 322 of file rb_evaluation.h.

Referenced by libMesh::RBEIMConstruction::compute_best_fit_error(), rb_solve(), libMesh::RBEvaluation::rb_solve(), and libMesh::RBEIMEvaluation::rb_solve().

◆ Fq_Aq_representor_innerprods

std::vector<std::vector<std::vector<Number> > > libMesh::RBEvaluation::Fq_Aq_representor_innerprods
inherited

Vectors storing the residual representor inner products to be used in computing the residuals online.

We store the Aq-dependent representor inner products because they depend on a reduced basis space. The basis independent representors are stored in RBSystem.

Definition at line 299 of file rb_evaluation.h.

Referenced by libMesh::RBDataSerialization::add_rb_evaluation_data_to_builder(), cache_online_residual_terms(), libMesh::RBEvaluation::compute_residual_dual_norm(), libMesh::RBEvaluation::legacy_read_offline_data_from_files(), libMesh::RBEvaluation::legacy_write_offline_data_to_files(), libMesh::RBDataDeserialization::load_rb_evaluation_data(), libMesh::RBEvaluation::resize_data_structures(), uncached_compute_residual_dual_norm(), and libMesh::RBConstruction::update_residual_terms().

◆ Fq_Mq_representor_innerprods

std::vector<std::vector<std::vector<Number> > > libMesh::TransientRBEvaluation::Fq_Mq_representor_innerprods

◆ Fq_representor_innerprods

std::vector<Number> libMesh::RBEvaluation::Fq_representor_innerprods
inherited

◆ greedy_param_list

std::vector<RBParameters> libMesh::RBEvaluation::greedy_param_list
inherited

◆ initial_L2_error_all_N

std::vector<Real> libMesh::TransientRBEvaluation::initial_L2_error_all_N

◆ M_q_representor

std::vector<std::vector<std::unique_ptr<NumericVector<Number> > > > libMesh::TransientRBEvaluation::M_q_representor

Vector storing the mass matrix representors.

These are basis dependent and hence stored here.

Definition at line 244 of file transient_rb_evaluation.h.

Referenced by clear_riesz_representors(), resize_data_structures(), libMesh::TransientRBConstruction::update_residual_terms(), and libMesh::TransientRBConstruction::write_riesz_representors_to_files().

◆ Mq_Mq_representor_innerprods

std::vector<std::vector<std::vector<Number> > > libMesh::TransientRBEvaluation::Mq_Mq_representor_innerprods

◆ old_RB_solution

DenseVector<Number> libMesh::TransientRBEvaluation::old_RB_solution

The RB solution at the previous time-level.

Definition at line 195 of file transient_rb_evaluation.h.

Referenced by compute_residual_dual_norm(), rb_solve(), rb_solve_again(), and uncached_compute_residual_dual_norm().

◆ output_dual_innerprods

std::vector<std::vector<Number > > libMesh::RBEvaluation::output_dual_innerprods
inherited

◆ parameters

RBParameters libMesh::RBParametrized::parameters
privateinherited

◆ parameters_initialized

bool libMesh::RBParametrized::parameters_initialized
privateinherited

◆ parameters_max

RBParameters libMesh::RBParametrized::parameters_max
privateinherited

◆ parameters_min

RBParameters libMesh::RBParametrized::parameters_min
privateinherited

◆ RB_Aq_vector

std::vector<DenseMatrix<Number> > libMesh::RBEvaluation::RB_Aq_vector
inherited

◆ RB_Fq_vector

std::vector<DenseVector<Number> > libMesh::RBEvaluation::RB_Fq_vector
inherited

◆ RB_initial_condition_all_N

std::vector<DenseVector<Number> > libMesh::TransientRBEvaluation::RB_initial_condition_all_N

◆ RB_inner_product_matrix

DenseMatrix<Number> libMesh::RBEvaluation::RB_inner_product_matrix
inherited

◆ RB_L2_matrix

DenseMatrix<Number> libMesh::TransientRBEvaluation::RB_L2_matrix

◆ RB_LHS_matrix

DenseMatrix<Number> libMesh::TransientRBEvaluation::RB_LHS_matrix

Cached data for subsequent solves.

Definition at line 171 of file transient_rb_evaluation.h.

Referenced by rb_solve(), rb_solve_again(), and resize_data_structures().

◆ RB_M_q_vector

std::vector<DenseMatrix<Number> > libMesh::TransientRBEvaluation::RB_M_q_vector

◆ RB_output_error_bounds

std::vector<Real > libMesh::RBEvaluation::RB_output_error_bounds
inherited

◆ RB_output_error_bounds_all_k

std::vector<std::vector<Real> > libMesh::TransientRBEvaluation::RB_output_error_bounds_all_k

The error bounds for each RB output for all time-levels from the most recent rb_solve.

Definition at line 190 of file transient_rb_evaluation.h.

Referenced by rb_solve().

◆ RB_output_vectors

std::vector<std::vector<DenseVector<Number> > > libMesh::RBEvaluation::RB_output_vectors
inherited

◆ RB_outputs

std::vector<Number > libMesh::RBEvaluation::RB_outputs
inherited

The vectors storing the RB output values and corresponding error bounds.

Definition at line 281 of file rb_evaluation.h.

Referenced by libMesh::RBEvaluation::rb_solve(), and libMesh::RBEvaluation::resize_data_structures().

◆ RB_outputs_all_k

std::vector<std::vector<Number> > libMesh::TransientRBEvaluation::RB_outputs_all_k

The RB outputs for all time-levels from the most recent rb_solve.

Definition at line 184 of file transient_rb_evaluation.h.

Referenced by rb_solve().

◆ RB_RHS_matrix

DenseMatrix<Number> libMesh::TransientRBEvaluation::RB_RHS_matrix

Definition at line 172 of file transient_rb_evaluation.h.

Referenced by rb_solve(), rb_solve_again(), and resize_data_structures().

◆ RB_RHS_save

DenseVector<Number> libMesh::TransientRBEvaluation::RB_RHS_save

Definition at line 173 of file transient_rb_evaluation.h.

Referenced by rb_solve(), rb_solve_again(), and resize_data_structures().

◆ RB_solution

DenseVector<Number> libMesh::RBEvaluation::RB_solution
inherited

◆ RB_temporal_solution_data

std::vector<DenseVector<Number> > libMesh::TransientRBEvaluation::RB_temporal_solution_data

Array storing the solution data at each time level from the most recent solve.

Definition at line 200 of file transient_rb_evaluation.h.

Referenced by libMesh::TransientRBConstruction::load_rb_solution(), and rb_solve().

◆ rb_theta_expansion

RBThetaExpansion* libMesh::RBEvaluation::rb_theta_expansion
privateinherited

◆ verbose_mode

bool libMesh::RBParametrized::verbose_mode
inherited

Public boolean to toggle verbose mode.

Definition at line 170 of file rb_parametrized.h.

Referenced by libMesh::RBParametrized::valid_params().


The documentation for this class was generated from the following files:
libMesh::RBEvaluation::get_n_basis_functions
virtual unsigned int get_n_basis_functions() const
Get the current number of basis functions.
Definition: rb_evaluation.h:145
libMesh::RBTemporalDiscretization::_n_time_steps
unsigned int _n_time_steps
The number of time-steps.
Definition: rb_temporal_discretization.h:114
libMesh::RBParametrized::get_parameters_min
const RBParameters & get_parameters_min() const
Get an RBParameters object that specifies the minimum allowable value for each parameter.
Definition: rb_parametrized.C:174
libMesh::Number
Real Number
Definition: libmesh_common.h:195
libMesh::RBParametrized::_discrete_parameter_values
std::map< std::string, std::vector< Real > > _discrete_parameter_values
Map that defines the allowable values of any discrete parameters.
Definition: rb_parametrized.h:235
libMesh::RBEvaluation::RB_Aq_vector
std::vector< DenseMatrix< Number > > RB_Aq_vector
Dense matrices for the RB computations.
Definition: rb_evaluation.h:260
libMesh::RBThetaExpansion::get_n_output_terms
unsigned int get_n_output_terms(unsigned int output_index) const
Get the number of affine terms associated with the specified output.
Definition: rb_theta_expansion.C:53
libMesh::RBParameters::print
void print() const
Print the parameters.
Definition: rb_parameters.C:134
libMesh::RBTemporalDiscretization::get_control
Real get_control(const unsigned int k) const
Get/set the RHS control.
Definition: rb_temporal_discretization.C:79
libMesh::RBTemporalDiscretization::set_n_time_steps
void set_n_time_steps(const unsigned int K)
Definition: rb_temporal_discretization.C:73
libMesh::RBTemporalDiscretization::_current_time_step
unsigned int _current_time_step
The current time-step.
Definition: rb_temporal_discretization.h:109
libMesh::PARALLEL
Definition: enum_parallel_type.h:36
libMesh::TransientRBEvaluation::M_q_representor
std::vector< std::vector< std::unique_ptr< NumericVector< Number > > > > M_q_representor
Vector storing the mass matrix representors.
Definition: transient_rb_evaluation.h:244
libMesh::TransientRBEvaluation::old_RB_solution
DenseVector< Number > old_RB_solution
The RB solution at the previous time-level.
Definition: transient_rb_evaluation.h:195
libMesh::RBParametrized::get_closest_value
static Real get_closest_value(Real value, const std::vector< Real > &list_of_values)
Definition: rb_parametrized.C:433
libMesh::TransientRBEvaluation::_rb_solve_data_cached
bool _rb_solve_data_cached
Check that the data has been cached in case of using rb_solve_again.
Definition: transient_rb_evaluation.h:249
libMesh::RBEvaluation::is_rb_theta_expansion_initialized
bool is_rb_theta_expansion_initialized() const
Definition: rb_evaluation.C:96
libMesh::RBParametrized::read_discrete_parameter_values_from_file
void read_discrete_parameter_values_from_file(const std::string &file_name, const bool read_binary_data, std::map< std::string, std::vector< Real >> &discrete_parameter_values_in)
Read in the discrete parameter values from file, if we have any.
Definition: rb_parametrized.C:340
libMesh::RBTemporalDiscretization::get_euler_theta
Real get_euler_theta() const
Get/set euler_theta, parameter that determines the temporal discretization.
Definition: rb_temporal_discretization.C:46
libMesh::libmesh_real
T libmesh_real(T a)
Definition: libmesh_common.h:166
libMesh::RBTemporalDiscretization::set_delta_t
void set_delta_t(const Real delta_t_in)
Definition: rb_temporal_discretization.C:41
libMesh::TransientRBEvaluation::clear
virtual void clear() override
Clear this TransientRBEvaluation object.
Definition: transient_rb_evaluation.C:53
libMesh::TransientRBEvaluation::RB_initial_condition_all_N
std::vector< DenseVector< Number > > RB_initial_condition_all_N
The RB initial conditions (i.e.
Definition: transient_rb_evaluation.h:218
libMesh::RBParametrized::get_n_params
unsigned int get_n_params() const
Get the number of parameters.
Definition: rb_parametrized.C:115
libMesh::RBParametrized::verbose_mode
bool verbose_mode
Public boolean to toggle verbose mode.
Definition: rb_parametrized.h:170
libMesh::DenseVector::zero
virtual void zero() override
Set every element in the vector to 0.
Definition: dense_vector.h:379
libMesh::DenseMatrix::add
boostcopy::enable_if_c< ScalarTraits< T2 >::value, void >::type add(const T2 factor, const DenseMatrix< T3 > &mat)
Adds factor times mat to this matrix.
Definition: dense_matrix.h:945
libMesh::RBTemporalDiscretization::_control
std::vector< Real > _control
The RHS control (scalar function of time).
Definition: rb_temporal_discretization.h:121
libMesh::RBEvaluation::output_dual_innerprods
std::vector< std::vector< Number > > output_dual_innerprods
The vector storing the dual norm inner product terms for each output.
Definition: rb_evaluation.h:308
libMesh::ReferenceCounter::_counts
static Counts _counts
Actually holds the data.
Definition: reference_counter.h:122
std::sqrt
MetaPhysicL::DualNumber< T, D > sqrt(const MetaPhysicL::DualNumber< T, D > &in)
libMesh::TOLERANCE
static const Real TOLERANCE
Definition: libmesh_common.h:128
libMesh::ParallelObject::comm
const Parallel::Communicator & comm() const
Definition: parallel_object.h:94
libMesh::TransientRBEvaluation::RB_L2_matrix
DenseMatrix< Number > RB_L2_matrix
Dense RB L2 matrix.
Definition: transient_rb_evaluation.h:166
libMesh::libmesh_conj
T libmesh_conj(T a)
Definition: libmesh_common.h:167
libMesh::ReferenceCounter::_n_objects
static Threads::atomic< unsigned int > _n_objects
The number of objects.
Definition: reference_counter.h:130
libMesh::WRITE
Definition: enum_xdr_mode.h:40
libMesh::RBEvaluation::clear
virtual void clear() override
Clear this RBEvaluation object.
Definition: rb_evaluation.C:62
libMesh::RBThetaExpansion::eval_output_theta
virtual Number eval_output_theta(unsigned int output_index, unsigned int q_l, const RBParameters &mu)
Evaluate theta_q_l at the current parameter.
Definition: rb_theta_expansion.C:141
libMesh::RBTemporalDiscretization::get_delta_t
Real get_delta_t() const
Get/set delta_t, the time-step size.
Definition: rb_temporal_discretization.C:36
libMesh::RBParametrized::set_parameters
void set_parameters(const RBParameters &params)
Set the current parameters to params.
Definition: rb_parametrized.C:155
libMesh::RBParametrized::get_n_discrete_params
unsigned int get_n_discrete_params() const
Get the number of discrete parameters.
Definition: rb_parametrized.C:135
libMesh::ReferenceCounter::get_info
static std::string get_info()
Gets a string containing the reference information.
Definition: reference_counter.C:47
libMesh::RBParametrized::parameters_max
RBParameters parameters_max
Definition: rb_parametrized.h:230
libMesh::RBParameters::n_parameters
unsigned int n_parameters() const
Get the number of parameters that have been added.
Definition: rb_parameters.C:63
libMesh::RBEvaluation::assert_file_exists
void assert_file_exists(const std::string &file_name)
Helper function that checks if file_name exists.
Definition: rb_evaluation.C:874
libMesh::RBParametrized::get_n_continuous_params
unsigned int get_n_continuous_params() const
Get the number of continuous parameters.
Definition: rb_parametrized.C:125
libMesh::RBParametrized::get_parameters_max
const RBParameters & get_parameters_max() const
Get an RBParameters object that specifies the maximum allowable value for each parameter.
Definition: rb_parametrized.C:182
libMesh::TransientRBEvaluation::cached_Fq_term
Number cached_Fq_term
Cached residual terms.
Definition: transient_rb_evaluation.h:233
libMesh::NumericVector::build
static std::unique_ptr< NumericVector< T > > build(const Parallel::Communicator &comm, const SolverPackage solver_package=libMesh::default_solver_package())
Builds a NumericVector on the processors in communicator comm using the linear solver package specifi...
Definition: numeric_vector.C:49
libMesh::RBParametrized::get_parameters
const RBParameters & get_parameters() const
Get the current parameters.
Definition: rb_parametrized.C:166
libMesh::DenseMatrix::resize
void resize(const unsigned int new_m, const unsigned int new_n)
Resize the matrix.
Definition: dense_matrix.h:822
libMesh::RBEvaluation::RBEvaluation
RBEvaluation(const Parallel::Communicator &comm)
Constructor.
Definition: rb_evaluation.C:47
libMesh::DenseVector::add
boostcopy::enable_if_c< ScalarTraits< T2 >::value, void >::type add(const T2 factor, const DenseVector< T3 > &vec)
Adds factor times vec to this vector.
Definition: dense_vector.h:436
libMesh::RBTemporalDiscretization::set_time_step
void set_time_step(const unsigned int k)
Definition: rb_temporal_discretization.C:62
libMesh::TransientRBEvaluation::Fq_Mq_representor_innerprods
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.
Definition: transient_rb_evaluation.h:224
libMesh::TransientRBEvaluation::cached_Fq_Aq_vector
DenseVector< Number > cached_Fq_Aq_vector
Definition: transient_rb_evaluation.h:234
libMesh::RBEvaluation::residual_scaling_denom
virtual Real residual_scaling_denom(Real alpha_LB)
Specifies the residual scaling on the denominator to be used in the a posteriori error bound.
Definition: rb_evaluation.C:385
libMesh::RBTemporalDiscretization::get_n_time_steps
unsigned int get_n_time_steps() const
Get/set the total number of time-steps.
Definition: rb_temporal_discretization.C:68
libMesh::TransientRBEvaluation::error_bound_all_k
std::vector< Real > error_bound_all_k
The error bound data for all time-levels from the most recent rb_solve.
Definition: transient_rb_evaluation.h:206
libMesh::libmesh_assert
libmesh_assert(ctx)
libMesh::DenseMatrix::vector_mult
void vector_mult(DenseVector< T > &dest, const DenseVector< T > &arg) const
Performs the matrix-vector multiplication, dest := (*this) * arg.
Definition: dense_matrix_impl.h:403
libMesh::RBParametrized::get_parameter_max
Real get_parameter_max(const std::string &param_name) const
Get maximum allowable value of parameter param_name.
Definition: rb_parametrized.C:198
libMesh::RBEvaluation::evaluate_RB_error_bound
bool evaluate_RB_error_bound
Boolean to indicate whether we evaluate a posteriori error bounds when rb_solve is called.
Definition: rb_evaluation.h:322
libMesh::RBTemporalDiscretization::set_control
void set_control(const std::vector< Real > &control)
Definition: rb_temporal_discretization.C:85
std::abs
MetaPhysicL::DualNumber< T, D > abs(const MetaPhysicL::DualNumber< T, D > &in)
libMesh::RBEvaluation::legacy_read_offline_data_from_files
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.
Definition: rb_evaluation.C:641
libMesh::TransientRBEvaluation::RB_outputs_all_k
std::vector< std::vector< Number > > RB_outputs_all_k
The RB outputs for all time-levels from the most recent rb_solve.
Definition: transient_rb_evaluation.h:184
libMesh::XdrMODE
XdrMODE
Defines an enum for read/write mode in Xdr format.
Definition: enum_xdr_mode.h:35
libMesh::RBTemporalDiscretization::get_time_step
unsigned int get_time_step() const
Get/set the current time-step.
Definition: rb_temporal_discretization.C:57
libMesh::DECODE
Definition: enum_xdr_mode.h:39
libMesh::TransientRBEvaluation::cached_Mq_Mq_matrix
DenseMatrix< Number > cached_Mq_Mq_matrix
Definition: transient_rb_evaluation.h:238
libMesh::RBEvaluation::RB_solution
DenseVector< Number > RB_solution
The RB solution vector.
Definition: rb_evaluation.h:270
libMesh::RBEvaluation::Fq_representor_innerprods
std::vector< Number > Fq_representor_innerprods
Vectors storing the residual representor inner products to be used in computing the residuals online.
Definition: rb_evaluation.h:290
libMesh::RBEvaluation::read_in_vectors
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.
Definition: rb_evaluation.C:971
libMesh::Threads::spin_mtx
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.
Definition: threads.C:29
libMesh::ParallelObject::processor_id
processor_id_type processor_id() const
Definition: parallel_object.h:106
libMesh::TransientRBEvaluation::RB_output_error_bounds_all_k
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.
Definition: transient_rb_evaluation.h:190
libMesh::RBEvaluation::Fq_Aq_representor_innerprods
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.
Definition: rb_evaluation.h:299
libMesh::TransientRBEvaluation::RB_M_q_vector
std::vector< DenseMatrix< Number > > RB_M_q_vector
Dense matrices for the RB mass matrices.
Definition: transient_rb_evaluation.h:178
libMesh::ParallelObject::_communicator
const Parallel::Communicator & _communicator
Definition: parallel_object.h:112
libMesh::get_io_compatibility_version
std::string get_io_compatibility_version()
Specifier for I/O file compatibility features.
Definition: libmesh_version.C:80
libMesh::RBEvaluation::clear_riesz_representors
virtual void clear_riesz_representors()
Clear all the Riesz representors that are used to compute the RB residual (and hence error bound).
Definition: rb_evaluation.C:411
libMesh::TransientRBEvaluation::Mq_Mq_representor_innerprods
std::vector< std::vector< std::vector< Number > > > Mq_Mq_representor_innerprods
Definition: transient_rb_evaluation.h:225
libMesh::RBParameters::set_value
void set_value(const std::string &param_name, Real value)
Set the value of the specified parameter.
Definition: rb_parameters.C:47
libMesh::RBEvaluation::rb_theta_expansion
RBThetaExpansion * rb_theta_expansion
A pointer to to the object that stores the theta expansion.
Definition: rb_evaluation.h:344
libMesh::RBEvaluation::read_in_vectors_from_multiple_files
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.
Definition: rb_evaluation.C:993
std::pow
double pow(double a, int b)
Definition: libmesh_augment_std_namespace.h:58
libMesh::RBEvaluation::get_stability_lower_bound
virtual Real get_stability_lower_bound()
Get a lower bound for the stability constant (e.g.
Definition: rb_evaluation.C:377
libMesh::RBParametrized::parameters_min
RBParameters parameters_min
Vectors that define the ranges (min and max) for the parameters.
Definition: rb_parametrized.h:229
libMesh::TransientRBEvaluation::RB_temporal_solution_data
std::vector< DenseVector< Number > > RB_temporal_solution_data
Array storing the solution data at each time level from the most recent solve.
Definition: transient_rb_evaluation.h:200
libMesh::DenseVector::size
virtual unsigned int size() const override
Definition: dense_vector.h:92
libMesh::RBTemporalDiscretization::_euler_theta
Real _euler_theta
The parameter that determines the generalized Euler scheme discretization that we employ.
Definition: rb_temporal_discretization.h:104
libMesh::READ
Definition: enum_xdr_mode.h:41
libMesh::RBParametrized::write_discrete_parameter_values_to_file
void write_discrete_parameter_values_to_file(const std::string &file_name, const bool write_binary_data)
Write out the discrete parameter values to file.
Definition: rb_parametrized.C:255
libMesh::RBEvaluation::write_out_vectors
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.
Definition: rb_evaluation.C:899
libMesh::DenseMatrix::zero
virtual void zero() override
Set every element in the matrix to 0.
Definition: dense_matrix.h:838
libMesh::TransientRBEvaluation::clear_riesz_representors
virtual void clear_riesz_representors() override
Clear all the Riesz representors that are used to compute the RB residual (and hence error bound).
Definition: transient_rb_evaluation.C:60
libMesh::Utility::mkdir
int mkdir(const char *pathname)
Create a directory.
Definition: utility.C:140
libMesh::RBEvaluation::Aq_Aq_representor_innerprods
std::vector< std::vector< std::vector< Number > > > Aq_Aq_representor_innerprods
Definition: rb_evaluation.h:300
libMesh::RBEvaluation::legacy_write_offline_data_to_files
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.
Definition: rb_evaluation.C:416
libMesh::RBParameters::get_parameter_names
void get_parameter_names(std::set< std::string > &param_names) const
Fill param_names with the names of the parameters.
Definition: rb_parameters.C:69
libMesh::Quality::valid
std::vector< ElemQuality > valid(const ElemType t)
Returns all valid quality metrics for element type t.
Definition: elem_quality.C:324
libMesh::RBEvaluation::RB_output_vectors
std::vector< std::vector< DenseVector< Number > > > RB_output_vectors
The vectors storing the RB output vectors.
Definition: rb_evaluation.h:275
libMesh::ENCODE
Definition: enum_xdr_mode.h:38
libMesh::DenseVector::resize
void resize(const unsigned int n)
Resize the vector.
Definition: dense_vector.h:355
distance
Real distance(const Point &p)
Definition: subdomains_ex3.C:50
libMesh::RBEvaluation::eval_output_dual_norm
Real eval_output_dual_norm(unsigned int n, const RBParameters &mu)
Evaluate the dual norm of output n for the current parameters.
Definition: rb_evaluation.C:392
libMesh::RBParametrized::initialize_parameters
void initialize_parameters(const RBParameters &mu_min_in, const RBParameters &mu_max_in, const std::map< std::string, std::vector< Real >> &discrete_parameter_values)
Initialize the parameter ranges and set current_parameters.
Definition: rb_parametrized.C:60
libMesh::RBParametrized::read_parameter_ranges_from_file
void read_parameter_ranges_from_file(const std::string &file_name, const bool read_binary, RBParameters &param_min, RBParameters &param_max)
Read in the parameter ranges from file.
Definition: rb_parametrized.C:303
libMesh::MeshTools::Private::globally_renumber_nodes_and_elements
void globally_renumber_nodes_and_elements(MeshBase &)
There is no reason for a user to ever call this function.
Definition: mesh_tools.C:2411
libMesh::TransientRBEvaluation::compute_residual_dual_norm
virtual Real compute_residual_dual_norm(const unsigned int N) override
Compute the dual norm of the residual for the solution saved in RB_solution.
Definition: transient_rb_evaluation.C:542
libMesh::ReferenceElem::get
const Elem & get(const ElemType type_in)
Definition: reference_elem.C:237
libMesh::RBParametrized::parameters
RBParameters parameters
Vector storing the current parameters.
Definition: rb_parametrized.h:224
libMesh::RBEvaluation::compute_RB_inner_product
bool compute_RB_inner_product
Boolean flag to indicate whether we compute the RB_inner_product_matrix.
Definition: rb_evaluation.h:327
libMesh::TransientRBEvaluation::RB_RHS_save
DenseVector< Number > RB_RHS_save
Definition: transient_rb_evaluation.h:173
libMesh::RBParametrized::valid_params
bool valid_params(const RBParameters &params)
Helper function to check that params is valid.
Definition: rb_parametrized.C:402
libMesh::TransientRBEvaluation::cache_online_residual_terms
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.
Definition: transient_rb_evaluation.C:420
value
static const bool value
Definition: xdr_io.C:56
libMesh::TransientRBEvaluation::Aq_Mq_representor_innerprods
std::vector< std::vector< std::vector< std::vector< Number > > > > Aq_Mq_representor_innerprods
Definition: transient_rb_evaluation.h:226
libMesh::RBParametrized::get_discrete_parameter_values
const std::map< std::string, std::vector< Real > > & get_discrete_parameter_values() const
Get a const reference to the discrete parameter values.
Definition: rb_parametrized.C:381
libMesh::TransientRBEvaluation::cached_Fq_Mq_vector
DenseVector< Number > cached_Fq_Mq_vector
Definition: transient_rb_evaluation.h:236
libMesh::RBTemporalDiscretization::_delta_t
Real _delta_t
The time-step size.
Definition: rb_temporal_discretization.h:95
libMesh::TransientRBEvaluation::initial_L2_error_all_N
std::vector< Real > initial_L2_error_all_N
Vector storing initial L2 error for all 1 <= N <= RB_size.
Definition: transient_rb_evaluation.h:212
libMesh::TransientRBEvaluation::residual_scaling_numer
virtual Real residual_scaling_numer(Real alpha_LB)
Specifies the residual scaling on the numerator to be used in the a posteriori error bound.
Definition: transient_rb_evaluation.C:415
libMesh::TransientRBEvaluation::RB_LHS_matrix
DenseMatrix< Number > RB_LHS_matrix
Cached data for subsequent solves.
Definition: transient_rb_evaluation.h:171
libMesh::TransientRBEvaluation::cached_Aq_Aq_matrix
DenseMatrix< Number > cached_Aq_Aq_matrix
Definition: transient_rb_evaluation.h:235
libMesh::RBParametrized::parameters_initialized
bool parameters_initialized
Flag indicating whether the parameters have been initialized.
Definition: rb_parametrized.h:219
libMesh::RBEvaluation::resize_data_structures
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.
Definition: rb_evaluation.C:108
libMesh::DenseMatrix::lu_solve
void lu_solve(const DenseVector< T > &b, DenseVector< T > &x)
Solve the system Ax=b given the input vector b.
Definition: dense_matrix_impl.h:625
libMesh::RBEvaluation::get_rb_theta_expansion
RBThetaExpansion & get_rb_theta_expansion()
Get a reference to the rb_theta_expansion.
Definition: rb_evaluation.C:88
libMesh::RBEvaluation::basis_functions
std::vector< std::unique_ptr< NumericVector< Number > > > basis_functions
The libMesh vectors storing the finite element coefficients of the RB basis functions.
Definition: rb_evaluation.h:241
libMesh::Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Definition: libmesh_common.h:121
libMesh::RBParametrized::is_value_in_list
static bool is_value_in_list(Real value, const std::vector< Real > &list_of_values, Real tol)
Helper function to check if the specified value is in the list of values (within a tolerance given by...
Definition: rb_parametrized.C:453
libMesh::TransientRBEvaluation::RB_RHS_matrix
DenseMatrix< Number > RB_RHS_matrix
Definition: transient_rb_evaluation.h:172
libMesh::ReferenceCounter::_enable_print_counter
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called.
Definition: reference_counter.h:141
libMesh::RBEvaluation::RB_Fq_vector
std::vector< DenseVector< Number > > RB_Fq_vector
Dense vector for the RHS.
Definition: rb_evaluation.h:265
libMesh::out
OStreamProxy out
libMesh::RBTemporalDiscretization::set_euler_theta
void set_euler_theta(const Real euler_theta_in)
Definition: rb_temporal_discretization.C:51
libMesh::RBParametrized::write_parameter_ranges_to_file
void write_parameter_ranges_to_file(const std::string &file_name, const bool write_binary)
Write out the parameter ranges to file.
Definition: rb_parametrized.C:222
libMesh::TransientRBEvaluation::cached_Aq_Mq_matrix
DenseMatrix< Number > cached_Aq_Mq_matrix
Definition: transient_rb_evaluation.h:237
libMesh::RBParametrized::is_discrete_parameter
bool is_discrete_parameter(const std::string &mu_name) const
Is parameter mu_name discrete?
Definition: rb_parametrized.C:373
libMesh::Quality::name
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:42
libMesh::RBParameters::get_value
Real get_value(const std::string &param_name) const
Get the value of the specific parameter.
Definition: rb_parameters.C:41
libMesh::RBParametrized::get_parameter_min
Real get_parameter_min(const std::string &param_name) const
Get minimum allowable value of parameter param_name.
Definition: rb_parametrized.C:190