HermesCommon  3.0
superlu_solver_real.cpp
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 #include "config.h"
23 #ifdef WITH_SUPERLU
24 #include "superlu_solver.h"
25 #include "callstack.h"
26 #include <slu_ddefs.h>
27 
28 namespace Hermes
29 {
30  namespace Solvers
31  {
32  template <>
33  void SuperLUSolver<double>::solver_driver(superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, int *etree, char *equed, double *R,
34  double *C, SuperMatrix *L, SuperMatrix *U, void *work, int lwork, SuperMatrix *B, SuperMatrix *X,
35  double *recip_pivot_growth, double *rcond, double *ferr, double *berr, slu_memusage_t *mem_usage, SuperLUStat_t *stat,
36  int *info)
37  {
38  dgssvx(options, A, perm_c, perm_r, etree, equed, R, C, L, U, work, lwork, B, X, recip_pivot_growth, rcond, ferr, berr, (mem_usage_t*)mem_usage, stat, info);
39  }
40 
41  template <>
42  void SuperLUSolver<double>::create_csc_matrix(SuperMatrix *A, int m, int n, int nnz, SuperLuType<double>::Scalar *nzval,
43  int *rowind, int *colptr, Stype_t stype, Dtype_t dtype, Mtype_t mtype)
44  {
45  dCreate_CompCol_Matrix(A, m, n, nnz, nzval, rowind, colptr, stype, dtype, mtype);
46  }
47 
48  template<>
49  void SuperLUSolver<double>::create_dense_matrix(SuperMatrix *X, int m, int n, SuperLuType<double>::Scalar *x,
50  int ldx, Stype_t stype, Dtype_t dtype, Mtype_t mtype)
51  {
52  dCreate_Dense_Matrix(X, m, n, (double*)x, ldx, stype, dtype, mtype);
53  }
54  }
55 }
56 #endif
General namespace for the Hermes library.
File containing functionality for investigating call stack.
SuperLU solver interface.