Teko  Version of the Day
 All Classes Files Functions Variables Pages
Teko_AdaptivePreconditionerFactory.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_AdaptivePreconditionerFactory_hpp__
11 #define __Teko_AdaptivePreconditionerFactory_hpp__
12 
13 #include "Teuchos_RCP.hpp"
14 #include "Teko_PreconditionerFactory.hpp"
15 #include "Teko_Utilities.hpp"
16 
17 namespace Teko {
18 
19 struct AdaptiveSolverSettings {
20  int numAppliesCycle = 100;
21  double targetResidualReduction = 0.1;
22 };
23 
57  public:
58  using SizeOrdinalType = Thyra::Ordinal;
59 
61 
62  ~AdaptivePreconditionerFactory() override = default;
63 
64  LinearOp buildPreconditionerOperator(LinearOp& lo, PreconditionerState& state) const override;
65 
66  void initializeFromParameterList(const Teuchos::ParameterList& pl) override;
67 
68  const std::vector<Teuchos::RCP<InverseFactory>>& get_inverses() const { return inverses; }
69 
70  const std::vector<Teuchos::RCP<InverseFactory>>& get_preconditioners() const {
71  return preconditioners;
72  }
73 
74  private:
75  std::vector<Teuchos::RCP<InverseFactory>> inverses;
76  std::vector<Teuchos::RCP<InverseFactory>> preconditioners;
77  std::vector<SizeOrdinalType> maximumSizes;
78  AdaptiveSolverSettings settings{};
79 };
80 
81 } // end namespace Teko
82 
83 #endif
void initializeFromParameterList(const Teuchos::ParameterList &pl) override
This function builds the internals of the preconditioner factory from a parameter list...
Abstract class which block preconditioner factories in Teko should be based on.
LinearOp buildPreconditionerOperator(LinearOp &lo, PreconditionerState &state) const override
Function that is called to build the preconditioner for the linear operator that is passed in...
An implementation of a state object preconditioners.