#include <iostream>
#include <vector>
+const char MEDPARTITIONER::MEDPartitioner::METIS_PART_ALG[]="Metis";
+const char MEDPARTITIONER::MEDPartitioner::SCOTCH_PART_ALG[]="Scotch";
+const char MEDPARTITIONER::MEDPartitioner::PTSCOTCH_PART_ALG[]="PTScotch";
+
MEDPARTITIONER::MEDPartitioner::MEDPartitioner(const std::string& filename, int ndomains, const std::string& library,bool create_boundary_faces, bool create_joints, bool mesure_memory):
_input_collection( 0 ), _output_collection( 0 ), _new_topology( 0 )
{
}
return cellGraph;
}
+
+std::vector<std::string> MEDPARTITIONER::MEDPartitioner::AvailableAlgorithms()
+{
+ std::vector<std::string> ret;
+#ifdef MED_ENABLE_METIS
+ ret.push_back(std::string(METIS_PART_ALG));
+#endif
+#ifdef MED_ENABLE_SCOTCH
+ ret.push_back(std::string(SCOTCH_PART_ALG));
+#endif
+#ifdef MED_ENABLE_PTSCOTCH
+ ret.push_back(std::string(PTSCOTCH_PART_ALG));
+#endif
+ return ret;
+}
MEDPartitioner(const MEDCoupling::MEDFileData* fileData, int ndomains=1, const std::string& library="metis",bool create_boundary_faces=false, bool create_joints=false, bool mesure_memory=false);
MEDPartitioner(const MEDCoupling::MEDFileData* fileData, Graph* graph, bool create_boundary_faces=false, bool create_joints=false, bool mesure_memory=false);
static MEDPARTITIONER::Graph* Graph(MEDCoupling::MEDCouplingSkyLineArray* graph, Graph::splitter_type split=Graph::METIS, int* edgeweight=0, DataArrayInt* vlbloctab=0);
+ static std::vector<std::string> AvailableAlgorithms();
void write(const std::string& filename);
MEDCoupling::MEDFileData* getMEDFileData();
~MEDPartitioner();
MeshCollection* _input_collection;
MeshCollection* _output_collection;
Topology* _new_topology;
+ public:
+ static const char METIS_PART_ALG[];
+ static const char SCOTCH_PART_ALG[];
+ static const char PTSCOTCH_PART_ALG[];
};
}
#endif
using namespace MEDPARTITIONER;
%}
+
+
%newobject MEDPARTITIONER::MEDPartitioner::New;
%newobject MEDPARTITIONER::MEDPartitioner::Graph;
%newobject MEDPARTITIONER::MEDPartitioner::Graph::getGraph;
MEDPartitioner(const MEDCoupling::MEDFileData* fileData, int ndomains=1, const std::string& library="metis",bool create_boundary_faces=false, bool create_joints=false, bool mesure_memory=false) throw(INTERP_KERNEL::Exception);
MEDPartitioner(const MEDCoupling::MEDFileData* fileData, Graph* graph, bool create_boundary_faces=false, bool create_joints=false, bool mesure_memory=false) throw(INTERP_KERNEL::Exception);
static MEDPARTITIONER::Graph* Graph(MEDCoupling::MEDCouplingSkyLineArray* graph, Graph::splitter_type split=Graph::METIS, int* edgeweight=0, MEDCoupling::DataArrayInt* vlbloctab=0) throw(INTERP_KERNEL::Exception);
+ static std::vector<std::string> AvailableAlgorithms();
MEDCoupling::MEDFileData* getMEDFileData() throw(INTERP_KERNEL::Exception);
void write(const std::string& filename) throw(INTERP_KERNEL::Exception);
};
IF(MEDCOUPLING_ENABLE_RENUMBER)
LIST(APPEND SWIG_MODULE_medcoupling_EXTRA_FLAGS -DWITH_RENUMBER)
LIST(APPEND medcoupling_LIB_dependancies renumbercpp)
-
- IF(Boost_FOUND)
- LIST(APPEND SWIG_MODULE_medcoupling_EXTRA_FLAGS -DHAS_BOOST)
- ENDIF(Boost_FOUND)
-
- IF(METIS_FOUND)
- LIST(APPEND SWIG_MODULE_medcoupling_EXTRA_FLAGS -DHAS_METIS)
- ENDIF(METIS_FOUND)
-
ENDIF(MEDCOUPLING_ENABLE_RENUMBER)
IF(MEDCOUPLING_ENABLE_PARTITIONER)
%include "MEDPartitionerCommon.i"
#endif
+
+%{
+ static const char SEQ_INTERPOL_EXT[]="Sequential interpolator";
+ static const char MEDFILEIO_EXT[]="MED file I/O";
+ static const char RENUM_EXT[]="Renumbering";
+ static const char PART_EXT[]="Partitioner";
+ static const char PAR_INTERPOL_EXT[]="Parallel interpolator";
+
+ static const char *EXTENSIONS[]={SEQ_INTERPOL_EXT,MEDFILEIO_EXT,RENUM_EXT,PART_EXT,PAR_INTERPOL_EXT};
+ static const int NB_OF_EXTENSIONS=sizeof(EXTENSIONS)/sizeof(const char *);
+%}
+
+%inline
+{
+ std::vector<std::string> Extensions()
+ {
+ std::vector<std::string> ret;
+ ret.push_back(std::string(SEQ_INTERPOL_EXT));
+#ifdef WITH_MED_FILE
+ ret.push_back(std::string(MEDFILEIO_EXT));
+#endif
+#ifdef WITH_RENUMBER
+ ret.push_back(std::string(RENUM_EXT));
+#endif
+#ifdef WITH_PARTITIONER
+ ret.push_back(std::string(PART_EXT));
+#endif
+ return ret;
+ }
+}
+
%pythoncode %{
def MEDCouplingDataArrayDoubleIadd(self,*args):
import _medcoupling
using namespace std;
namespace MED_RENUMBER
-{
+{
Renumbering* RenumberingFactory(const string &s)
{
#ifdef MED_ENABLE_METIS
#ifdef ENABLE_BOOST
- if (s=="METIS")
+ if (s==METIS_ALG)
{
return new METISRenumbering;
}
- else if(s=="BOOST")
+ else if(s==BOOST_ALG)
{
return new BOOSTRenumbering;
}
}
#endif
#ifndef ENABLE_BOOST
- if (s=="METIS")
+ if (s==METIS_ALG)
{
return new METISRenumbering;
}
#endif
#ifndef MED_ENABLE_METIS
#ifdef ENABLE_BOOST
- if (s=="BOOST")
+ if (s==BOOST_ALG)
{
return new BOOSTRenumbering;
}
#endif
#endif
}
+
+ std::vector<std::string> RenumberAvailableMethods()
+ {
+ std::vector<std::string> ret;
+#ifdef ENABLE_BOOST
+ ret.push_back(std::string(BOOST_ALG));
+#endif
+#ifdef MED_ENABLE_METIS
+ ret.push_back(std::string(METIS_ALG));
+#endif
+ return ret;
+ }
}
namespace MED_RENUMBER
{
RENUMBER_EXPORT Renumbering* RenumberingFactory(const std::string& s);
+ RENUMBER_EXPORT std::vector<std::string> RenumberAvailableMethods();
+ const char METIS_ALG[]="METIS";
+ const char BOOST_ALG[]="BOOST";
}
#endif /*RENUMBERINGFACTORY_HXX_*/
ENDIF()
SET(SWIG_MODULE_MEDRenumber_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS};-DWITHOUT_AUTOFIELD")
-IF(Boost_FOUND)
- SET(SWIG_MODULE_MEDRenumber_EXTRA_FLAGS -DHAS_BOOST ${SWIG_MODULE_MEDRenumber_EXTRA_FLAGS})
-ENDIF(Boost_FOUND)
-
-IF(METIS_FOUND)
- SET(SWIG_MODULE_MEDRenumber_EXTRA_FLAGS -DHAS_METIS ${SWIG_MODULE_MEDRenumber_EXTRA_FLAGS})
-ENDIF(METIS_FOUND)
-
SET (MEDRenumber_SWIG_DPYS_FILES
MEDRenumberCommon.i
MEDRenumberImpl.i)
namespace MED_RENUMBER
{
Renumbering *RenumberingFactory(const std::string& s) throw(INTERP_KERNEL::Exception);
-}
-
-%inline
-{
- std::vector<std::string> RenumberAvailableMethods()throw(INTERP_KERNEL::Exception)
- {
- std::vector<std::string> ret;
-#ifdef HAS_BOOST
- ret.push_back(std::string("BOOST"));
-#endif
-#ifdef HAS_METIS
- ret.push_back(std::string("METIS"));
-#endif
- return ret;
- }
+ std::vector<std::string> RenumberAvailableMethods();
}