Teko Version of the Day
Loading...
Searching...
No Matches
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
17namespace Teko {
18
19struct AdaptiveSolverSettings {
20 int numAppliesCycle = 100;
21 double targetResidualReduction = 0.1;
22};
23
56class AdaptivePreconditionerFactory : public PreconditionerFactory {
57 public:
58 using SizeOrdinalType = Thyra::Ordinal;
59
60 AdaptivePreconditionerFactory() = default;
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
LinearOp buildPreconditionerOperator(LinearOp &lo, PreconditionerState &state) const override
Function that is called to build the preconditioner for the linear operator that is passed in.
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.
An implementation of a state object preconditioners.