G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
gsINSPreconditioners.h
Go to the documentation of this file.
1
11#pragma once
12
15
17#include <gsSolver/gsMatrixOp.h>
18
19namespace gismo
20{
21
22// === Base class for INS preconditioners === //
23
24template <class T, int MatOrder>
25class gsINSPreconditioner : public gsLinearOperator<T>
26{
27
28public: // *** Smart pointers ***
29
30 typedef memory::shared_ptr<gsINSPreconditioner> Ptr;
31 typedef memory::unique_ptr<gsINSPreconditioner> uPtr;
32
33public: // *** Constructor/destructor ***
34
36 gsINSPreconditioner() {}
37
38public: // *** Static functions ***
39
41 static uPtr make()
42 { return memory::make_unique(new gsINSPreconditioner<T, MatOrder>()); }
43
48 static uPtr make(std::string precType, const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat, const gsOptionList& opt);
49
51 static gsOptionList defaultOptions();
52
53
54public: // *** Member functions ***
55
60 virtual void apply(const gsMatrix<T> & input, gsMatrix<T> & x) const
62
65 virtual void update(const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat)
67
68public: // *** Getters/setters ***
69
71 virtual int rows() const
73
75 virtual int cols() const
77
79 virtual std::string getName()
81
82}; // class gsINSPreconditioner
83
84
85// === Block preconditioner === //
86
107template <class T, int MatOrder>
108class gsINSBlockPrecondBase : public gsINSPreconditioner<T, MatOrder>
109{
110
111protected: // *** Class members ***
112
113 typename gsINSPrecondBlock<T>::Ptr m_Finv, m_Sinv;
114 typename gsLinearOperator<T>::Ptr m_Bt;
115 const gsOptionList m_opt;
116
117public: // *** Smart pointers ***
118
119 typedef memory::shared_ptr<gsINSBlockPrecondBase> Ptr;
120 typedef memory::unique_ptr<gsINSBlockPrecondBase> uPtr;
121
122public: // *** Constructor/destructor ***
123
130 m_Finv(Finv), m_Sinv(Sinv), m_Bt(B), m_opt(opt)
131 {}
132
133public: // *** Static functions ***
134
137 { return memory::make_unique(new gsINSBlockPrecondBase<T, MatOrder>(Finv, B, Sinv, opt)); }
138
139public: // *** Member functions ***
140
145 virtual void apply(const gsMatrix<T> & input, gsMatrix<T> & x) const;
146
147protected: // *** Member functions ***
148
153 {
154 m_Finv.reset(Finv);
155 }
156
162 {
163 m_Finv.reset(Finv);
164 m_Sinv.reset(Sinv);
165 }
166
167public: // *** Getters/setters ***
168
170 virtual int rows() const
171 {
172 return (m_Finv->rows() + m_Sinv->rows());
173 }
174
176 virtual int cols() const
177 {
178 return (m_Finv->cols() + m_Bt->cols());
179 }
180
181}; // class gsINSBlockPrecondBase
182
183
184// === LSC preconditioner === //
185
189template <class T, int MatOrder, class BlockFType = gsINSPrecondBlockF<T, MatOrder> >
191{
192
193public:
195
196protected: // *** Class members ***
197
198 using Base::m_Finv;
199 using Base::m_opt;
200
201public: // *** Smart pointers ***
202
203 typedef memory::shared_ptr<gsINSBlockPrecondLSC> Ptr;
204 typedef memory::unique_ptr<gsINSBlockPrecondLSC> uPtr;
205
206public: // *** Constructor/destructor ***
207
211 gsINSBlockPrecondLSC(const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat, const gsOptionList& opt) :
212 Base(new BlockFType(mat.at("matNS"), opt),
213 new gsINSPrecondBlockBt<T, MatOrder>(mat.at("matNS"), opt),
214 new gsINSPrecondSchurLSC<T, MatOrder>(mat, opt), opt)
215 { }
216
217public: // *** Static functions ***
218
222 static uPtr make(const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat, const gsOptionList& opt)
223 {
225 }
226
227public: // *** Member functions ***
228
231 virtual void update(const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat)
232 {
233 Base::update(new BlockFType(mat.at("matNS"), m_opt), new gsINSPrecondSchurLSC<T, MatOrder>(mat, m_opt));
234 }
235
237 virtual std::string getName()
238 {
239 std::string name = "LSC_" + m_Finv->getName();
240 return name;
241 }
242
243}; // class gsINSBlockPrecondLSC
244
245
246// === PCD preconditioner === //
247
251template <class T, int MatOrder, class BlockFType = gsINSPrecondBlockF<T, MatOrder> >
253{
254
255public:
257
258protected: // *** Class members ***
259
260 using Base::m_Finv;
261 using Base::m_opt;
262
263public: // *** Smart pointers ***
264
265 typedef memory::shared_ptr<gsINSBlockPrecondPCD> Ptr;
266 typedef memory::unique_ptr<gsINSBlockPrecondPCD> uPtr;
267
268public: // *** Constructor/destructor ***
269
273 gsINSBlockPrecondPCD(const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat, const gsOptionList& opt) :
274 Base(new BlockFType(mat.at("matNS"), opt),
275 new gsINSPrecondBlockBt<T, MatOrder>(mat.at("matNS"), opt),
276 new gsINSPrecondSchurPCD<T, MatOrder>(mat, opt), opt)
277 { }
278
279public: // *** Static functions ***
280
284 static uPtr make(const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat, const gsOptionList& opt)
285 {
287 }
288
289public: // *** Member functions ***
290
293 virtual void update(const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat)
294 {
295 Base::update(new BlockFType(mat.at("matNS"), m_opt), new gsINSPrecondSchurPCD<T, MatOrder>(mat, m_opt));
296 }
297
299 virtual std::string getName()
300 {
301 std::string name = "PCD_" + m_Finv->getName();
302 return name;
303 }
304
305}; // class gsINSBlockPrecondPCD
306
307
308// === PCDmod preconditioner === //
309
313template <class T, int MatOrder, class BlockFType = gsINSPrecondBlockF<T, MatOrder> >
315{
316
317public:
319
320protected: // *** Class members ***
321
322 using Base::m_Finv;
323 using Base::m_opt;
324
325public: // *** Smart pointers ***
326
327 typedef memory::shared_ptr<gsINSBlockPrecondPCDmod> Ptr;
328 typedef memory::unique_ptr<gsINSBlockPrecondPCDmod> uPtr;
329
330public: // *** Constructor/destructor ***
331
335 gsINSBlockPrecondPCDmod(const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat, const gsOptionList& opt) :
336 Base(new BlockFType(mat.at("matNS"), opt),
337 new gsINSPrecondBlockBt<T, MatOrder>(mat.at("matNS"), opt),
338 new gsINSPrecondSchurPCDmod<T, MatOrder>(mat, opt), opt)
339 { }
340
341public: // *** Static functions ***
342
346 static uPtr make(const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat, const gsOptionList& opt)
347 {
349 }
350
351public: // *** Member functions ***
352
355 virtual void update(const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat)
356 {
357 Base::update(new BlockFType(mat.at("matNS"), m_opt), new gsINSPrecondSchurPCDmod<T, MatOrder>(mat, m_opt));
358 }
359
361 virtual std::string getName()
362 {
363 std::string name = "PCDmod_" + m_Finv->getName();
364 return name;
365 }
366
367}; // class gsINSBlockPrecondPCDmod
368
369
370// === AL preconditioner === //
371
375template <class T, int MatOrder, class BlockFType = gsINSPrecondBlockFwhole<T, MatOrder> >
377{
378
379public:
381
382 protected: // *** Class members ***
383
384 using Base::m_Finv;
385 using Base::m_opt;
386
387public: // *** Smart pointers ***
388
389 typedef memory::shared_ptr<gsINSBlockPrecondAL> Ptr;
390 typedef memory::unique_ptr<gsINSBlockPrecondAL> uPtr;
391
392public: // *** Constructor/destructor ***
393
397 gsINSBlockPrecondAL(const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat, const gsOptionList& opt) :
398 Base(new BlockFType(mat.at("matNS"), opt),
399 new gsINSPrecondBlockBt<T, MatOrder>(mat.at("matNS"), opt),
400 new gsINSPrecondSchurAL<T, MatOrder>(mat, opt), opt)
401 { }
402
403public: // *** Static functions ***
404
408 static uPtr make(const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat, const gsOptionList& opt)
409 {
411 }
412
413public: // *** Static functions ***
414
421 static void fillALgammaPart_into(gsSparseMatrix<T, MatOrder>& matGammaPart, gsMatrix<T>& rhsGammaPart, const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat, const gsMatrix<T>& rhs, const gsOptionList& opt);
422
429 static void fillALmodifSystem_into(gsSparseMatrix<T, MatOrder>& matGamma, gsMatrix<T>& rhsGamma, const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat, const gsMatrix<T>& rhs, const gsOptionList& opt);
430
431public: // *** Member functions ***
432
435 virtual void update(const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat)
436 {
437 Base::update(new BlockFType(mat.at("matNS"), m_opt));
438 }
439
441 virtual std::string getName()
442 {
443 std::string name = "AL_" + m_Finv->getName();
444 return name;
445 }
446
447}; // class gsINSBlockPrecondAL
448
449
450// === SIMPLE preconditioner === //
451
455template <class T, int MatOrder, class BlockFType = gsINSPrecondBlockF<T, MatOrder> >
457{
458
459public:
461
462protected: // *** Class members ***
463
464 gsSparseMatrix<T, MatOrder> m_Dinv, m_B;
465 real_t m_alphaP;
466
467protected: // *** Base class members ***
468
469 using Base::m_Finv;
470 using Base::m_Bt;
471 using Base::m_Sinv;
472 using Base::m_opt;
473
474public: // *** Smart pointers ***
475
476 typedef memory::shared_ptr<gsINSBlockPrecondSIMPLE> Ptr;
477 typedef memory::unique_ptr<gsINSBlockPrecondSIMPLE> uPtr;
478
479public: // *** Constructor/destructor ***
480
484 gsINSBlockPrecondSIMPLE(const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat, const gsOptionList& opt) :
485 Base(new BlockFType(mat.at("matNS"), opt),
486 new gsINSPrecondBlockBt<T, MatOrder>(mat.at("matNS"), opt),
487 new gsINSPrecondSchurSIMPLE<T, MatOrder>(mat, opt), opt)
488 {
489 int uSize = opt.getInt("dim") * opt.getInt("udofs");
490 int pdofs = opt.getInt("pdofs");
491
492 const gsSparseMatrix<T, MatOrder>& matNS = mat.at("matNS");
493
494 gsSparseMatrix<T, MatOrder> blockA = matNS.block(0, 0, uSize, uSize);
495 diagInvMatrix_into(blockA, m_Dinv, 1, opt.getSwitch("lumpingA"));
496
497 m_B = matNS.block(uSize, 0, pdofs, uSize);
498
499 m_alphaP = opt.askReal("alphaP", 1.0);
500 }
501
502public: // *** Static functions ***
503
507 static uPtr make(const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat, const gsOptionList& opt)
508 {
510 }
511
512public: // *** Member functions ***
513
516 virtual void update(const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat)
517 {
518 Base::update(new BlockFType(mat.at("matNS"), m_opt), new gsINSPrecondSchurSIMPLE<T, MatOrder>(mat, m_opt));
519 }
520
525 virtual void apply(const gsMatrix<T> & input, gsMatrix<T> & x) const;
526
528 virtual std::string getName()
529 {
530 std::string name = "SIMPLE_" + m_Finv->getName();
531 return name;
532 }
533
534}; // class gsINSBlockPrecondSIMPLE
535
536
537// === SIMPLER preconditioner === //
538
542template <class T, int MatOrder, class BlockFType = gsINSPrecondBlockF<T, MatOrder> >
543class gsINSBlockPrecondSIMPLER : public gsINSBlockPrecondSIMPLE<T, MatOrder, BlockFType>
544{
545
546public:
548
549protected: // *** Class members ***
550
552
553protected: // *** Base class members ***
554
555 using Base::m_Dinv;
556 using Base::m_B;
557 using Base::m_alphaP;
558 using gsINSBlockPrecondBase<T, MatOrder>::m_Finv;
559 using gsINSBlockPrecondBase<T, MatOrder>::m_Bt;
560 using gsINSBlockPrecondBase<T, MatOrder>::m_Sinv;
561
562public: // *** Smart pointers ***
563
564 typedef memory::shared_ptr<gsINSBlockPrecondSIMPLER> Ptr;
565 typedef memory::unique_ptr<gsINSBlockPrecondSIMPLER> uPtr;
566
567public: // *** Constructor/destructor ***
568
572 gsINSBlockPrecondSIMPLER(const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat, const gsOptionList& opt) :
573 Base(mat, opt)
574 {
575 m_BDinv = m_B * m_Dinv;
576 }
577
578public: // *** Static functions ***
579
583 static uPtr make(const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat, const gsOptionList& opt)
584 {
586 }
587
588public: // *** Member functions ***
589
594 virtual void apply(const gsMatrix<T> & input, gsMatrix<T> & x) const;
595
597 virtual std::string getName()
598 {
599 std::string name = "SIMPLER_" + m_Finv->getName();
600 return name;
601 }
602
603}; // class gsINSBlockPrecondSIMPLER
604
605
606// === MSIMPLER preconditioner === //
607
611template <class T, int MatOrder, class BlockFType = gsINSPrecondBlockF<T, MatOrder> >
613{
614
615public:
617
618protected: // *** Class members ***
619
620 gsSparseMatrix<T, MatOrder> m_velMinv, m_B, m_BMinv;
621 real_t m_alphaP;
622
623protected: // *** Base class members ***
624
625 using Base::m_Finv;
626 using Base::m_Bt;
627 using Base::m_Sinv;
628 using Base::m_opt;
629
630public: // *** Smart pointers ***
631
632 typedef memory::shared_ptr<gsINSBlockPrecondMSIMPLER> Ptr;
633 typedef memory::unique_ptr<gsINSBlockPrecondMSIMPLER> uPtr;
634
635public: // *** Constructor/destructor ***
636
640 gsINSBlockPrecondMSIMPLER(const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat, const gsOptionList& opt) :
641 Base(new BlockFType(mat.at("matNS"), opt),
642 new gsINSPrecondBlockBt<T, MatOrder>(mat.at("matNS"), opt),
643 new gsINSPrecondSchurMSIMPLER<T, MatOrder>(mat, opt), opt)
644 {
645 int dim = opt.getInt("dim");
646 int udofs = opt.getInt("udofs");
647 int uSize = dim * udofs;
648 int pdofs = opt.getInt("pdofs");
649
650 const gsSparseMatrix<T, MatOrder>& matNS = mat.at("matNS");
651 const gsSparseMatrix<T, MatOrder>& velM = mat.at("matMu");
652
653 // approximation of velocity mass matrix inverse
654 diagInvMatrix_into(velM, m_velMinv, uSize / velM.rows(), opt.getSwitch("lumpingM"));
655
656 m_B = matNS.block(uSize, 0, pdofs, uSize);
657 m_BMinv = m_B * m_velMinv;
658
659 m_alphaP = opt.askReal("alphaP", 1.0);
660 }
661
662public: // *** Static functions ***
663
667 static uPtr make(const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat, const gsOptionList& opt)
668 {
670 }
671
672public: // *** Member functions ***
673
676 virtual void update(const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat)
677 {
678 Base::update(new BlockFType(mat.at("matNS"), m_opt));
679 }
680
685 virtual void apply(const gsMatrix<T> & input, gsMatrix<T> & x) const;
686
688 virtual std::string getName()
689 {
690 std::string name = "MSIMPLER_" + m_Finv->getName();
691 return name;
692 }
693
694}; // class gsINSBlockPrecondMSIMPLER
695
696
697// === Stokes diagonal preconditioner === //
698
702template <class T, int MatOrder, class BlockFType = gsINSPrecondBlockF<T, MatOrder> >
703class gsBlockPrecondStokes : public gsINSPreconditioner<T, MatOrder>
704{
705
706protected: // *** Class members ***
707
708 typename gsINSPrecondBlock<T>::Ptr m_Finv, m_Sinv;
709 const gsOptionList m_opt;
710
711public: // *** Smart pointers ***
712
713 typedef memory::shared_ptr<gsBlockPrecondStokes> Ptr;
714 typedef memory::unique_ptr<gsBlockPrecondStokes> uPtr;
715
716public: // *** Constructor/destructor ***
717
721 gsBlockPrecondStokes(const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat, const gsOptionList& opt) :
722 m_Finv(new BlockFType(mat.at("matNS"), opt)), m_Sinv(new gsINSPrecondSchurStokes<T, MatOrder>(mat, opt)), m_opt(opt)
723 {}
724
725public: // *** Static functions ***
726
730 static uPtr make(const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat, const gsOptionList& opt)
731 {
733 }
734
735public: // *** Member functions ***
736
739 virtual void update(const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat)
740 {
741 m_Finv.reset(new BlockFType(mat.at("matNS"), m_opt));
742 }
743
744
749 virtual void apply(const gsMatrix<T> & input, gsMatrix<T> & x) const;
750
751public: // *** Getters/setters ***
752
754 virtual int rows() const
755 {
756 return (m_Finv->rows() + m_Sinv->rows());
757 }
758
760 virtual int cols() const
761 {
762 return (m_Finv->cols() + m_Sinv->cols());
763 }
764
766 virtual std::string getName()
767 {
768 std::string name = "StokesDiag_" + m_Finv->getName();
769 return name;
770 }
771
772}; // class gsBlockPrecondStokes
773
774
775// === Stokes triangular preconditioner === //
776
780template <class T, int MatOrder, class BlockFType = gsINSPrecondBlockF<T, MatOrder> >
782{
783
784public:
786
787protected: // *** Base class members ***
788
789 using Base::m_Finv;
790 using Base::m_opt;
791
792public: // *** Smart pointers ***
793
794 typedef memory::shared_ptr<gsBlockPrecondStokesTriang> Ptr;
795 typedef memory::unique_ptr<gsBlockPrecondStokesTriang> uPtr;
796
797public: // *** Constructor/destructor ***
798
802 gsBlockPrecondStokesTriang(const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat, const gsOptionList& opt) :
803 Base(new BlockFType(mat.at("matNS"), opt),
804 new gsINSPrecondBlockBt<T, MatOrder>(mat.at("matNS"), opt),
805 new gsINSPrecondSchurStokes<T, MatOrder>(mat, opt), opt)
806 { }
807
808public: // *** Static functions ***
809
813 static uPtr make(const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat, const gsOptionList& opt)
814 {
816 }
817
818public: // *** Member functions ***
819
822 virtual void update(const std::map<std::string, gsSparseMatrix<T, MatOrder> >& mat)
823 {
824 Base::update(new BlockFType(mat.at("matNS"), m_opt));
825 }
826
828 virtual std::string getName()
829 {
830 std::string name = "StokesTriang_" + m_Finv->getName();
831 return name;
832 }
833
834}; // class gsBlockPrecondStokesTriang
835
836} // namespace gismo
837
838#ifndef GISMO_BUILD_LIB
839#include GISMO_HPP_HEADER(gsINSPreconditioners.hpp)
840#endif
Block triangular preconditioner for the Stokes problem.
Definition gsINSPreconditioners.h:782
gsBlockPrecondStokesTriang(const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat, const gsOptionList &opt)
Constructor.
Definition gsINSPreconditioners.h:802
static uPtr make(const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat, const gsOptionList &opt)
Returns a unique pointer to a newly created instance.
Definition gsINSPreconditioners.h:813
virtual std::string getName()
Returns the preconditioner name as a string.
Definition gsINSPreconditioners.h:828
virtual void update(const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat)
Update the preconditioner (new linearization or time step).
Definition gsINSPreconditioners.h:822
Block diagonal preconditioner for the Stokes problem.
Definition gsINSPreconditioners.h:704
static uPtr make(const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat, const gsOptionList &opt)
Returns a unique pointer to a newly created instance.
Definition gsINSPreconditioners.h:730
virtual std::string getName()
Returns the preconditioner name as a string.
Definition gsINSPreconditioners.h:766
virtual void update(const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat)
Update the preconditioner (new linearization or time step).
Definition gsINSPreconditioners.h:739
gsBlockPrecondStokes(const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat, const gsOptionList &opt)
Constructor.
Definition gsINSPreconditioners.h:721
virtual void apply(const gsMatrix< T > &input, gsMatrix< T > &x) const
Apply the preconditioner. Computes the vector \fx = P^{-1} y\f.
Definition gsINSPreconditioners.hpp:286
virtual int rows() const
Returns the number of rows of the preconditioner.
Definition gsINSPreconditioners.h:754
virtual int cols() const
Returns the number of columns of the preconditioner.
Definition gsINSPreconditioners.h:760
Augmented Lagrangian preconditioner.
Definition gsINSPreconditioners.h:377
static uPtr make(const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat, const gsOptionList &opt)
Returns a unique pointer to a newly created instance.
Definition gsINSPreconditioners.h:408
static void fillALmodifSystem_into(gsSparseMatrix< T, MatOrder > &matGamma, gsMatrix< T > &rhsGamma, const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat, const gsMatrix< T > &rhs, const gsOptionList &opt)
Fill the Augmented Lagrangian linear system.
Definition gsINSPreconditioners.hpp:182
virtual std::string getName()
Returns the preconditioner name as a string.
Definition gsINSPreconditioners.h:441
virtual void update(const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat)
Update the preconditioner (new linearization or time step).
Definition gsINSPreconditioners.h:435
static void fillALgammaPart_into(gsSparseMatrix< T, MatOrder > &matGammaPart, gsMatrix< T > &rhsGammaPart, const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat, const gsMatrix< T > &rhs, const gsOptionList &opt)
Fill the extra part of the Augmented Lagrangian linear system.
Definition gsINSPreconditioners.hpp:141
gsINSBlockPrecondAL(const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat, const gsOptionList &opt)
Constructor.
Definition gsINSPreconditioners.h:397
Base class for block preconditioners for linear systems arising from linearized Navier-Stokes of form...
Definition gsINSPreconditioners.h:109
void update(gsINSPrecondBlock< T > *Finv, gsINSPrecondBlock< T > *Sinv)
Update the preconditioner (new linearization or time step). To be used when both \fF\f and \fS\f bloc...
Definition gsINSPreconditioners.h:161
static uPtr make(gsINSPrecondBlock< T > *Finv, gsLinearOperator< T > *B, gsINSPrecondBlock< T > *Sinv, const gsOptionList &opt)
Returns a unique pointer to a newly created instance.
Definition gsINSPreconditioners.h:136
gsINSBlockPrecondBase(gsINSPrecondBlock< T > *Finv, gsLinearOperator< T > *B, gsINSPrecondBlock< T > *Sinv, const gsOptionList &opt)
Constructor.
Definition gsINSPreconditioners.h:129
virtual void apply(const gsMatrix< T > &input, gsMatrix< T > &x) const
Apply the preconditioner. Computes the vector \fx = P^{-1} y\f.
Definition gsINSPreconditioners.hpp:120
virtual int rows() const
Returns the number of rows of the preconditioner.
Definition gsINSPreconditioners.h:170
virtual int cols() const
Returns the number of columns of the preconditioner.
Definition gsINSPreconditioners.h:176
void update(gsINSPrecondBlock< T > *Finv)
Update the preconditioner (new linearization or time step). To be used when only the \fF\f block chan...
Definition gsINSPreconditioners.h:152
Least-squares commutator preconditioner.
Definition gsINSPreconditioners.h:191
static uPtr make(const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat, const gsOptionList &opt)
Returns a unique pointer to a newly created instance.
Definition gsINSPreconditioners.h:222
virtual std::string getName()
Returns the preconditioner name as a string.
Definition gsINSPreconditioners.h:237
virtual void update(const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat)
Update the preconditioner (new linearization or time step).
Definition gsINSPreconditioners.h:231
gsINSBlockPrecondLSC(const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat, const gsOptionList &opt)
Constructor.
Definition gsINSPreconditioners.h:211
MSIMPLER preconditioner.
Definition gsINSPreconditioners.h:613
static uPtr make(const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat, const gsOptionList &opt)
Returns a unique pointer to a newly created instance.
Definition gsINSPreconditioners.h:667
virtual std::string getName()
Returns the preconditioner name as a string.
Definition gsINSPreconditioners.h:688
virtual void update(const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat)
Update the preconditioner (new linearization or time step).
Definition gsINSPreconditioners.h:676
virtual void apply(const gsMatrix< T > &input, gsMatrix< T > &x) const
Apply the preconditioner. Computes the vector \fx = P^{-1} y\f.
Definition gsINSPreconditioners.hpp:255
gsINSBlockPrecondMSIMPLER(const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat, const gsOptionList &opt)
Constructor.
Definition gsINSPreconditioners.h:640
Pressure convection-diffusion preconditioner.
Definition gsINSPreconditioners.h:253
static uPtr make(const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat, const gsOptionList &opt)
Returns a unique pointer to a newly created instance.
Definition gsINSPreconditioners.h:284
virtual std::string getName()
Returns the preconditioner name as a string.
Definition gsINSPreconditioners.h:299
virtual void update(const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat)
Update the preconditioner (new linearization or time step).
Definition gsINSPreconditioners.h:293
gsINSBlockPrecondPCD(const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat, const gsOptionList &opt)
Constructor.
Definition gsINSPreconditioners.h:273
Modified pressure convection-diffusion preconditioner.
Definition gsINSPreconditioners.h:315
static uPtr make(const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat, const gsOptionList &opt)
Returns a unique pointer to a newly created instance.
Definition gsINSPreconditioners.h:346
gsINSBlockPrecondPCDmod(const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat, const gsOptionList &opt)
Constructor.
Definition gsINSPreconditioners.h:335
virtual std::string getName()
Returns the preconditioner name as a string.
Definition gsINSPreconditioners.h:361
virtual void update(const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat)
Update the preconditioner (new linearization or time step).
Definition gsINSPreconditioners.h:355
SIMPLER preconditioner.
Definition gsINSPreconditioners.h:544
static uPtr make(const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat, const gsOptionList &opt)
Returns a unique pointer to a newly created instance.
Definition gsINSPreconditioners.h:583
virtual std::string getName()
Returns the preconditioner name as a string.
Definition gsINSPreconditioners.h:597
virtual void apply(const gsMatrix< T > &input, gsMatrix< T > &x) const
Apply the preconditioner. Computes the vector \fx = P^{-1} y\f.
Definition gsINSPreconditioners.hpp:224
gsINSBlockPrecondSIMPLER(const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat, const gsOptionList &opt)
Constructor.
Definition gsINSPreconditioners.h:572
SIMPLE preconditioner.
Definition gsINSPreconditioners.h:457
gsINSBlockPrecondSIMPLE(const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat, const gsOptionList &opt)
Constructor.
Definition gsINSPreconditioners.h:484
static uPtr make(const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat, const gsOptionList &opt)
Returns a unique pointer to a newly created instance.
Definition gsINSPreconditioners.h:507
virtual std::string getName()
Returns the preconditioner name as a string.
Definition gsINSPreconditioners.h:528
virtual void update(const std::map< std::string, gsSparseMatrix< T, MatOrder > > &mat)
Update the preconditioner (new linearization or time step).
Definition gsINSPreconditioners.h:516
virtual void apply(const gsMatrix< T > &input, gsMatrix< T > &x) const
Apply the preconditioner. Computes the vector \fx = P^{-1} y\f.
Definition gsINSPreconditioners.hpp:199
A base class for individual blocks of block preconditioners.
Definition gsINSPrecondBlocks.h:28
Simple abstract class for discrete operators.
Definition gsLinearOperator.h:29
memory::shared_ptr< gsLinearOperator > Ptr
Shared pointer for gsLinearOperator.
Definition gsLinearOperator.h:33
virtual index_t rows() const =0
Returns the number of rows of the operator.
virtual index_t cols() const =0
Returns the number of columns of the operator.
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
Class which holds a list of parameters/options, and provides easy access to them.
Definition gsOptionList.h:33
Real askReal(const std::string &label, const Real &value=0) const
Reads value for option label from options.
Definition gsOptionList.cpp:139
bool getSwitch(const std::string &label) const
Reads value for option label from options.
Definition gsOptionList.cpp:51
const index_t & getInt(const std::string &label) const
Reads value for option label from options.
Definition gsOptionList.cpp:37
Sparse matrix class, based on gsEigen::SparseMatrix.
Definition gsSparseMatrix.h:139
#define GISMO_NO_IMPLEMENTATION
Definition gsDebug.h:129
Simple abstract class for (discrete) linear operators.
Simple adapter classes to use matrices or linear solvers as gsLinearOperators.
unique_ptr< T > make_unique(T *x)
Definition gsMemory.h:198
The G+Smo namespace, containing all definitions for the library.
void diagInvMatrix_into(const gsSparseMatrix< T, MatOrder > &mat, gsSparseMatrix< T, MatOrder > &diagInv, int repeat, bool lumping=false)
Fill a diagonal approximation of an inverse matrix.
Definition gsFlowUtils.h:137