libMesh
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Static 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.
 

Public Member Functions

 TransientRBEvaluation (const Parallel::Communicator &comm_in)
 Constructor.
 
 TransientRBEvaluation (TransientRBEvaluation &&)=default
 Special functions.
 
 TransientRBEvaluation (const TransientRBEvaluation &)=delete
 
TransientRBEvaluationoperator= (const TransientRBEvaluation &)=delete
 
TransientRBEvaluationoperator= (TransientRBEvaluation &&)=default
 
virtual ~TransientRBEvaluation ()
 
virtual void clear () override
 Clear this TransientRBEvaluation object.
 
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.
 
virtual Real rb_solve (unsigned int N) override
 Perform online solve with the N RB basis functions, for the set of parameters in current_params, where 0 <= N <= RB_size.
 
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).
 
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.
 
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_vector.
 
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.
 
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.
 
virtual void clear_riesz_representors () override
 Clear all the Riesz representors that are used to compute the RB residual (and hence error bound).
 
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.
 
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.
 
virtual Real rb_solve (unsigned int N)
 Perform online solve for current_params with the N basis functions.
 
virtual Real rb_solve (unsigned int N, const std::vector< Number > *evaluated_thetas)
 Perform online solve for current_params with the N basis functions.
 
virtual Real compute_residual_dual_norm (const unsigned int N)
 Compute the dual norm of the residual for the solution saved in RB_solution.
 
virtual Real compute_residual_dual_norm (const unsigned int N, const std::vector< Number > *evaluated_thetas)
 Compute the dual norm of the residual for the solution saved in RB_solution.
 
void set_rb_theta_expansion (RBThetaExpansion &rb_theta_expansion_in)
 Set the RBThetaExpansion object.
 
RBThetaExpansionget_rb_theta_expansion ()
 Get a reference to the rb_theta_expansion.
 
const RBThetaExpansionget_rb_theta_expansion () const
 
bool is_rb_theta_expansion_initialized () const
 
NumericVector< Number > & get_basis_function (unsigned int i)
 Get a reference to the i^th basis function.
 
const NumericVector< Number > & get_basis_function (unsigned int i) const
 
virtual Real residual_scaling_denom (Real alpha_LB)
 Specifies the residual scaling on the denominator to be used in the a posteriori error bound.
 
Real eval_output_dual_norm (unsigned int n, const std::vector< Number > *evaluated_thetas)
 Evaluate the dual norm of output n for the current parameters, or using the pre-evaluted theta values provided in the "evaluated_thetas" array.
 
virtual Real get_stability_lower_bound ()
 Get a lower bound for the stability constant (e.g.
 
virtual unsigned int get_n_basis_functions () const
 Get the current number of basis functions.
 
virtual void set_n_basis_functions (unsigned int n_bfs)
 Set the number of basis functions.
 
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.
 
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.
 
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.
 
void initialize_parameters (const RBParametrized &rb_parametrized)
 Initialize the parameter ranges and set current_parameters.
 
unsigned int get_n_params () const
 Get the number of parameters.
 
unsigned int get_n_continuous_params () const
 Get the number of continuous parameters.
 
unsigned int get_n_discrete_params () const
 Get the number of discrete parameters.
 
const RBParametersget_parameters () const
 Get the current parameters.
 
bool set_parameters (const RBParameters &params)
 Set the current parameters to params The parameters are checked for validity; an error is thrown if the number of parameters or samples is different than expected.
 
const RBParametersget_parameters_min () const
 Get an RBParameters object that specifies the minimum allowable value for each parameter.
 
const RBParametersget_parameters_max () const
 Get an RBParameters object that specifies the maximum allowable value for each parameter.
 
Real get_parameter_min (const std::string &param_name) const
 Get minimum allowable value of parameter param_name.
 
Real get_parameter_max (const std::string &param_name) const
 Get maximum allowable value of parameter param_name.
 
void print_parameters () const
 Print the current parameters.
 
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.
 
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.
 
bool is_discrete_parameter (const std::string &mu_name) const
 Is parameter mu_name discrete?
 
const std::map< std::string, std::vector< Real > > & get_discrete_parameter_values () const
 Get a const reference to the discrete parameter values.
 
void print_discrete_parameter_values () const
 Print out all the discrete parameter values.
 
const Parallel::Communicatorcomm () 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.
 
void set_delta_t (const Real delta_t_in)
 
Real get_euler_theta () const
 Get/set euler_theta, parameter that determines the temporal discretization.
 
void set_euler_theta (const Real euler_theta_in)
 
unsigned int get_time_step () const
 Get/set the current time-step.
 
void set_time_step (const unsigned int k)
 
unsigned int get_n_time_steps () const
 Get/set the total number of time-steps.
 
void set_n_time_steps (const unsigned int K)
 
Real get_control (const unsigned int k) const
 Get/set the RHS control.
 
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.
 
void pull_temporal_discretization_data (RBTemporalDiscretization &other)
 Pull the temporal discretization data from other.
 

Static Public Member Functions

static 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.
 
static 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.
 
static 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.
 
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.
 
static void print_info (std::ostream &out_stream=libMesh::out)
 Prints the reference information, by default to libMesh::out.
 
static unsigned int n_objects ()
 Prints the number of outstanding (created, but not yet destroyed) objects.
 
static void enable_print_counter_info ()
 Methods to enable/disable the reference counter output from print_info().
 
static void disable_print_counter_info ()
 

Public Attributes

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

Protected Types

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

Protected Member Functions

void increment_constructor_count (const std::string &name) noexcept
 Increments the construction counter.
 
void increment_destructor_count (const std::string &name) noexcept
 Increments the destruction counter.
 

Static Protected Member Functions

static void assert_file_exists (const std::string &file_name)
 Helper function that checks if file_name exists.
 

Protected Attributes

const Parallel::Communicator_communicator
 

Static Protected Attributes

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

Private Member Functions

void check_evaluated_thetas_size (const std::vector< Number > *evaluated_thetas) const
 For interfaces like rb_solve() and compute_residual_dual_norm() that optinally take a vector of "pre-evaluated" theta values, this function checks to make sure that, when provided, it is the right size.
 
void write_parameter_ranges_to_file (const std::string &file_name, const bool write_binary)
 Write out the parameter ranges 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.
 
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.
 
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.
 
bool check_if_valid_params (const RBParameters &params) const
 Helper function to check that params is valid:
 

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).
 

Private Attributes

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

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 119 of file reference_counter.h.

◆ Parent

The type of the parent.

Definition at line 74 of file transient_rb_evaluation.h.

Constructor & Destructor Documentation

◆ TransientRBEvaluation() [1/3]

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}
bool compute_RB_inner_product
Boolean flag to indicate whether we compute the RB_inner_product_matrix.
RBEvaluation(const Parallel::Communicator &comm)
Constructor.
bool _rb_solve_data_cached
Check that the data has been cached in case of using rb_solve_again.

References libMesh::RBEvaluation::compute_RB_inner_product.

◆ TransientRBEvaluation() [2/3]

libMesh::TransientRBEvaluation::TransientRBEvaluation ( TransientRBEvaluation &&  )
default

Special functions.

  • This class contains unique_ptrs, so it can't be default copy constructed/assigned.
  • The destructor is defaulted out of line.

◆ TransientRBEvaluation() [3/3]

libMesh::TransientRBEvaluation::TransientRBEvaluation ( const TransientRBEvaluation )
delete

◆ ~TransientRBEvaluation()

TransientRBEvaluation::~TransientRBEvaluation ( )
virtualdefault

Member Function Documentation

◆ assert_file_exists()

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

Helper function that checks if file_name exists.

Definition at line 977 of file rb_evaluation.C.

978{
979 libmesh_error_msg_if(!std::ifstream(file_name.c_str()), "File missing: " << file_name);
980}

Referenced by libMesh::RBEvaluation::legacy_read_offline_data_from_files(), 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 417 of file transient_rb_evaluation.C.

418{
419 LOG_SCOPE("cache_online_residual_terms()", "TransientRBEvaluation");
420
421 const RBParameters mu = get_parameters();
422
423 TransientRBThetaExpansion & trans_theta_expansion =
424 cast_ref<TransientRBThetaExpansion &>(get_rb_theta_expansion());
425 const unsigned int Q_m = trans_theta_expansion.get_n_M_terms();
426 const unsigned int Q_a = trans_theta_expansion.get_n_A_terms();
427 const unsigned int Q_f = trans_theta_expansion.get_n_F_terms();
428
429 cached_Fq_term = 0.;
430 unsigned int q=0;
431 for (unsigned int q_f1=0; q_f1<Q_f; q_f1++)
432 {
433 Number cached_theta_q_f1 = trans_theta_expansion.eval_F_theta(q_f1,mu);
434 for (unsigned int q_f2=q_f1; q_f2<Q_f; q_f2++)
435 {
436 Real delta = (q_f1==q_f2) ? 1. : 2.;
437 cached_Fq_term += delta*cached_theta_q_f1*trans_theta_expansion.eval_F_theta(q_f2,mu) *
439
440 q++;
441 }
442 }
443
445 for (unsigned int q_f=0; q_f<Q_f; q_f++)
446 {
447 Number cached_theta_q_f = trans_theta_expansion.eval_F_theta(q_f,mu);
448 for (unsigned int q_a=0; q_a<Q_a; q_a++)
449 {
450 Number cached_theta_q_a = trans_theta_expansion.eval_A_theta(q_a,mu);
451 for (unsigned int i=0; i<N; i++)
452 {
453 cached_Fq_Aq_vector(i) += 2.*cached_theta_q_f*cached_theta_q_a*
454 Fq_Aq_representor_innerprods[q_f][q_a][i];
455 }
456 }
457 }
458
460 q=0;
461 for (unsigned int q_a1=0; q_a1<Q_a; q_a1++)
462 {
463 Number cached_theta_q_a1 = trans_theta_expansion.eval_A_theta(q_a1,mu);
464 for (unsigned int q_a2=q_a1; q_a2<Q_a; q_a2++)
465 {
466 Number cached_theta_q_a2 = trans_theta_expansion.eval_A_theta(q_a2,mu);
467 Real delta = (q_a1==q_a2) ? 1. : 2.;
468
469 for (unsigned int i=0; i<N; i++)
470 {
471 for (unsigned int j=0; j<N; j++)
472 {
473 cached_Aq_Aq_matrix(i,j) += delta*
474 cached_theta_q_a1*cached_theta_q_a2*
476 }
477 }
478 q++;
479 }
480 }
481
483 for (unsigned int q_f=0; q_f<Q_f; q_f++)
484 {
485 Number cached_theta_q_f = trans_theta_expansion.eval_F_theta(q_f,mu);
486 for (unsigned int q_m=0; q_m<Q_m; q_m++)
487 {
488 Number cached_theta_q_m = trans_theta_expansion.eval_M_theta(q_m,mu);
489 for (unsigned int i=0; i<N; i++)
490 {
491 cached_Fq_Mq_vector(i) += 2.*cached_theta_q_f * cached_theta_q_m * Fq_Mq_representor_innerprods[q_f][q_m][i];
492 }
493 }
494 }
495
497 for (unsigned int q_a=0; q_a<Q_a; q_a++)
498 {
499 Number cached_theta_q_a = trans_theta_expansion.eval_A_theta(q_a,mu);
500
501 for (unsigned int q_m=0; q_m<Q_m; q_m++)
502 {
503 Number cached_theta_q_m = trans_theta_expansion.eval_M_theta(q_m,mu);
504
505 for (unsigned int i=0; i<N; i++)
506 {
507 for (unsigned int j=0; j<N; j++)
508 {
509 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];
510 }
511 }
512 }
513 }
514
516 q=0;
517 for (unsigned int q_m1=0; q_m1<Q_m; q_m1++)
518 {
519 Number cached_theta_q_m1 = trans_theta_expansion.eval_M_theta(q_m1,mu);
520 for (unsigned int q_m2=q_m1; q_m2<Q_m; q_m2++)
521 {
522 Number cached_theta_q_m2 = trans_theta_expansion.eval_M_theta(q_m2,mu);
523 Real delta = (q_m1==q_m2) ? 1. : 2.;
524
525 for (unsigned int i=0; i<N; i++)
526 {
527 for (unsigned int j=0; j<N; j++)
528 {
529 cached_Mq_Mq_matrix(i,j) += delta*
530 cached_theta_q_m1*cached_theta_q_m2*
532 }
533 }
534 q++;
535 }
536 }
537}
void resize(const unsigned int new_m, const unsigned int new_n)
Resizes the matrix to the specified size and calls zero().
void resize(const unsigned int n)
Resize the vector.
std::vector< Number > Fq_representor_innerprods
Vectors storing the residual representor inner products to be used in computing the residuals online.
std::vector< std::vector< std::vector< Number > > > Aq_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.
RBThetaExpansion & get_rb_theta_expansion()
Get a reference to the rb_theta_expansion.
const RBParameters & get_parameters() const
Get the current parameters.
std::vector< std::vector< std::vector< std::vector< Number > > > > Aq_Mq_representor_innerprods
Number cached_Fq_term
Cached residual terms.
std::vector< std::vector< std::vector< Number > > > Mq_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.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

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().

