Teko Version of the Day
Teko_ModALPreconditionerFactory.hpp
00001 /*
00002  * Author: Zhen Wang
00003  * Email: wangz@ornl.gov
00004  *        zhen.wang@alum.emory.edu
00005  */
00006 
00007 #ifndef __Teko_ModALPreconditionerFactory_hpp__
00008 #define __Teko_ModALPreconditionerFactory_hpp__
00009 
00010 #include "Teko_BlockPreconditionerFactory.hpp"
00011 #include "Teko_InvModALStrategy.hpp"
00012 
00013 namespace Teko
00014 {
00015 
00016 namespace NS
00017 {
00018 
00022 class ModALPrecondState : public BlockPreconditionerState
00023 {
00024 public:
00025    ModALPrecondState();
00026 
00027    LinearOp pressureMassMatrix_;
00028    LinearOp invPressureMassMatrix_;
00029    ModifiableLinearOp B1tMpB1_, B2tMpB2_, B3tMpB3_;
00030    ModifiableLinearOp A11p_, A22p_, A33p_;
00031    ModifiableLinearOp invA11p_, invA22p_, invA33p_, invS_;
00032    ModifiableLinearOp S_;
00033 
00034    double gamma_;
00035    bool isStabilized_;
00036 };
00037 
00112 class ModALPreconditionerFactory : public BlockPreconditionerFactory
00113 {
00114 public:
00115 
00116    ModALPreconditionerFactory();
00117 
00118    ModALPreconditionerFactory(const Teuchos::RCP<InverseFactory> & factory);
00119 
00120    ModALPreconditionerFactory(const Teuchos::RCP<InverseFactory> & invFactoryA,
00121          const Teuchos::RCP<InverseFactory> & invFactoryS);
00122 
00123    ModALPreconditionerFactory(const Teuchos::RCP<InverseFactory> & factory,
00124          LinearOp & pressureMassMatrix);
00125 
00126    ModALPreconditionerFactory(const Teuchos::RCP<InverseFactory> & invFactoryA,
00127          const Teuchos::RCP<InverseFactory> & invFactoryS,
00128          LinearOp & pressureMassMatrix);
00129 
00130    ModALPreconditionerFactory(const Teuchos::RCP<InvModALStrategy> & strategy);
00131 
00137    void
00138    setPressureMassMatrix(const LinearOp & pressureMassMatrix)
00139    {
00140       invOpsStrategy_->setPressureMassMatrix(pressureMassMatrix);
00141    }
00142 
00148    void
00149    setGamma(double gamma)
00150    {
00151       invOpsStrategy_->setGamma(gamma);
00152    }
00153 
00162    virtual LinearOp
00163    buildPreconditionerOperator(BlockedLinearOp & alOp,
00164          BlockPreconditionerState & state) const;
00165 
00169    virtual Teuchos::RCP<PreconditionerState>
00170    buildPreconditionerState() const
00171    {
00172       return Teuchos::rcp(new ModALPrecondState());
00173    }
00174 
00175 protected:
00176 
00177    Teuchos::RCP<InvModALStrategy> invOpsStrategy_;
00178 
00179    bool isSymmetric_;
00180 };
00181 
00182 } // end namespace NS
00183 
00184 } // end namespace Teko
00185 
00186 #endif /* __Teko_ModALPreconditionerFactory_hpp__ */
 All Classes Files Functions Variables