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

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

#include <rb_parametrized.h>

Inheritance diagram for libMesh::RBParametrized:
[legend]

Public Member Functions

 RBParametrized ()
 Constructor. More...
 
 RBParametrized (RBParametrized &&)=default
 Special functions. More...
 
RBParametrizedoperator= (RBParametrized &&)=default
 
 RBParametrized (const RBParametrized &)=default
 
RBParametrizedoperator= (const RBParametrized &)=default
 
virtual ~RBParametrized ()
 
virtual void clear ()
 Clear all the data structures associated with the system. More...
 
void initialize_parameters (const RBParameters &mu_min_in, const RBParameters &mu_max_in, const std::map< std::string, std::vector< Real >> &discrete_parameter_values)
 Initialize the parameter ranges and set current_parameters. More...
 
void initialize_parameters (const RBParametrized &rb_parametrized)
 Initialize the parameter ranges and set current_parameters. More...
 
unsigned int get_n_params () const
 Get the number of parameters. More...
 
unsigned int get_n_continuous_params () const
 Get the number of continuous parameters. More...
 
unsigned int get_n_discrete_params () const
 Get the number of discrete parameters. More...
 
std::set< std::string > get_parameter_names () const
 Get a set that stores the parameter names. More...
 
const RBParametersget_parameters () const
 Get the current parameters. More...
 
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. More...
 
const RBParametersget_parameters_min () const
 Get an RBParameters object that specifies the minimum allowable value for each parameter. More...
 
const RBParametersget_parameters_max () const
 Get an RBParameters object that specifies the maximum allowable value for each parameter. More...
 
Real get_parameter_min (const std::string &param_name) const
 Get minimum allowable value of parameter param_name. More...
 
Real get_parameter_max (const std::string &param_name) const
 Get maximum allowable value of parameter param_name. More...
 
void print_parameters () const
 Print the current parameters. More...
 
void write_parameter_data_to_files (const std::string &continuous_param_file_name, const std::string &discrete_param_file_name, const bool write_binary_data)
 Write out the parameter ranges to files. More...
 
void read_parameter_data_from_files (const std::string &continuous_param_file_name, const std::string &discrete_param_file_name, const bool read_binary_data)
 Read in the parameter ranges from files. More...
 
bool is_discrete_parameter (const std::string &mu_name) const
 Is parameter mu_name discrete? More...
 
const std::map< std::string, std::vector< Real > > & get_discrete_parameter_values () const
 Get a const reference to the discrete parameter values. More...
 
void print_discrete_parameter_values () const
 Print out all the discrete parameter values. More...
 

Static Public Member Functions

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

Public Attributes

bool verbose_mode
 Public boolean to toggle verbose mode. More...
 

Protected Types

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

Protected Member Functions

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

Static Protected Attributes

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

Private Member Functions

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

Static Private Member Functions

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

Private Attributes

bool parameters_initialized
 Flag indicating whether the parameters have been initialized. More...
 
RBParameters parameters
 Vector storing the current parameters. More...
 
RBParameters parameters_min
 Vectors that define the ranges (min and max) for the parameters. More...
 
RBParameters parameters_max
 
std::map< std::string, std::vector< Real > > _discrete_parameter_values
 Map that defines the allowable values of any discrete parameters. More...
 

Detailed Description

This class is part of the rbOOmit framework.

This class defines basic functionality of a parametrized object.

Author
David J. Knezevic
Date
2011

Definition at line 45 of file rb_parametrized.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.

Constructor & Destructor Documentation

◆ RBParametrized() [1/3]

libMesh::RBParametrized::RBParametrized ( )

Constructor.

Definition at line 36 of file rb_parametrized.C.

37  :
38  verbose_mode(false),
40 {
41 }
bool parameters_initialized
Flag indicating whether the parameters have been initialized.
bool verbose_mode
Public boolean to toggle verbose mode.

◆ RBParametrized() [2/3]

libMesh::RBParametrized::RBParametrized ( RBParametrized &&  )
default

Special functions.

  • This simple class can be default copy/move constructed/assigned.
  • Destructor is defaulted out-of-line.

◆ RBParametrized() [3/3]

libMesh::RBParametrized::RBParametrized ( const RBParametrized )
default

◆ ~RBParametrized()

libMesh::RBParametrized::~RBParametrized ( )
virtualdefault

Member Function Documentation

◆ check_if_valid_params()

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

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

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

Referenced by set_parameters().

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

◆ clear()

