libMesh::RBEvaluation Class Reference

#include <rb_evaluation.h>

Inheritance diagram for libMesh::RBEvaluation:

List of all members.

Public Member Functions

 RBEvaluation ()
virtual ~RBEvaluation ()
virtual void clear ()
void set_rb_theta_expansion (RBThetaExpansion &rb_theta_expansion_in)
RBThetaExpansionget_rb_theta_expansion ()
bool is_rb_theta_expansion_initialized () const
virtual void resize_data_structures (const unsigned int Nmax, bool resize_error_bound_data=true)
NumericVector< Number > & get_basis_function (unsigned int i)
virtual Real rb_solve (unsigned int N)
virtual Real get_rb_solution_norm ()
virtual Real compute_residual_dual_norm (const unsigned int N)
virtual Real residual_scaling_denom (Real alpha_LB)
Real eval_output_dual_norm (unsigned int n, const RBParameters &mu)
virtual Real get_stability_lower_bound ()
virtual unsigned int get_n_basis_functions () const
virtual void set_n_basis_functions (unsigned int n_bfs)
virtual void clear_riesz_representors ()
virtual void write_offline_data_to_files (const std::string &directory_name="offline_data", const bool write_binary_data=true)
virtual void read_offline_data_from_files (const std::string &directory_name="offline_data", bool read_error_bound_data=true, const bool read_binary_data=true)
virtual void write_out_basis_functions (System &sys, const std::string &directory_name="offline_data", const bool write_binary_basis_functions=true)
virtual void write_out_vectors (System &sys, std::vector< NumericVector< Number > * > &vectors, const std::string &directory_name="offline_data", const std::string &data_name="bf", const bool write_binary_basis_functions=true)
virtual void read_in_basis_functions (System &sys, const std::string &directory_name="offline_data", const bool read_binary_basis_functions=true)
virtual void read_in_vectors (System &sys, std::vector< NumericVector< Number > * > &vectors, const std::string &directory_name, const std::string &data_name, const bool read_binary_vectors)
void initialize_parameters (const RBParameters &mu_min_in, const RBParameters &mu_max_in, const RBParameters &mu_in)
void initialize_parameters (const RBParametrized &rb_parametrized)
virtual void initialize_parameters (const std::string &parameters_filename)
unsigned int get_n_params () const
const RBParametersget_parameters () const
void set_parameters (const RBParameters &params)
const RBParametersget_parameters_min () const
const RBParametersget_parameters_max () const
Real get_parameter_min (const std::string &param_name) const
Real get_parameter_max (const std::string &param_name) const
void print_parameters () const
void write_parameter_ranges_to_file (const std::string &file_name, const bool write_binary)
void read_parameter_ranges_from_file (const std::string &file_name, const bool read_binary)

Static Public Member Functions

static std::string get_io_version_string ()
static std::string get_info ()
static void print_info (std::ostream &out=libMesh::out)
static unsigned int n_objects ()
static void enable_print_counter_info ()
static void disable_print_counter_info ()

Public Attributes

std::vector< NumericVector
< Number > * > 
basis_functions
std::vector< RBParametersgreedy_param_list
DenseMatrix< NumberRB_inner_product_matrix
std::vector< DenseMatrix
< Number > > 
RB_Aq_vector
std::vector< DenseVector
< Number > > 
RB_Fq_vector
DenseVector< NumberRB_solution
std::vector< std::vector
< DenseVector< Number > > > 
RB_output_vectors
std::vector< NumberRB_outputs
std::vector< RealRB_output_error_bounds
std::vector< NumberFq_representor_innerprods
std::vector< std::vector
< std::vector< Number > > > 
Fq_Aq_representor_innerprods
std::vector< std::vector
< std::vector< Number > > > 
Aq_Aq_representor_innerprods
std::vector< std::vector
< Number > > 
output_dual_innerprods
std::vector< std::vector
< NumericVector< Number > * > > 
Aq_representor
bool evaluate_RB_error_bound
bool compute_RB_inner_product
bool verbose_mode

Protected Types

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

Protected Member Functions

void increment_constructor_count (const std::string &name)
void increment_destructor_count (const std::string &name)

Static Protected Attributes

static Counts _counts
static Threads::atomic
< unsigned int > 
_n_objects
static Threads::spin_mutex _mutex
static bool _enable_print_counter = true

Private Attributes

RBThetaExpansionrb_theta_expansion

Detailed Description

This class is part of the rbOOmit framework.

RBEvaluation encapsulates the functionality required to _evaluate_ a given reduced basis model.

Author:
David J. Knezevic, 2011

Definition at line 52 of file rb_evaluation.h.


Member Typedef Documentation

typedef std::map<std::string, std::pair<unsigned int, unsigned int> > libMesh::ReferenceCounter::Counts [protected, inherited]

Data structure to log the information. The log is identified by the class name.

Definition at line 113 of file reference_counter.h.


Constructor & Destructor Documentation

libMesh::RBEvaluation::RBEvaluation (  ) 

