Isorropia_EpetraRedistributor.hpp

Go to the documentation of this file.
00001 //@HEADER
00002 /*
00003 ************************************************************************
00004 
00005               Isorropia: Partitioning and Load Balancing Package
00006                 Copyright (2006) 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 
00026 ************************************************************************
00027 */
00028 //@HEADER
00029 
00030 #ifndef _Isorropia_EpetraRedistributor_hpp_
00031 #define _Isorropia_EpetraRedistributor_hpp_
00032 
00033 #include <Isorropia_Redistributor.hpp>
00034 #include <Isorropia_ConfigDefs.hpp>
00035 #include <Teuchos_RCP.hpp>
00036 #include <Teuchos_ParameterList.hpp>
00037 
00038 #ifdef HAVE_EPETRA
00039 class Epetra_Map;
00040 class Epetra_BlockMap;
00041 class Epetra_Import;
00042 class Epetra_Vector;
00043 class Epetra_MultiVector;
00044 class Epetra_CrsGraph;
00045 class Epetra_CrsMatrix;
00046 class Epetra_RowMatrix;
00047 class Epetra_LinearProblem;
00048 class Epetra_SrcDistObject;
00049 class Epetra_DistObject;
00050 
00051 namespace Isorropia {
00052 
00053 namespace Epetra {
00054   class Partitioner;
00055 
00061 class Redistributor : public Isorropia::Redistributor {
00062 public:
00069   Redistributor(Teuchos::RCP<Isorropia::Epetra::Partitioner> partitioner);
00070 
00073   virtual ~Redistributor();
00074 
00079   void redistribute(const Epetra_SrcDistObject& src,
00080         Epetra_DistObject& target);
00081 
00097   Teuchos::RCP<Epetra_CrsGraph>
00098      redistribute(const Epetra_CrsGraph& input_graph, bool callFillComplete= true);
00099 
00115   Teuchos::RCP<Epetra_CrsMatrix>
00116      redistribute(const Epetra_CrsMatrix& input_matrix, bool callFillComplete= true);
00117 
00133   Teuchos::RCP<Epetra_CrsMatrix>
00134      redistribute(const Epetra_RowMatrix& input_matrix, bool callFillComplete= true);
00135 
00145   Teuchos::RCP<Epetra_Vector>
00146      redistribute(const Epetra_Vector& input_vector);
00147 
00157   Teuchos::RCP<Epetra_MultiVector>  
00158      redistribute(const Epetra_MultiVector& input_vector);
00159 
00167   void
00168      redistribute_reverse(const Epetra_Vector& input_vector, Epetra_Vector& output_vector);
00169 
00178   void
00179      redistribute_reverse(const Epetra_MultiVector& input_vector, Epetra_MultiVector& output_vector);
00180 private:
00185   void create_importer(const Epetra_BlockMap& src_map);
00186 
00187   Teuchos::RCP<Isorropia::Epetra::Partitioner> partitioner_;
00188   Teuchos::RCP<Epetra_Import> importer_;
00189   Teuchos::RCP<Epetra_Map> target_map_;
00190 
00191   bool created_importer_;
00192 
00193 }; //class Redistributor
00194 
00195 }//namespace Epetra
00196 
00197 }//namespace Isorropia
00198 
00199 #endif //HAVE_EPETRA
00200 
00201 #endif
00202