Isorropia: Partitioning, Load Balancing and more
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 
00062 class Redistributor : public Isorropia::Redistributor {
00063 public:
00064 
00072   Redistributor(Teuchos::RCP<Isorropia::Epetra::Partitioner> partitioner);
00073 
00081   Redistributor(Teuchos::RCP<Epetra_Map> target_map);
00082 
00090   Redistributor(Isorropia::Epetra::Partitioner *partitioner);
00091 
00099   Redistributor(Epetra_Map *target_map);
00100 
00104   virtual ~Redistributor();
00105 
00111   void redistribute(const Epetra_SrcDistObject& src,
00112         Epetra_DistObject& target);
00113 
00130   Teuchos::RCP<Epetra_CrsGraph>
00131      redistribute(const Epetra_CrsGraph& input_graph, bool callFillComplete= true);
00132 
00150   void redistribute(const Epetra_CrsGraph& input_graph, Epetra_CrsGraph * &outputGraphPtr, bool callFillComplete= true);
00151 
00168   Teuchos::RCP<Epetra_CrsMatrix>
00169      redistribute(const Epetra_CrsMatrix& input_matrix, bool callFillComplete= true);
00170 
00188   void redistribute(const Epetra_CrsMatrix& inputMatrix, Epetra_CrsMatrix * &outputMatrix, bool callFillComplete= true);
00189 
00206   Teuchos::RCP<Epetra_CrsMatrix>
00207      redistribute(const Epetra_RowMatrix& input_matrix, bool callFillComplete= true);
00208 
00209 
00226      void 
00227      redistribute(const Epetra_RowMatrix& inputMatrix, Epetra_CrsMatrix * &outputMatrix, bool callFillComplete= true);
00228 
00239   Teuchos::RCP<Epetra_Vector>
00240      redistribute(const Epetra_Vector& input_vector);
00241 
00252   void
00253   redistribute(const Epetra_Vector& inputVector, Epetra_Vector * &outputVector);
00254 
00266   Teuchos::RCP<Epetra_MultiVector>  
00267      redistribute(const Epetra_MultiVector& input_vector);
00268 
00269 
00281   void 
00282   redistribute(const Epetra_MultiVector& inputVector, Epetra_MultiVector * &outputVector);
00283 
00293   void
00294      redistribute_reverse(const Epetra_Vector& input_vector, Epetra_Vector& output_vector);
00295 
00304   void
00305      redistribute_reverse(const Epetra_MultiVector& input_vector, Epetra_MultiVector& output_vector);
00306 
00307   Epetra_Import &get_importer() { return *importer_;}
00308 
00309 private:
00314   void create_importer(const Epetra_BlockMap& src_map);
00315 
00316   Teuchos::RCP<Isorropia::Epetra::Partitioner> partitioner_;
00317   Teuchos::RCP<Epetra_Import> importer_;
00318   Teuchos::RCP<Epetra_Map> target_map_;
00319 
00320 }; //class Redistributor
00321 
00322 }//namespace Epetra
00323 
00324 }//namespace Isorropia
00325 
00326 #endif //HAVE_EPETRA
00327 
00328 #endif
00329