Isorropia_EpetraLibrary.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 #ifndef _Isorropia_EpetraLibrary_hpp_
00031 #define _Isorropia_EpetraLibrary_hpp_
00032 
00033 #include <Isorropia_ConfigDefs.hpp>
00034 #include <Teuchos_RCP.hpp>
00035 #include <Teuchos_ParameterList.hpp>
00036 
00037 #include <Isorropia_EpetraCostDescriber.hpp>
00038 
00039 #ifdef HAVE_EPETRA
00040 class Epetra_Map;
00041 class Epetra_BlockMap;
00042 class Epetra_Import;
00043 class Epetra_Vector;
00044 class Epetra_MultiVector;
00045 class Epetra_CrsGraph;
00046 class Epetra_CrsMatrix;
00047 class Epetra_RowMatrix;
00048 class Epetra_LinearProblem;
00049 
00050 namespace Isorropia {
00051 
00052 namespace Epetra {
00053   class CostDescriber;
00054 
00060 class Library {
00061 public:
00062 
00063   Library(Teuchos::RCP<const Epetra_CrsGraph> input_graph, int itype = unspecified_input_);
00064   Library(Teuchos::RCP<const Epetra_CrsGraph> input_graph,
00065     Teuchos::RCP<CostDescriber> costs, int itype = unspecified_input_);
00066 
00067   Library(Teuchos::RCP<const Epetra_RowMatrix> input_matrix, int itype = unspecified_input_);
00068   Library(Teuchos::RCP<const Epetra_RowMatrix> input_matrix,
00069     Teuchos::RCP<CostDescriber> costs, int itype = unspecified_input_);
00070 
00071   Library(Teuchos::RCP<const Epetra_MultiVector> input_coords, int itype = unspecified_input_);
00072   Library(Teuchos::RCP<const Epetra_MultiVector> input_coords,
00073           Teuchos::RCP<const Epetra_MultiVector> weights, int itype = unspecified_input_);
00074 
00075   virtual ~Library();
00076 
00077   virtual int
00078   repartition(Teuchos::ParameterList& paramlist,
00079         std::vector<int>& myNewElements,
00080         int& exportsSize,
00081         std::vector<int>& imports) = 0;
00082 
00083   virtual int
00084   color(Teuchos::ParameterList& paramlist,
00085   std::vector<int>& colorAssignment) = 0 ;
00086 
00087   virtual int
00088   order(Teuchos::ParameterList& paramlist,
00089   std::vector<int>& orderAssignment) = 0 ;
00090 
00096   static const int hgraph_input_ = 1;
00097 
00102   static const int hgraph2d_finegrain_input_ = 2;
00103 
00109   static const int graph_input_ = 3;
00110 
00117   static const int geometric_input_ = 4;
00118 
00122   static const int unspecified_input_ = 5;
00123 
00124   int input_type_;
00125 
00126   int numPartSizes;
00127   int *partGIDs;
00128   float *partSizes;
00129 
00130 protected:
00131 
00132   Teuchos::RCP<const Epetra_BlockMap> input_map_;
00133   Teuchos::RCP<const Epetra_CrsGraph> input_graph_;
00134   Teuchos::RCP<const Epetra_RowMatrix> input_matrix_;
00135   Teuchos::RCP<const Epetra_MultiVector> input_coords_;
00136   Teuchos::RCP<Isorropia::Epetra::CostDescriber> costs_;
00137   Teuchos::RCP<const Epetra_MultiVector> weights_;
00138 
00139   virtual int precompute();
00140 
00141   virtual int postcompute() = 0;
00142 
00143 };//class Library
00144 
00145 }//namespace Epetra
00146 }//namespace Isorropia
00147 
00148 #endif //HAVE_EPETRA
00149 
00150 #endif
00151