EpetraExt Package Browser (Single Doxygen Collection) Development
Poisson2dOperator.h
Go to the documentation of this file.
00001 
00002 //@HEADER
00003 // ***********************************************************************
00004 // 
00005 //        AztecOO: An Object-Oriented Aztec Linear Solver Package 
00006 //                 Copyright (2002) Sandia Corporation
00007 // 
00008 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00009 // license for use of this work by or on behalf of the U.S. Government.
00010 // 
00011 // This library is free software; you can redistribute it and/or modify
00012 // it under the terms of the GNU Lesser General Public License as
00013 // published by the Free Software Foundation; either version 2.1 of the
00014 // License, or (at your option) any later version.
00015 //  
00016 // This library is distributed in the hope that it will be useful, but
00017 // WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019 // Lesser General Public License for more details.
00020 //  
00021 // You should have received a copy of the GNU Lesser General Public
00022 // License along with this library; if not, write to the Free Software
00023 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00024 // USA
00025 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00026 // 
00027 // ***********************************************************************
00028 //@HEADER
00029 
00030 #ifndef _POISSON2DOPERATOR_H_
00031 #define _POISSON2DOPERATOR_H_
00032 
00033 class Epetra_MultiVector;
00034 class Epetra_CrsMatrix;
00035 class Epetra_Map;
00036 class Epetra_Import;
00037 class Epetra_BlockMap;
00038 class Epetra_Comm;
00039 #include "Epetra_Operator.h"
00040 
00042 
00046 class Poisson2dOperator: public virtual Epetra_Operator {
00047       
00048  public:
00049 
00051 
00052 
00056   Poisson2dOperator(int nx, int ny, const Epetra_Comm & comm);
00058 
00059   ~Poisson2dOperator();
00061   
00063 
00065 
00074   int SetUseTranspose(bool UseTranspose){useTranspose_ = UseTranspose; return(0);};
00076   
00078 
00080 
00088   int Apply(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
00089 
00091 
00102   int ApplyInverse(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const {return(Apply(X,Y));};
00103   
00105   /* Returns the quantity \f$ \| A \|_\infty\f$ such that
00106      \f[\| A \|_\infty = \max_{1\lei\lem} \sum_{j=1}^n |a_{ij}| \f].
00107      
00108      \warning This method must not be called unless HasNormInf() returns true.
00109   */ 
00110   double NormInf() const {return(8.0);};
00112   
00114 
00116   const char * Label() const{return(Label_);};
00117   
00119   bool UseTranspose() const {return(useTranspose_);};
00120   
00122   bool HasNormInf() const{return(true);};
00123   
00125   const Epetra_Comm & Comm() const{return(comm_);};
00126   
00128   const Epetra_Map & OperatorDomainMap() const {return(*map_);};
00129   
00131   const Epetra_Map & OperatorRangeMap() const {return(*map_);};
00133   
00135 
00136 
00137   Epetra_CrsMatrix * GeneratePrecMatrix() const;
00139 
00140 
00141   int nx_, ny_, myny_;
00142   bool useTranspose_;
00143   const Epetra_Comm & comm_;
00144   Epetra_Map * map_;
00145   int numImports_;
00146   int * importIDs_;
00147   Epetra_Map * importMap_;
00148   Epetra_Import * importer_;
00149   mutable Epetra_MultiVector * importX_;
00150   char * Label_;
00151 };
00152 
00153 #endif /* _POISSON2DOPERATOR_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines