Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members

Isorropia_Epetra.hpp

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 Questions? Contact Alan Williams (william@sandia.gov)
00026                 or Erik Boman    (egboman@sandia.gov)
00027 
00028 ************************************************************************
00029 */
00030 //@HEADER
00031 
00032 #ifndef _Isorropia_Epetra_hpp_
00033 #define _Isorropia_Epetra_hpp_
00034 
00035 #include <Isorropia_configdefs.hpp>
00036 #include <Teuchos_RefCountPtr.hpp>
00037 #include <Teuchos_ParameterList.hpp>
00038 
00039 #ifdef HAVE_EPETRA
00040 class Epetra_Comm;
00041 class Epetra_Map;
00042 class Epetra_BlockMap;
00043 class Epetra_Import;
00044 class Epetra_Vector;
00045 class Epetra_MultiVector;
00046 class Epetra_RowMatrix;
00047 class Epetra_CrsGraph;
00048 class Epetra_CrsMatrix;
00049 class Epetra_LinearProblem;
00050 #endif
00051 
00055 namespace Isorropia {
00056   class Partitioner;
00057   class CostDescriber;
00058 
00062 namespace Epetra {
00063 
00064 #ifdef HAVE_EPETRA
00065 
00083 Teuchos::RefCountPtr<Isorropia::Partitioner>
00084 create_partitioner(Teuchos::RefCountPtr<const Epetra_CrsGraph> input_graph,
00085        const Teuchos::ParameterList& paramlist);
00086 
00104 Teuchos::RefCountPtr<Isorropia::Partitioner>
00105 create_partitioner(Teuchos::RefCountPtr<const Epetra_CrsGraph> input_graph,
00106        Teuchos::RefCountPtr<const Isorropia::CostDescriber> costs,
00107        const Teuchos::ParameterList& paramlist);
00108 
00126 Teuchos::RefCountPtr<Isorropia::Partitioner>
00127 create_partitioner(Teuchos::RefCountPtr<const Epetra_RowMatrix> input_matrix,
00128        const Teuchos::ParameterList& paramlist);
00129 
00147 Teuchos::RefCountPtr<Isorropia::Partitioner>
00148 create_partitioner(Teuchos::RefCountPtr<const Epetra_RowMatrix> input_matrix,
00149        Teuchos::RefCountPtr<const Isorropia::CostDescriber> costs,
00150        const Teuchos::ParameterList& paramlist);
00151 
00157 Teuchos::RefCountPtr<Epetra_Map>
00158 create_target_map(const Epetra_Comm& comm, Partitioner& partitioner);
00159 
00181 Teuchos::RefCountPtr<Epetra_CrsMatrix>
00182   create_balanced_copy(const Epetra_CrsMatrix& input_matrix,
00183                      Teuchos::ParameterList& paramlist);
00184 
00196 Teuchos::RefCountPtr<Epetra_CrsMatrix>
00197 create_balanced_copy(const Epetra_RowMatrix& input_matrix);
00198 
00211 Teuchos::RefCountPtr<Epetra_CrsMatrix>
00212   create_balanced_copy(const Epetra_CrsMatrix& input_matrix,
00213                        const Epetra_Vector& row_weights);
00214 
00227 Teuchos::RefCountPtr<Epetra_CrsMatrix>
00228   create_balanced_copy(const Epetra_RowMatrix& input_matrix,
00229                        const Epetra_Vector& row_weights);
00230 
00250 Teuchos::RefCountPtr<Epetra_CrsGraph>
00251 create_balanced_copy(const Epetra_CrsGraph& input_graph,
00252                      Teuchos::ParameterList& paramlist);
00253 
00267 Teuchos::RefCountPtr<Epetra_CrsGraph>
00268   create_balanced_copy(const Epetra_CrsGraph& input_graph,
00269                        const Epetra_Vector& row_weights);
00270 
00287 Teuchos::RefCountPtr<Epetra_LinearProblem>
00288   create_balanced_copy(const Epetra_LinearProblem& input_problem);
00289 
00304 Teuchos::RefCountPtr<Epetra_CrsMatrix>
00305   redistribute_rows(const Epetra_CrsMatrix& input_matrix,
00306                     const Epetra_Map& target_rowmap,
00307                     Epetra_Import* importer=0);
00308 
00323 Teuchos::RefCountPtr<Epetra_CrsMatrix>
00324   redistribute_rows(const Epetra_RowMatrix& input_matrix,
00325                     const Epetra_Map& target_rowmap,
00326                     Epetra_Import* importer=0);
00327 
00340 Teuchos::RefCountPtr<Epetra_CrsGraph>
00341   redistribute_rows(const Epetra_CrsGraph& input_graph,
00342                     const Epetra_Map& target_rowmap,
00343                     Epetra_Import* importer=0);
00344 
00357 Teuchos::RefCountPtr<Epetra_MultiVector>
00358   redistribute(const Epetra_MultiVector& input,
00359                const Epetra_BlockMap& target_map,
00360                Epetra_Import* importer=0);
00361 
00374 Teuchos::RefCountPtr<Epetra_Vector>
00375   redistribute(const Epetra_Vector& input,
00376                const Epetra_Map& target_map,
00377                Epetra_Import* importer=0);
00378 
00379 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00380 
00385 Epetra_Vector* create_row_weights_nnz(const Epetra_RowMatrix& input_matrix);
00386 
00391 Epetra_Vector* create_row_weights_nnz(const Epetra_CrsGraph& input_graph);
00392 
00414 int
00415 repartition(const Epetra_BlockMap& input_map,
00416       const Epetra_Vector& weights,
00417             std::vector<int>& myNewElements,
00418             std::map<int,int>& exports,
00419             std::map<int,int>& imports);
00420 
00426 void gather_all_proc_global_offsets(const Epetra_BlockMap& blkmap,
00427                                     std::vector<int>& all_proc_offsets);
00428 
00429 #endif //DOXYGEN_SHOULD_SKIP_THIS
00430 #endif //HAVE_EPETRA
00431 
00432 }//namespace Epetra
00433 }//namespace Isorropia
00434 
00435 #endif
00436