void libMesh::RBParametrized::clear ( )
virtual

◆ disable_print_counter_info()

void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 100 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

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

◆ enable_print_counter_info()

void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

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

Definition at line 94 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

95 {
96  _enable_print_counter = true;
97  return;
98 }
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...

◆ get_closest_value()

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

Definition at line 443 of file rb_parametrized.C.

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

Referenced by is_value_in_list().

444 {
445  libmesh_error_msg_if(list_of_values.empty(), "Error: list_of_values is empty.");
446 
447  Real min_distance = std::numeric_limits<Real>::max();
448  Real closest_val = 0.;
449  for (const auto & current_value : list_of_values)
450  {
451  Real distance = std::abs(value - current_value);
452  if (distance < min_distance)
453  {
454  min_distance = distance;
455  closest_val = current_value;
456  }
457  }
458 
459  return closest_val;
460 }
Real distance(const Point &p)
ADRealEigenVector< T, D, asd > abs(const ADRealEigenVector< T, D, asd > &)
Definition: type_vector.h:57
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const bool value
Definition: xdr_io.C:54

◆ get_discrete_parameter_values()

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

Get a const reference to the discrete parameter values.

Definition at line 370 of file rb_parametrized.C.

References _discrete_parameter_values, and parameters_initialized.

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

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

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

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

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

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 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:42
static Counts _counts
Actually holds the data.

◆ get_n_continuous_params()

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

Get the number of continuous parameters.

Definition at line 112 of file rb_parametrized.C.

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

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

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 }
bool parameters_initialized
Flag indicating whether the parameters have been initialized.
unsigned int get_n_discrete_params() const
Get the number of discrete parameters.
libmesh_assert(ctx)
unsigned int get_n_params() const
Get the number of parameters.

◆ get_n_discrete_params()

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

Get the number of discrete parameters.

Definition at line 121 of file rb_parametrized.C.

References get_discrete_parameter_values(), and parameters_initialized.

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

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 }
bool parameters_initialized
Flag indicating whether the parameters have been initialized.
const std::map< std::string, std::vector< Real > > & get_discrete_parameter_values() const
Get a const reference to the discrete parameter values.

◆ get_n_params()

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

Get the number of parameters.

Definition at line 103 of file rb_parametrized.C.

References libMesh::RBParameters::n_parameters(), parameters_initialized, parameters_max, and parameters_min.

Referenced by check_if_valid_params(), libMesh::RBEIMConstruction::compute_max_eim_error(), libMesh::RBConstruction::compute_max_error_bound(), get_n_continuous_params(), libMesh::RBSCMConstruction::print_info(), libMesh::RBEIMConstruction::print_info(), libMesh::RBConstruction::print_info(), libMesh::RBEIMEvaluation::set_eim_error_indicator_active(), and libMesh::RBConstruction::train_reduced_basis_with_POD().

104 {
105  libmesh_error_msg_if(!parameters_initialized, "Error: parameters not initialized in RBParametrized::get_n_params");
106 
107  libmesh_assert_equal_to ( parameters_min.n_parameters(), parameters_max.n_parameters() );
108 
109  return parameters_min.n_parameters();
110 }
bool parameters_initialized
Flag indicating whether the parameters have been initialized.
RBParameters parameters_min
Vectors that define the ranges (min and max) for the parameters.
unsigned int n_parameters() const
Get the number of parameters that have been added.

◆ get_parameter_max()

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

Get maximum allowable value of parameter param_name.

Definition at line 183 of file rb_parametrized.C.

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

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

184 {
185  libmesh_error_msg_if(!parameters_initialized, "Error: parameters not initialized in RBParametrized::get_parameter_max");
186 
187  return parameters_max.get_value(param_name);
188 }
Real get_value(const std::string &param_name) const
Get the value of the specified parameter, throw an error if it does not exist.
Definition: rb_parameters.C:64
bool parameters_initialized
Flag indicating whether the parameters have been initialized.

◆ get_parameter_min()

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

Get minimum allowable value of parameter param_name.

Definition at line 176 of file rb_parametrized.C.

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

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

177 {
178  libmesh_error_msg_if(!parameters_initialized, "Error: parameters not initialized in RBParametrized::get_parameter_min");
179 
180  return parameters_min.get_value(param_name);
181 }
Real get_value(const std::string &param_name) const
Get the value of the specified parameter, throw an error if it does not exist.
Definition: rb_parameters.C:64
bool parameters_initialized
Flag indicating whether the parameters have been initialized.
RBParameters parameters_min
Vectors that define the ranges (min and max) for the parameters.

