Thyra_EpetraLinearOp.hpp

Go to the documentation of this file.
00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 //               Thyra: Trilinos Solver Framework Core
00005 //                 Copyright (2004) Sandia Corporation
00006 // 
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 // 
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //  
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //  
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00025 // 
00026 // ***********************************************************************
00027 // @HEADER
00028 
00029 #ifndef THYRA_EPETRA_LINEAR_OP_HPP
00030 #define THYRA_EPETRA_LINEAR_OP_HPP
00031 
00032 #include "Thyra_EpetraLinearOpBase.hpp"
00033 #include "Thyra_SpmdVectorSpaceBase.hpp"
00034 
00035 namespace Thyra {
00036 
00058 class EpetraLinearOp : virtual public EpetraLinearOpBase {
00059 public:
00060 
00062   using SingleScalarEuclideanLinearOpBase<double>::euclideanApply;
00063 
00066 
00068   typedef double Scalar;
00069 
00071 
00074 
00079   EpetraLinearOp();
00080 
00082   EpetraLinearOp(
00083     const Teuchos::RefCountPtr<Epetra_Operator>                        &op
00084     ,ETransp                                                           opTrans         = NOTRANS
00085     ,EApplyEpetraOpAs                                                  applyAs         = EPETRA_OP_APPLY_APPLY
00086     ,EAdjointEpetraOp                                                  adjointSupport  = EPETRA_OP_ADJOINT_SUPPORTED
00087     ,const Teuchos::RefCountPtr< const SpmdVectorSpaceBase<Scalar> >   &spmdRange       = Teuchos::null
00088     ,const Teuchos::RefCountPtr< const SpmdVectorSpaceBase<Scalar> >   &spmdDomain      = Teuchos::null
00089     );
00090 
00131   void initialize(
00132     const Teuchos::RefCountPtr<Epetra_Operator>                        &op
00133     ,ETransp                                                           opTrans         = NOTRANS
00134     ,EApplyEpetraOpAs                                                  applyAs         = EPETRA_OP_APPLY_APPLY
00135     ,EAdjointEpetraOp                                                  adjointSupport  = EPETRA_OP_ADJOINT_SUPPORTED
00136     ,const Teuchos::RefCountPtr< const SpmdVectorSpaceBase<Scalar> >   &spmdRange       = Teuchos::null
00137     ,const Teuchos::RefCountPtr< const SpmdVectorSpaceBase<Scalar> >   &spmdDomain      = Teuchos::null
00138     );
00139   
00147   void uninitialize(
00148     Teuchos::RefCountPtr<Epetra_Operator>                       *op             = NULL
00149     ,ETransp                                                    *opTrans        = NULL
00150     ,EApplyEpetraOpAs                                           *applyAs        = NULL
00151     ,EAdjointEpetraOp                                           *adjointSupport = NULL
00152     ,Teuchos::RefCountPtr< const SpmdVectorSpaceBase<Scalar> >  *spmdRange       = NULL
00153     ,Teuchos::RefCountPtr< const SpmdVectorSpaceBase<Scalar> >  *spmdDomain      = NULL
00154     );
00155 
00163   Teuchos::RefCountPtr< const SpmdVectorSpaceBase<Scalar> > spmdRange() const;
00164 
00172   Teuchos::RefCountPtr< const SpmdVectorSpaceBase<Scalar> > spmdDomain() const;
00173 
00175   Teuchos::RefCountPtr<Epetra_Operator> epetra_op();
00176 
00178   Teuchos::RefCountPtr<const Epetra_Operator> epetra_op() const;
00179 
00181 
00184 
00186   void getEpetraOpView(
00187     Teuchos::RefCountPtr<Epetra_Operator>   *epetraOp
00188     ,ETransp                                *epetraOpTransp
00189     ,EApplyEpetraOpAs                       *epetraOpApplyAs
00190     ,EAdjointEpetraOp                       *epetraOpAdjointSupport
00191     );
00193   void getEpetraOpView(
00194     Teuchos::RefCountPtr<const Epetra_Operator>   *epetraOp
00195     ,ETransp                                      *epetraOpTransp
00196     ,EApplyEpetraOpAs                             *epetraOpApplyAs
00197     ,EAdjointEpetraOp                             *epetraOpAdjointSupport
00198     ) const;
00199 
00201 
00204 
00206   bool opSupported(ETransp M_trans) const;
00207   
00209   
00212 
00214   Teuchos::RefCountPtr< const ScalarProdVectorSpaceBase<Scalar> > rangeScalarProdVecSpc() const;
00216   Teuchos::RefCountPtr< const ScalarProdVectorSpaceBase<Scalar> > domainScalarProdVecSpc() const;
00218   void euclideanApply(
00219     const ETransp                     M_trans
00220     ,const MultiVectorBase<Scalar>    &X
00221     ,MultiVectorBase<Scalar>          *Y
00222     ,const Scalar                     alpha
00223     ,const Scalar                     beta
00224     ) const;
00225 
00227   
00230 
00232   Teuchos::RefCountPtr<const LinearOpBase<Scalar> > clone() const;
00233 
00235 
00238   
00240   std::string description() const;
00242   void describe(
00243     Teuchos::FancyOStream                &out
00244     ,const Teuchos::EVerbosityLevel      verbLevel
00245     ) const;
00246   
00248   
00249 protected:
00250 
00253 
00264   virtual Teuchos::RefCountPtr< const SpmdVectorSpaceBase<Scalar> > 
00265   allocateDomain(
00266     const Teuchos::RefCountPtr<Epetra_Operator>  &op 
00267     ,ETransp                                     op_trans 
00268     ) const; 
00269   
00280   virtual Teuchos::RefCountPtr< const SpmdVectorSpaceBase<Scalar> >
00281   allocateRange( 
00282     const Teuchos::RefCountPtr<Epetra_Operator>  &op 
00283     ,ETransp                                     op_trans 
00284     ) const; 
00285 
00287 
00288 private:
00289 
00290   // ////////////////////////////////////
00291   // Private data members
00292 
00293   Teuchos::RefCountPtr<Epetra_Operator>                     op_;
00294   ETransp                                                   opTrans_;
00295   EApplyEpetraOpAs                                          applyAs_;
00296   EAdjointEpetraOp                                          adjointSupport_;
00297   Teuchos::RefCountPtr< const SpmdVectorSpaceBase<Scalar> >  range_;
00298   Teuchos::RefCountPtr< const SpmdVectorSpaceBase<Scalar> >  domain_;
00299   Teuchos::RefCountPtr< const ScalarProdVectorSpaceBase<Scalar> >  sp_range_;
00300   Teuchos::RefCountPtr< const ScalarProdVectorSpaceBase<Scalar> >  sp_domain_;
00301   // ////////////////////////////////////
00302   // Private member functions
00303 
00304   const Epetra_Map& getRangeMap() const;
00305   const Epetra_Map& getDomainMap() const;
00306 
00307 };  // end class EpetraLinearOp
00308 
00309 } // end namespace Thyra
00310 
00311 #endif  // THYRA_EPETRA_LINEAR_OP_HPP

Generated on Thu Sep 18 12:37:58 2008 for Epetra Package Browser (Single Doxygen Collection) by doxygen 1.3.9.1