|
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_EpetraPartitioner2D_hpp_ 00031 #define _Isorropia_EpetraPartitioner2D_hpp_ 00032 00033 #include <Isorropia_ConfigDefs.hpp> 00034 #include <Teuchos_RCP.hpp> 00035 #include <Teuchos_ParameterList.hpp> 00036 00037 #include <Isorropia_EpetraOperator.hpp> 00038 #include <Isorropia_Partitioner2D.hpp> 00039 00040 #ifdef HAVE_EPETRA 00041 class Epetra_Map; 00042 class Epetra_BlockMap; 00043 class Epetra_Import; 00044 class Epetra_Vector; 00045 class Epetra_MultiVector; 00046 class Epetra_CrsGraph; 00047 class Epetra_CrsMatrix; 00048 class Epetra_RowMatrix; 00049 class Epetra_LinearProblem; 00050 00051 namespace Isorropia { 00052 00053 namespace Epetra { 00054 00060 class Partitioner2D : virtual public Isorropia::Partitioner2D, virtual public Isorropia::Epetra::Operator { 00061 public: 00085 Partitioner2D(Teuchos::RCP<const Epetra_CrsGraph> input_graph, 00086 const Teuchos::ParameterList& paramlist = Teuchos::ParameterList("EmptyParameterList"), 00087 bool compute_partitioning_now=true); 00088 00113 Partitioner2D(Teuchos::RCP<const Epetra_RowMatrix> input_matrix, 00114 const Teuchos::ParameterList& paramlist = Teuchos::ParameterList("EmptyParameterList"), 00115 bool compute_partitioning_now=true); 00116 00117 00118 00120 virtual ~Partitioner2D(); 00121 00122 00123 // MMW: Missing functions that are in EpetraPartioner, might need to implement 00124 //void setPartSizes(int len, int *global_part_id, float *part_size); 00125 //void clearPartSizes(); 00126 00138 void partition(bool force_repartitioning=false); 00139 00140 virtual void compute(bool forceRecomputing=false); 00141 00142 00145 int numElemsInPart(int part) const; 00146 00147 00150 int getNZIndx(int row, int column) const; 00151 00152 00155 void elemsInPart(int part, int* elementList, int len) const; 00156 00157 00158 // Should add RCP versions of the below 00159 00160 int createDomainAndRangeMaps(Epetra_Map *domainMap, 00161 Epetra_Map *rangeMap); 00162 00163 // perhaps pass parameter lists to these? 00164 int createColumnMap(Epetra_Map* colMap); 00165 int createRowMap(Epetra_Map* rowMap); 00166 00167 00168 00169 00170 };//class Partitioner2D 00171 00172 }//namespace Epetra 00173 }//namespace Isorropia 00174 00175 #endif //HAVE_EPETRA 00176 00177 #endif 00178 00179