◆ get_parameter_names()

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

Get a set that stores the parameter names.

Definition at line 129 of file rb_parametrized.C.

References parameters_initialized, and parameters_min.

130 {
131  libmesh_deprecated();
132  libmesh_error_msg_if(!parameters_initialized, "Error: parameters not initialized in RBParametrized::get_parameter_names");
133 
134  std::set<std::string> parameter_names;
135  for (const auto & pr : parameters_min)
136  parameter_names.insert(pr.first);
137 
138  return parameter_names;
139 }
bool parameters_initialized
Flag indicating whether the parameters have been initialized.
RBParameters parameters_min
Vectors that define the ranges (min and max) for the parameters.

◆ get_parameters()

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

Get the current parameters.

Definition at line 155 of file rb_parametrized.C.

References parameters, and parameters_initialized.

Referenced by libMesh::TransientRBConstruction::add_scaled_mass_matrix(), libMesh::TransientRBEvaluation::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(), libMesh::TransientRBConstruction::mass_matrix_scaled_matvec(), libMesh::RBConstruction::preevaluate_thetas(), libMesh::RBSCMConstruction::print_info(), libMesh::RBEIMConstruction::print_info(), libMesh::RBConstruction::print_info(), print_parameters(), libMesh::RBSCMConstruction::process_parameters_file(), libMesh::TransientRBEvaluation::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::TransientRBConstruction::truth_assembly(), libMesh::RBConstruction::truth_assembly(), libMesh::TransientRBConstruction::truth_solve(), libMesh::RBConstruction::truth_solve(), libMesh::TransientRBEvaluation::uncached_compute_residual_dual_norm(), and libMesh::RBConstruction::update_greedy_param_list().

156 {
157  libmesh_error_msg_if(!parameters_initialized, "Error: parameters not initialized in RBParametrized::get_parameters");
158 
159  return parameters;
160 }
bool parameters_initialized
Flag indicating whether the parameters have been initialized.
RBParameters parameters
Vector storing the current parameters.

◆ get_parameters_max()

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

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

Definition at line 169 of file rb_parametrized.C.

References parameters_initialized, and parameters_max.

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

170 {
171  libmesh_error_msg_if(!parameters_initialized, "Error: parameters not initialized in RBParametrized::get_parameters_max");
172 
173  return parameters_max;
174 }
bool parameters_initialized
Flag indicating whether the parameters have been initialized.

◆ get_parameters_min()

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

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

Definition at line 162 of file rb_parametrized.C.

References parameters_initialized, and parameters_min.

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

163 {
164  libmesh_error_msg_if(!parameters_initialized, "Error: parameters not initialized in RBParametrized::get_parameters_min");
165 
166  return parameters_min;
167 }
bool parameters_initialized
Flag indicating whether the parameters have been initialized.
RBParameters parameters_min
Vectors that define the ranges (min and max) for the parameters.

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

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

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

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 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:42
OStreamProxy err
static Counts _counts
Actually holds the data.
streamT * get()
Rather than implement every ostream/ios/ios_base function, we&#39;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

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

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

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

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 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:42
OStreamProxy err
static Counts _counts
Actually holds the data.
streamT * get()
Rather than implement every ostream/ios/ios_base function, we&#39;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

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

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.

References _discrete_parameter_values, libMesh::RBParameters::begin_serialized(), libMesh::RBParameters::end_serialized(), libMesh::RBParameters::n_parameters(), libMesh::RBParameters::n_samples(), libMesh::Quality::name(), parameters_initialized, parameters_max, parameters_min, libMesh::Real, set_parameters(), and libMesh::RBParameters::set_value().

Referenced by libMesh::RBConstruction::enrich_basis_from_rhs_terms(), initialize_parameters(), libMesh::RBDataDeserialization::load_parameter_ranges(), libMesh::RBSCMConstruction::perform_SCM_greedy(), libMesh::RBSCMConstruction::process_parameters_file(), read_parameter_data_from_files(), libMesh::RBEIMConstruction::set_rb_construction_parameters(), libMesh::RBConstruction::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().

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 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:42
bool parameters_initialized
Flag indicating whether the parameters have been initialized.
RBParameters parameters_min
Vectors that define the ranges (min and max) for the parameters.
std::map< std::string, std::vector< Real > > _discrete_parameter_values
Map that defines the allowable values of any discrete parameters.
bool set_parameters(const RBParameters &params)
Set the current parameters to params The parameters are checked for validity; an error is thrown if t...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void set_value(const std::string &param_name, Real value)
Set the value of the specified parameter.

