diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c0d63b418a7a305b10c5d3c63cfb05e852d1234..ab54efc27f47bcce6e66b25cd3592499391df43e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,6 +50,7 @@ option(ENABLE_QT "Build QT GUI" OFF) option(ENABLE_READLINE "Enable Readline in Lua prompt" ON) option(ENABLE_SLEPC "Enable SLEPc eigensolvers" ON) option(ENABLE_SOLVER "Enable solver components" ON) +option(ENABLE_SWIG_EXPERIMENTAL "Enable swig (in developement, totally unusable)" OFF) option(ENABLE_TAUCS "Enable Taucs linear algebra solver" ON) option(ENABLE_TETGEN "Enable Tetgen mesh generator" ON) option(ENABLE_TETGEN_NEW "Enable experimental version of Tetgen" OFF) @@ -1119,3 +1120,14 @@ message("") mark_as_advanced(BISON FLEX GMP_LIB GMSH_EXTRA_VERSION HDF5_LIB MAKEINFO MED_LIB OCC_INC SZ_LIB TAUCS_LIB LUA_LIB ACIS_LIB TEXI2PDF READLINE_LIB) + +if(ENABLE_SWIG_EXPERIMENTAL) + FIND_PACKAGE(SWIG REQUIRED) + INCLUDE(${SWIG_USE_FILE}) + FIND_PACKAGE(PythonLibs) + INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR};${PYTHON_INCLUDE_DIR};../Common;${CMAKE_CURRENT_BINARY_DIR}/../Common) + SET_SOURCE_FILES_PROPERTIES(Geo/GModel.i PROPERTIES CPLUSPLUS ON) + #SET_SOURCE_FILES_PROPERTIES(Geo/GModel.i SWIG_FLAGS "-includeall -importall") + SWIG_ADD_MODULE(gmshPython python Geo/GModel.i ${GMSH_SRC}) + SWIG_LINK_LIBRARIES(gmshPython ${PYTHON_LIBRARIES} ${EXTERNAL_LIBRARIES}) +endif(ENABLE_SWIG_EXPERIMENTAL) diff --git a/Geo/GModel.h b/Geo/GModel.h index f9e2fd56db5014e2dca98bec23c6fdae84339732..c81703d57f44e3af3a14b201f257ad1f16e3fc39 100644 --- a/Geo/GModel.h +++ b/Geo/GModel.h @@ -481,9 +481,9 @@ class GModel int writePartitionedMSH(const std::string &baseName, bool binary=false, bool saveAll=false, bool saveParametric=false, double scalingFactor=1.0); - int writeDistanceMSH(const std::string &name, double version=2.2, bool binary=false, + /*int writeDistanceMSH(const std::string &name, double version=2.2, bool binary=false, bool saveAll=false, bool saveParametric=false, - double scalingFactor=1.0); + double scalingFactor=1.0);*/ // Iridium file format int writeIR3(const std::string &name, int elementTagType, diff --git a/Geo/GModel.i b/Geo/GModel.i new file mode 100644 index 0000000000000000000000000000000000000000..83aba859eba2bf113a53faa3808aca83df148f6f --- /dev/null +++ b/Geo/GModel.i @@ -0,0 +1,9 @@ +%module gmshPython +%include std_string.i +%{ + #include "GModel.h" + void GmshInitialize(int argc=0, char **argv=NULL); +%} + +void GmshInitialize(int argc=0, char **argv=NULL); +%include "GModel.h" diff --git a/Geo/GModelIO_Fourier.cpp b/Geo/GModelIO_Fourier.cpp index 284fef35464ead75083e6864178a431ffc98ce48..6f5267db967d12d8b3b0e313329638abfed3a938 100644 --- a/Geo/GModelIO_Fourier.cpp +++ b/Geo/GModelIO_Fourier.cpp @@ -142,6 +142,12 @@ void GModel::_deleteFMInternals() { } +int GModel::readFourier() +{ + Msg::Error("Gmsh must be compiled with Fourier Model support toad fourier Model"); + return 0; +} + int GModel::readFourier(const std::string &fn) { Msg::Error("Gmsh must be compiled with Fourier Model support to load '%s'",