Finite Element Domain Decomposition Library
FEDDLib
Loading...
Searching...
No Matches
PrecBlock2x2_decl.hpp
1#ifndef PrecBlock2x2_DECL_hpp
2#define PrecBlock2x2_DECL_hpp
3#include "feddlib/core/FEDDCore.hpp"
4#include "feddlib/problems/problems_config.h"
5#include "PreconditionerOperator.hpp"
6#include <Thyra_DefaultProductMultiVector_decl.hpp>
7#include <Thyra_DefaultMultiVectorProductVectorSpace_decl.hpp>
8#include <Thyra_OperatorVectorTypes.hpp>
9#include <Thyra_MultiVectorStdOps_decl.hpp>
10#include <Thyra_MultiVectorBase_decl.hpp>
11#include <Thyra_VectorBase.hpp>
12#include <Thyra_TpetraVector_decl.hpp>
13#include <Thyra_DetachedMultiVectorView.hpp>
14#include <Thyra_SpmdVectorSpaceBase_decl.hpp>
23
24
52
53namespace FEDD {
54
55template <class SC = default_sc, class LO = default_lo, class GO = default_go, class NO = default_no>
56class PrecBlock2x2 : public PreconditionerOperator<SC,LO,GO,NO> {
57
58public:
59 typedef Teuchos::RCP<Thyra::LinearOpBase<SC> > ThyraLinOpPtr_Type;
60 typedef Teuchos::Comm<int> Comm_Type;
61 typedef Teuchos::RCP<const Comm_Type> CommConstPtr_Type;
62
63 PrecBlock2x2();
64
65 PrecBlock2x2(CommConstPtr_Type comm);
67
69 void setDiagonal(ThyraLinOpPtr_Type velocityInv,
70 ThyraLinOpPtr_Type pressureInv);
71
73 void setTriangular(ThyraLinOpPtr_Type velocityInv,
74 ThyraLinOpPtr_Type pressureInv,
75 ThyraLinOpPtr_Type BT);
76
78 void setTriangular(ThyraLinOpPtr_Type velocityInv,
79 ThyraLinOpPtr_Type laplaceInverse,
80 ThyraLinOpPtr_Type convectionDiffusionOperator,
81 ThyraLinOpPtr_Type massMatrixInverse,
82 ThyraLinOpPtr_Type massMatrixVInverse,
83 ThyraLinOpPtr_Type BT);
84
86 void setTriangular(ThyraLinOpPtr_Type velocityInv,
87 ThyraLinOpPtr_Type laplaceInverse,
88 ThyraLinOpPtr_Type massMatrixVInverse,
89 ThyraLinOpPtr_Type BT);
90
92 void setVeloctiyInv(ThyraLinOpPtr_Type veloctiyInv);
93
95 void setPressureInv(ThyraLinOpPtr_Type pressureInv);
96
98 void setPressureInvs(ThyraLinOpPtr_Type laplaceInverse, ThyraLinOpPtr_Type convectionDiffusionOperator, ThyraLinOpPtr_Type massMatrixInverse, ThyraLinOpPtr_Type massMatrixVInverse);
99
101 void setPressureInvs(ThyraLinOpPtr_Type laplaceInverse, ThyraLinOpPtr_Type massMatrixVInverse);
102
104 void setB(ThyraLinOpPtr_Type B) {B_ = B;};
105
107 void setF(ThyraLinOpPtr_Type F) {F_ = F;};
108
110 void setType(std::string type);
111
112 void initialize();
113
114 virtual void applyIt(
115 const Thyra::EOpTransp M_trans,
116 const Thyra::MultiVectorBase<SC> &X,
117 const Teuchos::Ptr<Thyra::MultiVectorBase<SC> > &Y,
118 const SC alpha,
119 const SC beta
120 ) const;
121
122protected:
124 virtual void applyImpl(
125 const Thyra::EOpTransp M_trans,
126 const Thyra::MultiVectorBase<SC> &X,
127 const Teuchos::Ptr<Thyra::MultiVectorBase<SC> > &Y,
128 const SC alpha,
129 const SC beta
130 ) const;
131
132
133
134
135
136private:
137
138 ThyraLinOpPtr_Type velocityInv_;
139 ThyraLinOpPtr_Type pressureInv_;
140 ThyraLinOpPtr_Type BT_;
141 ThyraLinOpPtr_Type B_;
142 ThyraLinOpPtr_Type F_;
143 ThyraLinOpPtr_Type laplaceInverse_;
144 ThyraLinOpPtr_Type convectionDiffusionOperator_;
145 ThyraLinOpPtr_Type massMatrixInverse_;
146 ThyraLinOpPtr_Type massMatrixVInverse_;
147
148 mutable Teuchos::RCP<const Thyra::DefaultProductVectorSpace<SC> > productRangeFluid_;
149
150 CommConstPtr_Type comm_;
151 std::string type_;
152
153};
154}
155#endif
virtual void applyImpl(const Thyra::EOpTransp M_trans, const Thyra::MultiVectorBase< SC > &X, const Teuchos::Ptr< Thyra::MultiVectorBase< SC > > &Y, const SC alpha, const SC beta) const
Apply of preconditioner in e.g. GMRES.
Definition PrecBlock2x2_def.hpp:188
void setType(std::string type)
Setting the preconditioning ype.
Definition PrecBlock2x2_def.hpp:137
void setDiagonal(ThyraLinOpPtr_Type velocityInv, ThyraLinOpPtr_Type pressureInv)
Diagonal preconditioner with \hat{S}= -1/nu M_p schur complement approximation.
Definition PrecBlock2x2_def.hpp:38
void setPressureInv(ThyraLinOpPtr_Type pressureInv)
Setting inverse approximation of Schur complement.
Definition PrecBlock2x2_def.hpp:112
void setVeloctiyInv(ThyraLinOpPtr_Type veloctiyInv)
Setting velocity inverse approximation.
Definition PrecBlock2x2_def.hpp:107
void setTriangular(ThyraLinOpPtr_Type velocityInv, ThyraLinOpPtr_Type pressureInv, ThyraLinOpPtr_Type BT)
Triangular preconditioner with \hat{S}= -1/nu M_p schur complement approximation.
Definition PrecBlock2x2_def.hpp:52
void setF(ThyraLinOpPtr_Type F)
Setting fluid system matrix F.
Definition PrecBlock2x2_decl.hpp:107
void setB(ThyraLinOpPtr_Type B)
Setting fluid system matrix B.
Definition PrecBlock2x2_decl.hpp:104
void setPressureInvs(ThyraLinOpPtr_Type laplaceInverse, ThyraLinOpPtr_Type convectionDiffusionOperator, ThyraLinOpPtr_Type massMatrixInverse, ThyraLinOpPtr_Type massMatrixVInverse)
Setting inverse approximation of Schur complement by multiple operators. Corresponds to PCD.
Definition PrecBlock2x2_def.hpp:117
Adaptive Mesh Refinement.
Definition AdaptiveMeshRefinement_decl.hpp:33