rb_evaluation.h
Go to the documentation of this file.
1 // rbOOmit: An implementation of the Certified Reduced Basis method.
2 // Copyright (C) 2009, 2010 David J. Knezevic
3 
4 // This file is part of rbOOmit.
5 
6 // rbOOmit is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 
11 // rbOOmit is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
15 
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 
20 #ifndef LIBMESH_RB_EVALUATION_H
21 #define LIBMESH_RB_EVALUATION_H
22 
23 // rbOOmit includes
26 
27 // libMesh includes
28 #include "libmesh/dense_matrix.h"
29 #include "libmesh/dense_vector.h"
30 #include "libmesh/auto_ptr.h"
32 
33 // C++ includes
34 
35 namespace libMesh
36 {
37 
38 class System;
39 template <typename T> class NumericVector;
40 
50 // ------------------------------------------------------------
51 // RBEvaluation class definition
53  public ParallelObject
54 {
55 public:
56 
61  LIBMESH_CAN_DEFAULT_TO_COMMWORLD);
62 
66  virtual ~RBEvaluation ();
67 
72  virtual void clear();
73 
77  void set_rb_theta_expansion(RBThetaExpansion& rb_theta_expansion_in);
78 
83 
88 
96  virtual void resize_data_structures(const unsigned int Nmax,
97  bool resize_error_bound_data=true);
98 
102  NumericVector<Number>& get_basis_function(unsigned int i);
103 
113  virtual Real rb_solve(unsigned int N);
114 
118  virtual Real get_rb_solution_norm();
119 
124  virtual Real compute_residual_dual_norm(const unsigned int N);
125 
131  virtual Real residual_scaling_denom(Real alpha_LB);
132 
137  Real eval_output_dual_norm(unsigned int n, const RBParameters& mu);
138 
144 
148  virtual unsigned int get_n_basis_functions() const
149  { return libmesh_cast_int<unsigned int>(basis_functions.size()); }
150 
155  virtual void set_n_basis_functions(unsigned int n_bfs) { basis_functions.resize(n_bfs); }
156 
162  virtual void clear_riesz_representors();
163 
168  virtual void write_offline_data_to_files(const std::string& directory_name = "offline_data",
169  const bool write_binary_data=true);
170 
175  virtual void read_offline_data_from_files(const std::string& directory_name = "offline_data",
176  bool read_error_bound_data=true,
177  const bool read_binary_data=true);
178 
186  virtual void write_out_basis_functions(System& sys,
187  const std::string& directory_name = "offline_data",
188  const bool write_binary_basis_functions = true);
189 
194  virtual void write_out_vectors(System& sys,
195  std::vector<NumericVector<Number>*>& vectors,
196  const std::string& directory_name = "offline_data",
197  const std::string& data_name = "bf",
198  const bool write_binary_basis_functions = true);
199 
207  virtual void read_in_basis_functions(System& sys,
208  const std::string& directory_name = "offline_data",
209  const bool read_binary_basis_functions = true);
210 
216  virtual void read_in_vectors(System& sys,
217  std::vector<NumericVector<Number>*>& vectors,
218  const std::string& directory_name,
219  const std::string& data_name,
220  const bool read_binary_vectors);
221 
225  static std::string get_io_version_string();
226 
227  //----------- PUBLIC DATA MEMBERS -----------//
228 
233  std::vector< NumericVector<Number>* > basis_functions;
234 
239  std::vector< RBParameters > greedy_param_list;
240 
248 
252  std::vector< DenseMatrix<Number> > RB_Aq_vector;
253 
257  std::vector< DenseVector<Number> > RB_Fq_vector;
258 
263 
267  std::vector< std::vector< DenseVector<Number> > > RB_output_vectors;
268 
273  std::vector< Number > RB_outputs;
274  std::vector< Real > RB_output_error_bounds;
275 
282  std::vector<Number> Fq_representor_innerprods;
283 
291  std::vector< std::vector< std::vector<Number> > > Fq_Aq_representor_innerprods;
292  std::vector< std::vector< std::vector<Number> > > Aq_Aq_representor_innerprods;
293 
300  std::vector< std::vector< Number > > output_dual_innerprods;
301 
308  std::vector< std::vector< NumericVector<Number>* > > Aq_representor;
309 
315 
320 
321 private:
322 
329 
330 };
331 
332 }
333 
334 #endif // LIBMESH_RB_EVALUATION_H

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:07 UTC

Hosted By:
SourceForge.net Logo