Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_LinearOpWithSolveFactoryBase_def.hpp
1 // @HEADER
2 // *****************************************************************************
3 // Thyra: Interfaces and Support for Abstract Numerical Algorithms
4 //
5 // Copyright 2004 NTESS and the Thyra contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef THYRA_LINEAR_OP_WITH_SOLVE_FACTORY_BASE_DEF_HPP
11 #define THYRA_LINEAR_OP_WITH_SOLVE_FACTORY_BASE_DEF_HPP
12 
13 
14 #include "Thyra_LinearOpWithSolveFactoryBase_decl.hpp"
15 
16 
17 namespace Thyra {
18 
19 
20 template<class Scalar>
22 {
23  return false;
24 }
25 
26 
27 template<class Scalar>
29  const RCP<PreconditionerFactoryBase<Scalar> > &/* precFactory */
30  ,const std::string &/* precFactoryName */
31  )
32 {
34  true,std::logic_error
35  ,"Error, the concrete implementation described as \'"<<this->description()<<"\' did not override this "
36  "setPreconditionerFactory(...) function and the default implementation throws this exception!"
37  );
38 }
39 
40 
41 template<class Scalar>
44 {
45  return Teuchos::null;
46 }
47 
48 
49 template<class Scalar>
52  ,std::string *precFactoryName
53  )
54 {
55  if(precFactory) *precFactory = Teuchos::null;
56  if(precFactoryName) *precFactoryName = "";
57 }
58 
59 
60 template<class Scalar>
62  const RCP<const LinearOpSourceBase<Scalar> > &fwdOpSrc
64  ) const
65 {
66  this->initializeOp(fwdOpSrc,Op);
67 }
68 
69 
70 template<class Scalar>
72  const EPreconditionerInputType /* precOpType */
73  ) const
74 {
75  return false;
76 }
77 
78 
79 template<class Scalar>
81  const RCP<const LinearOpSourceBase<Scalar> > &/* fwdOpSrc */
82  ,const RCP<const PreconditionerBase<Scalar> > &/* prec */
84  ,const ESupportSolveUse /* supportSolveUse */
85  ) const
86 {
88  true,std::logic_error
89  ,"Error, the concrete implementation described as \'"<<this->description()<<"\' did not override this "
90  "initializePreconditionedOp(...) function and the default implementation throws this exception!"
91  );
92 }
93 
94 
95 template<class Scalar>
97  const RCP<const LinearOpSourceBase<Scalar> > &/* fwdOpSrc */
98  ,const RCP<const LinearOpSourceBase<Scalar> > &/* approxFwdOpSrc */
100  ,const ESupportSolveUse /* supportSolveUse */
101  ) const
102 {
104  true,std::logic_error
105  ,"Error, the concrete implementation described as \'"<<this->description()<<"\' did not override this "
106  "initializePreconditionedOp(...) function and the default implementation throws this exception!"
107  );
108 }
109 
110 
111 } // namespace Thyra
112 
113 
114 #endif // THYRA_LINEAR_OP_WITH_SOLVE_FACTORY_BASE_DEF_HPP
Base class for all linear operators that can support a high-level solve operation.
virtual void initializePreconditionedOp(const RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, const RCP< const PreconditionerBase< Scalar > > &prec, LinearOpWithSolveBase< Scalar > *Op, const ESupportSolveUse supportSolveUse=SUPPORT_SOLVE_UNSPECIFIED) const
Initialize a pre-created LinearOpWithSolveBase object given a &quot;compatible&quot; LinearOpBase object and an...
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
virtual bool acceptsPreconditionerFactory() const
Determines if *this accepts external preconditioner factories.
Simple interface class to access a precreated preconditioner as one or more linear operators objects ...
virtual void unsetPreconditionerFactory(RCP< PreconditionerFactoryBase< Scalar > > *precFactory=NULL, std::string *precFactoryName=NULL)
Unset the preconditioner factory (if one is set).
virtual void initializeAndReuseOp(const RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, LinearOpWithSolveBase< Scalar > *Op) const
Initialize a pre-created LinearOpWithSolveBase object given a &quot;compatible&quot; LinearOpBase object but al...
virtual void initializeApproxPreconditionedOp(const RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, const RCP< const LinearOpSourceBase< Scalar > > &approxFwdOpSrc, LinearOpWithSolveBase< Scalar > *Op, const ESupportSolveUse supportSolveUse=SUPPORT_SOLVE_UNSPECIFIED) const
Initialize a pre-created LinearOpWithSolveBase object given a &quot;compatible&quot; forward LinearOpBase objec...
Factory interface for creating preconditioner objects from LinearOpBase objects.
Base interface for objects that can return a linear operator.
ESupportSolveUse
Enum that specifies how a LinearOpWithSolveBase object will be used for solves after it is constructe...
EPreconditionerInputType
Enum defining the status of a preconditioner object.
virtual bool supportsPreconditionerInputType(const EPreconditionerInputType precOpType) const
Determines if *this supports given preconditioner type.
virtual RCP< PreconditionerFactoryBase< Scalar > > getPreconditionerFactory() const
Get a preconditioner factory object.
virtual void setPreconditionerFactory(const RCP< PreconditionerFactoryBase< Scalar > > &precFactory, const std::string &precFactoryName)
Set a preconditioner factory object.