rb_evaluation.h
Go to the documentation of this file.00001 // rbOOmit: An implementation of the Certified Reduced Basis method. 00002 // Copyright (C) 2009, 2010 David J. Knezevic 00003 00004 // This file is part of rbOOmit. 00005 00006 // rbOOmit is free software; you can redistribute it and/or 00007 // modify it under the terms of the GNU Lesser General Public 00008 // License as published by the Free Software Foundation; either 00009 // version 2.1 of the License, or (at your option) any later version. 00010 00011 // rbOOmit is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 // Lesser General Public License for more details. 00015 00016 // You should have received a copy of the GNU Lesser General Public 00017 // License along with this library; if not, write to the Free Software 00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 00020 #ifndef LIBMESH_RB_EVALUATION_H 00021 #define LIBMESH_RB_EVALUATION_H 00022 00023 // rbOOmit includes 00024 #include "libmesh/rb_parametrized.h" 00025 #include "libmesh/rb_theta_expansion.h" 00026 00027 // libMesh includes 00028 #include "libmesh/dense_matrix.h" 00029 #include "libmesh/dense_vector.h" 00030 #include "libmesh/auto_ptr.h" 00031 00032 // C++ includes 00033 00034 namespace libMesh 00035 { 00036 00037 class System; 00038 template <typename T> class NumericVector; 00039 00049 // ------------------------------------------------------------ 00050 // RBEvaluation class definition 00051 00052 class RBEvaluation : public RBParametrized 00053 { 00054 public: 00055 00059 RBEvaluation (); 00060 00064 virtual ~RBEvaluation (); 00065 00070 virtual void clear(); 00071 00075 void set_rb_theta_expansion(RBThetaExpansion& rb_theta_expansion_in); 00076 00080 RBThetaExpansion& get_rb_theta_expansion(); 00081 00085 bool is_rb_theta_expansion_initialized() const; 00086 00094 virtual void resize_data_structures(const unsigned int Nmax, 00095 bool resize_error_bound_data=true); 00096 00100 NumericVector<Number>& get_basis_function(unsigned int i); 00101 00111 virtual Real rb_solve(unsigned int N); 00112 00116 virtual Real get_rb_solution_norm(); 00117 00122 virtual Real compute_residual_dual_norm(const unsigned int N); 00123 00129 virtual Real residual_scaling_denom(Real alpha_LB); 00130 00135 Real eval_output_dual_norm(unsigned int n, const RBParameters& mu); 00136 00141 virtual Real get_stability_lower_bound(); 00142 00146 virtual unsigned int get_n_basis_functions() const 00147 { return libmesh_cast_int<unsigned int>(basis_functions.size()); } 00148 00153 virtual void set_n_basis_functions(unsigned int n_bfs) { basis_functions.resize(n_bfs); } 00154 00160 virtual void clear_riesz_representors(); 00161 00166 virtual void write_offline_data_to_files(const std::string& directory_name = "offline_data", 00167 const bool write_binary_data=true); 00168 00173 virtual void read_offline_data_from_files(const std::string& directory_name = "offline_data", 00174 bool read_error_bound_data=true, 00175 const bool read_binary_data=true); 00176 00184 virtual void write_out_basis_functions(System& sys, 00185 const std::string& directory_name = "offline_data", 00186 const bool write_binary_basis_functions = true); 00187 00192 virtual void write_out_vectors(System& sys, 00193 std::vector<NumericVector<Number>*>& vectors, 00194 const std::string& directory_name = "offline_data", 00195 const std::string& data_name = "bf", 00196 const bool write_binary_basis_functions = true); 00197 00205 virtual void read_in_basis_functions(System& sys, 00206 const std::string& directory_name = "offline_data", 00207 const bool read_binary_basis_functions = true); 00208 00214 virtual void read_in_vectors(System& sys, 00215 std::vector<NumericVector<Number>*>& vectors, 00216 const std::string& directory_name, 00217 const std::string& data_name, 00218 const bool read_binary_vectors); 00219 00223 static std::string get_io_version_string(); 00224 00225 //----------- PUBLIC DATA MEMBERS -----------// 00226 00231 std::vector< NumericVector<Number>* > basis_functions; 00232 00237 std::vector< RBParameters > greedy_param_list; 00238 00245 DenseMatrix<Number> RB_inner_product_matrix; 00246 00250 std::vector< DenseMatrix<Number> > RB_Aq_vector; 00251 00255 std::vector< DenseVector<Number> > RB_Fq_vector; 00256 00260 DenseVector<Number> RB_solution; 00261 00265 std::vector< std::vector< DenseVector<Number> > > RB_output_vectors; 00266 00271 std::vector< Number > RB_outputs; 00272 std::vector< Real > RB_output_error_bounds; 00273 00280 std::vector<Number> Fq_representor_innerprods; 00281 00289 std::vector< std::vector< std::vector<Number> > > Fq_Aq_representor_innerprods; 00290 std::vector< std::vector< std::vector<Number> > > Aq_Aq_representor_innerprods; 00291 00298 std::vector< std::vector< Number > > output_dual_innerprods; 00299 00306 std::vector< std::vector< NumericVector<Number>* > > Aq_representor; 00307 00312 bool evaluate_RB_error_bound; 00313 00317 bool compute_RB_inner_product; 00318 00319 private: 00320 00326 RBThetaExpansion* rb_theta_expansion; 00327 00328 }; 00329 00330 } 00331 00332 #endif // LIBMESH_RB_EVALUATION_H
Site Created By: libMesh Developers
Last modified: February 05 2013 19:54:48 UTC
Hosted By: