rb_construction_base.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_CONSTRUCTION_BASE_H
21 #define LIBMESH_RB_CONSTRUCTION_BASE_H
22 
23 // rbOOmit includes
26 #include "libmesh/rb_theta.h"
27 
28 // libMesh includes
29 #include "libmesh/system.h"
30 #include "libmesh/numeric_vector.h"
31 #include "libmesh/linear_solver.h"
32 #include "libmesh/perf_log.h"
33 
34 // C++ includes
35 #include <set>
36 
37 namespace libMesh
38 {
39 
54 // ------------------------------------------------------------
55 // RBConstructionBase class definition
56 template<class Base>
57 class RBConstructionBase : public Base, public RBParametrized
58 {
59 public:
60 
66  const std::string& name,
67  const unsigned int number);
68 
72  virtual ~RBConstructionBase ();
73 
78 
82  sys_type & system () { return *this; }
83 
88  virtual void clear ();
89 
94 
99 
104 
109 
115  virtual void initialize_training_parameters(const RBParameters& mu_min,
116  const RBParameters& mu_max,
117  unsigned int n_training_parameters,
118  std::map<std::string, bool> log_param_scale,
119  bool deterministic=true);
120 
124  virtual void load_training_set(std::map< std::string, std::vector<Number> >& new_training_set);
125 
135  std::pair<std::string,std::string> set_alternative_solver(AutoPtr<LinearSolver<Number> >& ls);
136 
144  const std::pair<std::string,std::string>& orig);
145 
150  void broadcast_parameters(unsigned int proc_id);
151 
155  void set_training_random_seed(unsigned int seed);
156 
161  void set_deterministic_training_parameter_name(const std::string name);
162 
166  const std::string& get_deterministic_training_parameter_name() const;
167 
171  void set_deterministic_training_parameter_repeats(unsigned int repeats);
172 
177 
178 protected:
179 
184  virtual void init_data ();
185 
189  RBParameters get_params_from_training_set(unsigned int index);
190 
194  void set_params_from_training_set(unsigned int index);
195 
199  virtual void set_params_from_training_set_and_broadcast(unsigned int index);
200 
207  std::pair<unsigned int, Real>& error_pair);
208 
213  std::map<std::string, bool> log_param_scale,
214  std::map< std::string, NumericVector<Number>* >& training_parameters_in,
215  unsigned int n_training_samples_in,
216  const RBParameters& min_parameters,
217  const RBParameters& max_parameters,
219  bool serial_training_set=false);
220 
227  const std::string& deterministic_parameter_name,
228  const unsigned int deterministic_parameter_repeats,
229  std::map<std::string, bool> log_param_scale,
230  std::map< std::string, NumericVector<Number>* >& training_parameters_in,
231  unsigned int n_deterministic_training_samples_in,
232  const RBParameters& min_parameters,
233  const RBParameters& max_parameters,
235  bool serial_training_set=false);
236 
242  std::map<std::string, bool> log_param_scale,
243  std::map< std::string, NumericVector<Number>* >& training_parameters_in,
244  unsigned int n_training_samples_in,
245  const RBParameters& min_parameters,
246  const RBParameters& max_parameters,
247  bool serial_training_set=false);
248 
249 
250  //----------- PROTECTED DATA MEMBERS -----------//
251 
259 
266 
279  std::string alternative_solver;
280 
281 
282 private:
283 
289 
293  std::map< std::string, NumericVector<Number>* > training_parameters;
294 
302 
309 
315 
316 };
317 
318 } // namespace libMesh
319 
320 
321 #endif // LIBMESH_RB_CONSTRUCTION_BASE_H

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

Hosted By:
SourceForge.net Logo