Logo  0.95.0-final
Finite Element Embedded Library and Language in C++
Feel++ Feel++ on Github Feel++ community
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
solverlinearepetra.hpp
Go to the documentation of this file.
1 /* -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2 
3  This file is part of the Feel library
4 
5  Author(s): Christophe Prud'homme <christophe.prudhomme@feelpp.org>
6  Date: 2006-09-25
7 
8  Copyright (C) 2006 Université Joseph Fourier
9 
10  This library is free software; you can redistribute it and/or
11  modify it under the terms of the GNU Lesser General Public
12  License as published by the Free Software Foundation; either
13  version 3.0 of the License, or (at your option) any later version.
14 
15  This library is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public
21  License along with this library; if not, write to the Free Software
22  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 */
29 #ifndef __epetra_linear_solver_h__
30 #define __epetra_linear_solver_h__
31 
32 
33 #include <feel/feelcore/feel.hpp>
34 
35 
36 #include <feel/feelalg/solverlinear.hpp>
39 
40 // AztexOO
41 #include <AztecOO.h>
42 
43 // Ifpack
44 #include <Ifpack_CrsIct.h>
45 
46 // ml
47 #include <ml_config.h>
48 #include <ml_RowMatrix.h>
49 #include <ml_MultiLevelPreconditioner.h>
50 #include <Teuchos_ParameterList.hpp>
51 
52 
53 namespace Feel
54 {
55 namespace trilinos
56 {
57 boost::shared_ptr<ML_Epetra::MultiLevelPreconditioner>
58 createMLPreconditioner( Epetra_RowMatrix const& mat, po::variables_map const& vm )
59 {
60  // A is an Epetra_RowMatrix derived class object
61  // solver is an AztecOO object
62  Teuchos::ParameterList MList;
63  // default values for smoothed aggregation
64  ML_Epetra::SetDefaults( "SA",MList );
65  MList.set( "max levels", vm["max-levels"].as<int>() );
66  MList.set( "increasing or decreasing",vm["increasing-or-decreasing"].as<std::string>() );
67  MList.set( "aggregation: type", vm["aggregation-type"].as<std::string>() );
68  MList.set( "coarse: type",vm["coarse-type"].as<std::string>() );
69 
70  return boost::shared_ptr<ML_Epetra::MultiLevelPreconditioner>( new ML_Epetra::MultiLevelPreconditioner( mat,
71  MList,
72  true ) );
73 }
74 
75 } // trilinos
76 } // Feel
77 
78 
79 #endif // #ifdef __epetra_linear_solver_h__
80 

Generated on Sun Oct 20 2013 08:25:05 for Feel++ by doxygen 1.8.4