IFPACK Development
ifp_parameters.h
00001 /*@HEADER
00002 // ***********************************************************************
00003 //
00004 //       Ifpack: Object-Oriented Algebraic Preconditioner Package
00005 //                 Copyright (2002) Sandia Corporation
00006 //
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 //
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
00025 //
00026 // ***********************************************************************
00027 //@HEADER
00028 */
00029 
00030 #ifndef _ifp_parameters_h_
00031 #define _ifp_parameters_h_
00032 
00033 #include <Ifpack_ConfigDefs.h>
00034 
00035 #include <Teuchos_map.hpp>
00036 #include <Teuchos_ParameterList.hpp>
00037 #include <Epetra_CombineMode.h>
00038 
00039 namespace Ifpack {
00040 
00041 //define enum values to which parameter names will be mapped.
00042 enum parameter {
00043   //parameters of type double
00044   absolute_threshold,
00045   relative_threshold,
00046   drop_tolerance,
00047   fill_tolerance,
00048   relax_value,
00049 
00050   //parameters of type int
00051   //(if you add or remove int parameters, be sure to
00052   //update FIRST_INT_PARAM and LAST_INT_PARAM macros below, as
00053   //they are used below and in ifp_parameters.cpp)
00054   level_fill,
00055   level_overlap,
00056   num_steps,
00057 
00058   //mixed type parameters
00059   use_reciprocal,
00060   overlap_mode
00061 };
00062 
00063 #define FIRST_INT_PARAM Ifpack::level_fill
00064 #define LAST_INT_PARAM Ifpack::num_steps
00065 
00066 //define struct with union of all Ifpack parameters
00067 struct param_struct {
00068   int int_params[LAST_INT_PARAM-FIRST_INT_PARAM+1];
00069   double double_params[FIRST_INT_PARAM];
00070   bool use_reciprocal;
00071   Epetra_CombineMode overlap_mode;
00072 };
00073 
00074 Teuchos::map<string,parameter>& key_map();
00075 
00076 void initialize_string_map();
00077 
00078 string upper_case(const string& s);
00079 
00080 void set_parameters(const Teuchos::ParameterList& parameterlist,
00081                     param_struct& params,
00082                     bool cerr_warning_if_unused=false);
00083 
00084 }//namespace Ifpack
00085 
00086 #endif //_ifp_parameters_h_
00087 
 All Classes Files Functions Variables Enumerations Friends