HermesCommon  3.0
amesos_solver.h
Go to the documentation of this file.
1 // This file is part of HermesCommon
2 //
3 // Copyright (c) 2009 hp-FEM group at the University of Nevada, Reno (UNR).
4 // Email: hpfem-group@unr.edu, home page: http://www.hpfem.org/.
5 //
6 // Hermes2D is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published
8 // by the Free Software Foundation; either version 2 of the License,
9 // or (at your option) any later version.
10 //
11 // Hermes2D is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with Hermes2D; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #ifndef __HERMES_COMMON_AMESOS_SOLVER_H_
23 #define __HERMES_COMMON_AMESOS_SOLVER_H_
24 #include "../../config.h"
25 #ifdef HAVE_AMESOS
27 #include "epetra.h"
28 #include "util/compat.h"
29 #include <Amesos.h>
30 #include <Amesos_BaseSolver.h>
31 
32 namespace Hermes
33 {
34  namespace Solvers
35  {
38  template<typename Scalar>
39  class HERMES_API AmesosSolver : public DirectSolver < Scalar >
40  {
41  public:
42  static bool is_available(const char *name);
43 
45  bool use_transpose();
47  void set_use_transpose(bool use_transpose);
48 
49  AmesosSolver(const char *solver_type, EpetraMatrix<Scalar> *m, EpetraVector<Scalar> *rhs);
50 
51  void free();
52  virtual ~AmesosSolver();
53  virtual void solve();
54  virtual int get_matrix_size();
55  protected:
56  static Amesos factory;
57  Amesos_BaseSolver *solver;
58  Epetra_LinearProblem problem;
61 
62  bool setup_factorization();
63  template<typename T> friend LinearMatrixSolver<T>* create_linear_solver(Matrix<T>* matrix, Vector<T>* rhs, bool use_direct_solver);
64  };
65  }
66 }
67 #endif
68 #endif
General (abstract) matrix representation in Hermes.
Definition: matrix.h:36
General namespace for the Hermes library.
Linear matrix solver functionality.
General (abstract) vector representation in Hermes.
Encapsulation of Amesos linear solver.
Definition: amesos_solver.h:39
HERMES_API LinearMatrixSolver< Scalar > * create_linear_solver(Matrix< Scalar > *matrix, Vector< Scalar > *rhs, bool use_direct_solver=false)
Function returning a solver according to the users's choice.
Abstract class for defining solver interface.
File containing platform compatibility layer, especially for Win / MSVC.
EpetraMatrix and EpetraVector storage classes for Amesos, AztecOO, ... .