Teko  Version of the Day
 All Classes Files Functions Variables Pages
Teko_InvModALStrategy.hpp
1 /*
2  * Author: Zhen Wang
3  * Email: wangz@ornl.gov
4  * zhen.wang@alum.emory.edu
5  */
6 
7 #ifndef __Teko_ModALStrategy_hpp__
8 #define __Teko_ModALStrategy_hpp__
9 
10 #include "Teuchos_RCP.hpp"
11 
12 #include "Thyra_LinearOpBase.hpp"
13 
14 #include "Teko_Utilities.hpp"
15 #include "Teko_InverseFactory.hpp"
16 #include "Teko_BlockPreconditionerFactory.hpp"
17 
18 #include "Teko_ALOperator.hpp"
19 
20 namespace Teko
21 {
22 
23 namespace NS
24 {
25 
26 class ModALPrecondState;
27 
28 class InvModALStrategy
29 {
30 public:
31 
33  InvModALStrategy();
34 
35  InvModALStrategy(const Teuchos::RCP<InverseFactory> & factory);
36 
37  InvModALStrategy(const Teuchos::RCP<InverseFactory> & factory,
38  LinearOp & pressureMassMatrix);
39 
40  InvModALStrategy(const Teuchos::RCP<InverseFactory> & invFactA,
41  const Teuchos::RCP<InverseFactory> & invFactS);
42 
43  InvModALStrategy(const Teuchos::RCP<InverseFactory> & invFactA,
44  const Teuchos::RCP<InverseFactory> & invFactS,
45  LinearOp & pressureMassMatrix);
46 
48  virtual
49  ~InvModALStrategy()
50  {
51  }
52 
60  virtual LinearOp
61  getInvA11p(BlockPreconditionerState & state) const;
62 
70  virtual LinearOp
71  getInvA22p(BlockPreconditionerState & state) const;
72 
80  virtual LinearOp
81  getInvA33p(BlockPreconditionerState & state) const;
82 
90  virtual LinearOp
91  getInvS(BlockPreconditionerState & state) const;
92 
100  virtual void
101  buildState(const BlockedLinearOp & A, BlockPreconditionerState & state) const;
102 
106  virtual void
107  initializeState(const BlockedLinearOp & A, ModALPrecondState * state) const;
108 
115  virtual void
116  computeInverses(const BlockedLinearOp & A, ModALPrecondState * state) const;
117 
123  void
124  setPressureMassMatrix(const LinearOp & pressureMassMatrix);
125 
131  void
132  setGamma(double gamma);
133 
138  virtual void
139  setSymmetric(bool isSymmetric)
140  {
141  isSymmetric_ = isSymmetric;
142  }
143 
144 protected:
145 
146  // In the modified AL preconditioner, we need to two methods,
147  // one for solving \f$ A_{ii}, i = 1, 2(, 3) \f$,
148  // the other for solving \f$ S \f$.
149  Teuchos::RCP<InverseFactory> invFactoryA_;
150  Teuchos::RCP<InverseFactory> invFactoryS_;
151  LinearOp pressureMassMatrix_;
152  double gamma_;
153 
154  DiagonalType scaleType_;
155  bool isSymmetric_;
156  int dim_;
157 };
158 
159 } // end namespace NS
160 
161 } // end namespace Teko
162 
163 #endif /* __Teko_ModALStrategy_hpp__ */