Teko Version of the Day
Loading...
Searching...
No Matches
Teko_DiagnosticPreconditionerFactory.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_DiagnosticPreconditionerFactory_hpp__
11#define __Teko_DiagnosticPreconditionerFactory_hpp__
12
13#include "Teuchos_Time.hpp"
14
15// Teko includes
16#include "Teko_PreconditionerFactory.hpp"
17
18namespace Teko {
19
38 public:
41
48 DiagnosticPreconditionerFactory(const Teuchos::RCP<Teko::InverseFactory>& invFactory,
49 const std::string& label,
50 const Teuchos::RCP<std::ostream>& os = Teuchos::null,
51 bool printResidual = false);
52
60 DiagnosticPreconditionerFactory(const Teuchos::RCP<Teko::InverseFactory>& invFactory,
61 const Teuchos::RCP<Teko::InverseFactory>& precFactory,
62 const std::string& label,
63 const Teuchos::RCP<std::ostream>& os = Teuchos::null,
64 bool printResidual = false);
65
68
82 virtual LinearOp buildPreconditionerOperator(LinearOp& lo, PreconditionerState& state) const;
83
85
86
97 virtual void initializeFromParameterList(const Teuchos::ParameterList& settings);
98
111 virtual Teuchos::RCP<Teuchos::ParameterList> getRequestedParameters() const;
112
124 virtual bool updateRequestedParameters(const Teuchos::ParameterList& pl);
125
127
128 int numInitialBuilds() const { return buildTimer_->numCalls(); }
129 double totalInitialBuildTime() const;
130
131 int numRebuilds() const { return rebuildTimer_->numCalls(); }
132 double totalRebuildTime() const;
133
134 private:
135 void initTimers(const std::string& label);
136
137 Teuchos::RCP<std::ostream> outputStream_;
138 Teuchos::RCP<Teko::InverseFactory> invFactory_;
139 Teuchos::RCP<Teko::InverseFactory> precFactory_;
140 std::string diagString_;
141 bool printResidual_;
142
143 mutable Teuchos::RCP<Teuchos::Time>
144 buildTimer_; // only first pass construction time (no rebuild)
145 mutable Teuchos::RCP<Teuchos::Time>
146 precBuildTimer_; // only first pass construction time (no rebuild)
147 mutable Teuchos::RCP<Teuchos::Time> rebuildTimer_; // rebuild-construction timer (no build)
148 mutable Teuchos::RCP<Teuchos::Time> precRebuildTimer_; // rebuild-construction timer (no build)
149};
150
151} // end namespace Teko
152
153#endif
virtual ~DiagnosticPreconditionerFactory()
default destructor: prints out diagnostic string
virtual bool updateRequestedParameters(const Teuchos::ParameterList &pl)
Update this object with the fields from a parameter list.
virtual void initializeFromParameterList(const Teuchos::ParameterList &settings)
This function builds the internals of the preconditioner factory from a parameter list.
DiagnosticPreconditionerFactory()
Default constructor, for use with the AutoClone class.
virtual Teuchos::RCP< Teuchos::ParameterList > getRequestedParameters() const
Request the additional parameters this preconditioner factory needs.
virtual LinearOp buildPreconditionerOperator(LinearOp &lo, PreconditionerState &state) const
Function that is called to build the preconditioner for the linear operator that is passed in.
Abstract class which block preconditioner factories in Teko should be based on.
An implementation of a state object preconditioners.