parmetis_partitioner.h
Go to the documentation of this file.00001 // The libMesh Finite Element Library. 00002 // Copyright (C) 2002-2012 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner 00003 00004 // This library is free software; you can redistribute it and/or 00005 // modify it under the terms of the GNU Lesser General Public 00006 // License as published by the Free Software Foundation; either 00007 // version 2.1 of the License, or (at your option) any later version. 00008 00009 // This library is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 // Lesser General Public License for more details. 00013 00014 // You should have received a copy of the GNU Lesser General Public 00015 // License along with this library; if not, write to the Free Software 00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 00018 00019 00020 #ifndef LIBMESH_PARMETIS_PARTITIONER_H 00021 #define LIBMESH_PARMETIS_PARTITIONER_H 00022 00023 // Local Includes ----------------------------------- 00024 #include "libmesh/id_types.h" 00025 #include "libmesh/partitioner.h" 00026 00027 // C++ Includes ----------------------------------- 00028 #include <cstddef> 00029 #include <map> 00030 #include <vector> 00031 00032 namespace libMesh 00033 { 00034 00035 00036 00042 // ------------------------------------------------------------ 00043 // ParmetisPartitioner class definition 00044 class ParmetisPartitioner : public Partitioner 00045 { 00046 public: 00047 00051 ParmetisPartitioner () {} 00052 00057 virtual AutoPtr<Partitioner> clone () const { 00058 AutoPtr<Partitioner> cloned_partitioner 00059 (new ParmetisPartitioner()); 00060 return cloned_partitioner; 00061 } 00062 00063 00064 protected: 00065 00072 virtual void _do_repartition (MeshBase& mesh, 00073 const unsigned int n); 00074 00078 virtual void _do_partition (MeshBase& mesh, 00079 const unsigned int n); 00080 00081 private: 00082 00083 // These methods & data only need to be available if the 00084 // ParMETIS library is available. 00085 #ifdef LIBMESH_HAVE_PARMETIS 00086 00090 void initialize (const MeshBase& mesh, const unsigned int n_sbdmns); 00091 00095 void build_graph (const MeshBase& mesh); 00096 00100 void assign_partitioning (MeshBase& mesh); 00101 00107 std::vector<dof_id_type> _n_active_elem_on_proc; 00108 00112 std::map<dof_id_type, dof_id_type> _global_index_by_pid_map; 00113 00118 std::vector<int> _vtxdist; 00119 std::vector<int> _xadj; 00120 std::vector<int> _adjncy; 00121 std::vector<int> _part; 00122 std::vector<float> _tpwgts; 00123 std::vector<float> _ubvec; 00124 std::vector<int> _options; 00125 std::vector<int> _vwgt; 00126 00127 int _wgtflag; 00128 int _ncon; 00129 int _numflag; 00130 int _nparts; 00131 int _edgecut; 00132 00133 #endif 00134 }; 00135 00136 00137 } // namespace libMesh 00138 00139 00140 00141 #endif // LIBMESH_PARMETIS_PARTITIONER_H
Site Created By: libMesh Developers
Last modified: February 05 2013 19:54:48 UTC
Hosted By: