Teko  Version of the Day
 All Classes Files Functions Variables Pages
Teko_TpetraBlockPreconditioner.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_TpetraBlockPreconditioner_hpp__
11 #define __Teko_TpetraBlockPreconditioner_hpp__
12 
13 // #include "Teko_BlockPreconditionerFactory.hpp"
14 #include "Teko_PreconditionerFactory.hpp"
15 #include "Teko_TpetraInverseOpWrapper.hpp"
16 #include "Teko_ConfigDefs.hpp"
17 
18 namespace Teko {
19 namespace TpetraHelpers {
20 
30 class TpetraBlockPreconditioner : public TpetraInverseOpWrapper {
31  public:
38  TpetraBlockPreconditioner(const Teuchos::RCP<const PreconditionerFactory> &bfp);
39 
54  virtual void initPreconditioner(bool clearOld = false);
55 
68  virtual void buildPreconditioner(const Teuchos::RCP<const Tpetra::Operator<ST, LO, GO, NT> > &A,
69  bool clear = true);
70 
84  virtual void buildPreconditioner(const Teuchos::RCP<const Tpetra::Operator<ST, LO, GO, NT> > &A,
85  const Tpetra::MultiVector<ST, LO, GO, NT> &mv,
86  bool clear = true);
87 
100  virtual void rebuildPreconditioner(
101  const Teuchos::RCP<const Tpetra::Operator<ST, LO, GO, NT> > &A);
102 
116  virtual void rebuildPreconditioner(const Teuchos::RCP<const Tpetra::Operator<ST, LO, GO, NT> > &A,
117  const Tpetra::MultiVector<ST, LO, GO, NT> &mv);
118 
128  virtual Teuchos::RCP<PreconditionerState> getPreconditionerState();
129 
139  virtual Teuchos::RCP<const PreconditionerState> getPreconditionerState() const;
140 
141  protected:
142  Teuchos::RCP<const Thyra::LinearOpBase<ST> > extractLinearOp(
143  const Teuchos::RCP<const Tpetra::Operator<ST, LO, GO, NT> > &A) const;
144  Teuchos::RCP<const MappingStrategy> extractMappingStrategy(
145  const Teuchos::RCP<const Tpetra::Operator<ST, LO, GO, NT> > &A) const;
146 
149 
150  // Teuchos::RCP<const BlockPreconditionerFactory> preconFactory_;
151  Teuchos::RCP<const PreconditionerFactory> preconFactory_;
152  Teuchos::RCP<Thyra::PreconditionerBase<ST> > preconObj_;
153  bool firstBuildComplete_;
154 };
155 
156 } // end namespace TpetraHelpers
157 } // end namespace Teko
158 
159 #endif
virtual void buildPreconditioner(const Teuchos::RCP< const Tpetra::Operator< ST, LO, GO, NT > > &A, bool clear=true)
Build this preconditioner from an Epetra_Operator passed in to this object.
virtual Teuchos::RCP< PreconditionerState > getPreconditionerState()
A single Epetra wrapper for all the BlockPreconditioners.
virtual void initPreconditioner(bool clearOld=false)
Build the underlying data structure for the preconditioner.
virtual void rebuildPreconditioner(const Teuchos::RCP< const Tpetra::Operator< ST, LO, GO, NT > > &A)
Rebuild this preconditioner from an Epetra_Operator passed in this to object.