Isorropia_EpetraPartitioner2D.hpp

Go to the documentation of this file.
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 #ifdef ISORROPIA_2D
00031 #ifndef _Isorropia_EpetraPartitioner2D_hpp_
00032 #define _Isorropia_EpetraPartitioner2D_hpp_
00033 
00034 #include <Isorropia_ConfigDefs.hpp>
00035 #include <Teuchos_RefCountPtr.hpp>
00036 #include <Teuchos_ParameterList.hpp>
00037 
00038 #include <Isorropia_EpetraCostDescriber.hpp>
00039 #include <Isorropia_EpetraOperator.hpp>
00040 #include <Isorropia_Partitioner2D.hpp>
00041 
00042 #ifdef HAVE_EPETRA
00043 class Epetra_Map;
00044 class Epetra_BlockMap;
00045 class Epetra_Import;
00046 class Epetra_Vector;
00047 class Epetra_MultiVector;
00048 class Epetra_CrsGraph;
00049 class Epetra_CrsMatrix;
00050 class Epetra_RowMatrix;
00051 class Epetra_LinearProblem;
00052 
00053 namespace Isorropia {
00054 
00055 namespace Epetra {
00056   class CostDescriber;
00057 
00063 class Partitioner2D : virtual public Isorropia::Partitioner2D, virtual public Isorropia::Epetra::Operator  {
00064 public:
00088   Partitioner2D(Teuchos::RefCountPtr<const Epetra_CrsGraph> input_graph,
00089               const Teuchos::ParameterList& paramlist,
00090               bool compute_partitioning_now=true);
00091 
00118   Partitioner2D(Teuchos::RefCountPtr<const Epetra_CrsGraph> input_graph,
00119               Teuchos::RefCountPtr<CostDescriber> costs,
00120               const Teuchos::ParameterList& paramlist,
00121               bool compute_partitioning_now=true);
00122 
00147   Partitioner2D(Teuchos::RefCountPtr<const Epetra_RowMatrix> input_matrix,
00148               const Teuchos::ParameterList& paramlist,
00149               bool compute_partitioning_now=true);
00150 
00178   Partitioner2D(Teuchos::RefCountPtr<const Epetra_RowMatrix> input_matrix,
00179               Teuchos::RefCountPtr<CostDescriber> costs,
00180               const Teuchos::ParameterList& paramlist,
00181               bool compute_partitioning_now=true);
00182 
00184   virtual ~Partitioner2D();
00185 
00214   void partition(bool force_repartitioning=false);
00215 
00216   virtual void compute(bool forceRecomputing=false);
00217 
00218   //  /** An internal method which determines whether the
00219   //      method compute_partitioning() has already been
00220   //      called on this class instance.
00221   //  */
00222   //  bool partitioning_already_computed() const __deprecated;
00223 
00224   //  /** An internal method which returns the new partition ID for a given element that
00225   //     resided locally in the old partitioning.
00226   //  */
00227   //  int newPartitionNumber(int myElem) const __deprecated;
00228 
00233   int numElemsInPartition(int partition) const;
00234 
00240   void elemsInPartition(int partition, int* elementList, int len) const;
00241 
00242   Teuchos::RefCountPtr<Epetra_Map> createNewMap();
00243 
00244   int createNewMaps(Teuchos::RefCountPtr<Epetra_Map> domainMap, 
00245         Teuchos::RefCountPtr<Epetra_Map> rangeMap);
00246 
00247   int partitionVectors();
00248 
00249 
00250 };//class Partitioner2D
00251 
00252 }//namespace Epetra
00253 }//namespace Isorropia
00254 
00255 #endif //HAVE_EPETRA
00256 
00257 #endif
00258 
00259 #endif //ISORROPIA_2D