rb_parameters.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_PARAMETERS_H
21 #define LIBMESH_RB_PARAMETERS_H
22 
23 // libMesh includes
24 #include "libmesh/libmesh_common.h"
25 
26 // C++ includes
27 #include <string>
28 #include <map>
29 #include <set>
30 
31 namespace libMesh
32 {
33 
43 {
44 public:
45 
49  RBParameters();
50 
54  RBParameters(const std::map<std::string, Real> & parameter_map);
55 
56  // Define a constant iterator for this class
57  typedef std::map<std::string, Real>::const_iterator const_iterator;
58 
62  void clear();
63 
67  Real get_value(const std::string & param_name) const;
68 
73  void set_value(const std::string & param_name, Real value);
74 
78  unsigned int n_parameters() const;
79 
83  void get_parameter_names(std::set<std::string> & param_names) const;
84 
88  const_iterator begin() const;
89 
93  const_iterator end() const;
94 
98  bool operator== (const RBParameters & rhs) const;
99 
103  bool operator!= (const RBParameters & node) const;
104 
110  std::string get_string(unsigned int precision=6) const;
111 
115  void print() const;
116 
117 private:
118 
122  std::map<std::string, Real> _parameters;
123 
124 };
125 
126 } // namespace libMesh
127 
128 
129 #endif // LIBMESH_RB_PARAMETERS_H
Real get_value(const std::string &param_name) const
const_iterator end() const
std::string get_string(unsigned int precision=6) const
bool operator==(const RBParameters &rhs) const
bool operator!=(const RBParameters &node) const
unsigned int n_parameters() const
const_iterator begin() const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void set_value(const std::string &param_name, Real value)
static const bool value
Definition: xdr_io.C:109
void get_parameter_names(std::set< std::string > &param_names) const
std::map< std::string, Real >::const_iterator const_iterator
Definition: rb_parameters.h:57
std::map< std::string, Real > _parameters