dune-istl 2.9.0
Loading...
Searching...
No Matches
umfpack.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
4// vi: set et ts=4 sw=2 sts=2:
5#ifndef DUNE_ISTL_UMFPACK_HH
6#define DUNE_ISTL_UMFPACK_HH
7
8#if HAVE_SUITESPARSE_UMFPACK || defined DOXYGEN
9
10#include<complex>
11#include<type_traits>
12
13#include<umfpack.h>
14
15#include<dune/common/exceptions.hh>
16#include<dune/common/fmatrix.hh>
17#include<dune/common/fvector.hh>
23
24
25
26namespace Dune {
38 // FORWARD DECLARATIONS
39 template<class M, class T, class TM, class TD, class TA>
40 class SeqOverlappingSchwarz;
41
42 template<class T, bool tag>
43 struct SeqOverlappingSchwarzAssemblerHelper;
44
45 // wrapper class for C-Function Calls in the backend. Choose the right function namespace
46 // depending on the template parameter used.
47template<typename SCalar, typename Integer>
49 {
50 static constexpr bool valid = false ;
51 };
52
53 template<>
54 struct UMFPackMethodChooser<double, std::true_type>
55 {
56 static constexpr bool valid = true ;
57
58 template<typename... A>
59 static void defaults(A... args)
60 {
61 umfpack_dl_defaults(args...);
62 }
63 template<typename... A>
64 static void free_numeric(A... args)
65 {
66 umfpack_dl_free_numeric(args...);
67 }
68 template<typename... A>
69 static void free_symbolic(A... args)
70 {
71 umfpack_dl_free_symbolic(args...);
72 }
73 template<typename... A>
74 static int load_numeric(A... args)
75 {
76 return umfpack_dl_load_numeric(args...);
77 }
78 template<typename... A>
79 static void numeric(A... args)
80 {
81 umfpack_dl_numeric(args...);
82 }
83 template<typename... A>
84 static void report_info(A... args)
85 {
86 umfpack_dl_report_info(args...);
87 }
88 template<typename... A>
89 static void report_status(A... args)
90 {
91 umfpack_dl_report_status(args...);
92 }
93 template<typename... A>
94 static int save_numeric(A... args)
95 {
96 return umfpack_dl_save_numeric(args...);
97 }
98 template<typename... A>
99 static void solve(A... args)
100 {
101 umfpack_dl_solve(args...);
102 }
103 template<typename... A>
104 static void symbolic(A... args)
105 {
106 umfpack_dl_symbolic(args...);
107 }
108 };
109
110 template<>
111 struct UMFPackMethodChooser<double, std::false_type>
112 {
113 static constexpr bool valid = true ;
114
115 template<typename... A>
116 static void defaults(A... args)
117 {
118 umfpack_di_defaults(args...);
119 }
120 template<typename... A>
121 static void free_numeric(A... args)
122 {
123 umfpack_di_free_numeric(args...);
124 }
125 template<typename... A>
126 static void free_symbolic(A... args)
127 {
128 umfpack_di_free_symbolic(args...);
129 }
130 template<typename... A>
131 static int load_numeric(A... args)
132 {
133 return umfpack_di_load_numeric(args...);
134 }
135 template<typename... A>
136 static void numeric(A... args)
137 {
138 umfpack_di_numeric(args...);
139 }
140 template<typename... A>
141 static void report_info(A... args)
142 {
143 umfpack_di_report_info(args...);
144 }
145 template<typename... A>
146 static void report_status(A... args)
147 {
148 umfpack_di_report_status(args...);
149 }
150 template<typename... A>
151 static int save_numeric(A... args)
152 {
153 return umfpack_di_save_numeric(args...);
154 }
155 template<typename... A>
156 static void solve(A... args)
157 {
158 umfpack_di_solve(args...);
159 }
160 template<typename... A>
161 static void symbolic(A... args)
162 {
163 umfpack_di_symbolic(args...);
164 }
165 };
166
167 template<>
168 struct UMFPackMethodChooser<std::complex<double>, std::true_type>
169 {
170 static constexpr bool valid = true ;
171
172 template<typename... A>
173 static void defaults(A... args)
174 {
175 umfpack_zl_defaults(args...);
176 }
177 template<typename... A>
178 static void free_numeric(A... args)
179 {
180 umfpack_zl_free_numeric(args...);
181 }
182 template<typename... A>
183 static void free_symbolic(A... args)
184 {
185 umfpack_zl_free_symbolic(args...);
186 }
187 template<typename... A>
188 static int load_numeric(A... args)
189 {
190 return umfpack_zl_load_numeric(args...);
191 }
192 template<typename... A>
193 static void numeric(const long int* cs, const long int* ri, const double* val, A... args)
194 {
195 umfpack_zl_numeric(cs,ri,val,NULL,args...);
196 }
197 template<typename... A>
198 static void report_info(A... args)
199 {
200 umfpack_zl_report_info(args...);
201 }
202 template<typename... A>
203 static void report_status(A... args)
204 {
205 umfpack_zl_report_status(args...);
206 }
207 template<typename... A>
208 static int save_numeric(A... args)
209 {
210 return umfpack_zl_save_numeric(args...);
211 }
212 template<typename... A>
213 static void solve(long int m, const long int* cs, const long int* ri, std::complex<double>* val, double* x, const double* b,A... args)
214 {
215 const double* cval = reinterpret_cast<const double*>(val);
216 umfpack_zl_solve(m,cs,ri,cval,NULL,x,NULL,b,NULL,args...);
217 }
218 template<typename... A>
219 static void symbolic(long int m, long int n, const long int* cs, const long int* ri, const double* val, A... args)
220 {
221 umfpack_zl_symbolic(m,n,cs,ri,val,NULL,args...);
222 }
223 };
224
225
226 template<>
227 struct UMFPackMethodChooser<std::complex<double>, std::false_type>
228 {
229 static constexpr bool valid = true ;
230
231 template<typename... A>
232 static void defaults(A... args)
233 {
234 umfpack_zi_defaults(args...);
235 }
236 template<typename... A>
237 static void free_numeric(A... args)
238 {
239 umfpack_zi_free_numeric(args...);
240 }
241 template<typename... A>
242 static void free_symbolic(A... args)
243 {
244 umfpack_zi_free_symbolic(args...);
245 }
246 template<typename... A>
247 static int load_numeric(A... args)
248 {
249 return umfpack_zi_load_numeric(args...);
250 }
251 template<typename... A>
252 static void numeric(const long int* cs, const long int* ri, const double* val, A... args)
253 {
254 umfpack_zi_numeric(cs,ri,val,NULL,args...);
255 }
256 template<typename... A>
257 static void report_info(A... args)
258 {
259 umfpack_zi_report_info(args...);
260 }
261 template<typename... A>
262 static void report_status(A... args)
263 {
264 umfpack_zi_report_status(args...);
265 }
266 template<typename... A>
267 static int save_numeric(A... args)
268 {
269 return umfpack_zi_save_numeric(args...);
270 }
271 template<typename... A>
272 static void solve(long int m, const long int* cs, const long int* ri, std::complex<double>* val, double* x, const double* b,A... args)
273 {
274 const double* cval = reinterpret_cast<const double*>(val);
275 umfpack_zi_solve(m,cs,ri,cval,NULL,x,NULL,b,NULL,args...);
276 }
277 template<typename... A>
278 static void symbolic(long int m, long int n, const long int* cs, const long int* ri, const double* val, A... args)
279 {
280 umfpack_zi_symbolic(m,n,cs,ri,val,NULL,args...);
281 }
282 };
283
284 namespace Impl
285 {
286 template<class M>
287 struct UMFPackVectorChooser
288 {};
289
290 template<typename T, typename A, int n, int m>
291 struct UMFPackVectorChooser<BCRSMatrix<FieldMatrix<T,n,m>,A > >
292 {
294 using domain_type = BlockVector<
295 FieldVector<T,m>,
296 typename std::allocator_traits<A>::template rebind_alloc<FieldVector<T,m> > >;
298 using range_type = BlockVector<
299 FieldVector<T,n>,
300 typename std::allocator_traits<A>::template rebind_alloc<FieldVector<T,n> > >;
301 };
302
303 template<typename T, typename A>
304 struct UMFPackVectorChooser<BCRSMatrix<T,A> >
305 {
307 using domain_type = BlockVector<T, A>;
309 using range_type = BlockVector<T, A>;
310 };
311 }
312
326 template<typename M>
328 : public InverseOperator<
329 typename Impl::UMFPackVectorChooser<M>::domain_type,
330 typename Impl::UMFPackVectorChooser<M>::range_type >
331 {
332 using T = typename M::field_type;
333
334 public:
336 using Matrix = M;
337 using matrix_type = M;
339 typedef ISTL::Impl::BCCSMatrix<typename Matrix::field_type, long int> UMFPackMatrix;
341 typedef ISTL::Impl::BCCSMatrixInitializer<M, long int> MatrixInitializer;
343 using domain_type = typename Impl::UMFPackVectorChooser<M>::domain_type;
345 using range_type = typename Impl::UMFPackVectorChooser<M>::range_type;
346
352
361 UMFPack(const Matrix& matrix, int verbose=0) : matrixIsLoaded_(false)
362 {
363 //check whether T is a supported type
364 static_assert((std::is_same<T,double>::value) || (std::is_same<T,std::complex<double> >::value),
365 "Unsupported Type in UMFPack (only double and std::complex<double> supported)");
366 Caller::defaults(UMF_Control);
367 setVerbosity(verbose);
368 setMatrix(matrix);
369 }
370
379 UMFPack(const Matrix& matrix, int verbose, bool) : matrixIsLoaded_(false)
380 {
381 //check whether T is a supported type
382 static_assert((std::is_same<T,double>::value) || (std::is_same<T,std::complex<double> >::value),
383 "Unsupported Type in UMFPack (only double and std::complex<double> supported)");
384 Caller::defaults(UMF_Control);
385 setVerbosity(verbose);
386 setMatrix(matrix);
387 }
388
398 UMFPack(const Matrix& mat_, const ParameterTree& config)
399 : UMFPack(mat_, config.get<int>("verbose", 0))
400 {}
401
404 UMFPack() : matrixIsLoaded_(false), verbosity_(0)
405 {
406 //check whether T is a supported type
407 static_assert((std::is_same<T,double>::value) || (std::is_same<T,std::complex<double> >::value),
408 "Unsupported Type in UMFPack (only double and std::complex<double> supported)");
409 Caller::defaults(UMF_Control);
410 }
411
422 UMFPack(const Matrix& mat_, const char* file, int verbose=0)
423 {
424 //check whether T is a supported type
425 static_assert((std::is_same<T,double>::value) || (std::is_same<T,std::complex<double> >::value),
426 "Unsupported Type in UMFPack (only double and std::complex<double> supported)");
427 Caller::defaults(UMF_Control);
428 setVerbosity(verbose);
429 int errcode = Caller::load_numeric(&UMF_Numeric, const_cast<char*>(file));
430 if ((errcode == UMFPACK_ERROR_out_of_memory) || (errcode == UMFPACK_ERROR_file_IO))
431 {
432 matrixIsLoaded_ = false;
433 setMatrix(mat_);
434 saveDecomposition(file);
435 }
436 else
437 {
438 matrixIsLoaded_ = true;
439 std::cout << "UMFPack decomposition successfully loaded from " << file << std::endl;
440 }
441 }
442
449 UMFPack(const char* file, int verbose=0)
450 {
451 //check whether T is a supported type
452 static_assert((std::is_same<T,double>::value) || (std::is_same<T,std::complex<double> >::value),
453 "Unsupported Type in UMFPack (only double and std::complex<double> supported)");
454 Caller::defaults(UMF_Control);
455 int errcode = Caller::load_numeric(&UMF_Numeric, const_cast<char*>(file));
456 if (errcode == UMFPACK_ERROR_out_of_memory)
457 DUNE_THROW(Dune::Exception, "ran out of memory while loading UMFPack decomposition");
458 if (errcode == UMFPACK_ERROR_file_IO)
459 DUNE_THROW(Dune::Exception, "IO error while loading UMFPack decomposition");
460 matrixIsLoaded_ = true;
461 std::cout << "UMFPack decomposition successfully loaded from " << file << std::endl;
462 setVerbosity(verbose);
463 }
464
465 virtual ~UMFPack()
466 {
467 if ((umfpackMatrix_.N() + umfpackMatrix_.M() > 0) || matrixIsLoaded_)
468 free();
469 }
470
475 {
476 if (umfpackMatrix_.N() != b.dim())
477 DUNE_THROW(Dune::ISTLError, "Size of right-hand-side vector b does not match the number of matrix rows!");
478 if (umfpackMatrix_.M() != x.dim())
479 DUNE_THROW(Dune::ISTLError, "Size of solution vector x does not match the number of matrix columns!");
480 if (b.size() == 0)
481 return;
482
483 double UMF_Apply_Info[UMFPACK_INFO];
484 Caller::solve(UMFPACK_A,
485 umfpackMatrix_.getColStart(),
486 umfpackMatrix_.getRowIndex(),
487 umfpackMatrix_.getValues(),
488 reinterpret_cast<double*>(&x[0]),
489 reinterpret_cast<double*>(&b[0]),
490 UMF_Numeric,
491 UMF_Control,
492 UMF_Apply_Info);
493
494 //this is a direct solver
495 res.iterations = 1;
496 res.converged = true;
497 res.elapsed = UMF_Apply_Info[UMFPACK_SOLVE_WALLTIME];
498
499 printOnApply(UMF_Apply_Info);
500 }
501
505 virtual void apply (domain_type& x, range_type& b, [[maybe_unused]] double reduction, InverseOperatorResult& res)
506 {
507 apply(x,b,res);
508 }
509
515 void apply(T* x, T* b)
516 {
517 double UMF_Apply_Info[UMFPACK_INFO];
518 Caller::solve(UMFPACK_A,
519 umfpackMatrix_.getColStart(),
520 umfpackMatrix_.getRowIndex(),
521 umfpackMatrix_.getValues(),
522 x,
523 b,
524 UMF_Numeric,
525 UMF_Control,
526 UMF_Apply_Info);
527 printOnApply(UMF_Apply_Info);
528 }
529
541 void setOption(unsigned int option, double value)
542 {
543 if (option >= UMFPACK_CONTROL)
544 DUNE_THROW(RangeError, "Requested non-existing UMFPack option");
545
546 UMF_Control[option] = value;
547 }
548
552 void saveDecomposition(const char* file)
553 {
554 int errcode = Caller::save_numeric(UMF_Numeric, const_cast<char*>(file));
555 if (errcode != UMFPACK_OK)
556 DUNE_THROW(Dune::Exception,"IO ERROR while trying to save UMFPack decomposition");
557 }
558
560 void setMatrix(const Matrix& matrix)
561 {
562 if ((umfpackMatrix_.N() + umfpackMatrix_.M() > 0) || matrixIsLoaded_)
563 free();
564 if (matrix.N() == 0 or matrix.M() == 0)
565 return;
566
567 if (umfpackMatrix_.N() + umfpackMatrix_.M() + umfpackMatrix_.nonzeroes() != 0)
568 umfpackMatrix_.free();
569 umfpackMatrix_.setSize(MatrixDimension<Matrix>::rowdim(matrix),
571 ISTL::Impl::BCCSMatrixInitializer<Matrix, long int> initializer(umfpackMatrix_);
572
573 copyToBCCSMatrix(initializer, matrix);
574
575 decompose();
576 }
577
578 template<class S>
579 void setSubMatrix(const Matrix& _mat, const S& rowIndexSet)
580 {
581 if ((umfpackMatrix_.N() + umfpackMatrix_.M() > 0) || matrixIsLoaded_)
582 free();
583
584 if (umfpackMatrix_.N() + umfpackMatrix_.M() + umfpackMatrix_.nonzeroes() != 0)
585 umfpackMatrix_.free();
586
587 umfpackMatrix_.setSize(rowIndexSet.size()*MatrixDimension<Matrix>::rowdim(_mat) / _mat.N(),
588 rowIndexSet.size()*MatrixDimension<Matrix>::coldim(_mat) / _mat.M());
589 ISTL::Impl::BCCSMatrixInitializer<Matrix, long int> initializer(umfpackMatrix_);
590
591 copyToBCCSMatrix(initializer, ISTL::Impl::MatrixRowSubset<Matrix,std::set<std::size_t> >(_mat,rowIndexSet));
592
593 decompose();
594 }
595
603 void setVerbosity(int v)
604 {
605 verbosity_ = v;
606 // set the verbosity level in UMFPack
607 if (verbosity_ == 0)
608 UMF_Control[UMFPACK_PRL] = 1;
609 if (verbosity_ == 1)
610 UMF_Control[UMFPACK_PRL] = 2;
611 if (verbosity_ == 2)
612 UMF_Control[UMFPACK_PRL] = 4;
613 }
614
620 {
621 return UMF_Numeric;
622 }
623
629 {
630 return umfpackMatrix_;
631 }
632
637 void free()
638 {
639 if (!matrixIsLoaded_)
640 {
641 Caller::free_symbolic(&UMF_Symbolic);
642 umfpackMatrix_.free();
643 }
644 Caller::free_numeric(&UMF_Numeric);
645 matrixIsLoaded_ = false;
646 }
647
648 const char* name() { return "UMFPACK"; }
649
650 private:
651 typedef typename Dune::UMFPackMethodChooser<T,std::integral_constant<bool, (sizeof(typename UMFPackMatrix::size_type) == 8)>> Caller;
652
653 template<class Mat,class X, class TM, class TD, class T1>
656
658 void decompose()
659 {
660 double UMF_Decomposition_Info[UMFPACK_INFO];
661 Caller::symbolic(static_cast<int>(umfpackMatrix_.N()),
662 static_cast<int>(umfpackMatrix_.N()),
663 umfpackMatrix_.getColStart(),
664 umfpackMatrix_.getRowIndex(),
665 reinterpret_cast<double*>(umfpackMatrix_.getValues()),
666 &UMF_Symbolic,
667 UMF_Control,
668 UMF_Decomposition_Info);
669 Caller::numeric(umfpackMatrix_.getColStart(),
670 umfpackMatrix_.getRowIndex(),
671 reinterpret_cast<double*>(umfpackMatrix_.getValues()),
672 UMF_Symbolic,
673 &UMF_Numeric,
674 UMF_Control,
675 UMF_Decomposition_Info);
676 Caller::report_status(UMF_Control,UMF_Decomposition_Info[UMFPACK_STATUS]);
677 if (verbosity_ == 1)
678 {
679 std::cout << "[UMFPack Decomposition]" << std::endl;
680 std::cout << "Wallclock Time taken: " << UMF_Decomposition_Info[UMFPACK_NUMERIC_WALLTIME] << " (CPU Time: " << UMF_Decomposition_Info[UMFPACK_NUMERIC_TIME] << ")" << std::endl;
681 std::cout << "Flops taken: " << UMF_Decomposition_Info[UMFPACK_FLOPS] << std::endl;
682 std::cout << "Peak Memory Usage: " << UMF_Decomposition_Info[UMFPACK_PEAK_MEMORY]*UMF_Decomposition_Info[UMFPACK_SIZE_OF_UNIT] << " bytes" << std::endl;
683 std::cout << "Condition number estimate: " << 1./UMF_Decomposition_Info[UMFPACK_RCOND] << std::endl;
684 std::cout << "Numbers of non-zeroes in decomposition: L: " << UMF_Decomposition_Info[UMFPACK_LNZ] << " U: " << UMF_Decomposition_Info[UMFPACK_UNZ] << std::endl;
685 }
686 if (verbosity_ == 2)
687 {
688 Caller::report_info(UMF_Control,UMF_Decomposition_Info);
689 }
690 }
691
692 void printOnApply(double* UMF_Info)
693 {
694 Caller::report_status(UMF_Control,UMF_Info[UMFPACK_STATUS]);
695 if (verbosity_ > 0)
696 {
697 std::cout << "[UMFPack Solve]" << std::endl;
698 std::cout << "Wallclock Time: " << UMF_Info[UMFPACK_SOLVE_WALLTIME] << " (CPU Time: " << UMF_Info[UMFPACK_SOLVE_TIME] << ")" << std::endl;
699 std::cout << "Flops Taken: " << UMF_Info[UMFPACK_SOLVE_FLOPS] << std::endl;
700 std::cout << "Iterative Refinement steps taken: " << UMF_Info[UMFPACK_IR_TAKEN] << std::endl;
701 std::cout << "Error Estimate: " << UMF_Info[UMFPACK_OMEGA1] << " resp. " << UMF_Info[UMFPACK_OMEGA2] << std::endl;
702 }
703 }
704
705 UMFPackMatrix umfpackMatrix_;
706 bool matrixIsLoaded_;
707 int verbosity_;
708 void *UMF_Symbolic;
709 void *UMF_Numeric;
710 double UMF_Control[UMFPACK_CONTROL];
711 };
712
713 template<typename T, typename A, int n, int m>
715 {
716 enum { value=true};
717 };
718
719 template<typename T, typename A>
721 {
722 enum { value = true };
723 };
724
726 template<class F,class=void> struct isValidBlock : std::false_type{};
727 template<class B> struct isValidBlock<B, std::enable_if_t<std::is_same<typename FieldTraits<B>::real_type,double>::value>> : std::true_type {};
728
729 template<typename TL, typename M>
730 std::shared_ptr<Dune::InverseOperator<typename Dune::TypeListElement<1, TL>::type,
731 typename Dune::TypeListElement<2, TL>::type>>
732 operator() (TL /*tl*/, const M& mat, const Dune::ParameterTree& config,
733 std::enable_if_t<
734 isValidBlock<typename Dune::TypeListElement<1, TL>::type::block_type>::value,int> = 0) const
735 {
736 int verbose = config.get("verbose", 0);
737 return std::make_shared<Dune::UMFPack<M>>(mat,verbose);
738 }
739
740 // second version with SFINAE to validate the template parameters of UMFPack
741 template<typename TL, typename M>
742 std::shared_ptr<Dune::InverseOperator<typename Dune::TypeListElement<1, TL>::type,
743 typename Dune::TypeListElement<2, TL>::type>>
744 operator() (TL /*tl*/, const M& /*mat*/, const Dune::ParameterTree& /*config*/,
745 std::enable_if_t<
746 !isValidBlock<typename Dune::TypeListElement<1, TL>::type::block_type>::value,int> = 0) const
747 {
748 DUNE_THROW(UnsupportedType,
749 "Unsupported Type in UMFPack (only double and std::complex<double> supported)");
750 }
751 };
753} // end namespace Dune
754
755#endif // HAVE_SUITESPARSE_UMFPACK
756
757#endif //DUNE_ISTL_UMFPACK_HH
Templates characterizing the type of a solver.
Implementations of the inverse operator interface.
#define DUNE_REGISTER_DIRECT_SOLVER(name,...)
Definition solverregistry.hh:13
Implementation of the BCRSMatrix class.
void free()
free allocated space.
Definition umfpack.hh:637
virtual void apply(domain_type &x, range_type &b, InverseOperatorResult &res)
Apply inverse operator,.
Definition umfpack.hh:474
static void report_info(A... args)
Definition umfpack.hh:198
virtual SolverCategory::Category category() const
Category of the solver (see SolverCategory::Category)
Definition umfpack.hh:348
M matrix_type
Definition umfpack.hh:337
static void solve(long int m, const long int *cs, const long int *ri, std::complex< double > *val, double *x, const double *b, A... args)
Definition umfpack.hh:213
void setMatrix(const Matrix &matrix)
Initialize data from given matrix.
Definition umfpack.hh:560
static int save_numeric(A... args)
Definition umfpack.hh:208
static void numeric(A... args)
Definition umfpack.hh:79
UMFPack(const Matrix &mat_, const ParameterTree &config)
Construct a solver object from a matrix.
Definition umfpack.hh:398
std::shared_ptr< Dune::InverseOperator< typename Dune::TypeListElement< 1, TL >::type, typename Dune::TypeListElement< 2, TL >::type > > operator()(TL, const M &mat, const Dune::ParameterTree &config, std::enable_if_t< isValidBlock< typename Dune::TypeListElement< 1, TL >::type::block_type >::value, int >=0) const
Definition umfpack.hh:732
ISTL::Impl::BCCSMatrix< typename Matrix::field_type, long int > UMFPackMatrix
The corresponding UMFPack matrix type.
Definition umfpack.hh:339
static void report_status(A... args)
Definition umfpack.hh:89
static void solve(long int m, const long int *cs, const long int *ri, std::complex< double > *val, double *x, const double *b, A... args)
Definition umfpack.hh:272
UMFPack(const Matrix &mat_, const char *file, int verbose=0)
Try loading a decomposition from file and do a decomposition if unsuccessful.
Definition umfpack.hh:422
static int load_numeric(A... args)
Definition umfpack.hh:131
static void free_numeric(A... args)
Definition umfpack.hh:64
static void defaults(A... args)
Definition umfpack.hh:173
typename Impl::UMFPackVectorChooser< M >::range_type range_type
The type of the range of the solver.
Definition umfpack.hh:345
static int save_numeric(A... args)
Definition umfpack.hh:267
static void report_info(A... args)
Definition umfpack.hh:84
static void solve(A... args)
Definition umfpack.hh:99
UMFPack()
default constructor
Definition umfpack.hh:404
static int load_numeric(A... args)
Definition umfpack.hh:247
static void symbolic(A... args)
Definition umfpack.hh:161
static void symbolic(long int m, long int n, const long int *cs, const long int *ri, const double *val, A... args)
Definition umfpack.hh:219
static void numeric(A... args)
Definition umfpack.hh:136
static void report_info(A... args)
Definition umfpack.hh:141
static void report_status(A... args)
Definition umfpack.hh:203
static void free_symbolic(A... args)
Definition umfpack.hh:69
static void free_symbolic(A... args)
Definition umfpack.hh:183
void setSubMatrix(const Matrix &_mat, const S &rowIndexSet)
Definition umfpack.hh:579
static void solve(A... args)
Definition umfpack.hh:156
static void free_numeric(A... args)
Definition umfpack.hh:178
ISTL::Impl::BCCSMatrixInitializer< M, long int > MatrixInitializer
Type of an associated initializer class.
Definition umfpack.hh:341
void apply(T *x, T *b)
additional apply method with c-arrays in analogy to superlu
Definition umfpack.hh:515
static constexpr bool valid
Definition umfpack.hh:50
void setVerbosity(int v)
sets the verbosity level for the UMFPack solver
Definition umfpack.hh:603
UMFPack(const char *file, int verbose=0)
try loading a decomposition from file
Definition umfpack.hh:449
static void defaults(A... args)
Definition umfpack.hh:232
static void numeric(const long int *cs, const long int *ri, const double *val, A... args)
Definition umfpack.hh:252
static void numeric(const long int *cs, const long int *ri, const double *val, A... args)
Definition umfpack.hh:193
static int save_numeric(A... args)
Definition umfpack.hh:151
static int load_numeric(A... args)
Definition umfpack.hh:74
static void symbolic(A... args)
Definition umfpack.hh:104
virtual ~UMFPack()
Definition umfpack.hh:465
const char * name()
Definition umfpack.hh:648
static void free_symbolic(A... args)
Definition umfpack.hh:126
void saveDecomposition(const char *file)
saves a decomposition to a file
Definition umfpack.hh:552
UMFPackMatrix & getInternalMatrix()
Return the column compress matrix from UMFPack.
Definition umfpack.hh:628
static void free_numeric(A... args)
Definition umfpack.hh:121
static void free_numeric(A... args)
Definition umfpack.hh:237
static void report_status(A... args)
Definition umfpack.hh:146
typename Impl::UMFPackVectorChooser< M >::domain_type domain_type
The type of the domain of the solver.
Definition umfpack.hh:343
UMFPack(const Matrix &matrix, int verbose=0)
Construct a solver object from a matrix.
Definition umfpack.hh:361
static int save_numeric(A... args)
Definition umfpack.hh:94
static void symbolic(long int m, long int n, const long int *cs, const long int *ri, const double *val, A... args)
Definition umfpack.hh:278
static void report_info(A... args)
Definition umfpack.hh:257
virtual void apply(domain_type &x, range_type &b, double reduction, InverseOperatorResult &res)
apply inverse operator, with given convergence criteria.
Definition umfpack.hh:505
void setOption(unsigned int option, double value)
Set UMFPack-specific options.
Definition umfpack.hh:541
static void defaults(A... args)
Definition umfpack.hh:59
M Matrix
The matrix type.
Definition umfpack.hh:336
static void free_symbolic(A... args)
Definition umfpack.hh:242
static void defaults(A... args)
Definition umfpack.hh:116
static int load_numeric(A... args)
Definition umfpack.hh:188
UMFPack(const Matrix &matrix, int verbose, bool)
Constructor for compatibility with SuperLU standard constructor.
Definition umfpack.hh:379
void * getFactorization()
Return the matrix factorization.
Definition umfpack.hh:619
static void report_status(A... args)
Definition umfpack.hh:262
Matrix & mat
Definition matrixmatrix.hh:347
STL namespace.
Definition allocator.hh:11
PropertyMapTypeSelector< Amg::VertexVisitedTag, Amg::PropertiesGraph< G, Amg::VertexProperties, EP, VM, EM > >::Type get(const Amg::VertexVisitedTag &tag, Amg::PropertiesGraph< G, Amg::VertexProperties, EP, VM, EM > &graph)
Definition dependency.hh:293
Definition matrixutils.hh:211
A sparse block matrix with compressed row storage.
Definition bcrsmatrix.hh:466
derive error class from the base class in common
Definition istlexception.hh:19
Sequential overlapping Schwarz preconditioner.
Definition overlappingschwarz.hh:755
Definition overlappingschwarz.hh:694
Definition matrixutils.hh:27
Statistics about the application of an inverse operator.
Definition solver.hh:48
double elapsed
Elapsed time in seconds.
Definition solver.hh:82
int iterations
Number of iterations.
Definition solver.hh:67
bool converged
True if convergence criterion has been met.
Definition solver.hh:73
Abstract base class for all solvers.
Definition solver.hh:99
Category
Definition solvercategory.hh:23
@ sequential
Category for sequential solvers.
Definition solvercategory.hh:25
Definition solverregistry.hh:77
Definition solvertype.hh:16
@ value
Whether this is a direct solver.
Definition solvertype.hh:24
Definition solvertype.hh:30
@ value
whether the solver internally uses column compressed storage
Definition solvertype.hh:36
Definition umfpack.hh:49
The UMFPack direct sparse solver.
Definition umfpack.hh:331
Definition umfpack.hh:725
Definition umfpack.hh:726