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

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

#include <rb_scm_evaluation.h>

Inheritance diagram for libMesh::RBSCMEvaluation:
[legend]

Public Member Functions

 RBSCMEvaluation (const Parallel::Communicator &comm)
 Constructor. More...
 
virtual ~RBSCMEvaluation ()
 Destructor. More...
 
void set_rb_theta_expansion (RBThetaExpansion &rb_theta_expansion_in)
 Set the RBThetaExpansion object. More...
 
RBThetaExpansionget_rb_theta_expansion ()
 Get a reference to the rb_theta_expansion. More...
 
virtual Real get_SCM_LB ()
 Evaluate single SCM lower bound. More...
 
virtual Real get_SCM_UB ()
 Evaluate single SCM upper bound. More...
 
Real get_C_J_stability_constraint (unsigned int j) const
 Get stability constraints (i.e. More...
 
void set_C_J_stability_constraint (unsigned int j, Real stability_constraint_in)
 Set stability constraints (i.e. More...
 
Real get_SCM_UB_vector (unsigned int j, unsigned int q)
 Get entries of SCM_UB_vector, which stores the vector y, corresponding to the minimizing eigenvectors for the elements of C_J. More...
 
void set_SCM_UB_vector (unsigned int j, unsigned int q, Real y_q)
 Set entries of SCM_UB_vector, which stores the vector y, corresponding to the minimizing eigenvectors for the elements of C_J. More...
 
unsigned int get_C_J_size ()
 Get size of the set C_J. More...
 
const RBParametersget_C_J_entry (unsigned int j)
 Get entry of C_J. More...
 
Real get_C_J_stability_value (unsigned int j)
 Get entry of C_J_stability_vector. More...
 
Real get_B_min (unsigned int i) const
 Get B_min and B_max. More...
 
Real get_B_max (unsigned int i) const
 
void set_B_min (unsigned int i, Real B_min_val)
 Set B_min and B_max. More...
 
void set_B_max (unsigned int i, Real B_max_val)
 
virtual void save_current_parameters ()
 Helper function to save current_parameters in saved_parameters. More...
 
virtual void reload_current_parameters ()
 Helper function to (re)load current_parameters from saved_parameters. More...
 
virtual void set_current_parameters_from_C_J (unsigned int C_J_index)
 Set parameters based on values saved in "C_J". More...
 
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. More...
 
virtual void legacy_read_offline_data_from_files (const std::string &directory_name="offline_data", const bool read_binary_data=true)
 Read in the saved Offline reduced basis data to initialize the system for Online solves. More...
 
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...
 
void set_parameters (const RBParameters &params)
 Set the current parameters to params. More...
 
const RBParametersget_parameters_min () const
 Get an RBParameters object that specifies the minimum allowable value for each parameter. More...
 
const RBParametersget_parameters_max () const
 Get an RBParameters object that specifies the maximum allowable value for each parameter. More...
 
Real get_parameter_min (const std::string &param_name) const
 Get minimum allowable value of parameter param_name. More...
 
Real get_parameter_max (const std::string &param_name) const
 Get maximum allowable value of parameter param_name. More...
 
void print_parameters () const
 Print the current parameters. More...
 
void write_parameter_data_to_files (const std::string &continuous_param_file_name, const std::string &discrete_param_file_name, const bool write_binary_data)
 Write out the parameter ranges to files. More...
 
void read_parameter_data_from_files (const std::string &continuous_param_file_name, const std::string &discrete_param_file_name, const bool read_binary_data)
 Read in the parameter ranges from files. More...
 
bool is_discrete_parameter (const std::string &mu_name) const
 Is parameter mu_name discrete? More...
 
const std::map< std::string, std::vector< Real > > & get_discrete_parameter_values () const
 Get a const reference to the discrete parameter values. More...
 
void print_discrete_parameter_values () const
 Print out all the discrete parameter values. More...
 
const Parallel::Communicatorcomm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

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

Public Attributes

std::vector< RealB_min
 B_min, B_max define the bounding box. More...
 
std::vector< RealB_max
 
std::vector< RBParametersC_J
 Vector storing the greedily selected parameters during SCM training. More...
 
std::vector< RealC_J_stability_vector
 Vector storing the (truth) stability values at the parameters in C_J. More...
 
std::vector< std::vector< Real > > SCM_UB_vectors
 This matrix stores the infimizing vectors y_1( $ \mu $),...,y_Q_a( $ \mu $), for each $ \mu $ in C_J, which are used in computing the SCM upper bounds. More...
 
bool verbose_mode
 Public boolean to toggle verbose mode. More...
 

Protected Types

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

Protected Member Functions

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

Protected Attributes

const Parallel::Communicator_communicator
 

Static Protected Attributes

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

Private Attributes

RBParameters saved_parameters
 Vector in which to save a parameter set. More...
 
RBThetaExpansionrb_theta_expansion
 A pointer to to the object that stores the theta expansion. More...
 

Detailed Description

This class is part of the rbOOmit framework.

RBSCMEvaluation encapsulates the functionality required to evaluate the Successive Constraint Method for associated with a reduced basis model.

Author
David J. Knezevic
Date
2011

Definition at line 52 of file rb_scm_evaluation.h.

Member Typedef Documentation

◆ Counts

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

Data structure to log the information.

The log is identified by the class name.

Definition at line 117 of file reference_counter.h.

Constructor & Destructor Documentation

◆ RBSCMEvaluation()

libMesh::RBSCMEvaluation::RBSCMEvaluation ( const Parallel::Communicator comm)

Constructor.

◆ ~RBSCMEvaluation()

virtual libMesh::RBSCMEvaluation::~RBSCMEvaluation ( )
virtual

Destructor.

Member Function Documentation

◆ clear()

virtual void libMesh::RBParametrized::clear ( )
virtualinherited

◆ comm()

const Parallel::Communicator& libMesh::ParallelObject::comm ( ) const
inherited

◆ disable_print_counter_info()

static void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

◆ enable_print_counter_info()

static void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

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

◆ get_B_max()

Real libMesh::RBSCMEvaluation::get_B_max ( unsigned int  i) const

◆ get_B_min()

Real libMesh::RBSCMEvaluation::get_B_min ( unsigned int  i) const

Get B_min and B_max.

◆ get_C_J_entry()

const RBParameters& libMesh::RBSCMEvaluation::get_C_J_entry ( unsigned int  j)

Get entry of C_J.

◆ get_C_J_size()

unsigned int libMesh::RBSCMEvaluation::get_C_J_size ( )

Get size of the set C_J.

Definition at line 120 of file rb_scm_evaluation.h.

References C_J.

121  { return cast_int<unsigned int>(C_J.size()); }
std::vector< RBParameters > C_J
Vector storing the greedily selected parameters during SCM training.

◆ get_C_J_stability_constraint()

Real libMesh::RBSCMEvaluation::get_C_J_stability_constraint ( unsigned int  j) const

Get stability constraints (i.e.

the values of coercivity/ inf-sup/stability constants at the parameter values chosen during the greedy); we store one constraint for each element of C_J.

◆ get_C_J_stability_value()

Real libMesh::RBSCMEvaluation::get_C_J_stability_value ( unsigned int  j)

Get entry of C_J_stability_vector.

Definition at line 131 of file rb_scm_evaluation.h.

References C_J_stability_vector.

131 { return C_J_stability_vector[j]; }
std::vector< Real > C_J_stability_vector
Vector storing the (truth) stability values at the parameters in C_J.

◆ get_closest_value()

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

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

◆ get_info()

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

Gets a string containing the reference information.

◆ get_n_continuous_params()

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

Get the number of continuous parameters.

◆ get_n_discrete_params()

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

Get the number of discrete parameters.

◆ get_n_params()

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

Get the number of parameters.

◆ get_parameter_max()

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

Get maximum allowable value of parameter param_name.

◆ get_parameter_min()

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

Get minimum allowable value of parameter param_name.

◆ get_parameter_names()

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

Get a set that stores the parameter names.

◆ get_parameters()

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

Get the current parameters.

Referenced by SimpleRBEvaluation::get_stability_lower_bound().

◆ get_parameters_max()

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

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

◆ get_parameters_min()

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

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

◆ get_rb_theta_expansion()

RBThetaExpansion& libMesh::RBSCMEvaluation::get_rb_theta_expansion ( )

Get a reference to the rb_theta_expansion.

◆ get_SCM_LB()

virtual Real libMesh::RBSCMEvaluation::get_SCM_LB ( )
virtual

Evaluate single SCM lower bound.

Referenced by SimpleRBEvaluation::get_stability_lower_bound().

◆ get_SCM_UB()

virtual Real libMesh::RBSCMEvaluation::get_SCM_UB ( )
virtual

Evaluate single SCM upper bound.

◆ get_SCM_UB_vector()

Real libMesh::RBSCMEvaluation::get_SCM_UB_vector ( unsigned int  j,
unsigned int  q 
)

Get entries of SCM_UB_vector, which stores the vector y, corresponding to the minimizing eigenvectors for the elements of C_J.

◆ increment_constructor_count()

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

Increments the construction counter.

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

Definition at line 181 of file reference_counter.h.

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

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

182 {
183  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
184  std::pair<unsigned int, unsigned int> & p = _counts[name];
185 
186  p.first++;
187 }
std::string name(const ElemQuality q)
static Counts _counts
Actually holds the data.
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.

◆ increment_destructor_count()

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

Increments the destruction counter.

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

Definition at line 194 of file reference_counter.h.

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

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

195 {
196  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
197  std::pair<unsigned int, unsigned int> & p = _counts[name];
198 
199  p.second++;
200 }
std::string name(const ElemQuality q)
static Counts _counts
Actually holds the data.
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.

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

◆ initialize_parameters() [2/2]

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

Initialize the parameter ranges and set current_parameters.

◆ is_discrete_parameter()

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

Is parameter mu_name discrete?

◆ legacy_read_offline_data_from_files()

virtual void libMesh::RBSCMEvaluation::legacy_read_offline_data_from_files ( const std::string &  directory_name = "offline_data",
const bool  read_binary_data = true 
)
virtual

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

Note
This is a legacy method, use RBDataSerialization instead.

◆ legacy_write_offline_data_to_files()

virtual void libMesh::RBSCMEvaluation::legacy_write_offline_data_to_files ( const std::string &  directory_name = "offline_data",
const bool  write_binary_data = true 
)
virtual

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.

◆ n_objects()

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

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

Definition at line 83 of file reference_counter.h.

References libMesh::ReferenceCounter::_n_objects.

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

◆ n_processors()

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

Definition at line 93 of file parallel_object.h.

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

Referenced by libMesh::MeshBase::partition().

94  { return cast_int<processor_id_type>(_communicator.size()); }
processor_id_type size() const
Definition: communicator.h:175
const Parallel::Communicator & _communicator

◆ print_discrete_parameter_values()

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

Print out all the discrete parameter values.

◆ print_info()

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

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

◆ print_parameters()

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

Print the current parameters.

◆ processor_id()

processor_id_type libMesh::ParallelObject::processor_id ( ) const
inherited

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

◆ reload_current_parameters()

virtual void libMesh::RBSCMEvaluation::reload_current_parameters ( )
virtual

Helper function to (re)load current_parameters from saved_parameters.

◆ save_current_parameters()

virtual void libMesh::RBSCMEvaluation::save_current_parameters ( )
virtual

Helper function to save current_parameters in saved_parameters.

◆ set_B_max()

void libMesh::RBSCMEvaluation::set_B_max ( unsigned int  i,
Real  B_max_val 
)

◆ set_B_min()

void libMesh::RBSCMEvaluation::set_B_min ( unsigned int  i,
Real  B_min_val 
)

Set B_min and B_max.

◆ set_C_J_stability_constraint()

void libMesh::RBSCMEvaluation::set_C_J_stability_constraint ( unsigned int  j,
Real  stability_constraint_in 
)

Set stability constraints (i.e.

the values of coercivity/ inf-sup/stability constants at the parameter values chosen during the greedy); we store one constraint for each element of C_J.

◆ set_current_parameters_from_C_J()

virtual void libMesh::RBSCMEvaluation::set_current_parameters_from_C_J ( unsigned int  C_J_index)
virtual

Set parameters based on values saved in "C_J".

◆ set_parameters()

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

Set the current parameters to params.

Referenced by SimpleRBEvaluation::get_stability_lower_bound().

◆ set_rb_theta_expansion()

void libMesh::RBSCMEvaluation::set_rb_theta_expansion ( RBThetaExpansion rb_theta_expansion_in)

Set the RBThetaExpansion object.

◆ set_SCM_UB_vector()

void libMesh::RBSCMEvaluation::set_SCM_UB_vector ( unsigned int  j,
unsigned int  q,
Real  y_q 
)

Set entries of SCM_UB_vector, which stores the vector y, corresponding to the minimizing eigenvectors for the elements of C_J.

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

Member Data Documentation

◆ _communicator

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

◆ _counts

Counts libMesh::ReferenceCounter::_counts
staticprotectedinherited

◆ _enable_print_counter

bool libMesh::ReferenceCounter::_enable_print_counter
staticprotectedinherited

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

Definition at line 141 of file reference_counter.h.

◆ _mutex

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

Mutual exclusion object to enable thread-safe reference counting.

Definition at line 135 of file reference_counter.h.

◆ _n_objects

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

The number of objects.

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

Definition at line 130 of file reference_counter.h.

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

◆ B_max

std::vector<Real> libMesh::RBSCMEvaluation::B_max

Definition at line 186 of file rb_scm_evaluation.h.

◆ B_min

std::vector<Real> libMesh::RBSCMEvaluation::B_min

B_min, B_max define the bounding box.

Definition at line 185 of file rb_scm_evaluation.h.

◆ C_J

std::vector<RBParameters > libMesh::RBSCMEvaluation::C_J

Vector storing the greedily selected parameters during SCM training.

Definition at line 192 of file rb_scm_evaluation.h.

Referenced by get_C_J_size().

◆ C_J_stability_vector

std::vector<Real> libMesh::RBSCMEvaluation::C_J_stability_vector

Vector storing the (truth) stability values at the parameters in C_J.

Definition at line 198 of file rb_scm_evaluation.h.

Referenced by get_C_J_stability_value().

◆ rb_theta_expansion

RBThetaExpansion* libMesh::RBSCMEvaluation::rb_theta_expansion
private

A pointer to to the object that stores the theta expansion.

This is not a std::unique_ptr since we may want to share it.

Note
A shared_ptr would be a good option here.

Definition at line 222 of file rb_scm_evaluation.h.

◆ saved_parameters

RBParameters libMesh::RBSCMEvaluation::saved_parameters
private

Vector in which to save a parameter set.

Useful in get_SCM_LB, for example.

Definition at line 214 of file rb_scm_evaluation.h.

◆ SCM_UB_vectors

std::vector<std::vector<Real> > libMesh::RBSCMEvaluation::SCM_UB_vectors

This matrix stores the infimizing vectors y_1( $ \mu $),...,y_Q_a( $ \mu $), for each $ \mu $ in C_J, which are used in computing the SCM upper bounds.

Definition at line 206 of file rb_scm_evaluation.h.

◆ verbose_mode

bool libMesh::RBParametrized::verbose_mode
inherited

Public boolean to toggle verbose mode.

Definition at line 170 of file rb_parametrized.h.


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