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 #ifndef _Isorropia_EpetraPartitioner_hpp_
00031 #define _Isorropia_EpetraPartitioner_hpp_
00032
00033 #include <Isorropia_ConfigDefs.hpp>
00034 #include <Teuchos_RCP.hpp>
00035 #include <Teuchos_ParameterList.hpp>
00036
00037 #include <Isorropia_EpetraCostDescriber.hpp>
00038 #include <Isorropia_EpetraOperator.hpp>
00039 #include <Isorropia_Partitioner.hpp>
00040
00041 #ifdef HAVE_EPETRA
00042 class Epetra_Map;
00043 class Epetra_BlockMap;
00044 class Epetra_Import;
00045 class Epetra_Vector;
00046 class Epetra_MultiVector;
00047 class Epetra_CrsGraph;
00048 class Epetra_CrsMatrix;
00049 class Epetra_RowMatrix;
00050 class Epetra_LinearProblem;
00051
00052 namespace Isorropia {
00053
00054 namespace Epetra {
00055 class CostDescriber;
00056
00062 class Partitioner : public Isorropia::Partitioner, public Isorropia::Epetra::Operator {
00063 public:
00064
00065 Partitioner(Teuchos::RCP<const Epetra_CrsGraph> input_graph,
00066 bool compute_partitioning_now=true);
00067
00068 Partitioner(Teuchos::RCP<const Epetra_CrsGraph> input_graph,
00069 const Teuchos::ParameterList& paramlist,
00070 bool compute_partitioning_now=true);
00071
00072 Partitioner(Teuchos::RCP<const Epetra_CrsGraph> input_graph,
00073 Teuchos::RCP<CostDescriber> costs,
00074 const Teuchos::ParameterList& paramlist,
00075 bool compute_partitioning_now=true);
00076
00077 Partitioner(Teuchos::RCP<const Epetra_RowMatrix> input_matrix,
00078 bool compute_partitioning_now=true);
00079
00080 Partitioner(Teuchos::RCP<const Epetra_RowMatrix> input_matrix,
00081 const Teuchos::ParameterList& paramlist,
00082 bool compute_partitioning_now=true);
00083
00084 Partitioner(Teuchos::RCP<const Epetra_RowMatrix> input_matrix,
00085 Teuchos::RCP<CostDescriber> costs,
00086 const Teuchos::ParameterList& paramlist,
00087 bool compute_partitioning_now=true);
00088
00089 Partitioner(Teuchos::RCP<const Epetra_MultiVector> coords,
00090 bool compute_partitioning_now=true);
00091
00092 Partitioner(Teuchos::RCP<const Epetra_MultiVector> coords,
00093 const Teuchos::ParameterList& paramlist,
00094 bool compute_partitioning_now=true);
00095
00096 Partitioner(Teuchos::RCP<const Epetra_MultiVector> coords,
00097 Teuchos::RCP<const Epetra_MultiVector> weights,
00098 const Teuchos::ParameterList& paramlist,
00099 bool compute_partitioning_now=true);
00100
00102 virtual ~Partitioner();
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119 void setPartSizes(int len, int *global_part_id, float *part_size);
00120
00121
00122
00123
00124 void clearPartSizes();
00125
00137 void partition(bool force_repartitioning=false);
00138
00139 virtual void compute(bool forceRecomputing=false);
00140
00141 int numElemsInPart(int part) const {
00142 return (numElemsWithProperty(part));
00143 }
00144
00145 void elemsInPart(int part, int* elementList, int len) const {
00146 elemsWithProperty(part, elementList, len);
00147 }
00148
00159 Teuchos::RCP<Epetra_Map> createNewMap();
00160
00161 private:
00162 int *partGIDs;
00163 float *partSizes;
00164 int numPartSizes;
00165
00166 };
00167
00168 }
00169 }
00170
00171 #endif //HAVE_EPETRA
00172
00173 #endif
00174