Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_LinearOpWithSolveFactoryBase_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_LINEAR_OP_WITH_SOLVE_FACTORY_BASE_DECL_HPP
43 #define THYRA_LINEAR_OP_WITH_SOLVE_FACTORY_BASE_DECL_HPP
44 
45 #include "Thyra_LinearOpWithSolveBase.hpp"
46 #include "Thyra_PreconditionerFactoryBase.hpp"
47 #include "Teuchos_ParameterListAcceptor.hpp"
48 #include "Teuchos_VerboseObject.hpp"
49 
50 
51 namespace Thyra {
52 
53 
403 template<class Scalar>
405  : virtual public Teuchos::Describable,
406  virtual public Teuchos::VerboseObject<LinearOpWithSolveFactoryBase<Scalar> >,
407  virtual public Teuchos::ParameterListAcceptor
408 {
409 public:
410 
413 
418  virtual bool acceptsPreconditionerFactory() const;
419 
441  virtual void setPreconditionerFactory(
442  const RCP<PreconditionerFactoryBase<Scalar> > &precFactory,
443  const std::string &precFactoryName
444  );
445 
451  getPreconditionerFactory() const;
452 
461  virtual void unsetPreconditionerFactory(
462  RCP<PreconditionerFactoryBase<Scalar> > *precFactory = NULL,
463  std::string *precFactoryName = NULL
464  );
465 
467 
470 
474  virtual bool isCompatible(
475  const LinearOpSourceBase<Scalar> &fwdOpSrc ) const = 0;
476 
486  createOp() const = 0;
487 
561  virtual void initializeOp(
562  const RCP<const LinearOpSourceBase<Scalar> > &fwdOpSrc,
564  const ESupportSolveUse supportSolveUse = SUPPORT_SOLVE_UNSPECIFIED
565  ) const = 0;
566 
633  virtual void initializeAndReuseOp(
634  const RCP<const LinearOpSourceBase<Scalar> > &fwdOpSrc,
636  ) const;
637 
697  virtual void uninitializeOp(
699  RCP<const LinearOpSourceBase<Scalar> > *fwdOpSrc = NULL,
700  RCP<const PreconditionerBase<Scalar> > *prec = NULL,
701  RCP<const LinearOpSourceBase<Scalar> > *approxFwdOpSrc = NULL,
702  ESupportSolveUse *supportSolveUse = NULL
703  ) const = 0;
704 
706 
709 
714  virtual bool supportsPreconditionerInputType(const EPreconditionerInputType precOpType) const;
715 
833  virtual void initializePreconditionedOp(
834  const RCP<const LinearOpSourceBase<Scalar> > &fwdOpSrc,
835  const RCP<const PreconditionerBase<Scalar> > &prec,
837  const ESupportSolveUse supportSolveUse = SUPPORT_SOLVE_UNSPECIFIED
838  ) const;
839 
866  const RCP<const LinearOpSourceBase<Scalar> > &fwdOpSrc,
867  const RCP<const LinearOpSourceBase<Scalar> > &approxFwdOpSrc,
869  const ESupportSolveUse supportSolveUse = SUPPORT_SOLVE_UNSPECIFIED
870  ) const;
871 
873 
874 private:
875 
876  // Not defined and not to be called
878  operator=(const LinearOpWithSolveFactoryBase<Scalar>&);
879 
880 };
881 
882 
883 } // namespace Thyra
884 
885 
886 #endif // THYRA_LINEAR_OP_WITH_SOLVE_FACTORY_BASE_DECL_HPP
How the output LOWSB object will be useded for solves in unspecified.
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...
virtual void initializeOp(const RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, LinearOpWithSolveBase< Scalar > *Op, const ESupportSolveUse supportSolveUse=SUPPORT_SOLVE_UNSPECIFIED) const =0
Initialize a pre-created LinearOpWithSolveBase object given a &quot;compatible&quot; LinearOpBase object...
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...
virtual RCP< LinearOpWithSolveBase< Scalar > > createOp() const =0
Create an (uninitialized) LinearOpWithSolveBase object to be initialized later in this-&gt;initializeOp(...
Factory interface for creating LinearOpWithSolveBase objects from compatible LinearOpBase objects...
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...
virtual bool isCompatible(const LinearOpSourceBase< Scalar > &fwdOpSrc) const =0
Check that a LinearOpBase object is compatible with *this factory object.
virtual void uninitializeOp(LinearOpWithSolveBase< Scalar > *Op, RCP< const LinearOpSourceBase< Scalar > > *fwdOpSrc=NULL, RCP< const PreconditionerBase< Scalar > > *prec=NULL, RCP< const LinearOpSourceBase< Scalar > > *approxFwdOpSrc=NULL, ESupportSolveUse *supportSolveUse=NULL) const =0
Uninitialize a LinearOpWithSolveBase object and return its remembered forward linear operator and pot...
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.