$extrastylesheet
partitioner_factory.C
Go to the documentation of this file.
00001 // The libMesh Finite Element Library.
00002 // Copyright (C) 2002-2014 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 // C++ Includes   -----------------------------------
00021 
00022 // Local Includes -----------------------------------
00023 #include "libmesh/libmesh_config.h"
00024 #include "libmesh/centroid_partitioner.h"
00025 #include "libmesh/metis_partitioner.h"
00026 #include "libmesh/parmetis_partitioner.h"
00027 #include "libmesh/linear_partitioner.h"
00028 #include "libmesh/hilbert_sfc_partitioner.h"
00029 #include "libmesh/morton_sfc_partitioner.h"
00030 #include "libmesh/factory.h"
00031 
00032 namespace libMesh
00033 {
00034 
00035 
00036 //-------------------------------------------------
00037 // Full specialization for the Factory<Partitioner>
00038 template<>
00039 std::map<std::string, Factory<Partitioner>*>&
00040 Factory<Partitioner>::factory_map()
00041 {
00042   static std::map<std::string, Factory<Partitioner>*> _map;
00043   return _map;
00044 }
00045 
00046 
00047 
00048 // ------------------------------------------------------------
00049 // Register Partitioning classes with the factory.  These will never
00050 // be called from user code, they just need to get instantiated.  Hide
00051 // them in an anonymous namespace to prevent name clashes
00052 namespace {
00053 
00054 #ifdef LIBMESH_HAVE_METIS
00055 FactoryImp<MetisPartitioner,      Partitioner> metis    ("Metis");
00056 #endif
00057 
00058 #ifdef LIBMESH_HAVE_PARMETIS
00059 FactoryImp<ParmetisPartitioner,   Partitioner> parmetis ("Parmetis");
00060 #endif
00061 
00062 #ifdef LIBMESH_HAVE_SFCURVES
00063 FactoryImp<SFCPartitioner,        Partitioner> sfc      ("SFCurves");
00064 FactoryImp<HilbertSFCPartitioner, Partitioner> hilbert  ("Hilbert");
00065 FactoryImp<MortonSFCPartitioner,  Partitioner> morton   ("Morton");
00066 #endif
00067 
00068 FactoryImp<LinearPartitioner,     Partitioner> linear   ("Linear");
00069 FactoryImp<CentroidPartitioner,   Partitioner> centroid ("Centroid");
00070 
00071 }
00072 
00073 } // namespace libMesh