Teko Version of the Day
Loading...
Searching...
No Matches
Teko_BlockPreconditionerFactory.cpp
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#include "Teko_BlockPreconditionerFactory.hpp"
11
12#include "Teko_Preconditioner.hpp"
13#include "Teko_InverseLibrary.hpp"
14
15#include "Thyra_DefaultPreconditioner.hpp"
16
17using namespace Thyra;
18
19namespace Teko {
20
22
24 PreconditionerState &state) const {
25 // get the blocked linear operator
26 RCP<LinearOpBase<double> > loA = Teuchos::rcp_const_cast<Thyra::LinearOpBase<double> >(lo);
27 BlockedLinearOp A = Teuchos::rcp_dynamic_cast<Thyra::PhysicallyBlockedLinearOpBase<double> >(loA);
28
29 state.setInitialized(false);
30
31 return buildPreconditionerOperator(A, dynamic_cast<BlockPreconditionerState &>(state));
32}
33
36 const Thyra::LinearOpSourceBase<double> &fwdOpSrc) const {
37 RCP<const Thyra::PhysicallyBlockedLinearOpBase<double> > A =
38 Teuchos::rcp_dynamic_cast<const Thyra::PhysicallyBlockedLinearOpBase<double> >(
39 fwdOpSrc.getOp());
40 return A != Teuchos::null;
41}
42
43} // end namespace Teko
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.
bool isCompatible(const Thyra::LinearOpSourceBase< double > &fwdOpSrc) const
is this operator compatiable with the preconditioner factory?
An implementation of a state object for block preconditioners.
An implementation of a state object preconditioners.
virtual void setInitialized(bool init=true)