From 236135e52b8fa237997fbcfb9b91140eea40bb91 Mon Sep 17 00:00:00 2001 From: Bruno Seny <bruno.seny@student.uclouvain.be> Date: Wed, 4 Nov 2009 08:38:57 +0000 Subject: [PATCH] - make Solver module optional - invert #define logic (HAVE_MESH, HAVE_POST, HAVE_SOLVER, ... instead of HAVE_NO_MESH, HAVE_NO_POST, HAVE_NO_SOLVER) --- CMakeLists.txt | 26 +-- Common/CommandLine.cpp | 8 +- Common/Gmsh.cpp | 10 +- Common/GmshConfig.h.in | 6 +- Common/GmshRemote.cpp | 4 +- Common/OpenFile.cpp | 32 ++-- Common/Options.cpp | 320 ++++++++++++++++++------------------ Fltk/visibilityWindow.cpp | 6 +- Geo/GFaceCompound.cpp | 7 +- Geo/GFaceCompound.h | 39 ++++- Geo/GModel.cpp | 10 +- Geo/GModelIO_Geo.cpp | 4 +- Geo/Geo.cpp | 4 +- Geo/GeoStringInterface.cpp | 8 +- Geo/MTetrahedron.cpp | 12 +- Geo/MTriangle.cpp | 6 +- Geo/gmshLevelset.h | 2 +- Mesh/Field.cpp | 8 +- Mesh/Field.h | 4 +- Mesh/Generator.cpp | 4 +- Mesh/highOrderSmoother.cpp | 18 +- Mesh/highOrderSmoother.h | 23 +++ Mesh/meshGFace.cpp | 12 +- Mesh/meshGFaceOptimize.cpp | 11 +- Mesh/meshPartition.cpp | 7 +- Parser/Gmsh.tab.cpp | 72 ++++---- Parser/Gmsh.y | 72 ++++---- Plugin/FieldView.cpp | 4 +- Plugin/GSHHS.cpp | 4 +- Solver/elasticitySolver.cpp | 2 +- 30 files changed, 402 insertions(+), 343 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9be0b85f98..a379d4a624 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,7 @@ option(ENABLE_PETSC "Enable PETSc linear algebra solvers" ON) option(ENABLE_POST "Build the post-processing module" ON) option(ENABLE_QT "Build QT GUI" OFF) option(ENABLE_SLEPC "Enable SLEPc eigensolvers" ON) +option(ENABLE_SOLVER "Enable solver components" ON) 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) @@ -253,26 +254,27 @@ add_subdirectory(Geo) if(ENABLE_MESH) add_subdirectory(Mesh) -else(ENABLE_MESH) - set(HAVE_NO_MESH TRUE) - list(APPEND CONFIG_OPTIONS "NoMesh") + set(HAVE_MESH TRUE) + list(APPEND CONFIG_OPTIONS "Mesh") endif(ENABLE_MESH) -add_subdirectory(Solver) +if(ENABLE_SOLVER) + add_subdirectory(Solver) + set(HAVE_SOLVER TRUE) + list(APPEND CONFIG_OPTIONS "Solver") +endif(ENABLE_SOLVER) if(ENABLE_POST) add_subdirectory(Post) add_subdirectory(Plugin) -else(ENABLE_POST) - set(HAVE_NO_POST TRUE) - list(APPEND CONFIG_OPTIONS "NoPost") + set(HAVE_POST TRUE) + list(APPEND CONFIG_OPTIONS "Post") endif(ENABLE_POST) if(ENABLE_PARSER) add_subdirectory(Parser) -else(ENABLE_PARSER) - set(HAVE_NO_PARSER TRUE) - list(APPEND CONFIG_OPTIONS "NoParser") + set(HAVE_PARSER TRUE) + list(APPEND CONFIG_OPTIONS "Parser") endif(ENABLE_PARSER) if(ENABLE_FLTK) @@ -280,10 +282,10 @@ if(ENABLE_FLTK) set(FLTK_SKIP_FLUID TRUE) find_package(FLTK) if(FLTK_FOUND) + add_subdirectory(Fltk) set(HAVE_FLTK TRUE) list(APPEND CONFIG_OPTIONS "Fltk") list(APPEND EXTERNAL_INCLUDES ${FLTK_INCLUDE_DIR}) - add_subdirectory(Fltk) if(ENABLE_NATIVE_FILE_CHOOSER) add_subdirectory(contrib/NativeFileChooser) set(HAVE_NATIVE_FILE_CHOOSER TRUE) @@ -301,10 +303,10 @@ elseif(ENABLE_QT) set(QT_USE_QTOPENGL TRUE) include(${QT_USE_FILE}) if(QT_FOUND) + add_subdirectory(Qt) set(HAVE_QT TRUE) list(APPEND CONFIG_OPTIONS "Qt") list(APPEND EXTERNAL_INCLUDES ${QT_INCLUDE_DIR}) - add_subdirectory(Qt) endif(QT_FOUND) endif(ENABLE_FLTK) diff --git a/Common/CommandLine.cpp b/Common/CommandLine.cpp index 573d086cea..608403dd74 100644 --- a/Common/CommandLine.cpp +++ b/Common/CommandLine.cpp @@ -29,7 +29,7 @@ #endif #endif -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) #include "PView.h" #endif @@ -114,7 +114,7 @@ void GetOptions(int argc, char *argv[]) int terminal = CTX::instance()->terminal; CTX::instance()->terminal = 1; -#if !defined(HAVE_NO_PARSER) +#if defined(HAVE_PARSER) // Parse session and option files ParseFile(CTX::instance()->homeDir + CTX::instance()->sessionFileName, true); ParseFile(CTX::instance()->homeDir + CTX::instance()->optionsFileName, true); @@ -263,11 +263,11 @@ void GetOptions(int argc, char *argv[]) CTX::instance()->batch = 1; while(i < argc) { std::string fileName = std::string(argv[i]) + "_new"; -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) unsigned int n = PView::list.size(); #endif OpenProject(argv[i]); -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) // convert post-processing views to latest binary format for(unsigned int j = n; j < PView::list.size(); j++) PView::list[j]->write(fileName, 1, (j == n) ? false : true); diff --git a/Common/Gmsh.cpp b/Common/Gmsh.cpp index 057f67e6c8..33b7760072 100644 --- a/Common/Gmsh.cpp +++ b/Common/Gmsh.cpp @@ -18,13 +18,13 @@ #include "Context.h" #include "robustPredicates.h" -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) #include "Generator.h" #include "Field.h" #include "meshPartition.h" #endif -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) #include "PluginManager.h" #endif @@ -46,7 +46,7 @@ int GmshInitialize(int argc, char **argv) // Make sure we have enough resources (stack) CheckResources(); -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) // Initialize the default plugins PluginManager::instance()->registerDefaultPlugins(); #endif @@ -131,7 +131,7 @@ int GmshBatch() MergeFile(CTX::instance()->files[i]); } -#if !defined(HAVE_NO_POST) && !defined(HAVE_NO_MESH) +#if defined(HAVE_POST) && defined(HAVE_MESH) if(!CTX::instance()->bgmFileName.empty()) { MergeFile(CTX::instance()->bgmFileName); if(PView::list.size()) @@ -151,7 +151,7 @@ int GmshBatch() CreateOutputFile(CTX::instance()->outputFileName, FORMAT_GEO); } else if(CTX::instance()->batch > 0){ -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) if(CTX::instance()->batch < 4) GModel::current()->mesh(CTX::instance()->batch); else if(CTX::instance()->batch == 4) diff --git a/Common/GmshConfig.h.in b/Common/GmshConfig.h.in index 3b484fee7b..dc88f710c5 100644 --- a/Common/GmshConfig.h.in +++ b/Common/GmshConfig.h.in @@ -23,20 +23,20 @@ #cmakedefine HAVE_LIBZ #cmakedefine HAVE_MATHEX #cmakedefine HAVE_MED +#cmakedefine HAVE_MESH #cmakedefine HAVE_METIS #cmakedefine HAVE_MPI #cmakedefine HAVE_NATIVE_FILE_CHOOSER #cmakedefine HAVE_NETGEN -#cmakedefine HAVE_NO_MESH -#cmakedefine HAVE_NO_PARSER -#cmakedefine HAVE_NO_POST #cmakedefine HAVE_NO_SOCKLEN_T #cmakedefine HAVE_NO_VSNPRINTF #cmakedefine HAVE_OCC #cmakedefine HAVE_OCC_MESH_CONSTRAINTS #cmakedefine HAVE_OPENGL #cmakedefine HAVE_OSMESA +#cmakedefine HAVE_PARSER #cmakedefine HAVE_PETSC +#cmakedefine HAVE_POST #cmakedefine HAVE_QT #cmakedefine HAVE_SLEPC #cmakedefine HAVE_SOLVER diff --git a/Common/GmshRemote.cpp b/Common/GmshRemote.cpp index b1935478ea..56bc3ca593 100644 --- a/Common/GmshRemote.cpp +++ b/Common/GmshRemote.cpp @@ -10,7 +10,7 @@ #include "OS.h" #include "VertexArray.h" -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) #include "PView.h" #include "PViewOptions.h" #include "PViewData.h" @@ -18,7 +18,7 @@ static void computeAndSendVertexArrays(GmshClient *client) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) for(unsigned int i = 0; i < PView::list.size(); i++){ PView *p = PView::list[i]; p->fillVertexArrays(); diff --git a/Common/OpenFile.cpp b/Common/OpenFile.cpp index 6b625a6d21..a7cb9ef7d0 100644 --- a/Common/OpenFile.cpp +++ b/Common/OpenFile.cpp @@ -17,15 +17,15 @@ #include "StringUtils.h" #include "GeomMeshMatcher.h" -#if !defined(HAVE_NO_PARSER) +#if defined(HAVE_PARSER) #include "Parser.h" #endif -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) #include "HighOrder.h" #endif -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) #include "PView.h" #include "PViewData.h" #endif @@ -94,7 +94,7 @@ void SetBoundingBox() SBoundingBox3d bb = GModel::current()->bounds(); -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) if(bb.empty()) { for(unsigned int i = 0; i < PView::list.size(); i++) if(!PView::list[i]->getData()->getBoundingBox().empty()) @@ -144,7 +144,7 @@ void AddToTemporaryBoundingBox(double x, double y, double z) int ParseFile(std::string fileName, bool close, bool warnIfMissing) { -#if defined(HAVE_NO_PARSER) +#if !defined(HAVE_PARSER) Msg::Error("Gmsh parser is not compiled in this version"); return 0; #else @@ -158,7 +158,7 @@ int ParseFile(std::string fileName, bool close, bool warnIfMissing) return 0; } -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) int numViewsBefore = PView::list.size(); #endif @@ -191,7 +191,7 @@ int ParseFile(std::string fileName, bool close, bool warnIfMissing) gmsh_yylineno = old_yylineno; gmsh_yyviewindex = old_yyviewindex; -#if defined(HAVE_FLTK) && !defined(HAVE_NO_POST) +#if defined(HAVE_FLTK) && defined(HAVE_POST) if(FlGui::available() && numViewsBefore != (int)PView::list.size()) FlGui::instance()->updateViews(); #endif @@ -265,7 +265,7 @@ int MergeFile(std::string fileName, bool warnIfMissing) CTX::instance()->geom.draw = 0; // don't try to draw the model while reading -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) int numViewsBefore = PView::list.size(); #endif @@ -298,7 +298,7 @@ int MergeFile(std::string fileName, bool warnIfMissing) else if(ext == ".med" || ext == ".MED" || ext == ".mmed" || ext == ".MMED" || ext == ".rmed" || ext == ".RMED"){ status = GModel::readMED(fileName); -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) if(status > 1) status = PView::readMED(fileName); #endif } @@ -350,17 +350,17 @@ int MergeFile(std::string fileName, bool warnIfMissing) // MATCHER END status = GModel::current()->readMSH(fileName); -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) if(status > 1) status = PView::readMSH(fileName); #endif -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) if(CTX::instance()->mesh.order > 1) SetOrderN(GModel::current(), CTX::instance()->mesh.order, CTX::instance()->mesh.secondOrderLinear, CTX::instance()->mesh.secondOrderIncomplete); #endif } -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) else if(!strncmp(header, "$PostFormat", 11) || !strncmp(header, "$View", 5)) { status = PView::readPOS(fileName); @@ -376,7 +376,7 @@ int MergeFile(std::string fileName, bool warnIfMissing) CTX::instance()->geom.draw = 1; CTX::instance()->mesh.changed = ENT_ALL; -#if defined(HAVE_FLTK) && !defined(HAVE_NO_POST) +#if defined(HAVE_FLTK) && defined(HAVE_POST) if(FlGui::available() && numViewsBefore != (int)PView::list.size()) FlGui::instance()->updateViews(); #endif @@ -393,11 +393,11 @@ int MergeFile(std::string fileName, bool warnIfMissing) void ClearProject() { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) for(int i = PView::list.size() - 1; i >= 0; i--) delete PView::list[i]; #endif -#if !defined(HAVE_NO_PARSER) +#if defined(HAVE_PARSER) gmsh_yysymbols.clear(); #endif for(int i = GModel::list.size() - 1; i >= 0; i--) @@ -436,7 +436,7 @@ void OpenProject(std::string fileName) // if the current model is not empty make it invisible, clear the // parser variables and add a new model GModel::current()->setVisibility(0); -#if !defined(HAVE_NO_PARSER) +#if defined(HAVE_PARSER) gmsh_yysymbols.clear(); #endif new GModel(); diff --git a/Common/Options.cpp b/Common/Options.cpp index ef30e3681e..60482a4772 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -15,17 +15,17 @@ #include "Options.h" #include "DefaultOptions.h" -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) #include "Generator.h" #include "Field.h" #include "BackgroundMesh.h" #endif -#if !defined(HAVE_NO_PARSER) +#if defined(HAVE_PARSER) #include "Parser.h" #endif -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) #include "PView.h" #include "PViewOptions.h" #include "PViewData.h" @@ -423,7 +423,7 @@ void InitOptions(int num) void ReInitOptions(int num) { // horrible trick so that opt_view_XXX will act on the reference view -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) std::vector<PView*> tmp = PView::list; PView::list.clear(); InitOptions(num); @@ -476,7 +476,7 @@ static void PrintOptionCategory(int level, int diff, int help, const char *cat, GmshColorTable *GetColorTable(int num) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) PViewOptions *opt; if(PView::list.empty() || num < 0 || num > (int)PView::list.size() - 1) opt = &PViewOptions::reference; @@ -493,7 +493,7 @@ GmshColorTable *GetColorTable(int num) static void PrintColorTable(int num, int diff, const char *prefix, FILE *file) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) PViewOptions *opt; if(PView::list.empty() || num < 0 || num > (int)PView::list.size() - 1) opt = &PViewOptions::reference; @@ -623,7 +623,7 @@ void PrintOptions(int num, int level, int diff, int help, const char *filename) "PostProcessing.", file); if(level & GMSH_FULLRC) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) for(unsigned int i = 0; i < PView::list.size(); i++) { char tmp[256]; sprintf(tmp, "View[%d].", i); @@ -738,7 +738,7 @@ void PrintOptionsDoc() fprintf(file, "@end ftable\n"); fclose(file); -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) file = fopen("opt_view.texi", "w"); if(!file) { Msg::Error("Unable to open file 'opt_view.texi'"); @@ -798,7 +798,7 @@ void PrintOptionsDoc() fprintf(file, "@end ftable\n"); fclose(file); -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) file = fopen("opt_fields.texi", "w"); if(!file) { Msg::Error("Unable to open file 'opt_fields.texi'"); @@ -1151,7 +1151,7 @@ std::string opt_solver_help4(OPT_ARGS_STR) std::string opt_solver_input_name(OPT_ARGS_STR) { if(action & GMSH_SET){ -#if !defined(HAVE_NO_PARSER) +#if defined(HAVE_PARSER) ConnectionManager::get(num)->inputFileName = FixRelativePath(gmsh_yyname, val); #else ConnectionManager::get(num)->inputFileName = val; @@ -1225,7 +1225,7 @@ std::string opt_solver_extension4(OPT_ARGS_STR) std::string opt_solver_mesh_name(OPT_ARGS_STR) { if(action & GMSH_SET){ -#if !defined(HAVE_NO_PARSER) +#if defined(HAVE_PARSER) ConnectionManager::get(num)->meshFileName = FixRelativePath(gmsh_yyname, val); #else ConnectionManager::get(num)->meshFileName = val; @@ -1882,7 +1882,7 @@ int _gui_action_valid(int action, int num) std::string opt_view_name(OPT_ARGS_STR) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(""); if(!data) return ""; if(action & GMSH_SET) { @@ -1915,7 +1915,7 @@ std::string opt_view_name(OPT_ARGS_STR) std::string opt_view_format(OPT_ARGS_STR) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(""); if(action & GMSH_SET) { opt->format = val; @@ -1932,7 +1932,7 @@ std::string opt_view_format(OPT_ARGS_STR) std::string opt_view_filename(OPT_ARGS_STR) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(""); if(!data) return ""; return data->getFileName(); @@ -1943,7 +1943,7 @@ std::string opt_view_filename(OPT_ARGS_STR) std::string opt_view_axes_label0(OPT_ARGS_STR) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(""); if(action & GMSH_SET) { opt->axesLabel[0] = val; @@ -1960,7 +1960,7 @@ std::string opt_view_axes_label0(OPT_ARGS_STR) std::string opt_view_axes_label1(OPT_ARGS_STR) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(""); if(action & GMSH_SET) { opt->axesLabel[1] = val; @@ -1977,7 +1977,7 @@ std::string opt_view_axes_label1(OPT_ARGS_STR) std::string opt_view_axes_label2(OPT_ARGS_STR) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(""); if(action & GMSH_SET) { opt->axesLabel[2] = val; @@ -1994,7 +1994,7 @@ std::string opt_view_axes_label2(OPT_ARGS_STR) std::string opt_view_axes_format0(OPT_ARGS_STR) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(""); if(action & GMSH_SET) { opt->axesFormat[0] = val; @@ -2011,7 +2011,7 @@ std::string opt_view_axes_format0(OPT_ARGS_STR) std::string opt_view_axes_format1(OPT_ARGS_STR) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(""); if(action & GMSH_SET) { opt->axesFormat[1] = val; @@ -2028,7 +2028,7 @@ std::string opt_view_axes_format1(OPT_ARGS_STR) std::string opt_view_axes_format2(OPT_ARGS_STR) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(""); if(action & GMSH_SET) { opt->axesFormat[2] = val; @@ -2045,7 +2045,7 @@ std::string opt_view_axes_format2(OPT_ARGS_STR) std::string opt_view_gen_raise0(OPT_ARGS_STR) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(""); if(action & GMSH_SET) { opt->genRaiseX = val; @@ -2063,7 +2063,7 @@ std::string opt_view_gen_raise0(OPT_ARGS_STR) std::string opt_view_gen_raise1(OPT_ARGS_STR) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(""); if(action & GMSH_SET) { opt->genRaiseY = val; @@ -2081,7 +2081,7 @@ std::string opt_view_gen_raise1(OPT_ARGS_STR) std::string opt_view_gen_raise2(OPT_ARGS_STR) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(""); if(action & GMSH_SET) { opt->genRaiseZ = val; @@ -2135,7 +2135,7 @@ void _string2stipple(std::string str, int &repeat, int &pattern) std::string opt_view_stipple0(OPT_ARGS_STR) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(""); if(action & GMSH_SET) { opt->stippleString[0] = val; @@ -2149,7 +2149,7 @@ std::string opt_view_stipple0(OPT_ARGS_STR) std::string opt_view_stipple1(OPT_ARGS_STR) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(""); if(action & GMSH_SET) { opt->stippleString[1] = val; @@ -2163,7 +2163,7 @@ std::string opt_view_stipple1(OPT_ARGS_STR) std::string opt_view_stipple2(OPT_ARGS_STR) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(""); if(action & GMSH_SET) { opt->stippleString[2] = val; @@ -2177,7 +2177,7 @@ std::string opt_view_stipple2(OPT_ARGS_STR) std::string opt_view_stipple3(OPT_ARGS_STR) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(""); if(action & GMSH_SET) { opt->stippleString[3] = val; @@ -2191,7 +2191,7 @@ std::string opt_view_stipple3(OPT_ARGS_STR) std::string opt_view_stipple4(OPT_ARGS_STR) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(""); if(action & GMSH_SET) { opt->stippleString[4] = val; @@ -2205,7 +2205,7 @@ std::string opt_view_stipple4(OPT_ARGS_STR) std::string opt_view_stipple5(OPT_ARGS_STR) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(""); if(action & GMSH_SET) { opt->stippleString[5] = val; @@ -2219,7 +2219,7 @@ std::string opt_view_stipple5(OPT_ARGS_STR) std::string opt_view_stipple6(OPT_ARGS_STR) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(""); if(action & GMSH_SET) { opt->stippleString[6] = val; @@ -2233,7 +2233,7 @@ std::string opt_view_stipple6(OPT_ARGS_STR) std::string opt_view_stipple7(OPT_ARGS_STR) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(""); if(action & GMSH_SET) { opt->stippleString[7] = val; @@ -2247,7 +2247,7 @@ std::string opt_view_stipple7(OPT_ARGS_STR) std::string opt_view_stipple8(OPT_ARGS_STR) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(""); if(action & GMSH_SET) { opt->stippleString[8] = val; @@ -2261,7 +2261,7 @@ std::string opt_view_stipple8(OPT_ARGS_STR) std::string opt_view_stipple9(OPT_ARGS_STR) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(""); if(action & GMSH_SET) { opt->stippleString[9] = val; @@ -3453,7 +3453,7 @@ double opt_general_color_scheme(OPT_ARGS_NUM) SetDefaultColorOptions(0, MeshOptions_Color); SetDefaultColorOptions(0, SolverOptions_Color); SetDefaultColorOptions(0, PostProcessingOptions_Color); -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) for(unsigned int i = 0; i < PView::list.size(); i++) SetDefaultColorOptions(i, ViewOptions_Color); #endif @@ -3464,13 +3464,13 @@ double opt_general_color_scheme(OPT_ARGS_NUM) SetColorOptionsGUI(0, MeshOptions_Color); SetColorOptionsGUI(0, SolverOptions_Color); SetColorOptionsGUI(0, PostProcessingOptions_Color); -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) for(unsigned int i = 0; i < PView::list.size(); i++) SetColorOptionsGUI(i, ViewOptions_Color); #endif SetColorOptionsGUI(0, PrintOptions_Color); -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) // horrible trick so that opt_view_XXX will act on the reference view std::vector<PView*> tmp = PView::list; PView::list.clear(); @@ -5620,7 +5620,7 @@ double opt_mesh_zone_definition(OPT_ARGS_NUM) return CTX::instance()->mesh.zoneDefinition; } -#if defined(HAVE_NO_MESH) +#if !defined(HAVE_MESH) static void GetStatistics(double stat[50]) { for(int i = 0; i < 50; i++) stat[i] = 0; @@ -6133,7 +6133,7 @@ double opt_post_plugins(OPT_ARGS_NUM) double opt_post_nb_views(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) return PView::list.size(); #else return 0; @@ -6149,7 +6149,7 @@ double opt_post_file_format(OPT_ARGS_NUM) double opt_view_nb_timestep(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(!data) return 1; #if defined(HAVE_FLTK) @@ -6167,7 +6167,7 @@ double opt_view_nb_timestep(OPT_ARGS_NUM) double opt_view_timestep(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(!data) return 0; if(action & GMSH_SET) { @@ -6193,7 +6193,7 @@ double opt_view_timestep(OPT_ARGS_NUM) double opt_view_min(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(!data) return 0.; // use adaptive data if available @@ -6205,7 +6205,7 @@ double opt_view_min(OPT_ARGS_NUM) double opt_view_max(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(!data) return 0.; // use adaptive data if available @@ -6217,7 +6217,7 @@ double opt_view_max(OPT_ARGS_NUM) double opt_view_custom_min(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->customMin = val; @@ -6236,7 +6236,7 @@ double opt_view_custom_min(OPT_ARGS_NUM) double opt_view_custom_max(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->customMax = val; @@ -6254,7 +6254,7 @@ double opt_view_custom_max(OPT_ARGS_NUM) double opt_view_xmin(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(!data) return 0.; return data->getBoundingBox().min().x(); @@ -6265,7 +6265,7 @@ double opt_view_xmin(OPT_ARGS_NUM) double opt_view_xmax(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(!data) return 0.; return data->getBoundingBox().max().x(); @@ -6276,7 +6276,7 @@ double opt_view_xmax(OPT_ARGS_NUM) double opt_view_ymin(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(!data) return 0.; return data->getBoundingBox().min().y(); @@ -6287,7 +6287,7 @@ double opt_view_ymin(OPT_ARGS_NUM) double opt_view_ymax(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(!data) return 0.; return data->getBoundingBox().max().y(); @@ -6298,7 +6298,7 @@ double opt_view_ymax(OPT_ARGS_NUM) double opt_view_zmin(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(!data) return 0.; return data->getBoundingBox().min().z(); @@ -6309,7 +6309,7 @@ double opt_view_zmin(OPT_ARGS_NUM) double opt_view_zmax(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(!data) return 0.; return data->getBoundingBox().max().z(); @@ -6320,7 +6320,7 @@ double opt_view_zmax(OPT_ARGS_NUM) double opt_view_offset0(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->offset[0] = val; @@ -6338,7 +6338,7 @@ double opt_view_offset0(OPT_ARGS_NUM) double opt_view_offset1(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->offset[1] = val; @@ -6356,7 +6356,7 @@ double opt_view_offset1(OPT_ARGS_NUM) double opt_view_offset2(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->offset[2] = val; @@ -6374,7 +6374,7 @@ double opt_view_offset2(OPT_ARGS_NUM) double opt_view_raise0(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->raise[0] = val; @@ -6392,7 +6392,7 @@ double opt_view_raise0(OPT_ARGS_NUM) double opt_view_raise1(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->raise[1] = val; @@ -6410,7 +6410,7 @@ double opt_view_raise1(OPT_ARGS_NUM) double opt_view_raise2(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->raise[2] = val; @@ -6428,7 +6428,7 @@ double opt_view_raise2(OPT_ARGS_NUM) double opt_view_normal_raise(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->normalRaise = val; @@ -6446,7 +6446,7 @@ double opt_view_normal_raise(OPT_ARGS_NUM) double opt_view_transform00(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->transform[0][0] = val; @@ -6464,7 +6464,7 @@ double opt_view_transform00(OPT_ARGS_NUM) double opt_view_transform01(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->transform[0][1] = val; @@ -6482,7 +6482,7 @@ double opt_view_transform01(OPT_ARGS_NUM) double opt_view_transform02(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->transform[0][2] = val; @@ -6500,7 +6500,7 @@ double opt_view_transform02(OPT_ARGS_NUM) double opt_view_transform10(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->transform[1][0] = val; @@ -6518,7 +6518,7 @@ double opt_view_transform10(OPT_ARGS_NUM) double opt_view_transform11(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->transform[1][1] = val; @@ -6536,7 +6536,7 @@ double opt_view_transform11(OPT_ARGS_NUM) double opt_view_transform12(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->transform[1][2] = val; @@ -6554,7 +6554,7 @@ double opt_view_transform12(OPT_ARGS_NUM) double opt_view_transform20(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->transform[2][0] = val; @@ -6572,7 +6572,7 @@ double opt_view_transform20(OPT_ARGS_NUM) double opt_view_transform21(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->transform[2][1] = val; @@ -6590,7 +6590,7 @@ double opt_view_transform21(OPT_ARGS_NUM) double opt_view_transform22(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->transform[2][2] = val; @@ -6608,7 +6608,7 @@ double opt_view_transform22(OPT_ARGS_NUM) double opt_view_arrow_size_min(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->arrowSizeMin = val; @@ -6625,7 +6625,7 @@ double opt_view_arrow_size_min(OPT_ARGS_NUM) double opt_view_arrow_size_max(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->arrowSizeMax = val; @@ -6642,7 +6642,7 @@ double opt_view_arrow_size_max(OPT_ARGS_NUM) double opt_view_normals(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->normals = val; @@ -6659,7 +6659,7 @@ double opt_view_normals(OPT_ARGS_NUM) double opt_view_tangents(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->tangents = val; @@ -6676,7 +6676,7 @@ double opt_view_tangents(OPT_ARGS_NUM) double opt_view_displacement_factor(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->displacementFactor = val; @@ -6694,7 +6694,7 @@ double opt_view_displacement_factor(OPT_ARGS_NUM) double opt_view_fake_transparency(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->fakeTransparency = (int)val; @@ -6712,7 +6712,7 @@ double opt_view_fake_transparency(OPT_ARGS_NUM) double opt_view_explode(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->explode = val; @@ -6730,7 +6730,7 @@ double opt_view_explode(OPT_ARGS_NUM) double opt_view_visible(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->visible = (int)val; @@ -6748,7 +6748,7 @@ double opt_view_visible(OPT_ARGS_NUM) double opt_view_intervals_type(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->intervalsType = (int)val; @@ -6769,7 +6769,7 @@ double opt_view_intervals_type(OPT_ARGS_NUM) double opt_view_saturate_values(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->saturateValues = (int)val; @@ -6788,7 +6788,7 @@ double opt_view_saturate_values(OPT_ARGS_NUM) double opt_view_adapt_visualization_grid(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->adaptVisualizationGrid = (int)val; @@ -6815,7 +6815,7 @@ double opt_view_adapt_visualization_grid(OPT_ARGS_NUM) double opt_view_max_recursion_level(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->maxRecursionLevel = (int)val; @@ -6838,7 +6838,7 @@ double opt_view_max_recursion_level(OPT_ARGS_NUM) double opt_view_target_error(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->targetError = val; @@ -6861,7 +6861,7 @@ double opt_view_target_error(OPT_ARGS_NUM) double opt_view_type(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->type = (int)val; @@ -6882,7 +6882,7 @@ double opt_view_type(OPT_ARGS_NUM) double opt_view_auto_position(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->autoPosition = (int)val; @@ -6901,7 +6901,7 @@ double opt_view_auto_position(OPT_ARGS_NUM) double opt_view_position0(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->position[0] = (int)val; @@ -6918,7 +6918,7 @@ double opt_view_position0(OPT_ARGS_NUM) double opt_view_position1(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->position[1] = (int)val; @@ -6935,7 +6935,7 @@ double opt_view_position1(OPT_ARGS_NUM) double opt_view_size0(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->size[0] = (int)val; @@ -6952,7 +6952,7 @@ double opt_view_size0(OPT_ARGS_NUM) double opt_view_size1(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->size[1] = (int)val; @@ -6969,7 +6969,7 @@ double opt_view_size1(OPT_ARGS_NUM) double opt_view_axes(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->axes = (int)val; @@ -6990,7 +6990,7 @@ double opt_view_axes(OPT_ARGS_NUM) double opt_view_axes_mikado(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->axesMikado = (int)val; @@ -7008,7 +7008,7 @@ double opt_view_axes_mikado(OPT_ARGS_NUM) double opt_view_axes_auto_position(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->axesAutoPosition = (int)val; @@ -7027,7 +7027,7 @@ double opt_view_axes_auto_position(OPT_ARGS_NUM) double opt_view_axes_xmin(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->axesPosition[0] = val; @@ -7045,7 +7045,7 @@ double opt_view_axes_xmin(OPT_ARGS_NUM) double opt_view_axes_xmax(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->axesPosition[1] = val; @@ -7063,7 +7063,7 @@ double opt_view_axes_xmax(OPT_ARGS_NUM) double opt_view_axes_ymin(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->axesPosition[2] = val; @@ -7081,7 +7081,7 @@ double opt_view_axes_ymin(OPT_ARGS_NUM) double opt_view_axes_ymax(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->axesPosition[3] = val; @@ -7099,7 +7099,7 @@ double opt_view_axes_ymax(OPT_ARGS_NUM) double opt_view_axes_zmin(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->axesPosition[4] = val; @@ -7117,7 +7117,7 @@ double opt_view_axes_zmin(OPT_ARGS_NUM) double opt_view_axes_zmax(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->axesPosition[5] = val; @@ -7135,7 +7135,7 @@ double opt_view_axes_zmax(OPT_ARGS_NUM) double opt_view_axes_tics0(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->axesTics[0] = (int)val; @@ -7153,7 +7153,7 @@ double opt_view_axes_tics0(OPT_ARGS_NUM) double opt_view_axes_tics1(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->axesTics[1] = (int)val; @@ -7171,7 +7171,7 @@ double opt_view_axes_tics1(OPT_ARGS_NUM) double opt_view_axes_tics2(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->axesTics[2] = (int)val; @@ -7189,7 +7189,7 @@ double opt_view_axes_tics2(OPT_ARGS_NUM) double opt_view_nb_iso(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->nbIso = (int)val; @@ -7207,7 +7207,7 @@ double opt_view_nb_iso(OPT_ARGS_NUM) double opt_view_boundary(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->boundary = (int)val; @@ -7228,7 +7228,7 @@ double opt_view_boundary(OPT_ARGS_NUM) double opt_view_light(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->light = (int)val; @@ -7248,7 +7248,7 @@ double opt_view_light(OPT_ARGS_NUM) double opt_view_light_two_side(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->lightTwoSide = (int)val; @@ -7265,7 +7265,7 @@ double opt_view_light_two_side(OPT_ARGS_NUM) double opt_view_light_lines(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->lightLines = (int)val; @@ -7282,7 +7282,7 @@ double opt_view_light_lines(OPT_ARGS_NUM) double opt_view_smooth_normals(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->smoothNormals = (int)val; @@ -7300,7 +7300,7 @@ double opt_view_smooth_normals(OPT_ARGS_NUM) double opt_view_angle_smooth_normals(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->angleSmoothNormals = val; @@ -7318,7 +7318,7 @@ double opt_view_angle_smooth_normals(OPT_ARGS_NUM) double opt_view_show_element(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->showElement = (int)val; @@ -7336,7 +7336,7 @@ double opt_view_show_element(OPT_ARGS_NUM) double opt_view_show_time(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->showTime = (int)val; @@ -7355,7 +7355,7 @@ double opt_view_show_time(OPT_ARGS_NUM) double opt_view_show_scale(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->showScale = (int)val; @@ -7372,7 +7372,7 @@ double opt_view_show_scale(OPT_ARGS_NUM) double opt_view_draw_strings(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->drawStrings = (int)val; @@ -7389,7 +7389,7 @@ double opt_view_draw_strings(OPT_ARGS_NUM) double opt_view_draw_points(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->drawPoints = (int)val; @@ -7411,7 +7411,7 @@ double opt_view_draw_points(OPT_ARGS_NUM) double opt_view_draw_lines(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->drawLines = (int)val; @@ -7433,7 +7433,7 @@ double opt_view_draw_lines(OPT_ARGS_NUM) double opt_view_draw_triangles(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->drawTriangles = (int)val; @@ -7455,7 +7455,7 @@ double opt_view_draw_triangles(OPT_ARGS_NUM) double opt_view_draw_quadrangles(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->drawQuadrangles = (int)val; @@ -7477,7 +7477,7 @@ double opt_view_draw_quadrangles(OPT_ARGS_NUM) double opt_view_draw_tetrahedra(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->drawTetrahedra = (int)val; @@ -7499,7 +7499,7 @@ double opt_view_draw_tetrahedra(OPT_ARGS_NUM) double opt_view_draw_hexahedra(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->drawHexahedra = (int)val; @@ -7521,7 +7521,7 @@ double opt_view_draw_hexahedra(OPT_ARGS_NUM) double opt_view_draw_prisms(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->drawPrisms = (int)val; @@ -7543,7 +7543,7 @@ double opt_view_draw_prisms(OPT_ARGS_NUM) double opt_view_draw_pyramids(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->drawPyramids = (int)val; @@ -7565,7 +7565,7 @@ double opt_view_draw_pyramids(OPT_ARGS_NUM) double opt_view_draw_scalars(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->drawScalars = (int)val; @@ -7587,7 +7587,7 @@ double opt_view_draw_scalars(OPT_ARGS_NUM) double opt_view_draw_vectors(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->drawVectors = (int)val; @@ -7609,7 +7609,7 @@ double opt_view_draw_vectors(OPT_ARGS_NUM) double opt_view_draw_tensors(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->drawTensors = (int)val; @@ -7631,7 +7631,7 @@ double opt_view_draw_tensors(OPT_ARGS_NUM) double opt_view_draw_skin_only(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->drawSkinOnly = (int)val; @@ -7649,7 +7649,7 @@ double opt_view_draw_skin_only(OPT_ARGS_NUM) double opt_view_scale_type(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->scaleType = (int)val; @@ -7670,7 +7670,7 @@ double opt_view_scale_type(OPT_ARGS_NUM) double opt_view_range_type(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->rangeType = (int)val; @@ -7692,7 +7692,7 @@ double opt_view_range_type(OPT_ARGS_NUM) double opt_view_tensor_type(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->tensorType = (int)val; @@ -7713,7 +7713,7 @@ double opt_view_tensor_type(OPT_ARGS_NUM) double opt_view_vector_type(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->vectorType = (int)val; @@ -7734,7 +7734,7 @@ double opt_view_vector_type(OPT_ARGS_NUM) double opt_view_glyph_location(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->glyphLocation = (int)val; @@ -7755,7 +7755,7 @@ double opt_view_glyph_location(OPT_ARGS_NUM) double opt_view_center_glyphs(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->centerGlyphs = val ? 1 : 0; @@ -7774,7 +7774,7 @@ double opt_view_center_glyphs(OPT_ARGS_NUM) double opt_view_point_size(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->pointSize = val; @@ -7791,7 +7791,7 @@ double opt_view_point_size(OPT_ARGS_NUM) double opt_view_line_width(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->lineWidth = val; @@ -7808,7 +7808,7 @@ double opt_view_line_width(OPT_ARGS_NUM) double opt_view_point_type(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->pointType = (int)val; @@ -7829,7 +7829,7 @@ double opt_view_point_type(OPT_ARGS_NUM) double opt_view_line_type(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->lineType = (int)val; @@ -7850,7 +7850,7 @@ double opt_view_line_type(OPT_ARGS_NUM) double opt_view_colormap_alpha(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->colorTable.dpar[COLORTABLE_ALPHA] = val; @@ -7870,7 +7870,7 @@ double opt_view_colormap_alpha(OPT_ARGS_NUM) double opt_view_colormap_alpha_power(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->colorTable.dpar[COLORTABLE_ALPHAPOW] = val; @@ -7890,7 +7890,7 @@ double opt_view_colormap_alpha_power(OPT_ARGS_NUM) double opt_view_colormap_beta(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->colorTable.dpar[COLORTABLE_BETA] = val; @@ -7910,7 +7910,7 @@ double opt_view_colormap_beta(OPT_ARGS_NUM) double opt_view_colormap_bias(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->colorTable.dpar[COLORTABLE_BIAS] = val; @@ -7930,7 +7930,7 @@ double opt_view_colormap_bias(OPT_ARGS_NUM) double opt_view_colormap_curvature(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->colorTable.dpar[COLORTABLE_CURVATURE] = val; @@ -7950,7 +7950,7 @@ double opt_view_colormap_curvature(OPT_ARGS_NUM) double opt_view_colormap_invert(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->colorTable.ipar[COLORTABLE_INVERT] = (int)val; @@ -7970,7 +7970,7 @@ double opt_view_colormap_invert(OPT_ARGS_NUM) double opt_view_colormap_number(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->colorTable.ipar[COLORTABLE_NUMBER] = (int)val; @@ -7990,7 +7990,7 @@ double opt_view_colormap_number(OPT_ARGS_NUM) double opt_view_colormap_rotation(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->colorTable.ipar[COLORTABLE_ROTATION] = (int)val; @@ -8010,7 +8010,7 @@ double opt_view_colormap_rotation(OPT_ARGS_NUM) double opt_view_colormap_swap(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->colorTable.ipar[COLORTABLE_SWAP] = (int)val; @@ -8030,7 +8030,7 @@ double opt_view_colormap_swap(OPT_ARGS_NUM) double opt_view_external_view(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->externalViewIndex = (int)val; @@ -8054,7 +8054,7 @@ double opt_view_external_view(OPT_ARGS_NUM) double opt_view_gen_raise_view(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->viewIndexForGenRaise = (int)val; @@ -8078,7 +8078,7 @@ double opt_view_gen_raise_view(OPT_ARGS_NUM) double opt_view_gen_raise_factor(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->genRaiseFactor = val; @@ -8096,7 +8096,7 @@ double opt_view_gen_raise_factor(OPT_ARGS_NUM) double opt_view_use_gen_raise(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->useGenRaise = (int)val; @@ -8116,7 +8116,7 @@ double opt_view_use_gen_raise(OPT_ARGS_NUM) double opt_view_use_stipple(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->useStipple = (int)val; @@ -8134,7 +8134,7 @@ double opt_view_use_stipple(OPT_ARGS_NUM) double opt_view_clip(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->clip = (int)val; @@ -8152,7 +8152,7 @@ double opt_view_clip(OPT_ARGS_NUM) double opt_view_force_num_components(OPT_ARGS_NUM) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->forceNumComponents = (int)val; @@ -8178,7 +8178,7 @@ double opt_view_force_num_components(OPT_ARGS_NUM) static double ovcm(OPT_ARGS_NUM, int nn) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0.); if(action & GMSH_SET) { opt->componentMap[nn] = (int)val; @@ -8804,7 +8804,7 @@ unsigned int opt_mesh_color_19(OPT_ARGS_COL){ return opt_mesh_color_(19, num, ac unsigned int opt_view_color_points(OPT_ARGS_COL) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0); if(action & GMSH_SET) { opt->color.point = val; @@ -8823,7 +8823,7 @@ unsigned int opt_view_color_points(OPT_ARGS_COL) unsigned int opt_view_color_lines(OPT_ARGS_COL) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0); if(action & GMSH_SET) { opt->color.line = val; @@ -8842,7 +8842,7 @@ unsigned int opt_view_color_lines(OPT_ARGS_COL) unsigned int opt_view_color_triangles(OPT_ARGS_COL) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0); if(action & GMSH_SET) { opt->color.triangle = val; @@ -8861,7 +8861,7 @@ unsigned int opt_view_color_triangles(OPT_ARGS_COL) unsigned int opt_view_color_quadrangles(OPT_ARGS_COL) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0); if(action & GMSH_SET) { opt->color.quadrangle = val; @@ -8880,7 +8880,7 @@ unsigned int opt_view_color_quadrangles(OPT_ARGS_COL) unsigned int opt_view_color_tetrahedra(OPT_ARGS_COL) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0); if(action & GMSH_SET) { opt->color.tetrahedron = val; @@ -8899,7 +8899,7 @@ unsigned int opt_view_color_tetrahedra(OPT_ARGS_COL) unsigned int opt_view_color_hexahedra(OPT_ARGS_COL) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0); if(action & GMSH_SET) { opt->color.hexahedron = val; @@ -8918,7 +8918,7 @@ unsigned int opt_view_color_hexahedra(OPT_ARGS_COL) unsigned int opt_view_color_prisms(OPT_ARGS_COL) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0); if(action & GMSH_SET) { opt->color.prism = val; @@ -8937,7 +8937,7 @@ unsigned int opt_view_color_prisms(OPT_ARGS_COL) unsigned int opt_view_color_pyramids(OPT_ARGS_COL) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0); if(action & GMSH_SET) { opt->color.pyramid = val; @@ -8956,7 +8956,7 @@ unsigned int opt_view_color_pyramids(OPT_ARGS_COL) unsigned int opt_view_color_tangents(OPT_ARGS_COL) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0); if(action & GMSH_SET) { opt->color.tangents = val; @@ -8975,7 +8975,7 @@ unsigned int opt_view_color_tangents(OPT_ARGS_COL) unsigned int opt_view_color_normals(OPT_ARGS_COL) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0); if(action & GMSH_SET) { opt->color.normals = val; @@ -8994,7 +8994,7 @@ unsigned int opt_view_color_normals(OPT_ARGS_COL) unsigned int opt_view_color_text2d(OPT_ARGS_COL) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0); if(action & GMSH_SET) { opt->color.text2d = val; @@ -9012,7 +9012,7 @@ unsigned int opt_view_color_text2d(OPT_ARGS_COL) unsigned int opt_view_color_text3d(OPT_ARGS_COL) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0); if(action & GMSH_SET) { opt->color.text3d = val; @@ -9030,7 +9030,7 @@ unsigned int opt_view_color_text3d(OPT_ARGS_COL) unsigned int opt_view_color_axes(OPT_ARGS_COL) { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) GET_VIEW(0); if(action & GMSH_SET) { opt->color.axes = val; diff --git a/Fltk/visibilityWindow.cpp b/Fltk/visibilityWindow.cpp index c9fc52055a..a45d6b26c7 100644 --- a/Fltk/visibilityWindow.cpp +++ b/Fltk/visibilityWindow.cpp @@ -28,7 +28,7 @@ #include "Options.h" #include "Context.h" -#if !defined(HAVE_NO_PARSER) +#if defined(HAVE_PARSER) #include "Parser.h" #endif @@ -179,7 +179,7 @@ class VisibilityList { // singleton delete _entities[i]; _entities.clear(); GModel *m = GModel::current(); -#if !defined(HAVE_NO_PARSER) +#if defined(HAVE_PARSER) for(std::map<std::string, std::vector<double> >::iterator it = gmsh_yysymbols.begin(); it != gmsh_yysymbols.end(); ++it) for(unsigned int i = 0; i < it->second.size(); i++) @@ -594,7 +594,7 @@ static void _rebuild_tree_browser(bool force) std::map<int, std::vector<GEntity*> > groups[4]; m->getPhysicalGroups(groups); std::map<int, std::string> oldLabels; -#if !defined(HAVE_NO_PARSER) +#if defined(HAVE_PARSER) for(std::map<std::string, std::vector<double> >::iterator it = gmsh_yysymbols.begin(); it != gmsh_yysymbols.end(); ++it) for(unsigned int i = 0; i < it->second.size(); i++) diff --git a/Geo/GFaceCompound.cpp b/Geo/GFaceCompound.cpp index 73298509c8..bc7a5ea4a6 100644 --- a/Geo/GFaceCompound.cpp +++ b/Geo/GFaceCompound.cpp @@ -4,6 +4,9 @@ // bugs and problems to <gmsh@geuz.org>. #include "GmshConfig.h" + +#if defined(HAVE_SOLVER) + #include "GmshDefines.h" #include "GFaceCompound.h" #include "MLine.h" @@ -337,7 +340,7 @@ static bool closedCavity(MVertex *v, std::vector<MElement*> &vTri){ void GFaceCompound::one2OneMap() const { -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) if(!mapv2Tri){ std::vector<MTriangle*> allTri; std::list<GFace*>::const_iterator it = _compound.begin(); @@ -1660,3 +1663,5 @@ void GFaceCompound::printStuff() const fprintf(xyzc,"};\n"); fclose(xyzc); } + +#endif diff --git a/Geo/GFaceCompound.h b/Geo/GFaceCompound.h index acfa0478bd..1efae09473 100644 --- a/Geo/GFaceCompound.h +++ b/Geo/GFaceCompound.h @@ -8,7 +8,12 @@ #include <list> #include <map> +#include "GmshConfig.h" +#include "GmshMessage.h" #include "GFace.h" + +#if defined(HAVE_SOLVER) + #include "GEdge.h" #include "GEdgeCompound.h" #include "meshGFaceOptimize.h" @@ -63,9 +68,9 @@ class GFaceCompound : public GFace { mutable std::map<MVertex*, SVector3> _normals; void buildOct() const ; void buildAllNodes() const; - void parametrize(iterationStep,typeOfMapping) const ; - void parametrize_conformal() const ; - void compute_distance() const ; + void parametrize(iterationStep, typeOfMapping) const; + void parametrize_conformal() const; + void compute_distance() const; bool checkOrientation(int iter) const; void one2OneMap() const; bool checkCavity(std::vector<MElement*> &vTri) const; @@ -110,4 +115,32 @@ class GFaceCompound : public GFace { typeOfMapping _mapping; }; +#else + +template<class scalar> class linearSystem; +class GFaceCompound : public GFace { + public: + typedef enum {HARMONIC=1,CONFORMAL=2, CONVEXCOMBINATION=3} typeOfMapping; + GFaceCompound(GModel *m, int tag, std::list<GFace*> &compound, + std::list<GEdge*> &U0, std::list<GEdge*> &U1, + std::list<GEdge*> &V0, std::list<GEdge*> &V1, + linearSystem<double>* lsys = 0, + typeOfMapping typ = HARMONIC) : GFace(m, tag) + { + Msg::Error("Gmsh has to be compiled with solver support to use GFaceCompounds"); + } + virtual ~GFaceCompound() {} + virtual GPoint point(double par1, double par2) const { return GPoint(); } + virtual Pair<SVector3, SVector3> firstDer(const SPoint2 ¶m) const + { + return Pair<SVector3, SVector3>(SVector3(0,0,0), SVector3(0,0,0)); + } + virtual void secondDer(const SPoint2 ¶m, + SVector3 *dudu, SVector3 *dvdv, SVector3 *dudv) const{} + virtual SPoint2 getCoordinates(MVertex *v) const { return SPoint2(); } + void parametrize() const {} +}; + +#endif + #endif diff --git a/Geo/GModel.cpp b/Geo/GModel.cpp index f15e7842ac..e31f19aef4 100644 --- a/Geo/GModel.cpp +++ b/Geo/GModel.cpp @@ -27,7 +27,7 @@ #include "Context.h" #include "OS.h" -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) #include "Field.h" #include "Generator.h" #endif @@ -44,7 +44,7 @@ GModel::GModel(std::string name) list.push_back(this); // at the moment we always create (at least an empty) GEO model _createGEOInternals(); -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) _fields = new FieldManager(); #endif } @@ -56,7 +56,7 @@ GModel::~GModel() destroy(); _deleteGEOInternals(); _deleteOCCInternals(); -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) delete _fields; #endif } @@ -116,7 +116,7 @@ void GModel::destroy() if(normals) delete normals; normals = 0; -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) _fields->reset(); #endif gmshSurface::reset(); @@ -415,7 +415,7 @@ SBoundingBox3d GModel::bounds() int GModel::mesh(int dimension) { -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) GenerateMesh(this, dimension); return true; #else diff --git a/Geo/GModelIO_Geo.cpp b/Geo/GModelIO_Geo.cpp index 4ac656db2f..e911e3ac5c 100644 --- a/Geo/GModelIO_Geo.cpp +++ b/Geo/GModelIO_Geo.cpp @@ -20,7 +20,7 @@ #include "gmshRegion.h" #include "Field.h" -#if !defined(HAVE_NO_PARSER) +#if defined(HAVE_PARSER) #include "Parser.h" #endif @@ -291,7 +291,7 @@ int GModel::writeGEO(const std::string &name, bool printLabels) (*it)->writeGEO(fp); std::map<int, std::string> labels; -#if !defined(HAVE_NO_PARSER) +#if defined(HAVE_PARSER) // get "old-style" labels from parser for(std::map<std::string, std::vector<double> >::iterator it = gmsh_yysymbols.begin(); it != gmsh_yysymbols.end(); ++it) diff --git a/Geo/Geo.cpp b/Geo/Geo.cpp index b683a610d0..bd93e1a68a 100644 --- a/Geo/Geo.cpp +++ b/Geo/Geo.cpp @@ -12,7 +12,7 @@ #include "GeoInterpolation.h" #include "Context.h" -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) #include "Field.h" #endif @@ -725,7 +725,7 @@ int NEWVOLUME(void) int NEWFIELD(void) { -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) return (GModel::current()->getFields()->maxId() + 1); #else return 0; diff --git a/Geo/GeoStringInterface.cpp b/Geo/GeoStringInterface.cpp index c84a82695e..d5d3c60517 100644 --- a/Geo/GeoStringInterface.cpp +++ b/Geo/GeoStringInterface.cpp @@ -15,15 +15,13 @@ #include "Context.h" #include "GModel.h" -#if !defined(HAVE_NO_PARSER) +#if defined(HAVE_PARSER) #include "Parser.h" #endif void add_infile(std::string text, std::string fileName, bool deleted_something) { -#if defined(HAVE_NO_PARSER) - Msg::Error("GEO file creation not available without Gmsh parser"); -#else +#if defined(HAVE_PARSER) std::string tmpFileName = CTX::instance()->homeDir + CTX::instance()->tmpFileName; FILE *gmsh_yyin_old = gmsh_yyin; if(!(gmsh_yyin = fopen(tmpFileName.c_str(), "w"))) { @@ -75,6 +73,8 @@ void add_infile(std::string text, std::string fileName, bool deleted_something) fprintf(fp, "%s\n", text.c_str()); fclose(fp); +#else + Msg::Error("GEO file creation not available without Gmsh parser"); #endif } diff --git a/Geo/MTetrahedron.cpp b/Geo/MTetrahedron.cpp index e4dcfaadcc..9875212bff 100644 --- a/Geo/MTetrahedron.cpp +++ b/Geo/MTetrahedron.cpp @@ -7,7 +7,7 @@ #include "Numeric.h" #include "Context.h" -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) #include "qualityMeasures.h" #include "meshGFaceDelaunayInsertion.h" #include "meshGRegionDelaunayInsertion.h" @@ -17,7 +17,7 @@ SPoint3 MTetrahedron::circumcenter() { -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) MTet4 t(this, 0); double res[3]; t.circumcenter(res); @@ -29,7 +29,7 @@ SPoint3 MTetrahedron::circumcenter() double MTetrahedron::distoShapeMeasure() { -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) return qmDistorsionOfMapping(this); #else return 0.; @@ -38,7 +38,7 @@ double MTetrahedron::distoShapeMeasure() double MTetrahedronN::distoShapeMeasure() { -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) _disto = qmDistorsionOfMapping(this); #else _disto = 0.; @@ -48,7 +48,7 @@ double MTetrahedronN::distoShapeMeasure() double MTetrahedron::gammaShapeMeasure() { -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) double vol; return qmTet(this, QMTET_2, &vol); #else @@ -58,7 +58,7 @@ double MTetrahedron::gammaShapeMeasure() double MTetrahedron::etaShapeMeasure() { -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) double vol; return qmTet(this, QMTET_3, &vol); #else diff --git a/Geo/MTriangle.cpp b/Geo/MTriangle.cpp index 4d66d6a126..cd97bce754 100644 --- a/Geo/MTriangle.cpp +++ b/Geo/MTriangle.cpp @@ -7,7 +7,7 @@ #include "Numeric.h" #include "Context.h" -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) #include "qualityMeasures.h" #endif @@ -25,7 +25,7 @@ SPoint3 MTriangle::circumcenter() double MTriangle::distoShapeMeasure() { -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) return qmDistorsionOfMapping(this); #else return 0.; @@ -34,7 +34,7 @@ double MTriangle::distoShapeMeasure() double MTriangle::gammaShapeMeasure() { -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) return qmTriangle(this, QMTRI_RHO); #else return 0.; diff --git a/Geo/gmshLevelset.h b/Geo/gmshLevelset.h index cea8a8daf7..6dc84c6427 100644 --- a/Geo/gmshLevelset.h +++ b/Geo/gmshLevelset.h @@ -41,7 +41,7 @@ public: int type() const { return UNKNOWN; } }; -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) #include "PView.h" #include "OctreePost.h" diff --git a/Mesh/Field.cpp b/Mesh/Field.cpp index bb0518575f..c4063a46f7 100644 --- a/Mesh/Field.cpp +++ b/Mesh/Field.cpp @@ -23,7 +23,7 @@ #include "Numeric.h" #include "mathEvaluator.h" -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) #include "OctreePost.h" #include "PViewDataList.h" #include "MVertex.h" @@ -1056,7 +1056,7 @@ class ParametricField : public Field } }; -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) class PostViewField : public Field { OctreePost *octree; @@ -1368,7 +1368,7 @@ FieldManager::FieldManager() map_type_name["Box"] = new FieldFactoryT<BoxField>(); map_type_name["Cylinder"] = new FieldFactoryT<CylinderField>(); map_type_name["LonLat"] = new FieldFactoryT<LonLatField>(); -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) map_type_name["PostView"] = new FieldFactoryT<PostViewField>(); #endif map_type_name["Gradient"] = new FieldFactoryT<GradientField>(); @@ -1388,7 +1388,7 @@ FieldManager::FieldManager() background_field = -1; } -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) void Field::putOnNewView() { if(GModel::current()->getMeshStatus() < 1){ diff --git a/Mesh/Field.h b/Mesh/Field.h index 131e94bac6..91b94348c6 100644 --- a/Mesh/Field.h +++ b/Mesh/Field.h @@ -12,7 +12,7 @@ #include "GmshConfig.h" #include "STensor3.h" -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) #include "PView.h" #endif @@ -71,7 +71,7 @@ class Field { virtual bool isotropic () const {return true;} bool update_needed; virtual const char *getName() = 0; -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) void putOnView(PView * view, int comp = -1); void putOnNewView(); #endif diff --git a/Mesh/Generator.cpp b/Mesh/Generator.cpp index 911bc23261..aabc31277c 100644 --- a/Mesh/Generator.cpp +++ b/Mesh/Generator.cpp @@ -26,7 +26,7 @@ #include "HighOrder.h" #include "Generator.h" -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) #include "PView.h" #include "PViewData.h" #endif @@ -279,7 +279,7 @@ void GetStatistics(double stat[50], double quality[4][100]) stat[48] = distoMax; } -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) stat[26] = PView::list.size(); for(unsigned int i = 0; i < PView::list.size(); i++) { PViewData *data = PView::list[i]->getData(true); diff --git a/Mesh/highOrderSmoother.cpp b/Mesh/highOrderSmoother.cpp index 3490ac6247..dc56882ddd 100644 --- a/Mesh/highOrderSmoother.cpp +++ b/Mesh/highOrderSmoother.cpp @@ -7,6 +7,10 @@ // Koen Hillewaert // +#include "GmshConfig.h" + +#if defined(HAVE_SOLVER) + #include "MLine.h" #include "MTriangle.h" #include "MQuadrangle.h" @@ -35,6 +39,8 @@ static int swapHighOrderTriangles(GFace *gf, edgeContainer&, faceContainer&, static int findOptimalLocationsP2(GFace *gf, highOrderSmoother *s); static int findOptimalLocationsPN(GFace *gf, highOrderSmoother *s); +extern double angle3Points(MVertex *p1, MVertex *p2, MVertex *p3); + static double shapeMeasure(MElement *e) { const double d1 = e->distoShapeMeasure(); @@ -42,17 +48,6 @@ static double shapeMeasure(MElement *e) return d1; } -double angle3Points(MVertex *p1, MVertex *p2, MVertex *p3) -{ - SVector3 a(p1->x() - p2->x(), p1->y() - p2->y(), p1->z() - p2->z()); - SVector3 b(p3->x() - p2->x(), p3->y() - p2->y(), p3->z() - p2->z()); - SVector3 c = crossprod(a, b); - double sinA = c.norm(); - double cosA = dot(a, b); - // printf("%d %d %d -> %g %g\n",p1->iD,p2->iD,p3->iD,cosA,sinA); - return atan2 (sinA, cosA); -} - void highOrderSmoother::moveTo(MVertex *v, const std::map<MVertex*, SVector3> &m) const { @@ -1314,4 +1309,5 @@ void highOrderSmoother::smooth_pNpoint(GFace *gf) findOptimalLocationsPN(gf,this); } +#endif diff --git a/Mesh/highOrderSmoother.h b/Mesh/highOrderSmoother.h index 24bc860c31..8b16f060d2 100644 --- a/Mesh/highOrderSmoother.h +++ b/Mesh/highOrderSmoother.h @@ -8,6 +8,11 @@ #include <map> #include <vector> +#include "GmshConfig.h" +#include "GmshMessage.h" + +#if defined(HAVE_SOLVER) + #include "SVector3.h" #include "fullMatrix.h" #include "dofManager.h" @@ -84,4 +89,22 @@ public: } }; +#else + +class highOrderSmoother +{ + public: + highOrderSmoother(int dim) + { + Msg::Error("Gmsh has to be compiled with solver support to use highOrderSmoother"); + } + void add(MVertex * v, const SVector3 &d ){} + void smooth(GRegion*){} + void optimize(GFace *, + edgeContainer &edgeVertices, + faceContainer &faceVertices){} +}; + +#endif + #endif diff --git a/Mesh/meshGFace.cpp b/Mesh/meshGFace.cpp index 9e03fc0264..0fdce56151 100644 --- a/Mesh/meshGFace.cpp +++ b/Mesh/meshGFace.cpp @@ -1293,9 +1293,8 @@ void meshGFace::operator() (GFace *gf) bool checkMeshCompound(GFaceCompound *gf, std::list<GEdge*> &edges) { - bool isMeshed = false; - +#if defined(HAVE_SOLVER) //Check Topology bool correctTopo = gf->checkTopology(); if (!correctTopo){ @@ -1330,13 +1329,12 @@ bool checkMeshCompound(GFaceCompound *gf, std::list<GEdge*> &edges) edges.insert(edges.begin(), mySet.begin(), mySet.end()); return isMeshed; - +#endif } void partitionAndRemesh(GFaceCompound *gf) { - -#if defined(HAVE_CHACO) || defined(HAVE_METIS) +#if defined(HAVE_SOLVER) && (defined(HAVE_CHACO) || defined(HAVE_METIS)) //Partition the mesh and createTopology for new faces //----------------------------------------------------- @@ -1459,13 +1457,9 @@ void partitionAndRemesh(GFaceCompound *gf) //CreateOutputFile("toto.msh", CTX::instance()->mesh.format); //Msg::Exit(1); - -#else - return; #endif } - template<class T> static bool shouldRevert(MEdge &reference, std::vector<T*> &elements) { diff --git a/Mesh/meshGFaceOptimize.cpp b/Mesh/meshGFaceOptimize.cpp index 4d6e8ac65d..e243ab3f29 100644 --- a/Mesh/meshGFaceOptimize.cpp +++ b/Mesh/meshGFaceOptimize.cpp @@ -911,7 +911,16 @@ int edgeCollapsePass(double minLC, GFace *gf, std::set<MTri3*,compareTri3Ptr> &a return nbCollapse; } -extern double angle3Points(MVertex *p1, MVertex *p2, MVertex *p3); +double angle3Points(MVertex *p1, MVertex *p2, MVertex *p3) +{ + SVector3 a(p1->x() - p2->x(), p1->y() - p2->y(), p1->z() - p2->z()); + SVector3 b(p3->x() - p2->x(), p3->y() - p2->y(), p3->z() - p2->z()); + SVector3 c = crossprod(a, b); + double sinA = c.norm(); + double cosA = dot(a, b); + // printf("%d %d %d -> %g %g\n",p1->iD,p2->iD,p3->iD,cosA,sinA); + return atan2 (sinA, cosA); +} struct RecombineTriangle { diff --git a/Mesh/meshPartition.cpp b/Mesh/meshPartition.cpp index 627bcd28c4..4cd9b2781b 100644 --- a/Mesh/meshPartition.cpp +++ b/Mesh/meshPartition.cpp @@ -1024,8 +1024,7 @@ int CreatePartitionBoundaries(GModel *model) void createPartitionFaces(GModel *model, GFaceCompound *gf, int N, std::vector<discreteFace*> &discreteFaces) { - - +#if defined(HAVE_SOLVER) // Compound is partitioned in N discrete faces //-------------------------------------------- std::vector<std::set<MVertex*> > allNodes; @@ -1059,9 +1058,7 @@ void createPartitionFaces(GModel *model, GFaceCompound *gf, int N, discreteFaces[i]->mesh_vertices.push_back(*it); } } - - return; - +#endif } /******************************************************************************* diff --git a/Parser/Gmsh.tab.cpp b/Parser/Gmsh.tab.cpp index 8e1d4527d4..934ae1b844 100644 --- a/Parser/Gmsh.tab.cpp +++ b/Parser/Gmsh.tab.cpp @@ -370,13 +370,13 @@ #include "gmshSurface.h" #include "gmshLevelset.h" -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) #include "Generator.h" #include "Field.h" #include "BackgroundMesh.h" #endif -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) #include "PView.h" #include "PViewDataList.h" #include "PluginManager.h" @@ -398,7 +398,7 @@ std::map<std::string, std::vector<double> > gmsh_yysymbols; // Static parser variables (accessible only in this file) static std::map<std::string, std::string > gmsh_yystringsymbols; -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) static PViewDataList *ViewData; #endif static std::vector<double> ViewCoord; @@ -3999,7 +3999,7 @@ yyreduce: case 28: #line 258 "Gmsh.y" { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) if(!strcmp((yyvsp[(1) - (6)].c), "View") && ViewData->finalize()){ ViewData->setName((yyvsp[(2) - (6)].c)); ViewData->setFileName(gmsh_yyname); @@ -4016,7 +4016,7 @@ yyreduce: case 29: #line 272 "Gmsh.y" { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) if(!strcmp((yyvsp[(2) - (6)].c), "View")){ int index = (int)(yyvsp[(4) - (6)].d); if(index >= 0 && index < (int)PView::list.size()) @@ -4030,7 +4030,7 @@ yyreduce: case 30: #line 283 "Gmsh.y" { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) if(!strcmp((yyvsp[(2) - (6)].c), "View")){ int index = (int)(yyvsp[(4) - (6)].d); if(index >= 0 && index < (int)PView::list.size()) @@ -4044,7 +4044,7 @@ yyreduce: case 31: #line 297 "Gmsh.y" { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) ViewData = new PViewDataList(); #endif ;} @@ -4073,7 +4073,7 @@ yyreduce: case 41: #line 325 "Gmsh.y" { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) if(!strncmp((yyvsp[(1) - (1)].c), "SP", 2)){ ViewValueList = &ViewData->SP; ViewNumList = &ViewData->NbSP; } @@ -4180,7 +4180,7 @@ yyreduce: case 42: #line 429 "Gmsh.y" { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) if(ViewValueList){ for(int i = 0; i < 3; i++) for(unsigned int j = 0; j < ViewCoord.size() / 3; j++) @@ -4193,7 +4193,7 @@ yyreduce: case 43: #line 439 "Gmsh.y" { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) if(ViewValueList) (*ViewNumList)++; #endif ;} @@ -4202,7 +4202,7 @@ yyreduce: case 44: #line 448 "Gmsh.y" { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) for(int i = 0; i < (int)strlen((yyvsp[(1) - (1)].c)) + 1; i++) ViewData->T2C.push_back((yyvsp[(1) - (1)].c)[i]); #endif Free((yyvsp[(1) - (1)].c)); @@ -4212,7 +4212,7 @@ yyreduce: case 45: #line 455 "Gmsh.y" { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) for(int i = 0; i < (int)strlen((yyvsp[(3) - (3)].c)) + 1; i++) ViewData->T2C.push_back((yyvsp[(3) - (3)].c)[i]); #endif Free((yyvsp[(3) - (3)].c)); @@ -4222,7 +4222,7 @@ yyreduce: case 46: #line 465 "Gmsh.y" { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) ViewData->T2D.push_back((yyvsp[(3) - (8)].d)); ViewData->T2D.push_back((yyvsp[(5) - (8)].d)); ViewData->T2D.push_back((yyvsp[(7) - (8)].d)); @@ -4234,7 +4234,7 @@ yyreduce: case 47: #line 474 "Gmsh.y" { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) ViewData->NbT2++; #endif ;} @@ -4243,7 +4243,7 @@ yyreduce: case 48: #line 483 "Gmsh.y" { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) for(int i = 0; i < (int)strlen((yyvsp[(1) - (1)].c)) + 1; i++) ViewData->T3C.push_back((yyvsp[(1) - (1)].c)[i]); #endif Free((yyvsp[(1) - (1)].c)); @@ -4253,7 +4253,7 @@ yyreduce: case 49: #line 490 "Gmsh.y" { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) for(int i = 0; i < (int)strlen((yyvsp[(3) - (3)].c)) + 1; i++) ViewData->T3C.push_back((yyvsp[(3) - (3)].c)[i]); #endif Free((yyvsp[(3) - (3)].c)); @@ -4263,7 +4263,7 @@ yyreduce: case 50: #line 500 "Gmsh.y" { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) ViewData->T3D.push_back((yyvsp[(3) - (10)].d)); ViewData->T3D.push_back((yyvsp[(5) - (10)].d)); ViewData->T3D.push_back((yyvsp[(7) - (10)].d)); ViewData->T3D.push_back((yyvsp[(9) - (10)].d)); ViewData->T3D.push_back(ViewData->T3C.size()); @@ -4274,7 +4274,7 @@ yyreduce: case 51: #line 508 "Gmsh.y" { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) ViewData->NbT3++; #endif ;} @@ -4283,7 +4283,7 @@ yyreduce: case 52: #line 518 "Gmsh.y" { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) int type = (ViewData->NbSL || ViewData->NbVL) ? TYPE_LIN : (ViewData->NbST || ViewData->NbVT) ? TYPE_TRI : @@ -4302,7 +4302,7 @@ yyreduce: case 53: #line 537 "Gmsh.y" { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) int type = (ViewData->NbSL || ViewData->NbVL) ? TYPE_LIN : (ViewData->NbST || ViewData->NbVT) ? TYPE_TRI : @@ -4321,7 +4321,7 @@ yyreduce: case 54: #line 556 "Gmsh.y" { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) ViewValueList = &ViewData->Time; #endif ;} @@ -4674,7 +4674,7 @@ yyreduce: case 81: #line 850 "Gmsh.y" { -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) if(!strcmp((yyvsp[(1) - (5)].c),"Background")) GModel::current()->getFields()->background_field = (int)(yyvsp[(4) - (5)].d); else @@ -4686,7 +4686,7 @@ yyreduce: case 82: #line 859 "Gmsh.y" { -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) if(!GModel::current()->getFields()->newField((int)(yyvsp[(3) - (7)].d), (yyvsp[(6) - (7)].c))) yymsg(0, "Cannot create field %i of type '%s'", (int)(yyvsp[(3) - (7)].d), (yyvsp[(6) - (7)].c)); #endif @@ -4697,7 +4697,7 @@ yyreduce: case 83: #line 867 "Gmsh.y" { -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) Field *field = GModel::current()->getFields()->get((int)(yyvsp[(3) - (9)].d)); if(field){ FieldOption *option = field->options[(yyvsp[(6) - (9)].c)]; @@ -4722,7 +4722,7 @@ yyreduce: case 84: #line 889 "Gmsh.y" { -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) Field *field = GModel::current()->getFields()->get((int)(yyvsp[(3) - (9)].d)); if(field){ FieldOption *option = field->options[(yyvsp[(6) - (9)].c)]; @@ -4748,7 +4748,7 @@ yyreduce: case 85: #line 912 "Gmsh.y" { -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) Field *field = GModel::current()->getFields()->get((int)(yyvsp[(3) - (11)].d)); if(field){ FieldOption *option = field->options[(yyvsp[(6) - (11)].c)]; @@ -4776,7 +4776,7 @@ yyreduce: case 86: #line 940 "Gmsh.y" { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) try { PluginManager::instance()->setPluginOption((yyvsp[(3) - (9)].c), (yyvsp[(6) - (9)].c), (yyvsp[(8) - (9)].d)); } @@ -4791,7 +4791,7 @@ yyreduce: case 87: #line 952 "Gmsh.y" { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) try { PluginManager::instance()->setPluginOption((yyvsp[(3) - (9)].c), (yyvsp[(6) - (9)].c), (yyvsp[(8) - (9)].c)); } @@ -5931,7 +5931,7 @@ yyreduce: Tree_Add(GModel::current()->getGEOInternals()->LevelSets, &l); } } -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) else if(!strcmp((yyvsp[(2) - (8)].c), "PostView")){ int t = (int)(yyvsp[(4) - (8)].d); if(FindLevelSet(t)){ @@ -6114,7 +6114,7 @@ yyreduce: case 152: #line 2132 "Gmsh.y" { -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) GModel::current()->getFields()->deleteField((int)(yyvsp[(4) - (6)].d)); #endif ;} @@ -6123,7 +6123,7 @@ yyreduce: case 153: #line 2138 "Gmsh.y" { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) if(!strcmp((yyvsp[(2) - (6)].c), "View")){ int index = (int)(yyvsp[(4) - (6)].d); if(index >= 0 && index < (int)PView::list.size()) @@ -6168,7 +6168,7 @@ yyreduce: case 155: #line 2177 "Gmsh.y" { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) if(!strcmp((yyvsp[(2) - (4)].c), "Empty") && !strcmp((yyvsp[(3) - (4)].c), "Views")){ for(int i = PView::list.size() - 1; i >= 0; i--) if(PView::list[i]->getData()->empty()) delete PView::list[i]; @@ -6280,7 +6280,7 @@ yyreduce: case 162: #line 2283 "Gmsh.y" { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) if(!strcmp((yyvsp[(1) - (7)].c), "Save") && !strcmp((yyvsp[(2) - (7)].c), "View")){ int index = (int)(yyvsp[(4) - (7)].d); if(index >= 0 && index < (int)PView::list.size()){ @@ -6300,7 +6300,7 @@ yyreduce: case 163: #line 2300 "Gmsh.y" { -#if !defined(HAVE_NO_POST) && !defined(HAVE_NO_MESH) +#if defined(HAVE_POST) && defined(HAVE_MESH) if(!strcmp((yyvsp[(1) - (7)].c), "Background") && !strcmp((yyvsp[(2) - (7)].c), "Mesh") && !strcmp((yyvsp[(3) - (7)].c), "View")){ int index = (int)(yyvsp[(5) - (7)].d); if(index >= 0 && index < (int)PView::list.size()) @@ -6340,7 +6340,7 @@ yyreduce: case 165: #line 2334 "Gmsh.y" { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) try { PluginManager::instance()->action((yyvsp[(3) - (7)].c), (yyvsp[(6) - (7)].c), 0); } @@ -6355,7 +6355,7 @@ yyreduce: case 166: #line 2346 "Gmsh.y" { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) if(!strcmp((yyvsp[(2) - (3)].c), "ElementsFromAllViews")) PView::combine(false, 1, CTX::instance()->post.combineRemoveOrig); else if(!strcmp((yyvsp[(2) - (3)].c), "ElementsFromVisibleViews")) diff --git a/Parser/Gmsh.y b/Parser/Gmsh.y index 6f34f86017..c549d60f8d 100644 --- a/Parser/Gmsh.y +++ b/Parser/Gmsh.y @@ -31,13 +31,13 @@ #include "gmshSurface.h" #include "gmshLevelset.h" -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) #include "Generator.h" #include "Field.h" #include "BackgroundMesh.h" #endif -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) #include "PView.h" #include "PViewDataList.h" #include "PluginManager.h" @@ -59,7 +59,7 @@ std::map<std::string, std::vector<double> > gmsh_yysymbols; // Static parser variables (accessible only in this file) static std::map<std::string, std::string > gmsh_yystringsymbols; -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) static PViewDataList *ViewData; #endif static std::vector<double> ViewCoord; @@ -256,7 +256,7 @@ Printf : View : tSTRING tBIGSTR '{' Views '}' tEND { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) if(!strcmp($1, "View") && ViewData->finalize()){ ViewData->setName($2); ViewData->setFileName(gmsh_yyname); @@ -270,7 +270,7 @@ View : } | tAlias tSTRING '[' FExpr ']' tEND { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) if(!strcmp($2, "View")){ int index = (int)$4; if(index >= 0 && index < (int)PView::list.size()) @@ -281,7 +281,7 @@ View : } | tAliasWithOptions tSTRING '[' FExpr ']' tEND { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) if(!strcmp($2, "View")){ int index = (int)$4; if(index >= 0 && index < (int)PView::list.size()) @@ -295,7 +295,7 @@ View : Views : // nothing { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) ViewData = new PViewDataList(); #endif } @@ -323,7 +323,7 @@ ElementValues : Element : tSTRING { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) if(!strncmp($1, "SP", 2)){ ViewValueList = &ViewData->SP; ViewNumList = &ViewData->NbSP; } @@ -427,7 +427,7 @@ Element : } '(' ElementCoords ')' { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) if(ViewValueList){ for(int i = 0; i < 3; i++) for(unsigned int j = 0; j < ViewCoord.size() / 3; j++) @@ -437,7 +437,7 @@ Element : } '{' ElementValues '}' tEND { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) if(ViewValueList) (*ViewNumList)++; #endif } @@ -446,14 +446,14 @@ Element : Text2DValues : StringExprVar { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) for(int i = 0; i < (int)strlen($1) + 1; i++) ViewData->T2C.push_back($1[i]); #endif Free($1); } | Text2DValues ',' StringExprVar { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) for(int i = 0; i < (int)strlen($3) + 1; i++) ViewData->T2C.push_back($3[i]); #endif Free($3); @@ -463,7 +463,7 @@ Text2DValues : Text2D : tText2D '(' FExpr ',' FExpr ',' FExpr ')' { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) ViewData->T2D.push_back($3); ViewData->T2D.push_back($5); ViewData->T2D.push_back($7); @@ -472,7 +472,7 @@ Text2D : } '{' Text2DValues '}' tEND { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) ViewData->NbT2++; #endif } @@ -481,14 +481,14 @@ Text2D : Text3DValues : StringExprVar { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) for(int i = 0; i < (int)strlen($1) + 1; i++) ViewData->T3C.push_back($1[i]); #endif Free($1); } | Text3DValues ',' StringExprVar { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) for(int i = 0; i < (int)strlen($3) + 1; i++) ViewData->T3C.push_back($3[i]); #endif Free($3); @@ -498,7 +498,7 @@ Text3DValues : Text3D : tText3D '(' FExpr ',' FExpr ',' FExpr ',' FExpr ')' { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) ViewData->T3D.push_back($3); ViewData->T3D.push_back($5); ViewData->T3D.push_back($7); ViewData->T3D.push_back($9); ViewData->T3D.push_back(ViewData->T3C.size()); @@ -506,7 +506,7 @@ Text3D : } '{' Text3DValues '}' tEND { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) ViewData->NbT3++; #endif } @@ -516,7 +516,7 @@ InterpolationMatrix : tInterpolationScheme '{' RecursiveListOfListOfDouble '}' '{' RecursiveListOfListOfDouble '}' tEND { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) int type = (ViewData->NbSL || ViewData->NbVL) ? TYPE_LIN : (ViewData->NbST || ViewData->NbVT) ? TYPE_TRI : @@ -535,7 +535,7 @@ InterpolationMatrix : '{' RecursiveListOfListOfDouble '}' '{' RecursiveListOfListOfDouble '}' tEND { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) int type = (ViewData->NbSL || ViewData->NbVL) ? TYPE_LIN : (ViewData->NbST || ViewData->NbVT) ? TYPE_TRI : @@ -554,7 +554,7 @@ InterpolationMatrix : Time : tTime { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) ViewValueList = &ViewData->Time; #endif } @@ -848,7 +848,7 @@ Affectation : | tSTRING tField tAFFECT FExpr tEND { -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) if(!strcmp($1,"Background")) GModel::current()->getFields()->background_field = (int)$4; else @@ -857,7 +857,7 @@ Affectation : } | tField '[' FExpr ']' tAFFECT tSTRING tEND { -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) if(!GModel::current()->getFields()->newField((int)$3, $6)) yymsg(0, "Cannot create field %i of type '%s'", (int)$3, $6); #endif @@ -865,7 +865,7 @@ Affectation : } | tField '[' FExpr ']' '.' tSTRING tAFFECT FExpr tEND { -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) Field *field = GModel::current()->getFields()->get((int)$3); if(field){ FieldOption *option = field->options[$6]; @@ -887,7 +887,7 @@ Affectation : } | tField '[' FExpr ']' '.' tSTRING tAFFECT StringExpr tEND { -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) Field *field = GModel::current()->getFields()->get((int)$3); if(field){ FieldOption *option = field->options[$6]; @@ -910,7 +910,7 @@ Affectation : } | tField '[' FExpr ']' '.' tSTRING tAFFECT '{' RecursiveListOfDouble '}' tEND { -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) Field *field = GModel::current()->getFields()->get((int)$3); if(field){ FieldOption *option = field->options[$6]; @@ -938,7 +938,7 @@ Affectation : | tPlugin '(' tSTRING ')' '.' tSTRING tAFFECT FExpr tEND { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) try { PluginManager::instance()->setPluginOption($3, $6, $8); } @@ -950,7 +950,7 @@ Affectation : } | tPlugin '(' tSTRING ')' '.' tSTRING tAFFECT StringExpr tEND { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) try { PluginManager::instance()->setPluginOption($3, $6, $8); } @@ -1956,7 +1956,7 @@ LevelSet : Tree_Add(GModel::current()->getGEOInternals()->LevelSets, &l); } } -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) else if(!strcmp($2, "PostView")){ int t = (int)$4; if(FindLevelSet(t)){ @@ -2130,13 +2130,13 @@ Delete : } | tDelete tField '[' FExpr ']' tEND { -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) GModel::current()->getFields()->deleteField((int)$4); #endif } | tDelete tSTRING '[' FExpr ']' tEND { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) if(!strcmp($2, "View")){ int index = (int)$4; if(index >= 0 && index < (int)PView::list.size()) @@ -2175,7 +2175,7 @@ Delete : } | tDelete tSTRING tSTRING tEND { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) if(!strcmp($2, "Empty") && !strcmp($3, "Views")){ for(int i = PView::list.size() - 1; i >= 0; i--) if(PView::list[i]->getData()->empty()) delete PView::list[i]; @@ -2281,7 +2281,7 @@ Command : } | tSTRING tSTRING '[' FExpr ']' StringExprVar tEND { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) if(!strcmp($1, "Save") && !strcmp($2, "View")){ int index = (int)$4; if(index >= 0 && index < (int)PView::list.size()){ @@ -2298,7 +2298,7 @@ Command : } | tSTRING tSTRING tSTRING '[' FExpr ']' tEND { -#if !defined(HAVE_NO_POST) && !defined(HAVE_NO_MESH) +#if defined(HAVE_POST) && defined(HAVE_MESH) if(!strcmp($1, "Background") && !strcmp($2, "Mesh") && !strcmp($3, "View")){ int index = (int)$5; if(index >= 0 && index < (int)PView::list.size()) @@ -2332,7 +2332,7 @@ Command : } | tPlugin '(' tSTRING ')' '.' tSTRING tEND { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) try { PluginManager::instance()->action($3, $6, 0); } @@ -2344,7 +2344,7 @@ Command : } | tCombine tSTRING tEND { -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) if(!strcmp($2, "ElementsFromAllViews")) PView::combine(false, 1, CTX::instance()->post.combineRemoveOrig); else if(!strcmp($2, "ElementsFromVisibleViews")) diff --git a/Plugin/FieldView.cpp b/Plugin/FieldView.cpp index 8c0a67d6a9..1cc73b31a6 100644 --- a/Plugin/FieldView.cpp +++ b/Plugin/FieldView.cpp @@ -6,7 +6,7 @@ #include "FieldView.h" #include "GModel.h" -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) #include "Field.h" #endif @@ -41,7 +41,7 @@ StringXNumber *GMSH_FieldViewPlugin::getOption(int iopt) PView *GMSH_FieldViewPlugin::execute(PView *v) { -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) //int comp = (int)FieldViewOptions_Number[0].def; int iView = (int)FieldViewOptions_Number[1].def; int iField = (int)FieldViewOptions_Number[2].def; diff --git a/Plugin/GSHHS.cpp b/Plugin/GSHHS.cpp index a1c7db457c..5b96f80330 100644 --- a/Plugin/GSHHS.cpp +++ b/Plugin/GSHHS.cpp @@ -8,7 +8,7 @@ #include "GSHHS.h" #include "GModel.h" -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) #include "Field.h" #else class Field { @@ -998,7 +998,7 @@ PView *GMSH_GSHHSPlugin::execute(PView * v) return NULL; } Field *field = NULL; -#if !defined(HAVE_NO_MESH) +#if defined(HAVE_MESH) if (iField != -1) { field = GModel::current()->getFields()->get(iField); if(!field){ diff --git a/Solver/elasticitySolver.cpp b/Solver/elasticitySolver.cpp index 558fdf6a99..73f99fe40c 100644 --- a/Solver/elasticitySolver.cpp +++ b/Solver/elasticitySolver.cpp @@ -14,7 +14,7 @@ #include "linearSystemGMM.h" #include "Numeric.h" -#if !defined(HAVE_NO_POST) +#if defined(HAVE_POST) #include "PView.h" #include "PViewData.h" -- GitLab