Constructor.

virtual libMesh::RBEvaluation::~RBEvaluation (  )  [virtual]

Destructor.


Member Function Documentation

virtual void libMesh::RBEvaluation::clear (  )  [virtual]

Clear this RBEvaluation object. Delete the basis functions and clear and extra data in subclasses.

Reimplemented from libMesh::RBParametrized.

Reimplemented in libMesh::RBEIMEvaluation, and libMesh::TransientRBEvaluation.

virtual void libMesh::RBEvaluation::clear_riesz_representors (  )  [virtual]

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.

Reimplemented in libMesh::TransientRBEvaluation.

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

Reimplemented in libMesh::TransientRBEvaluation.

void libMesh::ReferenceCounter::disable_print_counter_info (  )  [static, inherited]

Definition at line 106 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

00107 {
00108   _enable_print_counter = false;
00109   return;
00110 }

void libMesh::ReferenceCounter::enable_print_counter_info (  )  [static, inherited]

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

Definition at line 100 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

00101 {
00102   _enable_print_counter = true;
00103   return;
00104 }

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

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

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

Get a reference to the i^th basis function.

std::string libMesh::ReferenceCounter::get_info (  )  [static, inherited]

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

00048 {
00049 #if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
00050 
00051   std::ostringstream oss;
00052 
00053   oss << '\n'
00054       << " ---------------------------------------------------------------------------- \n"
00055       << "| Reference count information                                                |\n"
00056       << " ---------------------------------------------------------------------------- \n";
00057 
00058   for (Counts::iterator it = _counts.begin();
00059        it != _counts.end(); ++it)
00060     {
00061       const std::string name(it->first);
00062       const unsigned int creations    = it->second.first;
00063       const unsigned int destructions = it->second.second;
00064 
00065       oss << "| " << name << " reference count information:\n"
00066           << "|  Creations:    " << creations    << '\n'
00067           << "|  Destructions: " << destructions << '\n';
00068     }
00069 
00070   oss << " ---------------------------------------------------------------------------- \n";
00071 
00072   return oss.str();
00073 
00074 #else
00075 
00076   return "";
00077 
00078 #endif
00079 }

static std::string libMesh::RBEvaluation::get_io_version_string (  )  [static]

Version string that we need to use for writing/reading basis functions.

virtual unsigned int libMesh::RBEvaluation::get_n_basis_functions (  )  const [inline, virtual]

Get the current number of basis functions.

Definition at line 146 of file rb_evaluation.h.

References basis_functions.

00147   { return libmesh_cast_int<unsigned int>(basis_functions.size()); }

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

Get the number of parameters.

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

Get maximum allowable value of parameter param_name.

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

Get minimum allowable value of parameter param_name.

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

Get the current parameters.

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

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

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

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

virtual Real libMesh::RBEvaluation::get_rb_solution_norm (  )  [virtual]

Return the norm of RB_solution.

Reimplemented in libMesh::TransientRBEvaluation.

RBThetaExpansion& libMesh::RBEvaluation::get_rb_theta_expansion (  ) 

Get a reference to the rb_theta_expansion.

virtual Real libMesh::RBEvaluation::get_stability_lower_bound (  )  [virtual]

Get a lower bound for the stability constant (e.g. coercivity constant or inf-sup constant) at the current parameter value.

void libMesh::ReferenceCounter::increment_constructor_count ( const std::string &  name  )  [inline, protected, inherited]

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

Definition at line 163 of file reference_counter.h.

References libMesh::ReferenceCounter::_counts, and libMesh::Threads::spin_mtx.

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

00164 {
00165   Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
00166   std::pair<unsigned int, unsigned int>& p = _counts[name];
00167 
00168   p.first++;
00169 }

void libMesh::ReferenceCounter::increment_destructor_count ( const std::string &  name  )  [inline, protected, inherited]

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

Definition at line 176 of file reference_counter.h.

References libMesh::ReferenceCounter::_counts, and libMesh::Threads::spin_mtx.

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

00177 {
00178   Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
00179   std::pair<unsigned int, unsigned int>& p = _counts[name];
00180 
00181   p.second++;
00182 }

virtual void libMesh::RBParametrized::initialize_parameters ( const std::string &  parameters_filename  )  [virtual, inherited]

Initialize the parameter ranges and set current_parameters by reading in data from the file input_filename

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

Initialize the parameter ranges and set current_parameters.

void libMesh::RBParametrized::initialize_parameters ( const RBParameters mu_min_in,
const RBParameters mu_max_in,
const RBParameters mu_in 
) [inherited]

Initialize the parameter ranges and set current_parameters.

bool libMesh::RBEvaluation::is_rb_theta_expansion_initialized (  )  const
Returns:
true if the theta expansion has been initialized.
static unsigned int libMesh::ReferenceCounter::n_objects (  )  [inline, static, inherited]

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

Definition at line 79 of file reference_counter.h.

References libMesh::ReferenceCounter::_n_objects.

00080   { return _n_objects; }