◆ initialize_parameters() [2/2]

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

Initialize the parameter ranges and set current_parameters.

Definition at line 96 of file rb_parametrized.C.

References get_discrete_parameter_values(), get_parameters_max(), get_parameters_min(), and initialize_parameters().

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.

◆ is_discrete_parameter()

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

Is parameter mu_name discrete?

Definition at line 363 of file rb_parametrized.C.

References _discrete_parameter_values, and parameters_initialized.

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

364 {
365  libmesh_error_msg_if(!parameters_initialized, "Error: parameters not initialized in RBParametrized::is_discrete_parameter");
366 
367  return (_discrete_parameter_values.find(mu_name) != _discrete_parameter_values.end());
368 }
bool parameters_initialized
Flag indicating whether the parameters have been initialized.
std::map< std::string, std::vector< Real > > _discrete_parameter_values
Map that defines the allowable values of any discrete parameters.

◆ is_value_in_list()

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

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

Definition at line 462 of file rb_parametrized.C.

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

Referenced by check_if_valid_params().

463 {
464  Real closest_value = get_closest_value(value, list_of_values);
465 
466  // Check if relative tolerance is satisfied
467  Real rel_error = std::abs(value - closest_value) / std::abs(value);
468  if (rel_error <= tol)
469  {
470  return true;
471  }
472 
473  // If relative tolerance isn't satisfied, we should still check an absolute
474  // error, since relative tolerance can be misleading if value is close to zero
475  Real abs_error = std::abs(value - closest_value);
476  return (abs_error <= tol);
477 }
static Real get_closest_value(Real value, const std::vector< Real > &list_of_values)
ADRealEigenVector< T, D, asd > abs(const ADRealEigenVector< T, D, asd > &)
Definition: type_vector.h:57
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const bool value
Definition: xdr_io.C:54

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

References libMesh::ReferenceCounter::_n_objects.

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

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

◆ operator=() [1/2]

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

◆ operator=() [2/2]

RBParametrized& libMesh::RBParametrized::operator= ( const RBParametrized )
default

◆ print_discrete_parameter_values()

void libMesh::RBParametrized::print_discrete_parameter_values ( ) const

Print out all the discrete parameter values.

Definition at line 377 of file rb_parametrized.C.

References get_discrete_parameter_values(), libMesh::Quality::name(), libMesh::out, and value.

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

