Ifpack2 Templated Preconditioning Package  Version 1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Ifpack2_Parameters.hpp
1 // @HEADER
2 // *****************************************************************************
3 // Ifpack2: Templated Object-Oriented Algebraic Preconditioner Package
4 //
5 // Copyright 2009 NTESS and the Ifpack2 contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef IFPACK2_PARAMETERS_HPP
11 #define IFPACK2_PARAMETERS_HPP
12 
13 #include "Ifpack2_ConfigDefs.hpp"
15 
16 namespace Ifpack2 {
17 
20 
22 
25 template<typename T>
26 void getParameter(const Teuchos::ParameterList& params, const std::string& name, T& value)
27 {
28  if (params.isParameter(name)) {
29  if (params.isType<T>(name)) {
30  value = params.get<T>(name);
31  }
32  }
33 }
34 
35 }//namespace Ifpack2
36 
37 #endif
T & get(const std::string &name, T def_value)
void getParameter(const Teuchos::ParameterList &params, const std::string &name, T &value)
Set a value from a ParameterList if a parameter with the specified name exists.
Definition: Ifpack2_Parameters.hpp:26
bool isParameter(const std::string &name) const
bool isType(const std::string &name) const
void getValidParameters(Teuchos::ParameterList &params)
Fills a list which contains all the parameters possibly used by Ifpack2.
Definition: Ifpack2_Parameters.cpp:18