Finite Element Domain Decomposition Library
FEDDLib
Loading...
Searching...
No Matches
PrecOpFaCSI_decl.hpp
1#ifndef PrecOpFaCSI_DECL_hpp
2#define PrecOpFaCSI_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
24namespace FEDD {
25
26template <class SC = default_sc, class LO = default_lo, class GO = default_go, class NO = default_no>
27class PrecOpFaCSI : public PreconditionerOperator<SC,LO,GO,NO> {
28
29public:
30 typedef Teuchos::RCP<Thyra::LinearOpBase<SC> > ThyraLinOpPtr_Type;
31 typedef Teuchos::Comm<int> Comm_Type;
32 typedef Teuchos::RCP<const Comm_Type> CommConstPtr_Type;
33
34 PrecOpFaCSI();
35
36 PrecOpFaCSI(CommConstPtr_Type comm, bool fluidPrecMonolithic, bool useFluidPreconditioner = true, bool useSolidPreconditioner = true, bool onlyDiagonal=false);
37
38 void setGE(ThyraLinOpPtr_Type C1,
39 ThyraLinOpPtr_Type C1T,
40 ThyraLinOpPtr_Type C2,
41 ThyraLinOpPtr_Type sInv,
42 ThyraLinOpPtr_Type fInv,
43 ThyraLinOpPtr_Type fF,
44 ThyraLinOpPtr_Type fBT);
45
46 void setGI(ThyraLinOpPtr_Type C1,
47 ThyraLinOpPtr_Type C1T,
48 ThyraLinOpPtr_Type C2,
49 ThyraLinOpPtr_Type C4,
50 ThyraLinOpPtr_Type sInv,
51 ThyraLinOpPtr_Type fInv,
52 ThyraLinOpPtr_Type fF,
53 ThyraLinOpPtr_Type fBT,
54 ThyraLinOpPtr_Type gInv);
55
56 void setGIShape(ThyraLinOpPtr_Type C1,
57 ThyraLinOpPtr_Type C1T,
58 ThyraLinOpPtr_Type C2,
59 ThyraLinOpPtr_Type C4,
60 ThyraLinOpPtr_Type sInv,
61 ThyraLinOpPtr_Type fInv,
62 ThyraLinOpPtr_Type fF,
63 ThyraLinOpPtr_Type fBT,
64 ThyraLinOpPtr_Type gInv,
65 ThyraLinOpPtr_Type shape_v,
66 ThyraLinOpPtr_Type shape_p);
67
68 void setC1(ThyraLinOpPtr_Type C1);
69 void setC1T(ThyraLinOpPtr_Type C1T);
70 void setC2(ThyraLinOpPtr_Type C2);
71 void setC4(ThyraLinOpPtr_Type C4);
72 void setShapeDeriv(ThyraLinOpPtr_Type shape_v, ThyraLinOpPtr_Type shape_p);
73 void setStructInv(ThyraLinOpPtr_Type sInv);
74 void setFluidInv(ThyraLinOpPtr_Type fInv);
75 void setGeoInv(ThyraLinOpPtr_Type gInv);
76 void setFluidF(ThyraLinOpPtr_Type fF);
77 void setFluidBT(ThyraLinOpPtr_Type fBT);
78
79 void initialize();
80
81 virtual void applyIt(
82 const Thyra::EOpTransp M_trans,
83 const Thyra::MultiVectorBase<SC> &X,
84 const Teuchos::Ptr<Thyra::MultiVectorBase<SC> > &Y,
85 const SC alpha,
86 const SC beta
87 ) const;
88
89protected:
90
91 virtual void applyImpl(
92 const Thyra::EOpTransp M_trans,
93 const Thyra::MultiVectorBase<SC> &X,
94 const Teuchos::Ptr<Thyra::MultiVectorBase<SC> > &Y,
95 const SC alpha,
96 const SC beta
97 ) const;
98
99
100
101
102
103private:
104
105 void copyToMono(Teuchos::Array< Teuchos::RCP< Thyra::MultiVectorBase< SC > > > X_fluid) const;
106
107 void copyFromMono(Teuchos::Array< Teuchos::RCP< Thyra::MultiVectorBase< SC > > > Y_fluid) const;
108
109 ThyraLinOpPtr_Type C1_;
110 ThyraLinOpPtr_Type C1T_;
111 ThyraLinOpPtr_Type C2_;
112 ThyraLinOpPtr_Type C4_;
113 ThyraLinOpPtr_Type sInv_;
114 ThyraLinOpPtr_Type fInv_;
115 ThyraLinOpPtr_Type fF_;
116 ThyraLinOpPtr_Type fBT_;
117 ThyraLinOpPtr_Type gInv_;
118 ThyraLinOpPtr_Type shape_v_;
119 ThyraLinOpPtr_Type shape_p_;
120 mutable Teuchos::RCP<const Thyra::DefaultProductVectorSpace<SC> > productRangeFluid_;
121 bool fluidPrecMonolithic_;
122 mutable Teuchos::RCP< Thyra::MultiVectorBase<SC> > X_fmono_;
123 mutable Teuchos::RCP< Thyra::MultiVectorBase<SC> > Y_fmono_;
124 CommConstPtr_Type comm_;
125 bool useFluidPreconditioner_;
126 bool useSolidPreconditioner_;
127 bool onlyDiagonal_;
128 mutable Teuchos::RCP< Thyra::MultiVectorBase<SC> > tmp_l_;
129 mutable Teuchos::RCP< Thyra::MultiVectorBase<SC> > Z_fv_;
130};
131}
132#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
Definition PrecOpFaCSI_def.hpp:204
Adaptive Mesh Refinement.
Definition AdaptiveMeshRefinement.cpp:5