void libMesh::ReferenceCounter::print_info ( std::ostream &  out = libMesh::out  )  [static, inherited]

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

Definition at line 88 of file reference_counter.C.

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

00089 {
00090   if( _enable_print_counter ) out_stream << ReferenceCounter::get_info();
00091 }

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

Print the current parameters.

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

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 in libMesh::RBEIMEvaluation, and libMesh::TransientRBEvaluation.

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

Read in all the basis functions from 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

virtual void libMesh::RBEvaluation::read_in_vectors ( System sys,
std::vector< NumericVector< Number > * > &  vectors,
const std::string &  directory_name,
const std::string &  data_name,
const bool  read_binary_vectors 
) [virtual]

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.

virtual void libMesh::RBEvaluation::read_offline_data_from_files ( const std::string &  directory_name = "offline_data",
bool  read_error_bound_data = true,
const bool  read_binary_data = true 
) [virtual]

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

Reimplemented in libMesh::RBEIMEvaluation, and libMesh::TransientRBEvaluation.

void libMesh::RBParametrized::read_parameter_ranges_from_file ( const std::string &  file_name,
const bool  read_binary 
) [inherited]

Read in the parameter ranges from file. Initialize parameters to the "minimum" parameter values.

virtual Real libMesh::RBEvaluation::residual_scaling_denom ( Real  alpha_LB  )  [virtual]

Specifies the residual scaling on the denominator to be used in the a posteriori error bound. Overload in subclass in order to obtain the desired error bound.

virtual void libMesh::RBEvaluation::resize_data_structures ( const unsigned int  Nmax,
bool  resize_error_bound_data = true 
) [virtual]

Resize and clear the data vectors corresponding to the value of Nmax. Optionally resize the data structures required for the error bound. Overload to also clear and resize any extra data in subclasses.

Reimplemented in libMesh::RBEIMEvaluation, and libMesh::TransientRBEvaluation.

virtual void libMesh::RBEvaluation::set_n_basis_functions ( unsigned int  n_bfs  )  [inline, virtual]

Set the number of basis functions. Useful when reading in stored data.

Definition at line 153 of file rb_evaluation.h.

References basis_functions.

00153 { basis_functions.resize(n_bfs); }

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

Set the current parameters to params

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

Set the RBThetaExpansion object.

virtual void libMesh::RBEvaluation::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.

Reimplemented in libMesh::RBEIMEvaluation, and libMesh::TransientRBEvaluation.

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

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

virtual 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 
) [virtual]

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

void libMesh::RBParametrized::write_parameter_ranges_to_file ( const std::string &  file_name,
const bool  write_binary 
) [inherited]

Write out the parameter ranges to file.


Member Data Documentation

bool libMesh::ReferenceCounter::_enable_print_counter = true [static, protected, inherited]

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

Definition at line 137 of file reference_counter.h.

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

Mutual exclusion object to enable thread-safe reference counting.

Definition at line 131 of file reference_counter.h.

Threads::atomic< unsigned int > libMesh::ReferenceCounter::_n_objects [static, protected, inherited]

The number of objects. Print the reference count information when the number returns to 0.

Definition at line 126 of file reference_counter.h.

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

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

Definition at line 290 of file rb_evaluation.h.

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

The libMesh vectors storing the finite element coefficients of the RB basis functions.

Definition at line 231 of file rb_evaluation.h.

Referenced by get_n_basis_functions(), and set_n_basis_functions().

Boolean flag to indicate whether we compute the RB_inner_product_matrix.

Definition at line 317 of file rb_evaluation.h.

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

Definition at line 312 of file rb_evaluation.h.

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

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

Vectors storing the residual representor inner products to be used in computing the residuals online. These values are independent of a basis, hence they can be copied over directly from an RBSystem.

Definition at line 280 of file rb_evaluation.h.

The list of parameters selected by the Greedy algorithm in generating the Reduced Basis associated with this RBEvaluation object.

Definition at line 237 of file rb_evaluation.h.

The vector storing the dual norm inner product terms for each output. These values are independent of a basis, hence they can be copied over directly from an RBSystem.

Definition at line 298 of file rb_evaluation.h.

Dense matrices for the RB computations.

Definition at line 250 of file rb_evaluation.h.

Dense vector for the RHS.

Definition at line 255 of file rb_evaluation.h.

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

Definition at line 272 of file rb_evaluation.h.

The vectors storing the RB output vectors.

Definition at line 265 of file rb_evaluation.h.

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

Definition at line 271 of file rb_evaluation.h.

The RB solution vector.

Definition at line 260 of file rb_evaluation.h.

A pointer to to the object that stores the theta expansion. This is not an AutoPtr since we may want to share it. (Note: a shared_ptr would be a good option here.)

Definition at line 326 of file rb_evaluation.h.

Public boolean to toggle verbose mode.

Definition at line 141 of file rb_parametrized.h.


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

Site Created By: libMesh Developers
Last modified: February 05 2013 19:55:37 UTC

Hosted By:
SourceForge.net Logo