Teko Version of the Day
Loading...
Searching...
No Matches
Teko_TimingsSIMPLEPreconditionerFactory.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_TimingsSIMPLEPreconditionerFactory_hpp__
11#define __Teko_TimingsSIMPLEPreconditionerFactory_hpp__
12
13#include "Teko_BlockPreconditionerFactory.hpp"
14#include "Teko_InverseFactory.hpp"
16
17#include "Teuchos_Time.hpp"
18
19namespace Teko {
20namespace NS {
21
22// Declaration of the preconditioner factory
39class TimingsSIMPLEPreconditionerFactory : public BlockPreconditionerFactory {
40 public:
41 // Constructor
42 TimingsSIMPLEPreconditionerFactory(const Teuchos::RCP<InverseFactory>& inverse, double alpha);
43
44 // Constructor
45 TimingsSIMPLEPreconditionerFactory(const Teuchos::RCP<InverseFactory>& invVelFactory,
46 const Teuchos::RCP<InverseFactory>& invPrsFactory,
47 double alpha);
48
51
54
55 // Function inherited from BlockPreconditionerFactory
56 LinearOp buildPreconditionerOperator(BlockedLinearOp& blo, BlockPreconditionerState& state) const;
57
59 virtual void setMassMatrix(Teko::LinearOp& mass) { massMatrix_ = mass; }
60
62 virtual Teuchos::RCP<Teuchos::ParameterList> getRequestedParameters() const;
63
65 virtual bool updateRequestedParameters(const Teuchos::ParameterList& pl);
66
68 virtual void initializeFromParameterList(const Teuchos::ParameterList& pl);
69
70 protected:
72
73 // class members
74 Teuchos::RCP<InverseFactory> customHFactory_;
75 Teuchos::RCP<InverseFactory> invVelFactory_;
76 Teuchos::RCP<InverseFactory> invPrsFactory_;
77 double alpha_;
78 DiagonalType fInverseType_;
79 // enum FInverseType {Diagonal,Lumped,AbsRowSum,Custom} fInverseType_;
80
81 bool useMass_;
82 Teko::LinearOp massMatrix_;
83
84 // Info for the block-diagonal approximation to H if used.
85 mutable Teuchos::ParameterList BlkDiagList_;
86
87 mutable Teuchos::Time constrTotal_;
88 mutable Teuchos::Time subTotal_;
89 mutable int constrCount_;
90
91 mutable Teuchos::RCP<DiagnosticLinearOp> timed_HBt_;
92 mutable Teuchos::RCP<DiagnosticLinearOp> timed_B_;
93 mutable Teuchos::RCP<DiagnosticLinearOp> timed_invF_;
94 mutable Teuchos::RCP<DiagnosticLinearOp> timed_invS_;
95 mutable Teuchos::RCP<DiagnosticLinearOp> timed_iU_t_iL_;
96};
97
98} // end namespace NS
99} // end namespace Teko
100
101#endif
Abstract class which block preconditioner factories in Teko should be based on.
virtual LinearOp buildPreconditionerOperator(BlockedLinearOp &blo, BlockPreconditionerState &state) const =0
Function that is called to build the preconditioner for the linear operator that is passed in.
An implementation of a state object for block preconditioners.
virtual bool updateRequestedParameters(const Teuchos::ParameterList &pl)
For assisting in construction of the preconditioner.
virtual void initializeFromParameterList(const Teuchos::ParameterList &pl)
Initialize from a parameter list.
LinearOp buildPreconditionerOperator(BlockedLinearOp &blo, BlockPreconditionerState &state) const
Function that is called to build the preconditioner for the linear operator that is passed in.
virtual void setMassMatrix(Teko::LinearOp &mass)
Set the mass matrix for this factory.
virtual ~TimingsSIMPLEPreconditionerFactory()
Destructor that outputs construction timings.
virtual Teuchos::RCP< Teuchos::ParameterList > getRequestedParameters() const
For assisting in construction of the preconditioner.