Hex  2.2
Hydrogen-electron collision solver
lu-superlu-dist.h
Go to the documentation of this file.
1 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
2 // //
3 // / / / / __ \ \ / / //
4 // / /__ / / / _ \ \ \/ / //
5 // / ___ / | |/_/ / /\ \ //
6 // / / / / \_\ / / \ \ //
7 // //
8 // //
9 // Copyright (c) 2016, Jakub Benda, Charles University in Prague //
10 // //
11 // MIT License: //
12 // //
13 // Permission is hereby granted, free of charge, to any person obtaining a //
14 // copy of this software and associated documentation files (the "Software"), //
15 // to deal in the Software without restriction, including without limitation //
16 // the rights to use, copy, modify, merge, publish, distribute, sublicense, //
17 // and/or sell copies of the Software, and to permit persons to whom the //
18 // Software is furnished to do so, subject to the following conditions: //
19 // //
20 // The above copyright notice and this permission notice shall be included //
21 // in all copies or substantial portions of the Software. //
22 // //
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS //
24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, //
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE //
26 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, //
27 // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF //
28 // OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. //
29 // //
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31 
32 #if (!defined(HEX_LU_SUPERLU_DIST_H) && defined(WITH_SUPERLU_DIST))
33 #define HEX_LU_SUPERLU_DIST_H
34 
35 // --------------------------------------------------------------------------------- //
36 
37 #include "hex-csrmatrix.h"
38 
39 // --------------------------------------------------------------------------------- //
40 
41 #include "luft.h"
42 
43 // --------------------------------------------------------------------------------- //
44 
45 #include <superlu_zdefs.h>
46 
47 // --------------------------------------------------------------------------------- //
48 
56 class LUft_SUPERLU_DIST : public LUft
57 {
58  public:
59 
60  // run-time selection mechanism
61  factorizerRunTimeSelectionDefinitions(LUft_SUPERLU_DIST, "superlu_dist")
62 
63 
64  LUft_SUPERLU_DIST ();
65 
67  virtual ~LUft_SUPERLU_DIST ();
68 
69  // Disable bitwise copy
70  LUft_SUPERLU_DIST const & operator= (LUft_SUPERLU_DIST const &) = delete;
71 
73  virtual void factorize (CsrMatrix<LU_int_t,Complex> const & matrix, LUftData data);
74 
76  virtual bool valid () const { return size_ != 0; }
77 
79  virtual std::size_t size () const { return size_; }
80 
82  virtual void solve (const cArrayView b, cArrayView x, int eqs) const;
83 
85  virtual void save (std::string name) const;
86 
88  virtual void load (std::string name, bool throw_on_io_failure = true);
89 
91  virtual void drop ();
92 
93  private:
94 
96  NumberArray<int_t> P_;
97  NumberArray<int_t> I_;
98  NumberArray<std::complex<double>> X_;
99 
100  // scaling and permutation data
101  ScalePermstruct_t ScalePermstruct_;
102 
103  // factorization data
104  LUstruct_t LUstruct_;
105 
106  // process grid
107  gridinfo_t * grid_;
108 
110  std::size_t size_;
111 };
112 
113 // --------------------------------------------------------------------------------- //
114 
115 #endif // WITH_SUPERLU_DIST
virtual void solve(const cArrayView b, cArrayView x, int eqs) const =0
Solve equations.
virtual std::size_t size() const
Size of the numerical data.
Definition: luft.h:117
LU factorization object.
Definition: luft.h:74
Definition: luft.h:42
#define factorizerRunTimeSelectionDefinitions(TYPE, NAME)
Definition: luft.h:198
virtual void drop()
Free memory.
Definition: luft.h:109
virtual void save() const
Definition: luft.h:181
virtual void load()
Definition: luft.h:187
Definition: luft.h:46