diff --git a/Common/LuaBindings.cpp b/Common/LuaBindings.cpp index 9af7c869ed99bfe35cdf51085125019f6c05a55f..1042b92d44cb63ae845e586c52acffc9c8d3ebf6 100644 --- a/Common/LuaBindings.cpp +++ b/Common/LuaBindings.cpp @@ -1,5 +1,6 @@ #include "GmshConfig.h" -#ifdef HAVE_LUA + +#if defined(HAVE_LUA) #include <iostream> #include <string> #include "Gmsh.h" @@ -15,7 +16,9 @@ #include "Bindings.h" #include "drawContext.h" #include "GmshMessage.h" +#if defined(HAVE_SOLVER) #include "linearSystemCSR.h" +#endif extern "C" { #include "lua.h" @@ -23,7 +26,7 @@ extern "C" { #include "lauxlib.h" } -#ifdef HAVE_READLINE +#if defined(HAVE_READLINE) #include "readline.h" #include "history.h" #endif @@ -332,10 +335,14 @@ binding::binding() MElement::registerBindings(this); MVertex::registerBindings(this); fullMatrix<double>::registerBindings(this); - function::registerBindings(this); gmshOptions::registerBindings(this); Msg::registerBindings(this); +#if defined(HAVE_SOLVER) + function::registerBindings(this); linearSystemCSRGmm<double>::registerBindings(this); +#endif } + binding *binding::_instance=NULL; + #endif diff --git a/Geo/GFaceCompound.h b/Geo/GFaceCompound.h index cbca113e0dd7d697cf67c7dc0e45423c6022e98e..187d982ed4207453da88206299b9754b31c7072f 100644 --- a/Geo/GFaceCompound.h +++ b/Geo/GFaceCompound.h @@ -132,18 +132,22 @@ class GFaceCompound : public GFace { template<class scalar> class linearSystem; class GFaceCompound : public GFace { public: - typedef enum {HARMONIC=1,CONFORMAL=2, CONVEXCOMBINATION=3} typeOfMapping; + typedef enum {HARMONIC=1,CONFORMAL=2, CONVEXCOMBINATION=3, MULTISCALE=4} 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) + linearSystem<double>* lsys =0, + typeOfMapping typ = HARMONIC, int allowPartition=1) + : GFace(m, tag) { Msg::Error("Gmsh has to be compiled with solver support to use GFaceCompounds"); } virtual ~GFaceCompound() {} - GPoint point(double par1, double par2) const ; - Pair<SVector3, SVector3> firstDer(const SPoint2 ¶m) const; + GPoint point(double par1, double par2) const { return GPoint(); } + Pair<SVector3, SVector3> firstDer(const SPoint2 ¶m) const + { + return Pair<SVector3, SVector3>(SVector3(0, 0, 0), SVector3(0, 0, 0)); + } void secondDer(const SPoint2 ¶m, SVector3 *dudu, SVector3 *dvdv, SVector3 *dudv) const{} virtual SPoint2 getCoordinates(MVertex *v) const { return SPoint2(); } diff --git a/Mesh/BackgroundMesh.cpp b/Mesh/BackgroundMesh.cpp index fe44f3d1d6114e95e5a824498d5b58f192ede539..07a866d73b57a979a58915e41074c30ac14ddb13 100644 --- a/Mesh/BackgroundMesh.cpp +++ b/Mesh/BackgroundMesh.cpp @@ -18,12 +18,15 @@ #include "MTriangle.h" #include "MVertex.h" #include "Octree.h" + +#if defined(HAVE_SOLVER) #include "dofManager.h" #include "laplaceTerm.h" #include "linearSystemGMM.h" #include "linearSystemCSR.h" #include "linearSystemFull.h" #include "linearSystemPETSc.h" +#endif // computes the characteristic length of the mesh at a vertex in order // to have the geometry captured with accuracy. A parameter called @@ -303,6 +306,7 @@ backgroundMesh::~backgroundMesh() void backgroundMesh::propagate1dMesh(GFace *_gf) { +#if defined(HAVE_SOLVER) std::list<GEdge*> e = _gf->edges(); std::list<GEdge*>::const_iterator it = e.begin(); std::map<MVertex*,double> sizes; @@ -371,10 +375,12 @@ void backgroundMesh::propagate1dMesh(GFace *_gf) _sizes[v_2D] = value; } delete _lsys; +#endif } void backgroundMesh::updateSizes(GFace *_gf) { +#if defined(HAVE_SOLVER) std::map<MVertex*,double>::iterator itv = _sizes.begin(); for ( ; itv != _sizes.end(); ++itv){ SPoint2 p; @@ -471,6 +477,7 @@ void backgroundMesh::updateSizes(GFace *_gf) _sizes[v_2D] = value; } delete _lsys; +#endif } double backgroundMesh::operator() (double u, double v, double w) const diff --git a/Mesh/multiscalePartition.cpp b/Mesh/multiscalePartition.cpp index 5fded42d846ab0938223312e35aeec4648ea6ace..445f2a8218af908e83db2e619fa963560b81b494 100644 --- a/Mesh/multiscalePartition.cpp +++ b/Mesh/multiscalePartition.cpp @@ -5,6 +5,7 @@ #include "MEdge.h" #include "MElement.h" #include "multiscaleLaplace.h" +#include "Numeric.h" #include "Context.h" static void recur_connect(MVertex *v, @@ -321,7 +322,7 @@ void multiscalePartition::setNumberOfPartitions(int &nbParts) void multiscalePartition::partition(partitionLevel & level, int nbParts, typeOfPartition method) { -#if defined(HAVE_METIS) || defined(HAVE_CHACO) +#if defined(HAVE_SOLVER) && (defined(HAVE_METIS) || defined(HAVE_CHACO)) if (method == LAPLACIAN){ std::map<MVertex*, SPoint3> coordinates; diff --git a/Plugin/Distance.cpp b/Plugin/Distance.cpp index bbd92cd634ed45be15a79c3edb6950870038a6ad..ae97e89d1aa34a9cf4ed60666109a67e4097d32a 100644 --- a/Plugin/Distance.cpp +++ b/Plugin/Distance.cpp @@ -40,6 +40,7 @@ std::string GMSH_DistancePlugin::getHelp() const PView *GMSH_DistancePlugin::execute(PView *v) { +#if defined(HAVE_SOLVER) std::vector<GEntity*> entities; GModel::current()->getEntities(entities); @@ -338,6 +339,6 @@ PView *GMSH_DistancePlugin::execute(PView *v) // } // fprintf(f2,"};\n"); // fclose(f2); - +#endif return 0; } diff --git a/Plugin/PluginManager.cpp b/Plugin/PluginManager.cpp index 073486e699a4436c0502196346f17e439cf33bdd..37d53e32a6cc12907403fda4babb0a11c4d0599a 100644 --- a/Plugin/PluginManager.cpp +++ b/Plugin/PluginManager.cpp @@ -211,6 +211,8 @@ void PluginManager::registerDefaultPlugins() ("Triangulate", GMSH_RegisterTriangulatePlugin())); allPlugins.insert(std::pair<std::string, GMSH_Plugin*> ("GSHHS", GMSH_RegisterGSHHSPlugin())); + allPlugins.insert(std::pair<std::string, GMSH_Plugin*> + ("ExtractEdges", GMSH_RegisterExtractEdgesPlugin())); #if defined(HAVE_TETGEN) allPlugins.insert(std::pair<std::string, GMSH_Plugin*> ("Tetrahedralize", GMSH_RegisterTetrahedralizePlugin())); @@ -219,10 +221,10 @@ void PluginManager::registerDefaultPlugins() allPlugins.insert(std::pair<std::string, GMSH_Plugin*> ("Homology", GMSH_RegisterHomologyComputationPlugin())); #endif +#if defined(HAVE_SOLVER) allPlugins.insert(std::pair<std::string, GMSH_Plugin*> ("Distance", GMSH_RegisterDistancePlugin())); - allPlugins.insert(std::pair<std::string, GMSH_Plugin*> - ("ExtractEdges", GMSH_RegisterExtractEdgesPlugin())); +#endif } #if defined(HAVE_FLTK)