Teko  Version of the Day
 All Classes Files Functions Variables Pages
Teko_EpetraBlockPreconditioner.hpp
1 // @HEADER
2 // *****************************************************************************
3 // Teko: A package for block and physics based preconditioning
4 //
5 // Copyright 2010 NTESS and the Teko contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef __Teko_EpetraBlockPreconditioner_hpp__
11 #define __Teko_EpetraBlockPreconditioner_hpp__
12 
13 // #include "Teko_BlockPreconditionerFactory.hpp"
14 #include "Teko_PreconditionerFactory.hpp"
15 #include "Teko_EpetraInverseOpWrapper.hpp"
16 
17 namespace Teko {
18 namespace Epetra {
19 
29 class EpetraBlockPreconditioner : public EpetraInverseOpWrapper {
30  public:
37  EpetraBlockPreconditioner(const Teuchos::RCP<const PreconditionerFactory> &bfp);
38 
53  virtual void initPreconditioner(bool clearOld = false);
54 
67  virtual void buildPreconditioner(const Teuchos::RCP<const Epetra_Operator> &A, bool clear = true);
68 
82  virtual void buildPreconditioner(const Teuchos::RCP<const Epetra_Operator> &A,
83  const Epetra_MultiVector &mv, bool clear = true);
84 
97  virtual void rebuildPreconditioner(const Teuchos::RCP<const Epetra_Operator> &A);
98 
112  virtual void rebuildPreconditioner(const Teuchos::RCP<const Epetra_Operator> &A,
113  const Epetra_MultiVector &mv);
114 
124  virtual Teuchos::RCP<PreconditionerState> getPreconditionerState();
125 
135  virtual Teuchos::RCP<const PreconditionerState> getPreconditionerState() const;
136 
137  protected:
138  Teuchos::RCP<const Thyra::LinearOpBase<double> > extractLinearOp(
139  const Teuchos::RCP<const Epetra_Operator> &A) const;
140  Teuchos::RCP<const MappingStrategy> extractMappingStrategy(
141  const Teuchos::RCP<const Epetra_Operator> &A) const;
142 
145 
146  // Teuchos::RCP<const BlockPreconditionerFactory> preconFactory_;
147  Teuchos::RCP<const PreconditionerFactory> preconFactory_;
148  Teuchos::RCP<Thyra::PreconditionerBase<double> > preconObj_;
149  bool firstBuildComplete_;
150 };
151 
152 } // end namespace Epetra
153 } // end namespace Teko
154 
155 #endif
virtual void buildPreconditioner(const Teuchos::RCP< const Epetra_Operator > &A, bool clear=true)
Build this preconditioner from an Epetra_Operator passed in to this object.
virtual void initPreconditioner(bool clearOld=false)
Build the underlying data structure for the preconditioner.
virtual void rebuildPreconditioner(const Teuchos::RCP< const Epetra_Operator > &A)
Rebuild this preconditioner from an Epetra_Operator passed in this to object.
A single Epetra wrapper for all the BlockPreconditioners.
virtual Teuchos::RCP< PreconditionerState > getPreconditionerState()