src/clp_utils.h

Go to the documentation of this file.
00001 //
00002 // C++ Interface: clp_utils
00003 //
00004 // Description: 
00005 //
00006 //
00007 // Author: Roman Geus <geus@maxwell>, (C) 2004
00008 //
00009 // Copyright: See COPYING file that comes with this distribution
00010 //
00011 //
00012 
00013 #ifndef CLP_UTILS_H
00014 #define CLP_UTILS_H
00015 
00016 #include <string>
00017 
00018 using std::string;
00019 
00020 template <typename T>
00021 static void set_from_clp(Teuchos::ParameterList& params, string param_name,
00022                 Trilinos_Util_Map& parser, string parser_name);
00023 
00024 template <>
00025 void set_from_clp<string>(Teuchos::ParameterList& params, string param_name,
00026                         Trilinos_Util_Map& parser, string parser_name) {
00027     string option = "-" + parser_name;
00028     if (parser.Has(option))
00029         params.set(param_name, parser.Get(option, ""));
00030 }
00031 
00032 template <>
00033 void set_from_clp<int>(Teuchos::ParameterList& params, string param_name,
00034                      Trilinos_Util_Map& parser, string parser_name) {
00035     string option = "-" + parser_name;
00036     if (parser.Has(option))
00037         params.set(param_name, parser.Get(option, 0));
00038 }
00039 
00040 template <>
00041 void set_from_clp<double>(Teuchos::ParameterList& params, string param_name,
00042                         Trilinos_Util_Map& parser, string parser_name) {
00043     string option = "-" + parser_name;
00044     if (parser.Has(option))
00045         params.set(param_name, parser.Get(option, 0.0));
00046 }
00047 
00048 template <>
00049 void set_from_clp<bool>(Teuchos::ParameterList& params, string param_name,
00050                       Trilinos_Util_Map& parser, string parser_name) {
00051     string option = "-" + parser_name;
00052     if (parser.Has(option))
00053         params.set(param_name, true);
00054 }
00055 
00056 #endif

Generated on Fri Oct 26 13:35:11 2007 for FEMAXX (Finite Element Maxwell Eigensolver) by  doxygen 1.4.7