|
Isorropia: Partitioning, Load Balancing and more Version 3.0
|
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(Isorropia::Epetra::Partitioner *partitioner); 00082 00086 virtual ~Redistributor(); 00087 00093 void redistribute(const Epetra_SrcDistObject& src, 00094 Epetra_DistObject& target); 00095 00112 Teuchos::RCP<Epetra_CrsGraph> 00113 redistribute(const Epetra_CrsGraph& input_graph, bool callFillComplete= true); 00114 00132 void redistribute(const Epetra_CrsGraph& input_graph, Epetra_CrsGraph * &outputGraphPtr, bool callFillComplete= true); 00133 00150 Teuchos::RCP<Epetra_CrsMatrix> 00151 redistribute(const Epetra_CrsMatrix& input_matrix, bool callFillComplete= true); 00152 00170 void redistribute(const Epetra_CrsMatrix& inputMatrix, Epetra_CrsMatrix * &outputMatrix, bool callFillComplete= true); 00171 00188 Teuchos::RCP<Epetra_CrsMatrix> 00189 redistribute(const Epetra_RowMatrix& input_matrix, bool callFillComplete= true); 00190 00191 00208 void 00209 redistribute(const Epetra_RowMatrix& inputMatrix, Epetra_CrsMatrix * &outputMatrix, bool callFillComplete= true); 00210 00221 Teuchos::RCP<Epetra_Vector> 00222 redistribute(const Epetra_Vector& input_vector); 00223 00234 void 00235 redistribute(const Epetra_Vector& inputVector, Epetra_Vector * &outputVector); 00236 00248 Teuchos::RCP<Epetra_MultiVector> 00249 redistribute(const Epetra_MultiVector& input_vector); 00250 00251 00263 void 00264 redistribute(const Epetra_MultiVector& inputVector, Epetra_MultiVector * &outputVector); 00265 00275 void 00276 redistribute_reverse(const Epetra_Vector& input_vector, Epetra_Vector& output_vector); 00277 00286 void 00287 redistribute_reverse(const Epetra_MultiVector& input_vector, Epetra_MultiVector& output_vector); 00288 private: 00293 void create_importer(const Epetra_BlockMap& src_map); 00294 00295 Teuchos::RCP<Isorropia::Epetra::Partitioner> partitioner_; 00296 Teuchos::RCP<Epetra_Import> importer_; 00297 Teuchos::RCP<Epetra_Map> target_map_; 00298 00299 bool created_importer_; 00300 00301 }; //class Redistributor 00302 00303 }//namespace Epetra 00304 00305 }//namespace Isorropia 00306 00307 #endif //HAVE_EPETRA 00308 00309 #endif 00310