$extrastylesheet
rb_parameters.h
Go to the documentation of this file.
00001 // rbOOmit: An implementation of the Certified Reduced Basis method.
00002 // Copyright (C) 2009, 2010 David J. Knezevic
00003 
00004 // This file is part of rbOOmit.
00005 
00006 // rbOOmit is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License, or (at your option) any later version.
00010 
00011 // rbOOmit is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 
00020 #ifndef LIBMESH_RB_PARAMETERS_H
00021 #define LIBMESH_RB_PARAMETERS_H
00022 
00023 // libMesh includes
00024 #include "libmesh/libmesh_common.h"
00025 
00026 // C++ includes
00027 #include <string>
00028 #include <map>
00029 #include <set>
00030 
00031 namespace libMesh
00032 {
00033 
00041 // ------------------------------------------------------------
00042 // RBParameters class definition
00043 class RBParameters
00044 {
00045 public:
00046 
00050   RBParameters();
00051 
00055   RBParameters(const std::map<std::string, Real>& parameter_map);
00056 
00057   // Define a constant iterator for this class
00058   typedef std::map<std::string, Real>::const_iterator const_iterator;
00059 
00063   void clear();
00064 
00068   Real get_value(const std::string& param_name) const;
00069 
00074   void set_value(const std::string& param_name, Real value);
00075 
00079   unsigned int n_parameters() const;
00080 
00084   void get_parameter_names(std::set<std::string>& param_names) const;
00085 
00089   const_iterator begin() const;
00090 
00094   const_iterator end() const;
00095 
00099   bool operator== (const RBParameters& rhs) const;
00100 
00104   bool operator!= (const RBParameters& node) const;
00105 
00111   std::string get_string(unsigned int precision=6) const;
00112 
00116   void print() const;
00117 
00118 private:
00119 
00123   std::map<std::string, Real> _parameters;
00124 
00125 };
00126 
00127 } // namespace libMesh
00128 
00129 
00130 #endif // LIBMESH_RB_PARAMETERS_H