Teko
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
src
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
17
using namespace
Thyra;
18
19
namespace
Teko {
20
22
23
LinearOp
BlockPreconditionerFactory::buildPreconditionerOperator
(LinearOp &lo,
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
35
bool
BlockPreconditionerFactory::isCompatible
(
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
Teko::BlockPreconditionerFactory::buildPreconditionerOperator
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.
Teko::BlockPreconditionerFactory::isCompatible
bool isCompatible(const Thyra::LinearOpSourceBase< double > &fwdOpSrc) const
is this operator compatiable with the preconditioner factory?
Definition
Teko_BlockPreconditionerFactory.cpp:35
Teko::BlockPreconditionerState
An implementation of a state object for block preconditioners.
Definition
Teko_BlockPreconditionerFactory.hpp:43
Teko::PreconditionerState
An implementation of a state object preconditioners.
Definition
Teko_PreconditionerState.hpp:34
Teko::PreconditionerState::setInitialized
virtual void setInitialized(bool init=true)
Definition
Teko_PreconditionerState.hpp:67
Generated by
1.17.0