◆ check_evaluated_thetas_size()

void libMesh::RBEvaluation::check_evaluated_thetas_size ( const std::vector< Number > *  evaluated_thetas) const
privateinherited

For interfaces like rb_solve() and compute_residual_dual_norm() that optinally take a vector of "pre-evaluated" theta values, this function checks to make sure that, when provided, it is the right size.

Definition at line 1196 of file rb_evaluation.C.

1197{
1198 if (rb_theta_expansion && evaluated_thetas)
1199 {
1200 auto actual_size = evaluated_thetas->size();
1201 auto expected_size =
1205
1206 libmesh_error_msg_if(actual_size != expected_size,
1207 "ERROR: Evaluated thetas vector has size " <<
1208 actual_size << ", but we expected " <<
1209 rb_theta_expansion->get_n_A_terms() << " A term(s), " <<
1210 rb_theta_expansion->get_n_F_terms() << " F term(s), and " <<
1211 rb_theta_expansion->get_total_n_output_terms() << " output term(s), " <<
1212 "for a total of " << expected_size << " terms.");
1213 }
1214}
RBThetaExpansion * rb_theta_expansion
A pointer to to the object that stores the theta expansion.
unsigned int get_total_n_output_terms() const
Returns the total number of affine terms associated with all outputs.
unsigned int get_n_F_terms() const
Get Q_f, the number of terms in the affine expansion for the right-hand side.
unsigned int get_n_A_terms() const
Get Q_a, the number of terms in the affine expansion for the bilinear form.

References libMesh::RBThetaExpansion::get_n_A_terms(), libMesh::RBThetaExpansion::get_n_F_terms(), libMesh::RBThetaExpansion::get_total_n_output_terms(), and libMesh::RBEvaluation::rb_theta_expansion.

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

◆ check_if_valid_params()

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

Helper function to check that params is valid:

  • same number of parameters (error)
  • parameter values are within the min/max range (warning)
  • discrete values are correctly discrete within tolerance (warning) Warnings are only printed if "verbose_mode" is true.

Definition at line 378 of file rb_parametrized.C.

379{
380 // Check if number of parameters are correct.
381 libmesh_error_msg_if(params.n_parameters() != get_n_params(),
382 "Error: Number of parameters don't match; found "
383 << params.n_parameters() << ", expected "
384 << get_n_params());
385
386 bool is_valid = true;
387 std::string prev_param_name = "";
388 for (const auto & [param_name, sample_vec] : params)
389 {
390 std::size_t sample_idx = 0;
391 const Real & min_value = get_parameter_min(param_name);
392 const Real & max_value = get_parameter_max(param_name);
393 for (const auto & value_vec : sample_vec)
394 {
395 for (const auto & value : value_vec)
396 {
397 // Check every parameter value (including across samples and vector-values)
398 // to ensure it's within the min/max range.
399 const bool outside_range = ((value < min_value) || (value > max_value));
400 is_valid = is_valid && !outside_range;
401 if (outside_range && verbose_mode)
402 {
403 libMesh::out << "Warning: parameter " << param_name << " value="
404 << value << " outside acceptable range: ("
405 << min_value << ", " << max_value << ")";
406 }
407
408 // For discrete params, make sure params.get_value(param_name) is sufficiently
409 // close to one of the discrete parameter values.
410 // Note that vector-values not yet supported in discrete parameters,
411 // and the .get_sample_value() call will throw an error if the user
412 // tries to do it.
413 if (const auto it = get_discrete_parameter_values().find(param_name);
414 it != get_discrete_parameter_values().end())
415 {
416 const bool is_value_discrete =
417 is_value_in_list(params.get_sample_value(param_name, sample_idx),
418 it->second,
419 TOLERANCE);
420 is_valid = is_valid && is_value_discrete;
421 if (!is_value_discrete && verbose_mode)
422 libMesh::out << "Warning: parameter " << param_name << " value="
423 << value << " is not in discrete value list.";
424 }
425 }
426 ++sample_idx;
427 }
428 }
429 return is_valid;
430}
unsigned int get_n_params() const
Get the number of parameters.
const std::map< std::string, std::vector< Real > > & get_discrete_parameter_values() const
Get a const reference to the discrete parameter values.
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...
Real get_parameter_max(const std::string &param_name) const
Get maximum allowable value of parameter param_name.
Real get_parameter_min(const std::string &param_name) const
Get minimum allowable value of parameter param_name.
bool verbose_mode
Public boolean to toggle verbose mode.
OStreamProxy out
static constexpr Real TOLERANCE
static const bool value
Definition xdr_io.C:55

References libMesh::RBParametrized::get_discrete_parameter_values(), libMesh::RBParametrized::get_n_params(), libMesh::RBParametrized::get_parameter_max(), libMesh::RBParametrized::get_parameter_min(), libMesh::RBParameters::get_sample_value(), libMesh::RBParametrized::is_value_in_list(), libMesh::RBParameters::n_parameters(), libMesh::out, libMesh::Real, libMesh::TOLERANCE, value, and libMesh::RBParametrized::verbose_mode.

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

◆ clear()

void TransientRBEvaluation::clear ( )
overridevirtual

Clear this TransientRBEvaluation object.

Override to also clear the M_q representors

Reimplemented from libMesh::RBEvaluation.

Definition at line 50 of file transient_rb_evaluation.C.

51{
53
55}
virtual void clear() override
Clear this RBEvaluation object.
virtual void clear_riesz_representors() override
Clear all the Riesz representors that are used to compute the RB residual (and hence error bound).

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

◆ 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 57 of file transient_rb_evaluation.C.

58{
60
61 // Delete the M_q representors
62 M_q_representor.clear();
63}
virtual void clear_riesz_representors()
Clear all the Riesz representors that are used to compute the RB residual (and hence error bound).
std::vector< std::vector< std::unique_ptr< NumericVector< Number > > > > M_q_representor
Vector storing the mass matrix representors.

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 97 of file parallel_object.h.