378 {
379  for (const auto & [name, values] : get_discrete_parameter_values())
380  {
381  libMesh::out << "Discrete parameter " << name << ", values: ";
382 
383  for (const auto & value : values)
384  libMesh::out << value << " ";
385  libMesh::out << std::endl;
386  }
387 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:42
const std::map< std::string, std::vector< Real > > & get_discrete_parameter_values() const
Get a const reference to the discrete parameter values.
OStreamProxy out
static const bool value
Definition: xdr_io.C:54

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

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

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

82 {
84  out_stream << ReferenceCounter::get_info();
85 }
static std::string get_info()
Gets a string containing the reference information.
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...

◆ print_parameters()

void libMesh::RBParametrized::print_parameters ( ) const

Print the current parameters.

Definition at line 190 of file rb_parametrized.C.

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

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

191 {
192  libmesh_error_msg_if(!parameters_initialized, "Error: parameters not initialized in RBParametrized::print_current_parameters");
193 
194  get_parameters().print();
195 }
bool parameters_initialized
Flag indicating whether the parameters have been initialized.
void print() const
Print the parameters.
const RBParameters & get_parameters() const
Get the current parameters.

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

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

Definition at line 330 of file rb_parametrized.C.

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

Referenced by read_parameter_data_from_files().

333 {
334  // read in the discrete parameters, if we have any
335  std::ifstream check_if_file_exists(file_name.c_str());
336  if (check_if_file_exists.good())
337  {
338  // The reading mode: DECODE for binary, READ for ASCII
339  XdrMODE mode = read_binary_data ? DECODE : READ;
340 
341  // Read in the parameter ranges
342  Xdr discrete_parameter_values_in(file_name, mode);
343  unsigned int n_discrete_params;
344  discrete_parameter_values_in >> n_discrete_params;
345 
346  for (unsigned int i=0; i<n_discrete_params; i++)
347  {
348  std::string param_name;
349  discrete_parameter_values_in >> param_name;
350 
351  unsigned int n_discrete_values;
352  discrete_parameter_values_in >> n_discrete_values;
353 
354  std::vector<Real> discrete_values(n_discrete_values);
355  for (auto & val : discrete_values)
356  discrete_parameter_values_in >> val;
357 
358  discrete_parameter_values[param_name] = discrete_values;
359  }
360  }
361 }
XdrMODE
Defines an enum for read/write mode in Xdr format.
Definition: enum_xdr_mode.h:35

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

Read in the parameter ranges from files.

Definition at line 274 of file rb_parametrized.C.

References initialize_parameters(), read_discrete_parameter_values_from_file(), and read_parameter_ranges_from_file().

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

277 {
278  RBParameters param_min;
279  RBParameters param_max;
280  read_parameter_ranges_from_file(continuous_param_file_name,
281  read_binary_data,
282  param_min,
283  param_max);
284 
285  std::map<std::string, std::vector<Real>> discrete_parameter_values_in;
286  read_discrete_parameter_values_from_file(discrete_param_file_name,
287  read_binary_data,
288  discrete_parameter_values_in);
289 
290  initialize_parameters(param_min, param_max, discrete_parameter_values_in);
291 }
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.
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.

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

Read in the parameter ranges from file.

Initialize parameters to the "minimum" parameter values.

Definition at line 293 of file rb_parametrized.C.

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

Referenced by read_parameter_data_from_files().

297 {
298  // The reading mode: DECODE for binary, READ for ASCII
299  XdrMODE mode = read_binary_data ? DECODE : READ;
300 
301  // Read in the parameter ranges
302  Xdr parameter_ranges_in(file_name, mode);
303  unsigned int n_continuous_params;
304  parameter_ranges_in >> n_continuous_params;
305 
306  for (unsigned int i=0; i<n_continuous_params; i++)
307  {
308  std::string param_name;
309  Real param_value;
310 
311  parameter_ranges_in >> param_name;
312  parameter_ranges_in >> param_value;
313 
314  param_min.set_value(param_name, param_value);
315  }
316  for (unsigned int i=0; i<n_continuous_params; i++)
317  {
318  std::string param_name;
319  Real param_value;
320 
321  parameter_ranges_in >> param_name;
322  parameter_ranges_in >> param_value;
323 
324  param_max.set_value(param_name, param_value);
325  }
326 
327  parameter_ranges_in.close();
328 }
XdrMODE
Defines an enum for read/write mode in Xdr format.
Definition: enum_xdr_mode.h:35
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ set_parameters()

bool libMesh::RBParametrized::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.

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

References check_if_valid_params(), parameters, and 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(), initialize_parameters(), libMesh::RBSCMEvaluation::reload_current_parameters(), libMesh::RBSCMEvaluation::set_current_parameters_from_C_J(), and RBParametersTest::testRBParametrized().

142 {
143  libmesh_error_msg_if(!parameters_initialized, "Error: parameters not initialized in RBParametrized::set_parameters");
144 
145  // Terminate if params has the wrong number of parameters or samples.
146  // If the parameters are outside the min/max range, return false.
147  const bool valid_params = check_if_valid_params(params);
148 
149  // Make a copy of params (default assignment operator just does memberwise copy, which is sufficient here)
150  this->parameters = params;
151 
152  return valid_params;
153 }
bool parameters_initialized
Flag indicating whether the parameters have been initialized.
bool check_if_valid_params(const RBParameters &params) const
Helper function to check that params is valid:
RBParameters parameters
Vector storing the current parameters.

◆ write_discrete_parameter_values_to_file()

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

Write out the discrete parameter values to file.

Definition at line 242 of file rb_parametrized.C.

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

Referenced by write_parameter_data_to_files().

244 {
245  // write out the discrete parameters, if we have any
246  if (get_n_discrete_params() > 0)
247  {
248  // The writing mode: ENCODE for binary, WRITE for ASCII
249  XdrMODE mode = write_binary_data ? ENCODE : WRITE;
250 
251  Xdr discrete_parameters_out(file_name, mode);
252  unsigned int n_discrete_params = get_n_discrete_params();
253  discrete_parameters_out << n_discrete_params;
254 
255  // Note: the following loops are not candidates for structured
256  // bindings syntax because the Xdr APIs which they call are not
257  // defined for const references. We must therefore make copies
258  // to call these functions.
259  for (const auto & pr : get_discrete_parameter_values())
260  {
261  std::string param_name = pr.first;
262  auto n_discrete_values = cast_int<unsigned int>(pr.second.size());
263  discrete_parameters_out << param_name << n_discrete_values;
264 
265  for (unsigned int i=0; i<n_discrete_values; i++)
266  {
267  Real discrete_value = pr.second[i];
268  discrete_parameters_out << discrete_value;
269  }
270  }
271  }
272 }
unsigned int get_n_discrete_params() const
Get the number of discrete parameters.
XdrMODE
Defines an enum for read/write mode in Xdr format.
Definition: enum_xdr_mode.h:35
const std::map< std::string, std::vector< Real > > & get_discrete_parameter_values() const
Get a const reference to the discrete parameter values.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

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

Write out the parameter ranges to files.

Definition at line 197 of file rb_parametrized.C.

References write_discrete_parameter_values_to_file(), and write_parameter_ranges_to_file().

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

200 {
201  write_parameter_ranges_to_file(continuous_param_file_name, write_binary_data);
202  write_discrete_parameter_values_to_file(discrete_param_file_name, write_binary_data);
203 }
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 write_parameter_ranges_to_file(const std::string &file_name, const bool write_binary)
Write out the parameter ranges to file.

◆ write_parameter_ranges_to_file()

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

Write out the parameter ranges to file.

Definition at line 205 of file rb_parametrized.C.

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

Referenced by write_parameter_data_to_files().

207 {
208  // The writing mode: ENCODE for binary, WRITE for ASCII
209  XdrMODE mode = write_binary_data ? ENCODE : WRITE;
210 
211  // Write out the parameter ranges
212  Xdr parameter_ranges_out(file_name, mode);
213  unsigned int n_continuous_params = get_n_continuous_params();
214  parameter_ranges_out << n_continuous_params;
215 
216  // Note: the following loops are not candidates for structured
217  // bindings syntax because the Xdr APIs which they call are not
218  // defined for const references. We must therefore make copies to
219  // call these functions.
220  for (const auto & pr : get_parameters_min())
221  {
222  std::string param_name = pr.first;
223  if (!is_discrete_parameter(param_name))
224  {
225  Real param_value = get_parameters_min().get_value(param_name);
226  parameter_ranges_out << param_name << param_value;
227  }
228  }
229  for (const auto & pr : get_parameters_max())
230  {
231  std::string param_name = pr.first;
232  if (!is_discrete_parameter(param_name))
233  {
234  Real param_value = get_parameters_max().get_value(param_name);
235  parameter_ranges_out << param_name << param_value;
236  }
237  }
238 
239  parameter_ranges_out.close();
240 }
Real get_value(const std::string &param_name) const
Get the value of the specified parameter, throw an error if it does not exist.
Definition: rb_parameters.C:64
const RBParameters & get_parameters_max() const
Get an RBParameters object that specifies the maximum allowable value for each parameter.
XdrMODE
Defines an enum for read/write mode in Xdr format.
Definition: enum_xdr_mode.h:35
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.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
bool is_discrete_parameter(const std::string &mu_name) const
Is parameter mu_name discrete?

Member Data Documentation

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

◆ _discrete_parameter_values

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

Map that defines the allowable values of any discrete parameters.

Definition at line 260 of file rb_parametrized.h.

Referenced by get_discrete_parameter_values(), initialize_parameters(), and 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().

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

The number of objects.

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

Definition at line 132 of file reference_counter.h.

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

◆ parameters

RBParameters libMesh::RBParametrized::parameters
private

Vector storing the current parameters.

Definition at line 249 of file rb_parametrized.h.

Referenced by clear(), get_parameters(), and set_parameters().

◆ parameters_initialized

bool libMesh::RBParametrized::parameters_initialized
private

◆ parameters_max

RBParameters libMesh::RBParametrized::parameters_max
private

◆ parameters_min

RBParameters libMesh::RBParametrized::parameters_min
private

Vectors that define the ranges (min and max) for the parameters.

Definition at line 254 of file rb_parametrized.h.

Referenced by clear(), get_n_params(), get_parameter_min(), get_parameter_names(), get_parameters_min(), and initialize_parameters().

◆ verbose_mode

bool libMesh::RBParametrized::verbose_mode

Public boolean to toggle verbose mode.

Definition at line 191 of file rb_parametrized.h.

Referenced by check_if_valid_params().


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