Teko  Version of the Day
 All Classes Files Functions Variables Pages
Teko_IdentityPreconditionerFactory.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_IdentityPreconditionerFactory.hpp"
11 
12 #include "Thyra_DefaultIdentityLinearOp.hpp"
13 #include "Thyra_DefaultScaledAdjointLinearOp.hpp"
14 
15 using Teuchos::rcp;
16 
17 namespace Teko {
18 
22 
24  LinearOp& lo, PreconditionerState& /* state */) const {
25  return Thyra::scale(scaling_, Thyra::identity(rangeSpace(lo)));
26 }
27 
29 void IdentityPreconditionerFactory::initializeFromParameterList(const Teuchos::ParameterList& pl) {
30  Teko_DEBUG_SCOPE("IdentityPreconditionerFactory::initializeFromParameterList", 10);
31  Teko_DEBUG_MSG_BEGIN(9);
32  DEBUG_STREAM << "Parameter list: " << std::endl;
33  pl.print(DEBUG_STREAM);
34  Teko_DEBUG_MSG_END();
35 
36  // get string specifying default inverse
37  std::string scaleStr = "Scaling";
38  if (pl.isParameter(scaleStr)) scaling_ = pl.get<double>(scaleStr);
39 }
40 
41 } // namespace Teko
LinearOp buildPreconditionerOperator(LinearOp &lo, PreconditionerState &state) const
Create the Identity preconditioner operator.
An implementation of a state object preconditioners.
virtual void initializeFromParameterList(const Teuchos::ParameterList &pl)
Initialize from a parameter list.