98 { return _communicator; }
const Parallel::Communicator & _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::ExactSolution::_compute_error(), libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::Partitioner::_find_global_index_by_pid_map(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::PetscLinearSolver< T >::_petsc_shell_matrix_get_diagonal(), libMesh::SlepcEigenSolver< T >::_petsc_shell_matrix_get_diagonal(), libMesh::PetscLinearSolver< T >::_petsc_shell_matrix_mult(), libMesh::SlepcEigenSolver< T >::_petsc_shell_matrix_mult(), libMesh::PetscLinearSolver< T >::_petsc_shell_matrix_mult_add(), 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::RBEIMEvaluation::add_interpolation_data(), libMesh::CondensedEigenSystem::add_matrices(), libMesh::EigenSystem::add_matrices(), libMesh::System::add_matrix(), libMesh::System::add_matrix(), libMesh::System::add_matrix(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::System::add_vector(), libMesh::MeshTools::Modification::all_tri(), libMesh::LaplaceMeshSmoother::allgather_graph(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::RBConstruction::allocate_data_structures(), libMesh::TransientRBConstruction::allocate_data_structures(), libMesh::TransientRBConstruction::assemble_affine_expansion(), libMesh::AdvectionSystem::assemble_claw_rhs(), libMesh::FEMSystem::assemble_qoi(), libMesh::Nemesis_IO::assert_symmetric_cmaps(), libMesh::MeshCommunication::assign_global_indices(), libMesh::Partitioner::assign_partitioning(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::Partitioner::build_graph(), libMesh::InfElemBuilder::build_inf_elem(), 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::MeshBase::cache_elem_data(), libMesh::DofMap::check_dirichlet_bcid_consistency(), libMesh::MeshTetInterface::check_hull_integrity(), libMesh::MeshBase::complete_preparation(), 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::DofMap::computed_sparsity_already(), libMesh::Problem_Interface::computeJacobian(), libMesh::Problem_Interface::computePreconditioner(), PetscSolverConfiguration::configure_solver(), libMesh::ContinuationSystem::ContinuationSystem(), libMesh::MeshBase::copy_constraint_rows(), libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::ExodusII_IO::copy_nodal_solution(), libMesh::ExodusII_IO::copy_scalar_solution(), libMesh::CondensedEigenSystem::copy_super_to_sub(), 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::PetscMatrix< T >::create_submatrix_nosort(), create_wrapped_function(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::MeshBase::detect_interior_parents(), libMesh::RBEIMEvaluation::distribute_bfs(), DMlibMeshFunction(), DMlibMeshJacobian(), DMlibMeshSetSystem_libMesh(), DMVariableBounds_libMesh(), libMesh::DTKSolutionTransfer::DTKSolutionTransfer(), libMesh::MeshRefinement::eliminate_unrefined_patches(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_interiors(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_nodes(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_sides(), libMesh::TransientRBConstruction::enrich_RB_space(), libMesh::EpetraVector< T >::EpetraVector(), AssembleOptimization::equality_constraints(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::PatchRecoveryErrorEstimator::estimate_error(), libMesh::WeightedPatchRecoveryErrorEstimator::estimate_error(), libMesh::SmoothnessEstimator::estimate_smoothness(), 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::RBEIMEvaluation::gather_bfs(), libMesh::DofMap::gather_constraints(), libMesh::MeshfreeInterpolation::gather_remote_data(), libMesh::CondensedEigenSystem::get_eigenpair(), libMesh::RBEIMEvaluation::get_eim_basis_function_node_value(), libMesh::RBEIMEvaluation::get_eim_basis_function_side_value(), libMesh::RBEIMEvaluation::get_eim_basis_function_value(), libMesh::MeshBase::get_info(), libMesh::RBEIMEvaluation::get_interior_basis_functions_as_vecs(), libMesh::ImplicitSystem::get_linear_solver(), libMesh::RBEIMConstruction::get_max_abs_value(), libMesh::RBEIMConstruction::get_node_max_abs_value(), libMesh::RBEIMEvaluation::get_parametrized_function_node_value(), libMesh::RBEIMEvaluation::get_parametrized_function_side_value(), libMesh::RBEIMEvaluation::get_parametrized_function_value(), libMesh::RBEIMConstruction::get_random_point(), libMesh::RBEIMConstruction::get_random_point(), libMesh::RBEIMConstruction::get_random_point(), libMesh::MeshTetInterface::improve_hull_integrity(), AssembleOptimization::inequality_constraints(), AssembleOptimization::inequality_constraints_jacobian(), libMesh::StaticCondensation::init(), libMesh::TimeSolver::init(), libMesh::SystemSubsetBySubdomain::init(), libMesh::LocationMap< T >::init(), libMesh::PetscDMWrapper::init_and_attach_petscdm(), libMesh::PetscDMWrapper::init_and_attach_petscdm(), ElasticitySystem::init_data(), libMesh::AdvectionSystem::init_data(), libMesh::ClawSystem::init_data(), libMesh::PetscDMWrapper::init_petscdm(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::OptimizationSystem::initialize_equality_constraints_storage(), libMesh::OptimizationSystem::initialize_inequality_constraints_storage(), libMesh::RBEIMConstruction::initialize_parametrized_functions_in_training_set(), libMesh::RBEIMConstruction::inner_product(), integrate_function(), libMesh::MeshTools::Modification::interpolate_surface(), libMesh::MeshTools::libmesh_assert_consistent_distributed(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::MeshTools::libmesh_assert_contiguous_dof_ids(), libMesh::MeshTools::libmesh_assert_equal_connectivity(), libMesh::MeshTools::libmesh_assert_equal_points(), 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_constraint_rows(), 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_linesearch_shellfunc(), libMesh::libmesh_petsc_preconditioner_apply(), libMesh::libmesh_petsc_snes_mffd_interface(), libMesh::libmesh_petsc_snes_postcheck(), libMesh::MeshRefinement::limit_level_mismatch_at_edge(), libMesh::MeshRefinement::limit_level_mismatch_at_node(), libMesh::MeshRefinement::limit_overrefined_boundary(), libMesh::MeshRefinement::limit_underrefined_boundary(), libMesh::LinearImplicitSystem::LinearImplicitSystem(), main(), libMesh::MeshCommunication::make_elems_parallel_consistent(), libMesh::MeshCommunication::make_new_node_proc_ids_parallel_consistent(), libMesh::MeshCommunication::make_new_nodes_parallel_consistent(), libMesh::MeshCommunication::make_node_bcids_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::TransientRBConstruction::mass_matrix_scaled_matvec(), libMesh::FEMSystem::mesh_position_set(), libMesh::TriangulatorInterface::MeshedHole::MeshedHole(), LinearElasticityWithContact::move_mesh(), libMesh::DistributedMesh::n_active_elem(), libMesh::MeshTools::n_active_levels(), libMesh::BoundaryInfo::n_boundary_conds(), libMesh::MeshTools::n_connected_components(), libMesh::DofMap::n_constrained_dofs(), libMesh::MeshBase::n_constraint_rows(), libMesh::DofMap::n_dofs(), libMesh::DofMap::n_dofs_per_processor(), libMesh::BoundaryInfo::n_edge_conds(), libMesh::CondensedEigenSystem::n_global_non_condensed_dofs(), libMesh::MeshTools::n_levels(), MixedOrderTest::n_neighbor_links(), libMesh::BoundaryInfo::n_nodeset_conds(), libMesh::SparsityPattern::Build::n_nonzeros(), libMesh::MeshTools::n_p_levels(), libMesh::BoundaryInfo::n_shellface_conds(), libMesh::RBEIMEvaluation::node_distribute_bfs(), libMesh::RBEIMEvaluation::node_gather_bfs(), libMesh::RBEIMConstruction::node_inner_product(), libMesh::PetscVector< T >::operator=(), libMesh::MeshBase::operator==(), libMesh::DistributedMesh::parallel_max_elem_id(), libMesh::DistributedMesh::parallel_max_node_id(), libMesh::DistributedMesh::parallel_max_unique_id(), libMesh::ReplicatedMesh::parallel_max_unique_id(), libMesh::DistributedMesh::parallel_n_elem(), libMesh::DistributedMesh::parallel_n_nodes(), libMesh::SparsityPattern::Build::parallel_sync(), libMesh::BoundaryInfo::parallel_sync_node_ids(), libMesh::BoundaryInfo::parallel_sync_side_ids(), libMesh::MeshTools::paranoid_n_levels(), libMesh::Partitioner::partition(), libMesh::Partitioner::partition_unpartitioned_elements(), libMesh::petsc_auto_fieldsplit(), LaplaceSystem::postprocess(), PoissonSystem::postprocess(), libMesh::MeshBase::print_constraint_rows(), libMesh::DofMap::print_dof_constraints(), libMesh::DofMap::process_mesh_constraint_rows(), libMesh::Partitioner::processor_pairs_to_interface_nodes(), libMesh::InterMeshProjection::project_system_vectors(), libMesh::XdrIO::read(), libMesh::Nemesis_IO::read(), FEMParameters::read(), libMesh::EquationSystems::read(), libMesh::CheckpointIO::read_header(), libMesh::ExodusII_IO::read_header(), libMesh::System::read_header(), libMesh::XdrIO::read_header(), libMesh::RBEIMEvaluation::read_in_interior_basis_functions(), libMesh::RBEIMEvaluation::read_in_node_basis_functions(), libMesh::RBEIMEvaluation::read_in_side_basis_functions(), libMesh::RBEvaluation::read_in_vectors_from_multiple_files(), libMesh::RBConstruction::read_riesz_representors_from_files(), libMesh::TransientRBConstruction::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::Nemesis_IO_Helper::read_var_names_impl(), MeshFunctionTest::read_variable_info_from_output_data(), libMesh::MeshBase::recalculate_n_partitions(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::StaticCondensationDofMap::reinit(), libMesh::BoundaryInfo::remove_edge_id(), libMesh::BoundaryInfo::remove_node_id(), libMesh::BoundaryInfo::remove_shellface_id(), libMesh::BoundaryInfo::remove_side_id(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::DistributedMesh::renumber_nodes_and_elements(), LinearElasticityWithContact::residual_and_jacobian(), OverlappingAlgebraicGhostingTest::run_ghosting_test(), OverlappingCouplingGhostingTest::run_sparsity_pattern_test(), scale_mesh_and_plot(), libMesh::DofMap::scatter_constraints(), libMesh::CheckpointIO::select_split_config(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::send_and_insert_dof_values(), libMesh::TransientRBConstruction::set_error_temporal_data(), libMesh::Partitioner::set_interface_node_processor_ids_BFS(), libMesh::Partitioner::set_interface_node_processor_ids_linear(), libMesh::Partitioner::set_interface_node_processor_ids_petscpartitioner(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::PetscDMWrapper::set_point_range_in_section(), libMesh::PetscDiffSolver::setup_petsc_data(), libMesh::RBEIMEvaluation::side_distribute_bfs(), libMesh::RBEIMEvaluation::side_gather_bfs(), libMesh::RBEIMConstruction::side_inner_product(), libMesh::Partitioner::single_partition(), libMesh::LaplaceMeshSmoother::smooth(), libMesh::VariationalMeshSmoother::smooth(), libMesh::NoxNonlinearSolver< Number >::solve(), libMesh::ClawSystem::solve_conservation_law(), libMesh::split_mesh(), libMesh::RBEIMConstruction::store_eim_solutions_for_training_set(), libMesh::MeshBase::subdomain_ids(), libMesh::BoundaryInfo::sync(), libMesh::MeshBase::sync_subdomain_name_map(), ConstraintOperatorTest::test1DCoarseningNewNodes(), ConstraintOperatorTest::test1DCoarseningOperator(), MeshFunctionTest::test_bad_gradient_var_with_out_of_mesh_value(), MeshFunctionTest::test_bad_hessian_var_with_out_of_mesh_value(), MeshfunctionDFEM::test_mesh_function_dfem(), MeshfunctionDFEM::test_mesh_function_dfem_grad(), MeshFunctionTest::test_p_level(), ExodusC0PolyhedronTest::test_write_and_read_hexagonal_prism(), ExodusC0PolygonTest::test_write_and_read_pentagon(), DofMapTest::testBadElemFECombo(), SystemsTest::testBlockRestrictedVarNDofs(), BoundaryInfoTest::testBoundaryOnChildrenErrors(), CheckpointIOTest::testC0PolygonCheckpoint(), VolumeTest::testC0PolygonMethods(), CheckpointIOTest::testC0PolyhedronCheckpoint(), VolumeTest::testC0PolyhedronMethods(), ConstraintOperatorTest::testCoreform(), ConnectedComponentsTest::testEdge(), MeshInputTest::testExodusIGASidesets(), MeshTriangulationTest::testFoundCenters(), PointLocatorTest::testLocator(), BoundaryInfoTest::testMesh(), BoundaryMeshSubdomainTest::testPerBoundarySubdomain(), PointLocatorTest::testPlanar(), MeshTriangulationTest::testPoly2TriEdge3ToTri7CenterFixup(), MeshTriangulationTest::testPoly2TriRefinementBase(), SystemsTest::testProjectCubeWithMeshFunction(), SystemsTest::testProjectScalarCoarsening(), BoundaryInfoTest::testRenumber(), BoundaryInfoTest::testSelectiveRenumber(), BoundaryMeshSubdomainTest::testSingleSubdomain(), CheckpointIOTest::testSplitter(), MeshInputTest::testTetgenIO(), MeshTriangulationTest::testTriangulatorInterp(), MeshTriangulationTest::testTriangulatorMeshedHoles(), MeshTriangulationTest::testTriangulatorRoundHole(), MeshSmootherTest::testVariationalSmoother(), libMesh::MeshTools::total_weight(), libMesh::RBConstruction::train_reduced_basis_with_POD(), libMesh::MeshfreeSolutionTransfer::transfer(), libMesh::MeshFunctionSolutionTransfer::transfer(), libMesh::Poly2TriTriangulator::triangulate(), libMesh::RBConstruction::truth_assembly(), libMesh::TransientRBConstruction::truth_assembly(), update_current_local_solution(), libMesh::TransientRBConstruction::update_RB_initial_condition_all_N(), libMesh::RBConstruction::update_RB_system_matrices(), libMesh::TransientRBConstruction::update_RB_system_matrices(), libMesh::TransientRBConstruction::update_residual_terms(), libMesh::RBConstruction::update_residual_terms(), libMesh::MeshTools::volume(), libMesh::STLIO::write(), libMesh::XdrIO::write(), libMesh::NameBasedIO::write(), libMesh::VTKIO::write_nodal_data(), libMesh::RBEIMEvaluation::write_out_interior_basis_functions(), libMesh::RBEIMEvaluation::write_out_node_basis_functions(), libMesh::RBEIMEvaluation::write_out_side_basis_functions(), libMesh::RBEvaluation::write_out_vectors(), libMesh::RBConstruction::write_riesz_representors_to_files(), libMesh::TransientRBConstruction::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() [1/3]

Real libMesh::RBEvaluation::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 uses the cached time-independent data.

Reimplemented from libMesh::RBEvaluation.

Definition at line 137 of file rb_evaluation.C.

352{
353 return compute_residual_dual_norm(N, nullptr);
354}
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_vector.

References libMesh::RBEvaluation::RB_Fq_vector.

◆ compute_residual_dual_norm() [2/3]

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_vector.

Reimplemented from libMesh::RBEvaluation.

Definition at line 539 of file transient_rb_evaluation.C.

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

References 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, and libMesh::Real.

Referenced by rb_solve().

◆ compute_residual_dual_norm() [3/3]

Real libMesh::RBEvaluation::compute_residual_dual_norm ( const unsigned int  N,
const std::vector< Number > *  evaluated_thetas 
)
virtual

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 143 of file rb_evaluation.C.

358{
359 LOG_SCOPE("compute_residual_dual_norm()", "RBEvaluation");
360
361 // In case the theta functions have been pre-evaluated, first check the size for consistency
362 this->check_evaluated_thetas_size(evaluated_thetas);
363
364 // If evaluated_thetas is provided, then mu is not actually used for anything
365 const RBParameters & mu = get_parameters();
366
367 const unsigned int n_A_terms = rb_theta_expansion->get_n_A_terms();
368 const unsigned int n_F_terms = rb_theta_expansion->get_n_F_terms();
369
370 // Use the stored representor inner product values
371 // to evaluate the residual norm
372 Number residual_norm_sq = 0.;
373
374 // Lambdas to help with evaluating F_theta and A_theta functions
375 // using either the pre-evaluated thetas (if provided) or by calling
376 // eval_{F,A}_theta()
377 auto eval_F = [&](unsigned int index)
378 {
379 return (evaluated_thetas) ? (*evaluated_thetas)[index + n_A_terms] : rb_theta_expansion->eval_F_theta(index, mu);
380 };
381 auto eval_A = [&](unsigned int index)
382 {
383 return (evaluated_thetas) ? (*evaluated_thetas)[index] : rb_theta_expansion->eval_A_theta(index, mu);
384 };
385
386 unsigned int q=0;
387 for (unsigned int q_f1=0; q_f1<n_F_terms; q_f1++)
388 {
389 const Number val_q_f1 = eval_F(q_f1);
390
391 for (unsigned int q_f2=q_f1; q_f2<n_F_terms; q_f2++)
392 {
393 const Number val_q_f2 = eval_F(q_f2);
394
395 Real delta = (q_f1==q_f2) ? 1. : 2.;
396 residual_norm_sq += delta * libmesh_real(val_q_f1 * libmesh_conj(val_q_f2) * Fq_representor_innerprods[q] );
397
398 q++;
399 }
400 }
401
402 for (unsigned int q_f=0; q_f<n_F_terms; q_f++)
403 {
404 const Number val_q_f = eval_F(q_f);
405
406 for (unsigned int q_a=0; q_a<n_A_terms; q_a++)
407 {
408 const Number val_q_a = eval_A(q_a);
409
410 for (unsigned int i=0; i<N; i++)
411 {
412 Real delta = 2.;
413 residual_norm_sq +=
414 delta * libmesh_real( val_q_f * libmesh_conj(val_q_a) *
416 }
417 }
418 }
419
420 q=0;
421 for (unsigned int q_a1=0; q_a1<n_A_terms; q_a1++)
422 {
423 const Number val_q_a1 = eval_A(q_a1);
424
425 for (unsigned int q_a2=q_a1; q_a2<n_A_terms; q_a2++)
426 {
427 const Number val_q_a2 = eval_A(q_a2);
428
429 Real delta = (q_a1==q_a2) ? 1. : 2.;
430
431 for (unsigned int i=0; i<N; i++)
432 {
433 for (unsigned int j=0; j<N; j++)
434 {
435 residual_norm_sq +=
436 delta * libmesh_real( libmesh_conj(val_q_a1) * val_q_a2 *
438 }
439 }
440
441 q++;
442 }
443 }
444
445 if (libmesh_real(residual_norm_sq) < 0.)
446 {
447 // libMesh::out << "Warning: Square of residual norm is negative "
448 // << "in RBSystem::compute_residual_dual_norm()" << std::endl;
449
450 // Sometimes this is negative due to rounding error,
451 // but when this occurs the error is on the order of 1.e-10,
452 // so shouldn't affect error bound much...
453 residual_norm_sq = std::abs(residual_norm_sq);
454 }
455
456 return std::sqrt( libmesh_real(residual_norm_sq) );
457}
void check_evaluated_thetas_size(const std::vector< Number > *evaluated_thetas) const
For interfaces like rb_solve() and compute_residual_dual_norm() that optinally take a vector of "pre-...
virtual Number eval_F_theta(unsigned int q, const RBParameters &mu) const
Evaluate theta_q_f at the current parameter.
virtual Number eval_A_theta(unsigned int q, const RBParameters &mu) const
Evaluate theta_q_a at the current parameter.
T libmesh_conj(T a)

References libMesh::RBThetaExpansion::get_n_output_terms(), libMesh::RBEvaluation::RB_output_vectors, and libMesh::RBEvaluation::rb_theta_expansion.

◆ disable_print_counter_info()

void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 100 of file reference_counter.C.

101{
102 _enable_print_counter = false;
103 return;
104}
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called.

References libMesh::ReferenceCounter::_enable_print_counter.

◆ enable_print_counter_info()

void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

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

Enabled by default.

Definition at line 94 of file reference_counter.C.

95{
97 return;
98}

References libMesh::ReferenceCounter::_enable_print_counter.

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

◆ eval_output_dual_norm()

Real libMesh::RBEvaluation::eval_output_dual_norm ( unsigned int  n,
const std::vector< Number > *  evaluated_thetas 
)
inherited

Evaluate the dual norm of output n for the current parameters, or using the pre-evaluted theta values provided in the "evaluated_thetas" array.

Definition at line 474 of file rb_evaluation.C.

476{
477 // Return value
478 Number output_bound_sq = 0.;
479
480 // mu is only used if evaluated_thetas == nullptr
481 const RBParameters & mu = this->get_parameters();
482
483 // Index into output_dual_innerprods
484 unsigned int q=0;
485 for (unsigned int q_l1=0; q_l1<rb_theta_expansion->get_n_output_terms(n); q_l1++)
486 {
487 for (unsigned int q_l2=q_l1; q_l2<rb_theta_expansion->get_n_output_terms(n); q_l2++)
488 {
489 Real delta = (q_l1==q_l2) ? 1. : 2.;
490
491 Number val_l1 =
492 evaluated_thetas ?
495
496 Number val_l2 =
497 evaluated_thetas ?
500
501 output_bound_sq += delta * libmesh_real(
502 libmesh_conj(val_l1) * val_l2 * output_dual_innerprods[n][q]);
503
504 q++;
505 }
506 }
507
508 return libmesh_real(std::sqrt( output_bound_sq ));
509}
std::vector< std::vector< Number > > output_dual_innerprods
The vector storing the dual norm inner product terms for each output.
unsigned int output_index_1D(unsigned int n, unsigned int q_l) const
Computes the one-dimensional index for output n, term q_l implied by a "row-major" ordering of the ou...
unsigned int get_n_output_terms(unsigned int output_index) const
Get the number of affine terms associated with the specified output.
virtual Number eval_output_theta(unsigned int output_index, unsigned int q_l, const RBParameters &mu) const
Evaluate theta_q_l at the current parameter.

References libMesh::RBThetaExpansion::eval_output_theta(), libMesh::RBThetaExpansion::get_n_A_terms(), libMesh::RBThetaExpansion::get_n_F_terms(), libMesh::RBThetaExpansion::get_n_output_terms(), libMesh::RBParametrized::get_parameters(), libMesh::libmesh_conj(), libMesh::libmesh_real(), libMesh::RBEvaluation::output_dual_innerprods, libMesh::RBThetaExpansion::output_index_1D(), libMesh::RBEvaluation::rb_theta_expansion, and libMesh::Real.

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

◆ get_basis_function() [1/2]

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

Get a reference to the i^th basis function.

Definition at line 207 of file rb_evaluation.C.

208{
209 libmesh_assert_less (i, basis_functions.size());
210
211 return *(basis_functions[i]);
212}
std::vector< std::unique_ptr< NumericVector< Number > > > basis_functions
The libMesh vectors storing the finite element coefficients of the RB basis functions.

References libMesh::RBEvaluation::basis_functions.

Referenced by libMesh::TransientRBConstruction::add_IC_to_RB_space(), libMesh::TransientRBConstruction::enrich_RB_space(), libMesh::RBConstruction::load_basis_function(), libMesh::RBConstruction::load_rb_solution(), libMesh::RBConstruction::update_RB_system_matrices(), and libMesh::TransientRBConstruction::update_RB_system_matrices().

◆ get_basis_function() [2/2]

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

Definition at line 214 of file rb_evaluation.C.

215{
216 libmesh_assert_less (i, basis_functions.size());
217
218 return *(basis_functions[i]);
219}

References libMesh::RBEvaluation::basis_functions.

◆ 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 432 of file rb_parametrized.C.

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

References 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}
std::vector< Real > _control
The RHS control (scalar function of time).
unsigned int get_n_time_steps() const
Get/set the total number of time-steps.

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 a const reference to the discrete parameter values.

Definition at line 359 of file rb_parametrized.C.

360{
361 libmesh_error_msg_if(!parameters_initialized, "Error: parameters not initialized in RBParametrized::get_discrete_parameter_values");
362
364}
std::map< std::string, std::vector< Real > > _discrete_parameter_values
Map that defines the allowable values of any discrete parameters.
bool parameters_initialized
Flag indicating whether the parameters have been initialized.

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

Referenced by libMesh::RBDataSerialization::add_parameter_ranges_to_builder(), libMesh::RBParametrized::check_if_valid_params(), libMesh::RBParametrized::get_n_discrete_params(), libMesh::RBParametrized::initialize_parameters(), libMesh::RBParametrized::print_discrete_parameter_values(), and libMesh::RBParametrized::write_discrete_parameter_values_to_file().

◆ 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 403 of file transient_rb_evaluation.C.

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

◆ 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 & [name, cd] : _counts)
59 oss << "| " << name << " reference count information:\n"
60 << "| Creations: " << cd.first << '\n'
61 << "| Destructions: " << cd.second << '\n';
62
63 oss << " ---------------------------------------------------------------------------- \n";
64
65 return oss.str();
66
67#else
68
69 return "";
70
71#endif
72}
static Counts _counts
Actually holds the data.
std::string name(const ElemQuality q)
This function returns a string containing some name for q.

References libMesh::ReferenceCounter::_counts.

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 169 of file rb_evaluation.h.

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

References libMesh::RBEvaluation::basis_functions.

Referenced by libMesh::RBDataSerialization::add_rb_evaluation_data_to_builder(), libMesh::RBDataSerialization::add_transient_rb_evaluation_data_to_builder(), libMesh::TransientRBConstruction::assemble_affine_expansion(), libMesh::RBConstruction::enrich_RB_space(), libMesh::RBConstruction::greedy_termination_test(), legacy_read_offline_data_from_files(), libMesh::RBEvaluation::legacy_write_offline_data_to_files(), legacy_write_offline_data_to_files(), main(), libMesh::RBConstruction::print_basis_function_orthogonality(), rb_solve(), libMesh::RBEvaluation::rb_solve(), libMesh::RBConstruction::read_riesz_representors_from_files(), libMesh::RBConstruction::recompute_all_residual_terms(), libMesh::TransientRBConstruction::set_error_temporal_data(), libMesh::RBConstruction::train_reduced_basis_with_greedy(), libMesh::RBConstruction::train_reduced_basis_with_POD(), libMesh::TransientRBConstruction::update_RB_initial_condition_all_N(), libMesh::RBConstruction::update_RB_system_matrices(), libMesh::TransientRBConstruction::update_RB_system_matrices(), libMesh::TransientRBConstruction::update_residual_terms(), libMesh::RBConstruction::update_residual_terms(), libMesh::RBConstruction::write_riesz_representors_to_files(), and libMesh::TransientRBConstruction::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 112 of file rb_parametrized.C.

113{
114 libmesh_error_msg_if(!parameters_initialized, "Error: parameters not initialized in RBParametrized::get_n_continuous_params");
115
117
118 return static_cast<unsigned int>(get_n_params() - get_n_discrete_params());
119}
unsigned int get_n_discrete_params() const
Get the number of discrete parameters.
libmesh_assert(ctx)

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 121 of file rb_parametrized.C.

122{
123 libmesh_error_msg_if(!parameters_initialized, "Error: parameters not initialized in RBParametrized::get_n_discrete_params");
124
125 return cast_int<unsigned int>
127}

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 171 of file rb_parametrized.C.

172{
173 libmesh_error_msg_if(!parameters_initialized, "Error: parameters not initialized in RBParametrized::get_parameter_max");
174
175 return parameters_max.get_value(param_name);
176}
Real get_value(const std::string &param_name) const
Get the value of the specified parameter, throw an error if it does not exist.

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

Referenced by libMesh::RBParametrized::check_if_valid_params(), main(), libMesh::RBEIMConstruction::print_info(), libMesh::RBSCMConstruction::print_info(), and libMesh::RBConstruction::print_info().

◆ 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 164 of file rb_parametrized.C.

165{
166 libmesh_error_msg_if(!parameters_initialized, "Error: parameters not initialized in RBParametrized::get_parameter_min");
167
168 return parameters_min.get_value(param_name);
169}

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

Referenced by libMesh::RBParametrized::check_if_valid_params(), main(), libMesh::RBEIMConstruction::print_info(), libMesh::RBSCMConstruction::print_info(), and libMesh::RBConstruction::print_info().

◆ get_parameters()

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

Get the current parameters.

Definition at line 143 of file rb_parametrized.C.

144{
145 libmesh_error_msg_if(!parameters_initialized, "Error: parameters not initialized in RBParametrized::get_parameters");
146
147 return parameters;
148}
RBParameters parameters
Vector storing the current parameters.

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

Referenced by libMesh::TransientRBConstruction::add_scaled_mass_matrix(), cache_online_residual_terms(), libMesh::RBEvaluation::compute_residual_dual_norm(), libMesh::RBSCMConstruction::compute_SCM_bounds_on_training_set(), libMesh::RBSCMConstruction::enrich_C_J(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_interiors(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_nodes(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_sides(), libMesh::RBEvaluation::eval_output_dual_norm(), 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::RBEIMConstruction::initialize_parametrized_functions_in_training_set(), libMesh::RBSCMEvaluation::legacy_read_offline_data_from_files(), main(), libMesh::TransientRBConstruction::mass_matrix_scaled_matvec(), libMesh::RBConstruction::preevaluate_thetas(), libMesh::RBEIMConstruction::print_info(), libMesh::RBSCMConstruction::print_info(), libMesh::RBConstruction::print_info(), libMesh::RBParametrized::print_parameters(), libMesh::RBSCMConstruction::process_parameters_file(), rb_solve(), libMesh::RBEvaluation::rb_solve(), libMesh::RBSCMEvaluation::save_current_parameters(), libMesh::RBEIMConstruction::train_eim_approximation_with_greedy(), libMesh::RBEIMConstruction::train_eim_approximation_with_POD(), libMesh::RBConstruction::truth_assembly(), libMesh::TransientRBConstruction::truth_assembly(), libMesh::RBConstruction::truth_solve(), libMesh::TransientRBConstruction::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_parameters_min()

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

◆ get_rb_theta_expansion() [1/2]

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

◆ get_rb_theta_expansion() [2/2]

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

Definition at line 93 of file rb_evaluation.C.

94{
95 libmesh_error_msg_if(!is_rb_theta_expansion_initialized(),
96 "Error: rb_theta_expansion hasn't been initialized yet");
97
98 return *rb_theta_expansion;
99}

References libMesh::RBEvaluation::is_rb_theta_expansion_initialized(), and libMesh::RBEvaluation::rb_theta_expansion.

◆ 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, ElasticityRBEvaluation, SimpleRBEvaluation, and SimpleRBEvaluation.

Definition at line 459 of file rb_evaluation.C.

460{
461 // Return a default value of 1, this function should
462 // be overloaded to specify a problem-dependent stability
463 // factor lower bound
464 return 1.;
465}

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)
inlineprotectednoexceptinherited

Increments the construction counter.

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

Definition at line 183 of file reference_counter.h.

184{
185 libmesh_try
186 {
187 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
188 std::pair<unsigned int, unsigned int> & p = _counts[name];
189 p.first++;
190 }
191 libmesh_catch (...)
192 {
193 auto stream = libMesh::err.get();
194 stream->exceptions(stream->goodbit); // stream must not throw
195 libMesh::err << "Encountered unrecoverable error while calling "
196 << "ReferenceCounter::increment_constructor_count() "
197 << "for a(n) " << name << " object." << std::endl;
198 std::terminate();
199 }
200}
streamT * get()
Rather than implement every ostream/ios/ios_base function, we'll be lazy and make esoteric uses go th...
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.
Definition threads.C:30
OStreamProxy err

References libMesh::err, libMesh::BasicOStreamProxy< charT, traits >::get(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCountedObject< T >::ReferenceCountedObject(), libMesh::ReferenceCountedObject< T >::ReferenceCountedObject(), and libMesh::ReferenceCountedObject< T >::ReferenceCountedObject().

◆ increment_destructor_count()

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

Increments the destruction counter.

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

Definition at line 207 of file reference_counter.h.

208{
209 libmesh_try
210 {
211 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
212 std::pair<unsigned int, unsigned int> & p = _counts[name];
213 p.second++;
214 }
215 libmesh_catch (...)
216 {
217 auto stream = libMesh::err.get();
218 stream->exceptions(stream->goodbit); // stream must not throw
219 libMesh::err << "Encountered unrecoverable error while calling "
220 << "ReferenceCounter::increment_destructor_count() "
221 << "for a(n) " << name << " object." << std::endl;
222 std::terminate();
223 }
224}

References libMesh::err, libMesh::BasicOStreamProxy< charT, traits >::get(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCountedObject< T >::~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.

Parameter ranges are inclusive. The input min/max RBParameters should have exactly 1 sample each. Vector-valued samples are not currently supported for the min/max parameters or for discrete parameters.

Definition at line 53 of file rb_parametrized.C.

56{
57 // Check that the min/max vectors have the same size.
58 libmesh_error_msg_if(mu_min_in.n_parameters() != mu_max_in.n_parameters(),
59 "Error: Invalid mu_min/mu_max in initialize_parameters(), different number of parameters.");
60 libmesh_error_msg_if(mu_min_in.n_samples() != 1 ||
61 mu_max_in.n_samples() != 1,
62 "Error: Invalid mu_min/mu_max in initialize_parameters(), only 1 sample supported.");
63
64 // Ensure all the values are valid for min and max.
65 auto pr_min = mu_min_in.begin_serialized();
66 auto pr_max = mu_max_in.begin_serialized();
67 for (; pr_min != mu_min_in.end_serialized(); ++pr_min, ++pr_max)
68 libmesh_error_msg_if((*pr_min).second > (*pr_max).second,
69 "Error: Invalid mu_min/mu_max in RBParameters constructor.");
70
71 parameters_min = mu_min_in;
72 parameters_max = mu_max_in;
73
74 // Add in min/max values due to the discrete parameters
75 for (const auto & [name, vals] : discrete_parameter_values)
76 {
77 libmesh_error_msg_if(vals.empty(), "Error: List of discrete parameters for " << name << " is empty.");
78
79 Real min_val = *std::min_element(vals.begin(), vals.end());
80 Real max_val = *std::max_element(vals.begin(), vals.end());
81
82 libmesh_assert_less_equal(min_val, max_val);
83
84 parameters_min.set_value(name, min_val);
85 parameters_max.set_value(name, max_val);
86 }
87
88 _discrete_parameter_values = discrete_parameter_values;
89
91
92 // Initialize the current parameters to parameters_min
94}
void set_value(const std::string &param_name, Real value)
Set the value of the specified parameter.
bool set_parameters(const RBParameters &params)
Set the current parameters to params The parameters are checked for validity; an error is thrown if t...

References libMesh::RBParametrized::_discrete_parameter_values, libMesh::RBParameters::begin_serialized(), libMesh::RBParameters::end_serialized(), libMesh::RBParameters::n_parameters(), libMesh::RBParameters::n_samples(), 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::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(), libMesh::RBEIMConstruction::set_rb_construction_parameters(), RBParametersTest::testRBParametrized(), libMesh::RBEIMConstruction::train_eim_approximation_with_greedy(), libMesh::RBEIMConstruction::train_eim_approximation_with_POD(), libMesh::RBConstruction::train_reduced_basis_with_greedy(), and libMesh::RBConstruction::train_reduced_basis_with_POD().

◆ 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 96 of file rb_parametrized.C.

97{
98 initialize_parameters(rb_parametrized.get_parameters_min(),
99 rb_parametrized.get_parameters_max(),
100 rb_parametrized.get_discrete_parameter_values());
101}
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.

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 351 of file rb_parametrized.C.

352{
353 libmesh_error_msg_if(!parameters_initialized,
354 "Error: parameters not initialized in RBParametrized::is_discrete_parameter");
355
356 return _discrete_parameter_values.count(mu_name);
357}

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

Referenced by libMesh::RBDataSerialization::add_parameter_ranges_to_builder(), libMesh::RBEIMConstruction::print_info(), libMesh::RBConstruction::print_info(), 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 101 of file rb_evaluation.C.

102{
104 {
105 return true;
106 }
107 else
108 {
109 return false;
110 }
111}

References libMesh::RBEvaluation::rb_theta_expansion.

Referenced by libMesh::RBEvaluation::get_rb_theta_expansion(), and 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 451 of file rb_parametrized.C.

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

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

Referenced by libMesh::RBParametrized::check_if_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 890 of file transient_rb_evaluation.C.

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

References Aq_Mq_representor_innerprods, libMesh::RBEvaluation::assert_file_exists(), libMesh::Xdr::close(), 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 738 of file transient_rb_evaluation.C.

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

References Aq_Mq_representor_innerprods, libMesh::Xdr::close(), 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 85 of file reference_counter.h.

86 { return _n_objects; }
static Threads::atomic< unsigned int > _n_objects
The number of objects.

References libMesh::ReferenceCounter::_n_objects.

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

◆ n_processors()

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

Definition at line 103 of file parallel_object.h.

104 {
105 processor_id_type returnval =
106 cast_int<processor_id_type>(_communicator.size());
107 libmesh_assert(returnval); // We never have an empty comm
108 return returnval;
109 }
processor_id_type size() const
uint8_t processor_id_type
Definition id_types.h:104

References libMesh::ParallelObject::_communicator, libMesh::libmesh_assert(), and libMesh::Parallel::Communicator::size().

Referenced by libMesh::Partitioner::_find_global_index_by_pid_map(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::DofMap::add_constraints_to_send_list(), libMesh::PetscDMWrapper::add_dofs_to_section(), libMesh::DistributedMesh::add_elem(), libMesh::DistributedMesh::add_node(), libMesh::System::add_vector(), libMesh::LaplaceMeshSmoother::allgather_graph(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::FEMSystem::assembly(), libMesh::Nemesis_IO::assert_symmetric_cmaps(), libMesh::Partitioner::assign_partitioning(), libMesh::AztecLinearSolver< T >::AztecLinearSolver(), libMesh::Partitioner::build_graph(), libMesh::EquationSystems::build_parallel_elemental_solution_vector(), libMesh::DistributedMesh::clear(), libMesh::DistributedMesh::clear_elems(), libMesh::Nemesis_IO_Helper::compute_border_node_ids(), libMesh::Nemesis_IO_Helper::construct_nemesis_filename(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::ExodusII_IO::copy_scalar_solution(), libMesh::Nemesis_IO::copy_scalar_solution(), libMesh::UnstructuredMesh::create_pid_mesh(), libMesh::MeshTools::create_processor_bounding_box(), libMesh::DistributedMesh::DistributedMesh(), libMesh::EnsightIO::EnsightIO(), libMesh::RBEIMEvaluation::gather_bfs(), libMesh::MeshBase::get_info(), libMesh::StaticCondensation::init(), libMesh::SystemSubsetBySubdomain::init(), libMesh::PetscDMWrapper::init_petscdm(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::Nemesis_IO_Helper::initialize(), libMesh::DistributedMesh::insert_elem(), libMesh::NumericVector< T >::is_effectively_ghosted(), libMesh::NumericVector< T >::is_effectively_serial(), 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::MeshBase::n_active_elem_on_proc(), libMesh::DofMap::n_dofs_per_processor(), libMesh::MeshBase::n_elem_on_proc(), libMesh::MeshBase::n_nodes_on_proc(), libMesh::RBEIMEvaluation::node_gather_bfs(), libMesh::MeshBase::partition(), libMesh::Partitioner::partition(), libMesh::Partitioner::partition_unpartitioned_elements(), libMesh::Partitioner::partition_unpartitioned_elements(), libMesh::MeshBase::print_constraint_rows(), libMesh::DofMap::print_dof_constraints(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read(), libMesh::NameBasedIO::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(), libMesh::Partitioner::repartition(), OverlappingFunctorTest::run_partitioner_test(), libMesh::DofMap::scatter_constraints(), libMesh::DistributedMesh::set_next_unique_id(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::PetscDMWrapper::set_point_range_in_section(), WriteVecAndScalar::setupTests(), libMesh::RBEIMEvaluation::side_gather_bfs(), DistributedMeshTest::testRemoteElemError(), CheckpointIOTest::testSplitter(), libMesh::DistributedMesh::update_parallel_id_counts(), libMesh::GMVIO::write_binary(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), libMesh::ExodusII_IO::write_nodal_data(), 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().

◆ operator=() [1/2]

TransientRBEvaluation & libMesh::TransientRBEvaluation::operator= ( const TransientRBEvaluation )
delete

◆ operator=() [2/2]

TransientRBEvaluation & libMesh::TransientRBEvaluation::operator= ( TransientRBEvaluation &&  )
default

◆ print_discrete_parameter_values()

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

Print out all the discrete parameter values.

Definition at line 366 of file rb_parametrized.C.

367{
368 for (const auto & [name, values] : get_discrete_parameter_values())
369 {
370 libMesh::out << "Discrete parameter " << name << ", values: ";
371
372 for (const auto & value : values)
373 libMesh::out << value << " ";
374 libMesh::out << std::endl;
375 }
376}
The libMesh namespace provides an interface to certain functionality in the library.

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

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

◆ print_info()

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

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

Definition at line 81 of file reference_counter.C.

82{
84 out_stream << ReferenceCounter::get_info();
85}
static std::string get_info()
Gets a string containing the reference information.

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

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

◆ print_parameters()

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

Print the current parameters.

Definition at line 178 of file rb_parametrized.C.

179{
180 libmesh_error_msg_if(!parameters_initialized, "Error: parameters not initialized in RBParametrized::print_current_parameters");
181
183}
void print(unsigned precision=6, int max_values=5) const
Print the parameters.

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

Referenced by main(), libMesh::RBEIMConstruction::train_eim_approximation_with_greedy(), and libMesh::RBConstruction::train_reduced_basis_with_greedy().

◆ 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 114 of file parallel_object.h.

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

References libMesh::ParallelObject::_communicator, and libMesh::Parallel::Communicator::rank().

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::PetscDMWrapper::add_dofs_to_section(), libMesh::DistributedMesh::add_elem(), libMesh::BoundaryInfo::add_elements(), libMesh::DistributedMesh::add_node(), libMesh::MeshTools::Modification::all_tri(), libMesh::FEMSystem::assembly(), libMesh::Nemesis_IO::assert_symmetric_cmaps(), libMesh::Partitioner::assign_partitioning(), libMesh::Nemesis_IO_Helper::build_element_and_node_maps(), libMesh::Partitioner::build_graph(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::EquationSystems::build_parallel_elemental_solution_vector(), libMesh::EquationSystems::build_parallel_solution_vector(), libMesh::MeshFunction::check_found_elem(), libMesh::DistributedMesh::clear(), libMesh::DistributedMesh::clear_elems(), 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_elemental_solution(), libMesh::ExodusII_IO::copy_nodal_solution(), libMesh::ExodusII_IO::copy_scalar_solution(), libMesh::Nemesis_IO::copy_scalar_solution(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::ExodusII_IO_Helper::create(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::DistributedMesh::DistributedMesh(), libMesh::DistributedMesh::DistributedMesh(), libMesh::DofMapBase::end_dof(), libMesh::DofMapBase::end_old_dof(), libMesh::EnsightIO::EnsightIO(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubFunctor::find_dofs_to_send(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::DofMapBase::first_dof(), libMesh::DofMapBase::first_old_dof(), libMesh::RBEIMEvaluation::gather_bfs(), 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::MeshBase::get_info(), libMesh::Nemesis_IO_Helper::get_init_global(), libMesh::Nemesis_IO_Helper::get_init_info(), libMesh::RBEIMEvaluation::get_interior_basis_functions_as_vecs(), libMesh::Nemesis_IO_Helper::get_loadbal_param(), libMesh::DofMap::get_local_constraints(), libMesh::MeshBase::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::LaplaceMeshSmoother::init(), libMesh::SystemSubsetBySubdomain::init(), 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::MeshTools::Modification::interpolate_surface(), libMesh::SparsityPattern::Build::join(), libMesh::RBEvaluation::legacy_write_offline_data_to_files(), libMesh::RBSCMEvaluation::legacy_write_offline_data_to_files(), legacy_write_offline_data_to_files(), 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(), main(), AugmentSparsityOnInterface::mesh_reinit(), libMesh::TriangulatorInterface::MeshedHole::MeshedHole(), libMesh::MeshBase::n_active_local_elem(), libMesh::BoundaryInfo::n_boundary_conds(), libMesh::MeshTools::n_connected_components(), libMesh::MeshBase::n_constraint_rows(), libMesh::BoundaryInfo::n_edge_conds(), libMesh::DofMapBase::n_local_dofs(), libMesh::MeshBase::n_local_elem(), libMesh::MeshBase::n_local_nodes(), libMesh::BoundaryInfo::n_nodeset_conds(), libMesh::BoundaryInfo::n_shellface_conds(), libMesh::RBEIMEvaluation::node_gather_bfs(), libMesh::DistributedMesh::own_node(), libMesh::BoundaryInfo::parallel_sync_node_ids(), libMesh::BoundaryInfo::parallel_sync_side_ids(), libMesh::MeshBase::print_constraint_rows(), libMesh::DofMap::print_dof_constraints(), libMesh::DofMap::process_mesh_constraint_rows(), 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::XdrIO::read(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read(), libMesh::NameBasedIO::read(), libMesh::EquationSystems::read(), libMesh::EquationSystems::read(), libMesh::ExodusII_IO_Helper::read_elem_num_map(), libMesh::ExodusII_IO_Helper::read_global_values(), libMesh::CheckpointIO::read_header(), libMesh::ExodusII_IO::read_header(), libMesh::System::read_header(), libMesh::XdrIO::read_header(), libMesh::DynaIO::read_mesh(), libMesh::ExodusII_IO_Helper::read_node_num_map(), libMesh::System::read_parallel_data(), libMesh::RBConstruction::read_riesz_representors_from_files(), libMesh::TransientRBConstruction::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::Nemesis_IO_Helper::read_var_names_impl(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::StaticCondensationDofMap::reinit(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::DistributedMesh::renumber_nodes_and_elements(), libMesh::DofMap::scatter_constraints(), libMesh::CheckpointIO::select_split_config(), libMesh::DistributedMesh::set_next_unique_id(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::PetscDMWrapper::set_point_range_in_section(), libMesh::RBEIMEvaluation::side_gather_bfs(), MeshFunctionTest::test_bad_gradient_var_with_out_of_mesh_value(), MeshFunctionTest::test_bad_hessian_var_with_out_of_mesh_value(), ExodusTest< elem_type >::test_read_gold(), ExodusTest< elem_type >::test_write(), ExodusC0PolyhedronTest::test_write_and_read_hexagonal_prism(), ExodusC0PolygonTest::test_write_and_read_pentagon(), MeshInputTest::testAbaqusRead(), MeshInputTest::testBadGmsh(), BoundaryInfoTest::testBoundaryIDs(), MeshInputTest::testCopyElementSolutionImpl(), MeshInputTest::testCopyElementVectorImpl(), MeshInputTest::testCopyNodalSolutionImpl(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), MeshInputTest::testDynaFileMappings(), MeshInputTest::testDynaNoSplines(), MeshInputTest::testDynaReadElem(), MeshInputTest::testDynaReadPatch(), MeshInputTest::testExodusFileMappings(), MeshInputTest::testExodusIGASidesets(), MeshInputTest::testExodusWriteElementDataFromDiscontinuousNodalData(), MeshInputTest::testGmshBCIDOverlap(), MeshInputTest::testGoodGmsh(), MeshInputTest::testGoodSTL(), MeshInputTest::testGoodSTLBinary(), BoundaryInfoTest::testInternalBoundary(), MeshInputTest::testLowOrderEdgeBlocks(), BoundaryMeshSubdomainTest::testPerBoundarySubdomain(), SystemsTest::testProjectMatrix3D(), BoundaryInfoTest::testShellFaceConstraints(), MeshInputTest::testSingleElementImpl(), BoundaryMeshSubdomainTest::testSingleSubdomain(), WriteVecAndScalar::testSolution(), CheckpointIOTest::testSplitter(), MeshInputTest::testTetgenIO(), MeshSmootherTest::testVariationalSmoother(), libMesh::MeshTools::total_weight(), libMesh::NetGenMeshInterface::triangulate(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::Parallel::Packing< Node * >::unpack(), libMesh::DistributedMesh::update_parallel_id_counts(), libMesh::DTKAdapter::update_variable_values(), libMesh::MeshTools::volume(), libMesh::STLIO::write(), libMesh::XdrIO::write(), libMesh::NameBasedIO::write(), libMesh::CheckpointIO::write(), libMesh::EquationSystems::write(), libMesh::EquationSystems::write(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::ExodusII_IO::write_element_data(), libMesh::ExodusII_IO::write_element_data_from_discontinuous_nodal_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_Helper::write_elemset_data(), libMesh::ExodusII_IO_Helper::write_elemsets(), 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::ExodusII_IO::write_nodal_data(), libMesh::VTKIO::write_nodal_data(), libMesh::UCDIO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data_common(), libMesh::ExodusII_IO::write_nodal_data_discontinuous(), libMesh::ExodusII_IO_Helper::write_nodal_values(), libMesh::ExodusII_IO_Helper::write_nodeset_data(), libMesh::ExodusII_IO_Helper::write_nodesets(), libMesh::Nemesis_IO_Helper::write_nodesets(), libMesh::RBEIMEvaluation::write_out_interior_basis_functions(), libMesh::RBEIMEvaluation::write_out_node_basis_functions(), libMesh::RBEIMEvaluation::write_out_side_basis_functions(), 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::ExodusII_IO_Helper::write_sidesets(), libMesh::Nemesis_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() [1/3]

Real libMesh::RBEvaluation::rb_solve ( unsigned int  N)
virtual

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 118 of file rb_evaluation.C.

222{
223 return rb_solve(N, nullptr);
224}
virtual Real rb_solve(unsigned int N) override
Perform online solve with the N RB basis functions, for the set of parameters in current_params,...

◆ rb_solve() [2/3]

Real TransientRBEvaluation::rb_solve ( unsigned int  N)
overridevirtual

Perform online solve with the N RB basis functions, for the set of parameters in current_params, where 0 <= N <= RB_size.

Returns
The (absolute) error bound associated with the RB approximation. With an empty RB space (N=0), our RB solution is zero, but we still obtain a meaningful error bound associated with the forcing terms.

Reimplemented from libMesh::RBEvaluation.

Definition at line 151 of file transient_rb_evaluation.C.

152{
153 LOG_SCOPE("rb_solve()", "TransientRBEvaluation");
154
155 libmesh_error_msg_if(N > get_n_basis_functions(),
156 "ERROR: N cannot be larger than the number of basis functions in rb_solve");
157
158 const RBParameters & mu = get_parameters();
159
160 TransientRBThetaExpansion & trans_theta_expansion =
161 cast_ref<TransientRBThetaExpansion &>(get_rb_theta_expansion());
162 const unsigned int Q_m = trans_theta_expansion.get_n_M_terms();
163 const unsigned int Q_a = trans_theta_expansion.get_n_A_terms();
164 const unsigned int Q_f = trans_theta_expansion.get_n_F_terms();
165
166 const unsigned int n_time_steps = get_n_time_steps();
167 const Real dt = get_delta_t();
168 const Real euler_theta = get_euler_theta();
169
170 // Resize the RB and error bound vectors
171 error_bound_all_k.resize(n_time_steps+1);
172 RB_outputs_all_k.resize(trans_theta_expansion.get_n_outputs());
173 RB_output_error_bounds_all_k.resize(trans_theta_expansion.get_n_outputs());
174 for (unsigned int n=0; n<trans_theta_expansion.get_n_outputs(); n++)
175 {
176 RB_outputs_all_k[n].resize(n_time_steps+1, 0.);
177 RB_output_error_bounds_all_k[n].resize(n_time_steps+1, 0.);
178 }
179
180 // First assemble the mass matrix
181 DenseMatrix<Number> RB_mass_matrix_N(N,N);
182 RB_mass_matrix_N.zero();
183 DenseMatrix<Number> RB_M_q_m;
184 for (unsigned int q_m=0; q_m<Q_m; q_m++)
185 {
186 RB_M_q_vector[q_m].get_principal_submatrix(N, RB_M_q_m);
187 RB_mass_matrix_N.add(trans_theta_expansion.eval_M_theta(q_m, mu), RB_M_q_m);
188 }
189
192
195
196 RB_LHS_matrix.add(1./dt, RB_mass_matrix_N);
197 RB_RHS_matrix.add(1./dt, RB_mass_matrix_N);
198
199 DenseMatrix<Number> RB_Aq_a;
200 for (unsigned int q_a=0; q_a<Q_a; q_a++)
201 {
202 RB_Aq_vector[q_a].get_principal_submatrix(N, RB_Aq_a);
203
204 RB_LHS_matrix.add( euler_theta*trans_theta_expansion.eval_A_theta(q_a,mu), RB_Aq_a);
205 RB_RHS_matrix.add( -(1.-euler_theta)*trans_theta_expansion.eval_A_theta(q_a,mu), RB_Aq_a);
206 }
207
208 // Add forcing terms
209 DenseVector<Number> RB_Fq_f;
212 for (unsigned int q_f=0; q_f<Q_f; q_f++)
213 {
214 RB_Fq_vector[q_f].get_principal_subvector(N, RB_Fq_f);
215 RB_RHS_save.add(trans_theta_expansion.eval_F_theta(q_f,mu), RB_Fq_f);
216 }
217
218 // Set system time level to 0
219 set_time_step(0);
220
221 // Resize/clear the solution vector
223
224 // Load the initial condition into RB_solution
225 if (N > 0)
226 {
228 }
229
230 // Resize/clear the old solution vector
232
233 // Initialize the RB rhs
234 DenseVector<Number> RB_rhs(N);
235 RB_rhs.zero();
236
237 // Initialize the vectors storing solution data
238 RB_temporal_solution_data.resize(n_time_steps+1);
239 for (unsigned int time_level=0; time_level<=n_time_steps; time_level++)
240 {
241 RB_temporal_solution_data[time_level].resize(N);
242 }
243 // and load the initial data
245
246 // Set outputs at initial time
247 {
248 DenseVector<Number> RB_output_vector_N;
249 for (unsigned int n=0; n<trans_theta_expansion.get_n_outputs(); n++)
250 {
251 RB_outputs_all_k[n][0] = 0.;
252 for (unsigned int q_l=0; q_l<trans_theta_expansion.get_n_output_terms(n); q_l++)
253 {
254 RB_output_vectors[n][q_l].get_principal_subvector(N, RB_output_vector_N);
255 RB_outputs_all_k[n][0] += trans_theta_expansion.eval_output_theta(n,q_l,mu)*RB_output_vector_N.dot(RB_solution);
256 }
257 }
258 }
259
260 // Initialize error bounds, if necessary
261 Real error_bound_sum = 0.;
262 Real alpha_LB = 0.;
264 {
265 if (N > 0)
266 {
267 error_bound_sum += pow( initial_L2_error_all_N[N-1], 2.);
268 }
269
270 // Set error bound at the initial time
271 error_bound_all_k[get_time_step()] = std::sqrt(error_bound_sum);
272
273 // Compute the outputs and associated error bounds at the initial time
274 DenseVector<Number> RB_output_vector_N;
275 for (unsigned int n=0; n<trans_theta_expansion.get_n_outputs(); n++)
276 {
277 RB_outputs_all_k[n][0] = 0.;
278 for (unsigned int q_l=0; q_l<trans_theta_expansion.get_n_output_terms(n); q_l++)
279 {
280 RB_output_vectors[n][q_l].get_principal_subvector(N, RB_output_vector_N);
281 RB_outputs_all_k[n][0] += trans_theta_expansion.eval_output_theta(n,q_l,mu)*RB_output_vector_N.dot(RB_solution);
282 }
283
285 }
286
287 alpha_LB = get_stability_lower_bound();
288
289 // Precompute time-invariant parts of the dual norm of the residual.
291 }
292
293 for (unsigned int time_level=1; time_level<=n_time_steps; time_level++)
294 {
295 set_time_step(time_level);
297
298 // Compute RB_rhs, as RB_LHS_matrix x old_RB_solution
300
301 // Add forcing terms
302 RB_rhs.add(get_control(time_level), RB_RHS_save);
303
304 if (N > 0)
305 {
307 }
308
309 // Save RB_solution for current time level
311
312 // Evaluate outputs
313 DenseVector<Number> RB_output_vector_N;
314 for (unsigned int n=0; n<trans_theta_expansion.get_n_outputs(); n++)
315 {
316 RB_outputs_all_k[n][time_level] = 0.;
317 for (unsigned int q_l=0; q_l<trans_theta_expansion.get_n_output_terms(n); q_l++)
318 {
319 RB_output_vectors[n][q_l].get_principal_subvector(N, RB_output_vector_N);
320 RB_outputs_all_k[n][time_level] += trans_theta_expansion.eval_output_theta(n,q_l,mu)*
321 RB_output_vector_N.dot(RB_solution);
322 }
323 }
324
325 // Calculate RB error bounds
327 {
328 // Evaluate the dual norm of the residual for RB_solution_vector
329 // Real epsilon_N = uncached_compute_residual_dual_norm(N);
330 Real epsilon_N = compute_residual_dual_norm(N);
331
332 error_bound_sum += residual_scaling_numer(alpha_LB) * pow(epsilon_N, 2.);
333
334 // store error bound at time-level _k
335 error_bound_all_k[time_level] = std::sqrt(error_bound_sum/residual_scaling_denom(alpha_LB));
336
337 // Now evaluated output error bounds
338 for (unsigned int n=0; n<trans_theta_expansion.get_n_outputs(); n++)
339 {
340 RB_output_error_bounds_all_k[n][time_level] = error_bound_all_k[time_level] *
341 eval_output_dual_norm(n, nullptr);
342 }
343 }
344 }
345
346 _rb_solve_data_cached = true ;
347
348 if (evaluate_RB_error_bound) // Calculate the error bounds
349 {
350 return error_bound_all_k[n_time_steps];
351 }
352 else // Don't calculate the error bounds
353 {
354 // Just return -1. if we did not compute the error bound
355 return -1.;
356 }
357}
void vector_mult(DenseVector< T > &dest, const DenseVector< T > &arg) const
Performs the matrix-vector multiplication, dest := (*this) * arg.
void lu_solve(const DenseVector< T > &b, DenseVector< T > &x)
Solve the system Ax=b given the input vector b.
std::enable_if< ScalarTraits< T2 >::value, void >::type add(const T2 factor, const DenseMatrix< T3 > &mat)
Adds factor times mat to this matrix.
virtual void zero() override final
Sets all elements of the matrix to 0 and resets any decomposition flag which may have been previously...
virtual void zero() override final
Set every element in the vector to 0.
std::enable_if< ScalarTraits< T2 >::value, void >::type add(const T2 factor, const DenseVector< T3 > &vec)
Adds factor times vec to this vector.
void get_principal_subvector(unsigned int sub_n, DenseVector< T > &dest) const
Puts the principal subvector of size sub_n (i.e.
virtual Real residual_scaling_denom(Real alpha_LB)
Specifies the residual scaling on the denominator to be used in the a posteriori error bound.
virtual Real get_stability_lower_bound()
Get a lower bound for the stability constant (e.g.
bool evaluate_RB_error_bound
Boolean to indicate whether we evaluate a posteriori error bounds when rb_solve is called.
std::vector< std::vector< DenseVector< Number > > > RB_output_vectors
The vectors storing the RB output vectors.
Real eval_output_dual_norm(unsigned int n, const std::vector< Number > *evaluated_thetas)
Evaluate the dual norm of output n for the current parameters, or using the pre-evaluted theta values...
std::vector< DenseVector< Number > > RB_Fq_vector
Dense vector for the RHS.
std::vector< DenseMatrix< Number > > RB_Aq_vector
Dense matrices for the RB computations.
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.
std::vector< std::vector< Number > > RB_outputs_all_k
The RB outputs for all time-levels from the most recent rb_solve.
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.
DenseMatrix< Number > RB_LHS_matrix
Cached data for subsequent solves.
std::vector< Real > error_bound_all_k
The error bound data for all time-levels from the most recent rb_solve.
std::vector< DenseVector< Number > > RB_temporal_solution_data
Array storing the solution data at each time level from the most recent solve.
virtual Real residual_scaling_numer(Real alpha_LB)
Specifies the residual scaling on the numerator to be used in the a posteriori error bound.
T pow(const T &x)
Definition utility.h:296

References _rb_solve_data_cached, libMesh::DenseMatrix< T >::add(), libMesh::DenseVector< 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::DenseMatrix< T >::get_principal_submatrix(), libMesh::DenseVector< T >::get_principal_subvector(), 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, 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(), libMesh::DenseMatrix< T >::vector_mult(), libMesh::DenseMatrix< T >::zero(), and libMesh::DenseVector< T >::zero().

◆ rb_solve() [3/3]

Real libMesh::RBEvaluation::rb_solve ( unsigned int  N,
const std::vector< Number > *  evaluated_thetas 
)
virtual

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 124 of file rb_evaluation.C.

228{
229 LOG_SCOPE("rb_solve()", "RBEvaluation");
230
231 libmesh_error_msg_if(N > get_n_basis_functions(),
232 "ERROR: N cannot be larger than the number of basis functions in rb_solve");
233
234 // In case the theta functions have been pre-evaluated, first check the size for consistency. The
235 // size of the input "evaluated_thetas" vector must match the sum of the "A", "F", and "output" terms
236 // in the expansion.
237 this->check_evaluated_thetas_size(evaluated_thetas);
238
239 const RBParameters & mu = get_parameters();
240
241 // Resize (and clear) the solution vector
243
244 // Assemble the RB system
245 DenseMatrix<Number> RB_system_matrix(N,N);
246 RB_system_matrix.zero();
247
248 DenseMatrix<Number> RB_Aq_a;
249 for (unsigned int q_a=0; q_a<rb_theta_expansion->get_n_A_terms(); q_a++)
250 {
251 RB_Aq_vector[q_a].get_principal_submatrix(N, RB_Aq_a);
252
253 if (evaluated_thetas)
254 RB_system_matrix.add((*evaluated_thetas)[q_a], RB_Aq_a);
255 else
256 RB_system_matrix.add(rb_theta_expansion->eval_A_theta(q_a, mu), RB_Aq_a);
257 }
258
259 // Assemble the RB rhs
260 DenseVector<Number> RB_rhs(N);
261 RB_rhs.zero();
262
263 DenseVector<Number> RB_Fq_f;
264 for (unsigned int q_f=0; q_f<rb_theta_expansion->get_n_F_terms(); q_f++)
265 {
266 RB_Fq_vector[q_f].get_principal_subvector(N, RB_Fq_f);
267
268 if (evaluated_thetas)
269 RB_rhs.add((*evaluated_thetas)[q_f+rb_theta_expansion->get_n_A_terms()], RB_Fq_f);
270 else
271 RB_rhs.add(rb_theta_expansion->eval_F_theta(q_f, mu), RB_Fq_f);
272 }
273
274 // Solve the linear system
275 if (N > 0)
276 {
277 RB_system_matrix.lu_solve(RB_rhs, RB_solution);
278 }
279
280 // Place to store the output of get_principal_subvector() calls
281 DenseVector<Number> RB_output_vector_N;
282
283 // Evaluate RB outputs
284 unsigned int output_counter = 0;
285 for (unsigned int n=0; n<rb_theta_expansion->get_n_outputs(); n++)
286 {
287 RB_outputs[n] = 0.;
288 for (unsigned int q_l=0; q_l<rb_theta_expansion->get_n_output_terms(n); q_l++)
289 {
290 RB_output_vectors[n][q_l].get_principal_subvector(N, RB_output_vector_N);
291
292 // Compute dot product with current output vector and RB_solution
293 auto dot_prod = RB_output_vector_N.dot(RB_solution);
294
295 // Determine the coefficient depending on whether or not
296 // pre-evaluated thetas were provided. Note that if
297 // pre-evaluated thetas were provided, they must come after
298 // the "A" and "F" thetas and be in "row-major" order. In
299 // other words, there is a possibly "ragged" 2D array of
300 // output thetas ordered by output index "n" and term index
301 // "q_l" which is accessed in row-major order.
302 auto coeff = evaluated_thetas ?
303 (*evaluated_thetas)[output_counter + rb_theta_expansion->get_n_A_terms() + rb_theta_expansion->get_n_F_terms()] :
305
306 // Finally, accumulate the result in RB_outputs[n]
307 RB_outputs[n] += coeff * dot_prod;
308
309 // Go to next output
310 output_counter++;
311 }
312 }
313
314 if (evaluate_RB_error_bound) // Calculate the error bounds
315 {
316 // Evaluate the dual norm of the residual for RB_solution_vector
317 Real epsilon_N = compute_residual_dual_norm(N, evaluated_thetas);
318
319 // Get lower bound for coercivity constant
320 const Real alpha_LB = get_stability_lower_bound();
321 // alpha_LB needs to be positive to get a valid error bound
322 libmesh_assert_greater ( alpha_LB, 0. );
323
324 // Evaluate the (absolute) error bound
325 Real abs_error_bound = epsilon_N / residual_scaling_denom(alpha_LB);
326
327 // Now compute the output error bounds
328 for (unsigned int n=0; n<rb_theta_expansion->get_n_outputs(); n++)
329 RB_output_error_bounds[n] = abs_error_bound * this->eval_output_dual_norm(n, evaluated_thetas);
330
331 return abs_error_bound;
332 }
333 else // Don't calculate the error bounds
334 {
335 // Just return -1. if we did not compute the error bound
336 return -1.;
337 }
338}
std::vector< Real > RB_output_error_bounds
std::vector< Number > RB_outputs
The vectors storing the RB output values and corresponding error bounds.
unsigned int get_n_outputs() const
Get n_outputs, the number output functionals.

References libMesh::RBEvaluation::RB_Aq_vector.

◆ 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 359 of file transient_rb_evaluation.C.

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

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 318 of file rb_parametrized.C.

321{
322 // read in the discrete parameters, if we have any
323 std::ifstream check_if_file_exists(file_name.c_str());
324 if (check_if_file_exists.good())
325 {
326 // The reading mode: DECODE for binary, READ for ASCII
327 XdrMODE mode = read_binary_data ? DECODE : READ;
328
329 // Read in the parameter ranges
330 Xdr discrete_parameter_values_in(file_name, mode);
331 unsigned int n_discrete_params;
332 discrete_parameter_values_in >> n_discrete_params;
333
334 for (unsigned int i=0; i<n_discrete_params; i++)
335 {
336 std::string param_name;
337 discrete_parameter_values_in >> param_name;
338
339 unsigned int n_discrete_values;
340 discrete_parameter_values_in >> n_discrete_values;
341
342 std::vector<Real> discrete_values(n_discrete_values);
343 for (auto & val : discrete_values)
344 discrete_parameter_values_in >> val;
345
346 discrete_parameter_values[param_name] = discrete_values;
347 }
348 }
349}

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 1065 of file rb_evaluation.C.

1068{
1069 LOG_SCOPE("read_in_basis_functions()", "RBEvaluation");
1070
1071 read_in_vectors(sys,
1073 directory_name,
1074 "bf",
1075 read_binary_basis_functions);
1076}
static 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.

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

Referenced by main().

◆ 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 
)
staticinherited

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 1078 of file rb_evaluation.C.

1083{
1084 std::vector<std::vector<std::unique_ptr<NumericVector<Number>>> *> vectors_vec;
1085 vectors_vec.push_back(&vectors);
1086
1087 std::vector<std::string> directory_name_vec;
1088 directory_name_vec.push_back(directory_name);
1089
1090 std::vector<std::string> data_name_vec;
1091 data_name_vec.push_back(data_name);
1092
1094 vectors_vec,
1095 directory_name_vec,
1096 data_name_vec,
1097 read_binary_vectors);
1098}
static 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.

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 
)
staticinherited

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 1100 of file rb_evaluation.C.

1105{
1106 LOG_SCOPE("read_in_vectors_from_multiple_files()", "RBEvaluation");
1107
1108 std::size_t n_files = multiple_vectors.size();
1109 std::size_t n_directories = multiple_directory_names.size();
1110 libmesh_assert((n_files == n_directories) && (n_files == multiple_data_names.size()));
1111
1112 if (n_files == 0)
1113 return;
1114
1115 // Make sure processors are synced up before we begin
1116 sys.comm().barrier();
1117
1118 std::ostringstream file_name;
1119 const std::string basis_function_suffix = (read_binary_vectors ? ".xdr" : ".dat");
1120
1121 // Following EquationSystemsIO::read, we use a temporary numbering (node major)
1122 // before writing out the data. For the sake of efficiency, we do this once for
1123 // all the vectors that we read in.
1125
1126 for (std::size_t data_index=0; data_index<n_directories; data_index++)
1127 {
1128 std::vector<std::unique_ptr<NumericVector<Number>>> & vectors = *multiple_vectors[data_index];
1129
1130 // Allocate storage for each vector
1131 for (auto & vec : vectors)
1132 {
1133 // vectors should all be nullptr, otherwise we get a memory leak when
1134 // we create the new vectors in RBEvaluation::read_in_vectors.
1135 libmesh_error_msg_if(vec, "Non-nullptr vector passed to read_in_vectors_from_multiple_files");
1136
1137 vec = NumericVector<Number>::build(sys.comm());
1138
1139 vec->init (sys.n_dofs(),
1140 sys.n_local_dofs(),
1141 false,
1142 PARALLEL);
1143 }
1144
1145 file_name.str("");
1146 file_name << multiple_directory_names[data_index]
1147 << "/" << multiple_data_names[data_index]
1148 << "_data" << basis_function_suffix;
1149
1150 // On processor zero check to be sure the file exists
1151 if (sys.comm().rank() == 0)
1152 {
1153 struct stat stat_info;
1154 int stat_result = stat(file_name.str().c_str(), &stat_info);
1155
1156 libmesh_error_msg_if(stat_result != 0, "File does not exist: " << file_name.str());
1157 }
1158
1159 assert_file_exists(file_name.str());
1160 Xdr vector_data(file_name.str(),
1161 read_binary_vectors ? DECODE : READ);
1162
1163 // Read the header data. This block of code is based on EquationSystems::_read_impl.
1164 {
1165 std::string version;
1166 vector_data.data(version);
1167
1168 const std::string libMesh_label = "libMesh-";
1169 std::string::size_type lm_pos = version.find(libMesh_label);
1170 libmesh_error_msg_if(lm_pos == std::string::npos, "version info missing in Xdr header");
1171
1172 std::istringstream iss(version.substr(lm_pos + libMesh_label.size()));
1173 int ver_major = 0, ver_minor = 0, ver_patch = 0;
1174 char dot;
1175 iss >> ver_major >> dot >> ver_minor >> dot >> ver_patch;
1176 vector_data.set_version(LIBMESH_VERSION_ID(ver_major, ver_minor, ver_patch));
1177
1178 // Actually read the header data. When we do this, set read_header=false
1179 // so that we do not reinit sys, since we assume that it has already been
1180 // set up properly (e.g. the appropriate variables have already been added).
1181 sys.read_header(vector_data, version, /*read_header=*/false, /*read_additional_data=*/false);
1182 }
1183
1184 // Comply with the System::read_serialized_vectors() interface which uses dumb pointers.
1185 std::vector<NumericVector<Number> *> vec_in;
1186 for (auto & vec : vectors)
1187 vec_in.push_back(vec.get());
1188
1189 sys.read_serialized_vectors (vector_data, vec_in);
1190 }
1191
1192 // Undo the temporary renumbering
1193 sys.get_mesh().fix_broken_node_and_element_numbering();
1194}
static std::unique_ptr< NumericVector< T > > build(const Parallel::Communicator &comm, SolverPackage solver_package=libMesh::default_solver_package(), ParallelType parallel_type=AUTOMATIC)
Builds a NumericVector on the processors in communicator comm using the linear solver package specifi...
void globally_renumber_nodes_and_elements(MeshBase &)
There is no reason for a user to ever call this function.
const Elem & get(const ElemType type_in)

References libMesh::RBEvaluation::assert_file_exists(), libMesh::Parallel::Communicator::barrier(), 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::Parallel::Communicator::rank(), 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 262 of file rb_parametrized.C.

265{
266 RBParameters param_min;
267 RBParameters param_max;
268 read_parameter_ranges_from_file(continuous_param_file_name,
269 read_binary_data,
270 param_min,
271 param_max);
272
273 std::map<std::string, std::vector<Real>> discrete_parameter_values_in;
274 read_discrete_parameter_values_from_file(discrete_param_file_name,
275 read_binary_data,
276 discrete_parameter_values_in);
277
278 initialize_parameters(param_min, param_max, discrete_parameter_values_in);
279}
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.
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.

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 281 of file rb_parametrized.C.

285{
286 // The reading mode: DECODE for binary, READ for ASCII
287 XdrMODE mode = read_binary_data ? DECODE : READ;
288
289 // Read in the parameter ranges
290 Xdr parameter_ranges_in(file_name, mode);
291 unsigned int n_continuous_params;
292 parameter_ranges_in >> n_continuous_params;
293
294 for (unsigned int i=0; i<n_continuous_params; i++)
295 {
296 std::string param_name;
297 Real param_value;
298
299 parameter_ranges_in >> param_name;
300 parameter_ranges_in >> param_value;
301
302 param_min.set_value(param_name, param_value);
303 }
304 for (unsigned int i=0; i<n_continuous_params; i++)
305 {
306 std::string param_name;
307 Real param_value;
308
309 parameter_ranges_in >> param_name;
310 parameter_ranges_in >> param_value;
311
312 param_max.set_value(param_name, param_value);
313 }
314
315 parameter_ranges_in.close();
316}

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 467 of file rb_evaluation.C.

468{
469 // Here we implement the residual scaling for a coercive
470 // problem.
471 return alpha_LB;
472}

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 412 of file transient_rb_evaluation.C.

413{
414 return get_delta_t();
415}

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 65 of file transient_rb_evaluation.C.

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

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, libMesh::make_range(), 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 75 of file rb_evaluation.C.

76{
77 basis_functions.resize(n_bfs);
78}

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()

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

Set the current parameters to params The parameters are checked for validity; an error is thrown if the number of parameters or samples is different than expected.

We

Returns
a boolean true if the new parameters are within the min/max range, and false otherwise (but the parameters are set regardless). Enabling the "verbose_mode" flag will also print more details.

Definition at line 129 of file rb_parametrized.C.

130{
131 libmesh_error_msg_if(!parameters_initialized, "Error: parameters not initialized in RBParametrized::set_parameters");
132
133 // Terminate if params has the wrong number of parameters or samples.
134 // If the parameters are outside the min/max range, return false.
135 const bool valid_params = check_if_valid_params(params);
136
137 // Make a copy of params (default assignment operator just does memberwise copy, which is sufficient here)
138 this->parameters = params;
139
140 return valid_params;
141}
bool check_if_valid_params(const RBParameters &params) const
Helper function to check that params is valid:

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

Referenced by libMesh::RBSCMConstruction::compute_SCM_bounds_on_training_set(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_interiors(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_nodes(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_sides(), libMesh::RBConstruction::get_RB_error_bound(), SimpleRBEvaluation::get_stability_lower_bound(), libMesh::RBParametrized::initialize_parameters(), main(), libMesh::RBSCMEvaluation::reload_current_parameters(), libMesh::RBSCMEvaluation::set_current_parameters_from_C_J(), and RBParametersTest::testRBParametrized().

◆ set_rb_theta_expansion()

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

◆ 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 587 of file transient_rb_evaluation.C.

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

References 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, and libMesh::Real.

◆ 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 230 of file rb_parametrized.C.

232{
233 // write out the discrete parameters, if we have any
234 if (get_n_discrete_params() > 0)
235 {
236 // The writing mode: ENCODE for binary, WRITE for ASCII
237 XdrMODE mode = write_binary_data ? ENCODE : WRITE;
238
239 Xdr discrete_parameters_out(file_name, mode);
240 unsigned int n_discrete_params = get_n_discrete_params();
241 discrete_parameters_out << n_discrete_params;
242
243 // Note: the following loops are not candidates for structured
244 // bindings syntax because the Xdr APIs which they call are not
245 // defined for const references. We must therefore make copies
246 // to call these functions.
247 for (const auto & pr : get_discrete_parameter_values())
248 {
249 std::string param_name = pr.first;
250 auto n_discrete_values = cast_int<unsigned int>(pr.second.size());
251 discrete_parameters_out << param_name << n_discrete_values;
252
253 for (unsigned int i=0; i<n_discrete_values; i++)
254 {
255 Real discrete_value = pr.second[i];
256 discrete_parameters_out << discrete_value;
257 }
258 }
259 }
260}

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 982 of file rb_evaluation.C.

985{
986 LOG_SCOPE("write_out_basis_functions()", "RBEvaluation");
987
988 std::vector<NumericVector<Number>*> basis_functions_ptrs;
989 for (std::size_t i=0; i<basis_functions.size(); i++)
990 {
991 basis_functions_ptrs.push_back(basis_functions[i].get());
992 }
993
995 basis_functions_ptrs,
996 directory_name,
997 "bf",
998 write_binary_basis_functions);
999}
static 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.

References libMesh::RBEvaluation::basis_functions, 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 
)
staticinherited

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

Definition at line 1001 of file rb_evaluation.C.

1006{
1007 LOG_SCOPE("write_out_vectors()", "RBEvaluation");
1008
1009 if (sys.comm().rank() == 0)
1010 {
1011 // Make a directory to store all the data files
1012 Utility::mkdir(directory_name.c_str());
1013 }
1014
1015 // Make sure processors are synced up before we begin
1016 sys.comm().barrier();
1017
1018 std::ostringstream file_name;
1019 const std::string basis_function_suffix = (write_binary_vectors ? ".xdr" : ".dat");
1020
1021 file_name << directory_name << "/" << data_name << "_data" << basis_function_suffix;
1022 Xdr bf_data(file_name.str(),
1023 write_binary_vectors ? ENCODE : WRITE);
1024
1025 // Following EquationSystems::write(), we should only write the header information
1026 // if we're proc 0
1027 if (sys.comm().rank() == 0)
1028 {
1029 std::string version("libMesh-" + libMesh::get_io_compatibility_version());
1030#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1031 version += " with infinite elements";
1032#endif
1033 bf_data.data(version ,"# File Format Identifier");
1034
1035 sys.write_header(bf_data, /*(unused arg)*/ version, /*write_additional_data=*/false);
1036 }
1037
1038 // Following EquationSystemsIO::write, we use a temporary numbering (node major)
1039 // before writing out the data
1041
1042 // Write all vectors at once.
1043 {
1044 // Note the API wants pointers to constant vectors, hence this...
1045 std::vector<const NumericVector<Number> *> bf_out;
1046 for (const auto & vec : vectors)
1047 bf_out.push_back(vec);
1048
1049 // for (auto & val : vectors)
1050 // bf_out.push_back(val);
1051 sys.write_serialized_vectors (bf_data, bf_out);
1052 }
1053
1054
1055 // set the current version
1056 bf_data.set_version(LIBMESH_VERSION_ID(LIBMESH_MAJOR_VERSION,
1057 LIBMESH_MINOR_VERSION,
1058 LIBMESH_MICRO_VERSION));
1059
1060
1061 // Undo the temporary renumbering
1062 sys.get_mesh().fix_broken_node_and_element_numbering();
1063}
int mkdir(const char *pathname)
Create a directory.
Definition utility.C:152
std::string get_io_compatibility_version()
Specifier for I/O file compatibility features.

References libMesh::Parallel::Communicator::barrier(), 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::Parallel::Communicator::rank(), 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 185 of file rb_parametrized.C.

188{
189 write_parameter_ranges_to_file(continuous_param_file_name, write_binary_data);
190 write_discrete_parameter_values_to_file(discrete_param_file_name, write_binary_data);
191}
void write_parameter_ranges_to_file(const std::string &file_name, const bool write_binary)
Write out the parameter ranges 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.

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 193 of file rb_parametrized.C.

195{
196 // The writing mode: ENCODE for binary, WRITE for ASCII
197 XdrMODE mode = write_binary_data ? ENCODE : WRITE;
198
199 // Write out the parameter ranges
200 Xdr parameter_ranges_out(file_name, mode);
201 unsigned int n_continuous_params = get_n_continuous_params();
202 parameter_ranges_out << n_continuous_params;
203
204 // Note: the following loops are not candidates for structured
205 // bindings syntax because the Xdr APIs which they call are not
206 // defined for const references. We must therefore make copies to
207 // call these functions.
208 for (const auto & pr : get_parameters_min())
209 {
210 std::string param_name = pr.first;
211 if (!is_discrete_parameter(param_name))
212 {
213 Real param_value = get_parameters_min().get_value(param_name);
214 parameter_ranges_out << param_name << param_value;
215 }
216 }
217 for (const auto & pr : get_parameters_max())
218 {
219 std::string param_name = pr.first;
220 if (!is_discrete_parameter(param_name))
221 {
222 Real param_value = get_parameters_max().get_value(param_name);
223 parameter_ranges_out << param_name << param_value;
224 }
225 }
226
227 parameter_ranges_out.close();
228}
const RBParameters & get_parameters_max() const
Get an RBParameters object that specifies the maximum allowable value for each parameter.
const RBParameters & get_parameters_min() const
Get an RBParameters object that specifies the minimum allowable value for each parameter.
unsigned int get_n_continuous_params() const
Get the number of continuous parameters.
bool is_discrete_parameter(const std::string &mu_name) const
Is parameter mu_name discrete?

References libMesh::Xdr::close(), libMesh::ENCODE, libMesh::RBParametrized::get_n_continuous_params(), libMesh::RBParametrized::get_parameters_max(), libMesh::RBParametrized::get_parameters_min(), libMesh::RBParameters::get_value(), 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 130 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

Actually holds the data.

Definition at line 124 of file reference_counter.h.

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

◆ _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 250 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 143 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 113 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 137 of file reference_counter.h.

◆ _n_objects

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

◆ _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 258 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 340 of file rb_evaluation.h.

Referenced by libMesh::RBEvaluation::clear_riesz_representors(), libMesh::RBConstruction::read_riesz_representors_from_files(), 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 242 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 215 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 346 of file rb_evaluation.h.

Referenced by rb_solve(), and libMesh::RBEvaluation::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 323 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(), 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 253 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 204 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

Vector storing the current parameters.

Definition at line 239 of file rb_parametrized.h.

Referenced by libMesh::RBParametrized::clear(), libMesh::RBParametrized::get_parameters(), and libMesh::RBParametrized::set_parameters().

◆ 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

The inner product matrix.

This should be close to the identity, we need to calculate this rather than assume diagonality in order to accurately perform projections since orthogonality degrades with increasing N.

Definition at line 279 of file rb_evaluation.h.

Referenced by libMesh::RBDataSerialization::add_rb_evaluation_data_to_builder(), libMesh::RBEvaluation::legacy_read_offline_data_from_files(), libMesh::RBEvaluation::legacy_write_offline_data_to_files(), libMesh::RBDataDeserialization::load_rb_evaluation_data(), libMesh::TransientRBConstruction::set_error_temporal_data(), and libMesh::RBConstruction::update_RB_system_matrices().

◆ 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 180 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

Definition at line 306 of file rb_evaluation.h.

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

◆ 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 199 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 305 of file rb_evaluation.h.

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

◆ 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 193 of file transient_rb_evaluation.h.

Referenced by rb_solve().

◆ RB_RHS_matrix

DenseMatrix<Number> libMesh::TransientRBEvaluation::RB_RHS_matrix

Definition at line 181 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 182 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 209 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 181 of file rb_parametrized.h.

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


The documentation for this class was generated from the following files: