FEI Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fei_Solver_Amesos.hpp
Go to the documentation of this file.
1 /*
2 // @HEADER
3 // ************************************************************************
4 // FEI: Finite Element Interface to Linear Solvers
5 // Copyright (2005) Sandia Corporation.
6 //
7 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the
8 // U.S. Government retains certain rights in this software.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Alan Williams (william@sandia.gov)
38 //
39 // ************************************************************************
40 // @HEADER
41 */
42 
43 #ifndef _fei_Solver_Amesos_h_
44 #define _fei_Solver_Amesos_h_
45 
46 
47 #include <fei_trilinos_macros.hpp>
48 
49 #ifdef HAVE_FEI_AMESOS
50 
51 #include <fei_Solver.hpp>
52 
53 namespace Teuchos {
54  class ParameterList;
55 }
56 class Amesos;
57 class Amesos_BaseSolver;
59 class Epetra_CrsMatrix;
60 class Epetra_MultiVector;
61 class Epetra_VbrMatrix;
62 
63 class Solver_Amesos : public fei::Solver {
64  public:
65  Solver_Amesos();
66  virtual ~Solver_Amesos();
67 
68  int solve(fei::LinearSystem* linearSystem,
69  fei::Matrix* preconditioningMatrix,
70  const fei::ParameterSet& parameterSet,
71  int& iterationsTaken,
72  int& status);
73 
74  Teuchos::ParameterList& get_ParameterList();
75 
76  private:
77  int solve(fei::LinearSystem* linearSystem,
78  fei::Matrix* preconditioningMatrix,
79  int numParams,
80  const char* const* solverParams,
81  int& iterationsTaken,
82  int& status);
83 
84  int parseParameters(int numParams,
85  const char*const* params);
86 
87  int solve_private(Epetra_CrsMatrix* A,
90  fei::Matrix* preconditioningMatrix,
91  int numParams,
92  const char* const* solverParams,
93  int& iterationsTaken,
94  int& status);
95 
96  int solve_private(Epetra_VbrMatrix* A,
99  fei::Matrix* preconditioningMatrix,
100  int numParams,
101  const char* const* solverParams,
102  int& iterationsTaken,
103  int& status);
104 
105  private:
106  double tolerance_;
107  int maxIters_;
108  Amesos* amesos_factory_;
109  Amesos_BaseSolver* amesos_solver_;
110  Epetra_LinearProblem* epetra_linearproblem_;
111  Teuchos::ParameterList* paramlist_;
112 }; //class Solver_Amesos
113 
114 #endif
115 
116 #endif
virtual int solve(fei::LinearSystem *linearSystem, fei::Matrix *preconditioningMatrix, const fei::ParameterSet &parameterSet, int &iterationsTaken, int &status)
Definition: fei_Solver.cpp:65