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 namespace Teko {
19 
20 namespace NS {
21 
22 class ModALPrecondState;
23 
24 class InvModALStrategy {
25  public:
27  InvModALStrategy();
28 
29  InvModALStrategy(const Teuchos::RCP<InverseFactory>& factory);
30 
31  InvModALStrategy(const Teuchos::RCP<InverseFactory>& factory, LinearOp& pressureMassMatrix);
32 
33  InvModALStrategy(const Teuchos::RCP<InverseFactory>& invFactA,
34  const Teuchos::RCP<InverseFactory>& invFactS);
35 
36  InvModALStrategy(const Teuchos::RCP<InverseFactory>& invFactA,
37  const Teuchos::RCP<InverseFactory>& invFactS, LinearOp& pressureMassMatrix);
38 
40  virtual ~InvModALStrategy() {}
41 
49  virtual LinearOp getInvA11p(BlockPreconditionerState& state) const;
50 
58  virtual LinearOp getInvA22p(BlockPreconditionerState& state) const;
59 
67  virtual LinearOp getInvA33p(BlockPreconditionerState& state) const;
68 
76  virtual LinearOp getInvS(BlockPreconditionerState& state) const;
77 
85  virtual void buildState(const BlockedLinearOp& A, BlockPreconditionerState& state) const;
86 
90  virtual void initializeState(const BlockedLinearOp& A, ModALPrecondState* state) const;
91 
98  virtual void computeInverses(const BlockedLinearOp& A, ModALPrecondState* state) const;
99 
105  void setPressureMassMatrix(const LinearOp& pressureMassMatrix);
106 
112  void setGamma(double gamma);
113 
118  virtual void setSymmetric(bool isSymmetric) { isSymmetric_ = isSymmetric; }
119 
120  protected:
121  // In the modified AL preconditioner, we need to two methods,
122  // one for solving \f$ A_{ii}, i = 1, 2(, 3) \f$,
123  // the other for solving \f$ S \f$.
124  Teuchos::RCP<InverseFactory> invFactoryA_;
125  Teuchos::RCP<InverseFactory> invFactoryS_;
126  LinearOp pressureMassMatrix_;
127  double gamma_;
128 
129  DiagonalType scaleType_;
130  bool isSymmetric_;
131  int dim_;
132 };
133 
134 } // end namespace NS
135 
136 } // end namespace Teko
137 
138 #endif /* __Teko_ModALStrategy_hpp__ */