transient_rb_construction.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_TRANSIENT_RB_CONSTRUCTION_H
21 #define LIBMESH_TRANSIENT_RB_CONSTRUCTION_H
22 
23 // rbOOmit includes
27 
28 // libMesh includes
30 
31 // C++ includes
32 
33 namespace libMesh
34 {
35 
45 // ------------------------------------------------------------
46 // TransientRBConstruction class definition
47 
49 {
50 public:
51 
57  const std::string& name,
58  const unsigned int number);
59 
63  virtual ~TransientRBConstruction ();
64 
69 
74 
79  virtual void clear ();
80 
89  virtual void initialize_rb_construction();
90 
94  virtual Real truth_solve(int write_interval);
95 
103  virtual Real train_reduced_basis(const std::string& directory_name = "offline_data",
104  const bool resize_rb_eval_data=true);
105 
110  virtual void process_parameters_file (const std::string& parameters_filename);
111 
115  virtual void print_info();
116 
121  virtual bool greedy_termination_test(Real training_greedy_error, int count);
122 
127  virtual void assemble_all_affine_operators();
128 
132  virtual void assemble_misc_matrices();
133 
137  void assemble_L2_matrix(SparseMatrix<Number>* input_matrix, bool apply_dirichlet_bc=true);
138 
143  void assemble_mass_matrix(SparseMatrix<Number>* input_matrix);
144 
149  void add_scaled_mass_matrix(Number scalar,
150  SparseMatrix<Number>* input_matrix);
151 
156  void mass_matrix_scaled_matvec(Number scalar,
157  NumericVector<Number>& dest,
158  NumericVector<Number>& arg);
159 
163  void set_L2_assembly(ElemAssembly& L2_assembly_in);
164 
169 
173  void assemble_Mq_matrix(unsigned int q, SparseMatrix<Number>* input_matrix, bool apply_dirichlet_bc=true);
174 
178  SparseMatrix<Number>* get_M_q(unsigned int q);
179 
184 
188  virtual void truth_assembly();
189 
196  int get_max_truth_solves() const { return max_truth_solves; }
197  void set_max_truth_solves(int max_truth_solves_in) { this->max_truth_solves = max_truth_solves_in; }
198 
202  Real get_POD_tol() const { return POD_tol; }
203  void set_POD_tol(const Real POD_tol_in) { this->POD_tol = POD_tol_in; }
204 
209  void set_delta_N(const unsigned int new_delta_N) { this->delta_N = new_delta_N; }
210 
215  virtual void load_rb_solution();
216 
224 
231 
236  virtual void write_riesz_representors_to_files(const std::string& riesz_representors_dir,
237  const bool write_binary_residual_representors);
238 
243  virtual void read_riesz_representors_from_files(const std::string& riesz_representors_dir,
244  const bool write_binary_residual_representors);
245 
246 
247  //----------- PUBLIC DATA MEMBERS -----------//
248 
253 
259 
263  std::vector< SparseMatrix<Number>* > M_q_vector;
264 
270  std::vector< SparseMatrix<Number>* > non_dirichlet_M_q_vector;
271 
276  std::vector< std::vector<Number> > truth_outputs_all_k;
277 
283 
290 
295  std::string init_filename;
296 
297 protected:
298 
303  virtual void allocate_data_structures();
304 
309  virtual void assemble_affine_expansion();
310 
316  virtual void initialize_truth();
317 
323 
328  void add_IC_to_RB_space();
329 
335  virtual void enrich_RB_space();
336 
340  virtual void update_system();
341 
345  virtual void update_RB_system_matrices();
346 
351  virtual void update_residual_terms(bool compute_inner_products);
352 
359 
360  //----------- PROTECTED DATA MEMBERS -----------//
361 
368 
376 
381 
387 
388 private:
389 
390  //----------- PRIVATE DATA MEMBERS -----------//
391 
395  std::vector< NumericVector<Number>* > temporal_data;
396 
397 };
398 
399 } // namespace libMesh
400 
401 #endif // LIBMESH_TRANSIENT_RB_CONSTRUCTION_H

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

Hosted By:
SourceForge.net Logo