Thyra  Version of the Day
Thyra_DefaultBlockedTriangularLinearOpWithSolveFactory_decl.hpp
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Thyra: Interfaces and Support for Abstract Numerical Algorithms
5 // Copyright (2004) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Roscoe A. Bartlett (bartlettra@ornl.gov)
38 //
39 // ***********************************************************************
40 // @HEADER
41 
42 #ifndef THYRA_DEFAULT_BLOCKED_TRIANGULAR_LINEAR_OP_WITH_SOLVE_FACTORY_DECL_HPP
43 #define THYRA_DEFAULT_BLOCKED_TRIANGULAR_LINEAR_OP_WITH_SOLVE_FACTORY_DECL_HPP
44 
45 
46 #include "Thyra_LinearOpWithSolveBase.hpp"
47 #include "Thyra_DefaultBlockedLinearOp.hpp"
48 #include "Thyra_LinearOpSourceBase.hpp"
49 
50 
51 namespace Thyra {
52 
53 
92 template<class Scalar>
94  : virtual public LinearOpWithSolveFactoryBase<Scalar>
95 {
96 public:
97 
100 
113  );
114 
115 
127  const RCP<const LinearOpWithSolveFactoryBase<Scalar> > &lowsf
128  );
129 
130  // 2007/10/02: rabartl: Add versions of constructor that accept an array of
131  // LOWSFB objects when needed. This will be needed for multi-physics
132  // problems for instance!
133 
136 
139 
141 
144 
146  std::string description() const;
147 
149 
152 
154  void setParameterList(RCP<ParameterList> const& paramList);
163 
165 
168 
170  virtual bool acceptsPreconditionerFactory() const;
171 
173  virtual void setPreconditionerFactory(
174  const RCP<PreconditionerFactoryBase<Scalar> > &precFactory,
175  const std::string &precFactoryName
176  );
177 
180  getPreconditionerFactory() const;
181 
183  virtual void unsetPreconditionerFactory(
184  RCP<PreconditionerFactoryBase<Scalar> > *precFactory,
185  std::string *precFactoryName
186  );
187 
189  virtual bool isCompatible(
190  const LinearOpSourceBase<Scalar> &fwdOpSrc
191  ) const;
192 
195 
197  virtual void initializeOp(
198  const RCP<const LinearOpSourceBase<Scalar> > &fwdOpSrc,
200  const ESupportSolveUse supportSolveUse
201  ) const;
202 
204  virtual void initializeAndReuseOp(
205  const RCP<const LinearOpSourceBase<Scalar> > &fwdOpSrc,
207  ) const;
208 
210  virtual void uninitializeOp(
212  RCP<const LinearOpSourceBase<Scalar> > *fwdOpSrc,
213  RCP<const PreconditionerBase<Scalar> > *prec,
214  RCP<const LinearOpSourceBase<Scalar> > *approxFwdOpSrc,
215  ESupportSolveUse *supportSolveUse
216  ) const;
217 
219  virtual bool supportsPreconditionerInputType(
220  const EPreconditionerInputType precOpType
221  ) const;
222 
224  virtual void initializePreconditionedOp(
225  const RCP<const LinearOpSourceBase<Scalar> > &fwdOpSrc,
226  const RCP<const PreconditionerBase<Scalar> > &prec,
228  const ESupportSolveUse supportSolveUse
229  ) const;
230 
233  const RCP<const LinearOpSourceBase<Scalar> > &fwdOpSrc,
234  const RCP<const LinearOpSourceBase<Scalar> > &approxFwdOpSrc,
236  const ESupportSolveUse supportSolveUse
237  ) const;
238 
240 
241 protected:
242 
245 
247  void informUpdatedVerbosityState() const;
248 
250 
251 private:
252 
254 
255  LOWSF_t lowsf_;
256 
257  // Not defined and not to be called
259 
260 };
261 
262 
267 template<class Scalar>
269 defaultBlockedTriangularLinearOpWithSolveFactory(
271  )
272 {
273  return Teuchos::rcp(
275  );
276 }
277 
278 
283 template<class Scalar>
284 RCP<DefaultBlockedTriangularLinearOpWithSolveFactory<Scalar> >
285 defaultBlockedTriangularLinearOpWithSolveFactory(
286  const RCP<const LinearOpWithSolveFactoryBase<Scalar> > &lowsf
287  )
288 {
289  return Teuchos::rcp(
290  new DefaultBlockedTriangularLinearOpWithSolveFactory<Scalar>(lowsf)
291  );
292 }
293 
294 
295 } // namespace Thyra
296 
297 
298 #endif // THYRA_DEFAULT_BLOCKED_TRIANGULAR_LINEAR_OP_WITH_SOLVE_FACTORY_DECL_HPP
Thyra::LinearOpWithSolveFactoryBase
Factory interface for creating LinearOpWithSolveBase objects from compatible LinearOpBase objects.
Definition: Thyra_LinearOpWithSolveFactoryBase_decl.hpp:404
Thyra::DefaultBlockedTriangularLinearOpWithSolveFactory::description
std::string description() const
Definition: Thyra_DefaultBlockedTriangularLinearOpWithSolveFactory_def.hpp:106
Thyra::DefaultBlockedTriangularLinearOpWithSolveFactory::uninitializeOp
virtual void uninitializeOp(LinearOpWithSolveBase< Scalar > *Op, RCP< const LinearOpSourceBase< Scalar > > *fwdOpSrc, RCP< const PreconditionerBase< Scalar > > *prec, RCP< const LinearOpSourceBase< Scalar > > *approxFwdOpSrc, ESupportSolveUse *supportSolveUse) const
Definition: Thyra_DefaultBlockedTriangularLinearOpWithSolveFactory_def.hpp:319
Thyra::DefaultBlockedTriangularLinearOpWithSolveFactory::acceptsPreconditionerFactory
virtual bool acceptsPreconditionerFactory() const
returns false.
Definition: Thyra_DefaultBlockedTriangularLinearOpWithSolveFactory_def.hpp:171
Thyra::ESupportSolveUse
ESupportSolveUse
Enum that specifies how a LinearOpWithSolveBase object will be used for solves after it is constructe...
Definition: Thyra_SolveSupportTypes.hpp:489
Thyra::DefaultBlockedTriangularLinearOpWithSolveFactory::initializeOp
virtual void initializeOp(const RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, LinearOpWithSolveBase< Scalar > *Op, const ESupportSolveUse supportSolveUse) const
Definition: Thyra_DefaultBlockedTriangularLinearOpWithSolveFactory_def.hpp:229
Thyra::DefaultBlockedTriangularLinearOpWithSolveFactory::isCompatible
virtual bool isCompatible(const LinearOpSourceBase< Scalar > &fwdOpSrc) const
Definition: Thyra_DefaultBlockedTriangularLinearOpWithSolveFactory_def.hpp:210
Thyra::LinearOpSourceBase
Base interface for objects that can return a linear operator.
Definition: Thyra_LinearOpSourceBase.hpp:57
Teuchos::RCP
Thyra::LinearOpWithSolveBase
Base class for all linear operators that can support a high-level solve operation.
Definition: Thyra_LinearOpWithSolveBase_decl.hpp:308
Thyra::DefaultBlockedTriangularLinearOpWithSolveFactory::getParameterList
RCP< const ParameterList > getParameterList() const
Definition: Thyra_DefaultBlockedTriangularLinearOpWithSolveFactory_def.hpp:152
Thyra::DefaultBlockedTriangularLinearOpWithSolveFactory::getNonconstParameterList
RCP< ParameterList > getNonconstParameterList()
Definition: Thyra_DefaultBlockedTriangularLinearOpWithSolveFactory_def.hpp:136
Thyra::PreconditionerBase
Simple interface class to access a precreated preconditioner as one or more linear operators objects ...
Definition: Thyra_OperatorSolveTypes.hpp:53
Thyra::DefaultBlockedTriangularLinearOpWithSolveFactory::supportsPreconditionerInputType
virtual bool supportsPreconditionerInputType(const EPreconditionerInputType precOpType) const
Definition: Thyra_DefaultBlockedTriangularLinearOpWithSolveFactory_def.hpp:347
Thyra::EPreconditionerInputType
EPreconditionerInputType
Enum defining the status of a preconditioner object.
Definition: Thyra_SolveSupportTypes.hpp:501
Thyra::DefaultBlockedTriangularLinearOpWithSolveFactory::informUpdatedVerbosityState
void informUpdatedVerbosityState() const
Overridden from Teuchos::VerboseObjectBase.
Definition: Thyra_DefaultBlockedTriangularLinearOpWithSolveFactory_def.hpp:393
Thyra::DefaultBlockedTriangularLinearOpWithSolveFactory::setParameterList
void setParameterList(RCP< ParameterList > const &paramList)
Definition: Thyra_DefaultBlockedTriangularLinearOpWithSolveFactory_def.hpp:126
Thyra::DefaultBlockedTriangularLinearOpWithSolveFactory::initializeAndReuseOp
virtual void initializeAndReuseOp(const RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, LinearOpWithSolveBase< Scalar > *Op) const
Definition: Thyra_DefaultBlockedTriangularLinearOpWithSolveFactory_def.hpp:308
Thyra::DefaultBlockedTriangularLinearOpWithSolveFactory::getPreconditionerFactory
virtual RCP< PreconditionerFactoryBase< Scalar > > getPreconditionerFactory() const
Returns null .
Definition: Thyra_DefaultBlockedTriangularLinearOpWithSolveFactory_def.hpp:191
Thyra::DefaultBlockedTriangularLinearOpWithSolveFactory
Implicit subclass that takes a blocked triangular LOWB object and turns it into a LOWSB object.
Definition: Thyra_DefaultBlockedTriangularLinearOpWithSolveFactory_decl.hpp:93
Thyra::DefaultBlockedTriangularLinearOpWithSolveFactory::initializeApproxPreconditionedOp
virtual void initializeApproxPreconditionedOp(const RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, const RCP< const LinearOpSourceBase< Scalar > > &approxFwdOpSrc, LinearOpWithSolveBase< Scalar > *Op, const ESupportSolveUse supportSolveUse) const
Definition: Thyra_DefaultBlockedTriangularLinearOpWithSolveFactory_def.hpp:376
Thyra::DefaultBlockedTriangularLinearOpWithSolveFactory::getValidParameters
RCP< const ParameterList > getValidParameters() const
Definition: Thyra_DefaultBlockedTriangularLinearOpWithSolveFactory_def.hpp:160
Thyra::DefaultBlockedTriangularLinearOpWithSolveFactory::initializePreconditionedOp
virtual void initializePreconditionedOp(const RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, const RCP< const PreconditionerBase< Scalar > > &prec, LinearOpWithSolveBase< Scalar > *Op, const ESupportSolveUse supportSolveUse) const
Definition: Thyra_DefaultBlockedTriangularLinearOpWithSolveFactory_def.hpp:362
Thyra::DefaultBlockedTriangularLinearOpWithSolveFactory::unsetParameterList
RCP< ParameterList > unsetParameterList()
Definition: Thyra_DefaultBlockedTriangularLinearOpWithSolveFactory_def.hpp:144
Thyra::DefaultBlockedTriangularLinearOpWithSolveFactory::setPreconditionerFactory
virtual void setPreconditionerFactory(const RCP< PreconditionerFactoryBase< Scalar > > &precFactory, const std::string &precFactoryName)
Throws exception.
Definition: Thyra_DefaultBlockedTriangularLinearOpWithSolveFactory_def.hpp:179
Thyra::DefaultBlockedTriangularLinearOpWithSolveFactory::createOp
virtual RCP< LinearOpWithSolveBase< Scalar > > createOp() const
Definition: Thyra_DefaultBlockedTriangularLinearOpWithSolveFactory_def.hpp:221
Teuchos::ConstNonconstObjectContainer
Thyra::DefaultBlockedTriangularLinearOpWithSolveFactory::unsetPreconditionerFactory
virtual void unsetPreconditionerFactory(RCP< PreconditionerFactoryBase< Scalar > > *precFactory, std::string *precFactoryName)
Throws exception.
Definition: Thyra_DefaultBlockedTriangularLinearOpWithSolveFactory_def.hpp:198
Thyra::PreconditionerFactoryBase
Factory interface for creating preconditioner objects from LinearOpBase objects.
Definition: Thyra_OperatorSolveTypes.hpp:54
Thyra::DefaultBlockedTriangularLinearOpWithSolveFactory::getUnderlyingLOWSF
RCP< LinearOpWithSolveFactoryBase< Scalar > > getUnderlyingLOWSF()
Definition: Thyra_DefaultBlockedTriangularLinearOpWithSolveFactory_def.hpp:87