00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
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 }
00433 }
00434
00435 #endif
00436