Back to index

salome-med  6.5.0
RenumberingFactory.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 #include "RenumberingFactory.hxx"
00021 #include "RENUMBER_Renumbering.hxx"
00022 #ifdef MED_ENABLE_METIS
00023 #include "RENUMBER_METISRenumbering.hxx"
00024 #endif
00025 #ifdef ENABLE_BOOST
00026 #include "RENUMBER_BOOSTRenumbering.hxx"
00027 #endif
00028 
00029 #include <iostream>
00030 
00031 using namespace std;
00032 
00033 namespace MED_RENUMBER
00034 {
00035   Renumbering* RenumberingFactory(const string &s)
00036   {
00037 #ifdef MED_ENABLE_METIS
00038 #ifdef ENABLE_BOOST
00039     if (s=="METIS")
00040       {
00041         return new METISRenumbering;
00042       }
00043     else if(s=="BOOST")
00044       {
00045         return new BOOSTRenumbering;
00046       }
00047     else 
00048       {
00049         std::cerr << "The method has to be METIS or BOOST" << std::endl;
00050         return 0;
00051       }
00052 #endif
00053 #ifndef ENABLE_BOOST
00054     if (s=="METIS")
00055       {
00056         return new METISRenumbering;
00057       }
00058     else
00059       {
00060         std::cerr << "The method has to be METIS!" << std::endl;
00061         return 0;
00062       }
00063 #endif
00064 #endif
00065 #ifndef MED_ENABLE_METIS
00066 #ifdef ENABLE_BOOST
00067     if (s=="BOOST")
00068       {
00069         return new BOOSTRenumbering;
00070       }
00071     else
00072       {
00073         std::cerr << "The method has to be BOOST!" << std::endl;
00074         return 0;
00075       }
00076 #endif
00077 #ifndef ENABLE_BOOST
00078     std::cerr << "Error, no method compiled" << std::endl;
00079     return 0;
00080 #endif
00081 #endif
00082   }
00083 }