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_PARTITIONER_H 00021 #define LIBMESH_PARTITIONER_H 00022 00023 // Local Includes ----------------------------------- 00024 #include "libmesh/libmesh.h" 00025 #include "libmesh/auto_ptr.h" 00026 #include "libmesh/id_types.h" 00027 00028 // C++ Includes ----------------------------------- 00029 #include <cstddef> 00030 00031 namespace libMesh 00032 { 00033 00034 // Forward Declarations 00035 class MeshBase; 00036 class ErrorVector; 00037 00038 00046 // ------------------------------------------------------------ 00047 // Partitioner class definition 00048 class Partitioner 00049 { 00050 public: 00051 00055 Partitioner ():_weights(NULL) {} 00056 00060 virtual ~Partitioner() {} 00061 00068 virtual AutoPtr<Partitioner> clone () const = 0; 00069 00070 00081 void partition (MeshBase& mesh, 00082 const unsigned int n=libMesh::n_processors()); 00083 00090 void repartition (MeshBase& mesh, 00091 const unsigned int n=libMesh::n_processors()); 00092 00096 static void partition_unpartitioned_elements (MeshBase &mesh, 00097 const unsigned int n=libMesh::n_processors()); 00098 00104 static void set_parent_processor_ids(MeshBase& mesh); 00105 00111 static void set_node_processor_ids(MeshBase& mesh); 00112 00118 virtual void attach_weights(ErrorVector * /*weights*/) { libmesh_not_implemented(); } 00119 00120 protected: 00121 00128 void single_partition (MeshBase& mesh); 00129 00135 virtual void _do_partition(MeshBase& mesh, 00136 const unsigned int n) = 0; 00137 00143 virtual void _do_repartition (MeshBase& mesh, 00144 const unsigned int n) { this->_do_partition (mesh, n); } 00145 00150 static const dof_id_type communication_blocksize; 00151 00155 ErrorVector * _weights; 00156 }; 00157 00158 00159 } // namespace libMesh 00160 00161 00162 00163 #endif // LIBMESH_PARTITIONER_H
Site Created By: libMesh Developers
Last modified: February 05 2013 19:54:48 UTC
Hosted By: