libMesh
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
Get the value of the specific parameter.
Definition: rb_parameters.C:45
std::string get_string(unsigned int precision=6) const
Get a string that specifies the contents of this RBParameters object.
unsigned int n_parameters() const
Get the number of parameters that have been added.
Definition: rb_parameters.C:62
void get_parameter_names(std::set< std::string > &param_names) const
Fill param_names with the names of the parameters.
Definition: rb_parameters.C:68
The libMesh namespace provides an interface to certain functionality in the library.
RBParameters()
Constructor.
Definition: rb_parameters.C:31
const_iterator end() const
Get a constant iterator to the end of this RBParameters object.
Definition: rb_parameters.C:85
This class is part of the rbOOmit framework.
Definition: rb_parameters.h:42
void print() const
Print the parameters.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void set_value(const std::string &param_name, Real value)
Set the value of the specified parameter.
Definition: rb_parameters.C:57
void clear()
Clear this object.
Definition: rb_parameters.C:40
static const bool value
Definition: xdr_io.C:108
bool operator!=(const RBParameters &node) const
Definition: rb_parameters.C:95
bool operator==(const RBParameters &rhs) const
Two RBParameters are equal if they have the same _parameters map.
Definition: rb_parameters.C:90
const_iterator begin() const
Get a constant iterator to beginning of this RBParameters object.
Definition: rb_parameters.C:80
std::map< std::string, Real >::const_iterator const_iterator
Definition: rb_parameters.h:57
std::map< std::string, Real > _parameters
The map that stores the actual parameters, indexed by names.