From e1462de5c11d439bffb850bcc3646315d7601962 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Mon, 8 Sep 2008 19:34:41 +0000
Subject: [PATCH] simplify HAVE_GMSH_EMBEDDED

---
 Common/Message.h            |  1 -
 Geo/GEdge.cpp               |  8 +++-----
 Geo/GEdgeLoop.cpp           |  7 +------
 Geo/GEntity.cpp             |  6 +++---
 Geo/GFace.cpp               | 26 +++++++++++++-------------
 Geo/GModel.cpp              | 14 +++++++-------
 Geo/GModelIO_CGNS.cpp       | 16 ++++++++--------
 Geo/GModelIO_Geo.cpp        |  6 +++---
 Geo/GModelIO_MED.cpp        |  4 ++--
 Geo/GModelIO_Mesh.cpp       | 18 +++++-------------
 Geo/GRegion.cpp             |  7 +------
 Geo/GVertex.cpp             |  7 +------
 Geo/MElement.cpp            | 20 ++++++++++----------
 Geo/MFace.cpp               |  6 +++---
 Geo/MVertex.cpp             |  7 +------
 Geo/discreteEdge.cpp        |  8 +++-----
 Geo/discreteFace.cpp        |  8 +++-----
 Geo/gmshFace.cpp            |  2 --
 Graphics/Post.cpp           |  6 +++---
 Graphics/gl2ps.cpp          |  6 +-----
 Mesh/Field.cpp              | 11 +++++++----
 Mesh/Partition.cpp          | 10 +++++-----
 Numeric/NumericEmbedded.cpp |  5 -----
 doc/texinfo/opt_fields.texi |  4 +++-
 utils/embed/GmshEmbedded.h  |  1 -
 utils/embed/Makefile        |  1 +
 26 files changed, 87 insertions(+), 128 deletions(-)

diff --git a/Common/Message.h b/Common/Message.h
index 30383e6dc4..ed5fe16fcd 100644
--- a/Common/Message.h
+++ b/Common/Message.h
@@ -7,7 +7,6 @@
 #define _MESSAGE_H_
 
 #include <map>
-#include <vector>
 #include <string>
 #include <stdarg.h>
 
diff --git a/Geo/GEdge.cpp b/Geo/GEdge.cpp
index 78ba2ade13..f887184cdd 100644
--- a/Geo/GEdge.cpp
+++ b/Geo/GEdge.cpp
@@ -10,12 +10,10 @@
 #include "GFace.h"
 #include "MElement.h"
 #include "GmshDefines.h"
+#include "Message.h"
 
-#if defined(HAVE_GMSH_EMBEDDED)
-#  include "GmshEmbedded.h"
-#else
-#  include "Message.h"
-#  include "GaussLegendre1D.h"
+#if !defined(HAVE_GMSH_EMBEDDED)
+#include "GaussLegendre1D.h"
 #endif
 
 GEdge::GEdge(GModel *model, int tag, GVertex *_v0, GVertex *_v1)
diff --git a/Geo/GEdgeLoop.cpp b/Geo/GEdgeLoop.cpp
index 7e4d501e98..c130525932 100644
--- a/Geo/GEdgeLoop.cpp
+++ b/Geo/GEdgeLoop.cpp
@@ -6,12 +6,7 @@
 #include <algorithm>
 #include <functional>
 #include "GEdgeLoop.h"
-
-#if defined(HAVE_GMSH_EMBEDDED)
-#  include "GmshEmbedded.h"
-#else
-#  include "Message.h"
-#endif
+#include "Message.h"
 
 void GEdgeSigned::print() const
 {
diff --git a/Geo/GEntity.cpp b/Geo/GEntity.cpp
index e98253798a..37996510af 100644
--- a/Geo/GEntity.cpp
+++ b/Geo/GEntity.cpp
@@ -7,12 +7,12 @@
 #include "GModel.h"
 #include "GEntity.h"
 #include "MElement.h"
+#include "VertexArray.h"
 
 #if defined(HAVE_GMSH_EMBEDDED)
-#  include "GmshEmbedded.h"
+#include "GmshEmbedded.h"
 #else
-#  include "VertexArray.h"
-#  include "Context.h"
+#include "Context.h"
 #endif
 
 extern Context_T CTX;
diff --git a/Geo/GFace.cpp b/Geo/GFace.cpp
index 8921c9a315..51969a9b65 100644
--- a/Geo/GFace.cpp
+++ b/Geo/GFace.cpp
@@ -8,23 +8,23 @@
 #include "GFace.h"
 #include "GEdge.h"
 #include "MElement.h"
+#include "Message.h"
+#include "VertexArray.h"
 
 #if defined(HAVE_GMSH_EMBEDDED)
-#  include "GmshEmbedded.h"
+#include "GmshEmbedded.h"
 #else
-#  include "Message.h"
-#  include "Numeric.h"
-#  include "GaussLegendre1D.h"
-#  include "VertexArray.h"
-#  include "Context.h"
-#  if defined(HAVE_GSL)
-#    include <gsl/gsl_vector.h>
-#    include <gsl/gsl_linalg.h>
-#  else
-#    define NRANSI
-#    include "nrutil.h"
+#include "Numeric.h"
+#include "GaussLegendre1D.h"
+#include "Context.h"
+#if defined(HAVE_GSL)
+#include <gsl/gsl_vector.h>
+#include <gsl/gsl_linalg.h>
+#else
+#define NRANSI
+#include "nrutil.h"
 void dsvdcmp(double **a, int m, int n, double w[], double **v);
-#  endif
+#endif
 #endif
 
 extern Context_T CTX;
diff --git a/Geo/GModel.cpp b/Geo/GModel.cpp
index 99a0931426..b969cbdcca 100644
--- a/Geo/GModel.cpp
+++ b/Geo/GModel.cpp
@@ -10,16 +10,16 @@
 #include "discreteFace.h"
 #include "discreteEdge.h"
 #include "discreteVertex.h"
+#include "Message.h"
 
 #if defined(HAVE_GMSH_EMBEDDED)
-#  include "GmshEmbedded.h"
+#include "GmshEmbedded.h"
 #else
-#  include "Message.h"
-#  include "gmshSurface.h"
-#  include "Octree.h"
-#  include "Field.h"
-#  include "Generator.h"
-#  include "Context.h"
+#include "gmshSurface.h"
+#include "Octree.h"
+#include "Field.h"
+#include "Generator.h"
+#include "Context.h"
 #endif
 
 extern Context_T CTX;
diff --git a/Geo/GModelIO_CGNS.cpp b/Geo/GModelIO_CGNS.cpp
index 7939d9ccd3..9eb6181459 100644
--- a/Geo/GModelIO_CGNS.cpp
+++ b/Geo/GModelIO_CGNS.cpp
@@ -39,10 +39,10 @@
 
 int cgnsErr(const int cgIndexFile = -1)
 {
-  Message::Error("Error detected by CGNS library\n");
-  Message::Error(cg_get_error());
+  Msg::Error("Error detected by CGNS library\n");
+  Msg::Error(cg_get_error());
   if(cgIndexFile != -1)
-    if(cg_close(cgIndexFile)) Message::Error("Unable to close CGNS file");
+    if(cg_close(cgIndexFile)) Msg::Error("Unable to close CGNS file");
   return 0;
 }
 
@@ -314,7 +314,7 @@ int GModel::writeCGNS(const std::string &name, int zoneDefinition,
           }
           break;
         default:
-          Message::Error("No mesh elements were found");
+          Msg::Error("No mesh elements were found");
           return 0;
         }
         // Place pointers to the entities in the 'groups' object
@@ -374,7 +374,7 @@ int GModel::writeCGNS(const std::string &name, int zoneDefinition,
       }
       break;
     default:
-      Message::Error("No mesh elements were found");
+      Msg::Error("No mesh elements were found");
       return 0;
     }
   }
@@ -866,7 +866,7 @@ int write_CGNS_zones(GModel &model, const int zoneDefinition, const int numZone,
             MElement::getInfoMSH(typeMSHm1+1, &elemName);
             if(typeCGNS == -1) {
               // This type is not supported in CGNS
-              Message::Warning("Element type %s is not supported in CGNS and "
+              Msg::Warning("Element type %s is not supported in CGNS and "
                                "has not been written to the file", elemName);
             }
             else {
@@ -1063,14 +1063,14 @@ int write_CGNS_zones(GModel &model, const int zoneDefinition, const int numZone,
 
 int GModel::readCGNS(const std::string &name)
 {
-  Message::Error("This version of Gmsh was compiled without CGNS support");
+  Msg::Error("This version of Gmsh was compiled without CGNS support");
   return 0;
 }
 
 int GModel::writeCGNS(const std::string &name, int zoneDefinition,
                       const CGNSOptions &options, double scalingFactor)
 {
-  Message::Error("This version of Gmsh was compiled without CGNS support");
+  Msg::Error("This version of Gmsh was compiled without CGNS support");
   return 0;
 }
 
diff --git a/Geo/GModelIO_Geo.cpp b/Geo/GModelIO_Geo.cpp
index 6ba5f39664..aef507ff23 100644
--- a/Geo/GModelIO_Geo.cpp
+++ b/Geo/GModelIO_Geo.cpp
@@ -137,12 +137,12 @@ int GModel::importGEOInternals()
   return 1;
 }
 
-class writeFieldOptionGEO{
+class writeFieldOptionGEO {
  private :
   FILE *geo;
   Field *field;
  public :
-  writeFieldOptionGEO(FILE *fp,Field *_field) { geo = fp ? fp : stdout; field=_field;}
+  writeFieldOptionGEO(FILE *fp,Field *_field) { geo = fp ? fp : stdout; field=_field; }
   void operator() (std::pair<std::string, FieldOption *> it)
   {
     std::string v;
@@ -151,7 +151,7 @@ class writeFieldOptionGEO{
   }
 };
 
-class writeFieldGEO{
+class writeFieldGEO {
  private :
   FILE *geo;
  public :
diff --git a/Geo/GModelIO_MED.cpp b/Geo/GModelIO_MED.cpp
index 213b04295c..83c129fd24 100644
--- a/Geo/GModelIO_MED.cpp
+++ b/Geo/GModelIO_MED.cpp
@@ -235,8 +235,8 @@ int GModel::readMED(const std::string &name, int meshIndex)
 			   (meshDim > 2) ? coord[meshDim * i + 2] : 0.,
 			   0, nodeTags.empty() ? 0 : nodeTags[i]);
 
-  // read elements
-  for(int mshType = 0; mshType < 50; mshType++){ // loop over all possible MSH types
+  // read elements (loop over all possible MSH element types)
+  for(int mshType = 0; mshType < MSH_NUM_TYPE; mshType++){
     med_geometrie_element type = msh2medElementType(mshType);
     if(type == MED_NONE) continue;
     med_int numEle = MEDnEntMaa(fid, meshName, MED_CONN, MED_MAILLE, type, MED_NOD);
diff --git a/Geo/GModelIO_Mesh.cpp b/Geo/GModelIO_Mesh.cpp
index 6ac8501d7b..41fef3126f 100644
--- a/Geo/GModelIO_Mesh.cpp
+++ b/Geo/GModelIO_Mesh.cpp
@@ -16,12 +16,7 @@
 #include "discreteEdge.h"
 #include "discreteVertex.h"
 #include "StringUtils.h"
-
-#if defined(HAVE_GMSH_EMBEDDED)
-#  include "GmshEmbedded.h"
-#else
-#  include "Message.h"
-#endif
+#include "Message.h"
 
 static void storePhysicalTagsInEntities(GModel *m, int dim,
                                         std::map<int, std::map<int, std::string> > &map)
@@ -115,14 +110,11 @@ int GModel::readMSH(const std::string &name)
     return 0;
   }
 
-  double version = 1.0;
-  bool binary = false, swap = false;
   char str[256] = "XXX";
+  double version = 1.0;
+  bool binary = false, swap = false, postpro = false;
   std::map<int, std::vector<MElement*> > elements[8];
   std::map<int, std::map<int, std::string> > physicals[4];
-  bool postpro = false;
-
-  // we might want to cache those for post-processing lookups
   std::map<int, MVertex*> vertexMap;
   std::vector<MVertex*> vertexVector;
  
@@ -424,7 +416,7 @@ int GModel::writeMSH(const std::string &name, double version, bool binary,
   // get the number of elements (we assume that all the elements in a
   // list have the same type, i.e., they are all of the same
   // polynomial order)
-  std::map<int,int> elements;
+  std::map<int, int> elements;
   for(viter it = firstVertex(); it != lastVertex(); ++it){
     int p = (saveAll ? 1 : (*it)->physicals.size());
     int n = p * (*it)->points.size();
@@ -455,7 +447,7 @@ int GModel::writeMSH(const std::string &name, double version, bool binary,
   }
 
   int numElements = 0;
-  std::map<int,int>::const_iterator it = elements.begin();
+  std::map<int, int>::const_iterator it = elements.begin();
   for(; it != elements.end(); ++it)
     numElements += it->second;
 
diff --git a/Geo/GRegion.cpp b/Geo/GRegion.cpp
index 1e45529c57..f785033ee0 100644
--- a/Geo/GRegion.cpp
+++ b/Geo/GRegion.cpp
@@ -8,12 +8,7 @@
 #include "GRegion.h"
 #include "GFace.h"
 #include "MElement.h"
-
-#if defined(HAVE_GMSH_EMBEDDED)
-#  include "GmshEmbedded.h"
-#else
-#  include "Message.h"
-#endif
+#include "Message.h"
 
 GRegion::GRegion(GModel *model, int tag) : GEntity (model, tag)
 {
diff --git a/Geo/GVertex.cpp b/Geo/GVertex.cpp
index 9d9efb8a3b..6bac3597d4 100644
--- a/Geo/GVertex.cpp
+++ b/Geo/GVertex.cpp
@@ -8,12 +8,7 @@
 #include "GVertex.h"
 #include "GFace.h"
 #include "MElement.h"
-
-#if defined(HAVE_GMSH_EMBEDDED)
-#  include "GmshEmbedded.h"
-#else
-#  include "Message.h"
-#endif
+#include "Message.h"
 
 GVertex::GVertex(GModel *m, int tag, double ms) : GEntity(m, tag), meshSize(ms) 
 {
diff --git a/Geo/MElement.cpp b/Geo/MElement.cpp
index d5f0c88040..62e51f709e 100644
--- a/Geo/MElement.cpp
+++ b/Geo/MElement.cpp
@@ -9,17 +9,17 @@
 #include "GEntity.h"
 #include "GFace.h"
 #include "FunctionSpace.h"
+#include "Message.h"
 
 #if defined(HAVE_GMSH_EMBEDDED)
-#  include "GmshEmbedded.h"
+#include "GmshEmbedded.h"
 #else
-#  include "Numeric.h"
-#  include "GaussLegendre1D.h"
-#  include "Message.h"
-#  include "Context.h"
-#  include "qualityMeasures.h"
-#  include "meshGFaceDelaunayInsertion.h"
-#  include "meshGRegionDelaunayInsertion.h"
+#include "Numeric.h"
+#include "GaussLegendre1D.h"
+#include "Context.h"
+#include "qualityMeasures.h"
+#include "meshGFaceDelaunayInsertion.h"
+#include "meshGRegionDelaunayInsertion.h"
 #endif
 
 #define SQU(a)      ((a)*(a))
@@ -101,7 +101,7 @@ void MElement::getIntegrationPoints(int pOrder, int *npts, IntPt **pts) const
 SPoint3 MTriangle::circumcenter()
 {
 #if defined(HAVE_GMSH_EMBEDDED)
-  return 0.;
+  return SPoint3();
 #else
   double p1[3] = {_v[0]->x(),_v[0]->y(),_v[0]->z()};
   double p2[3] = {_v[1]->x(),_v[1]->y(),_v[1]->z()};
@@ -115,7 +115,7 @@ SPoint3 MTriangle::circumcenter()
 SPoint3 MTetrahedron::circumcenter()
 {
 #if defined(HAVE_GMSH_EMBEDDED)
-  return 0.;
+  return SPoint3();
 #else
   MTet4 t(this,0);
   double res[3];
diff --git a/Geo/MFace.cpp b/Geo/MFace.cpp
index 3b254cbda3..a151dc2523 100644
--- a/Geo/MFace.cpp
+++ b/Geo/MFace.cpp
@@ -6,10 +6,10 @@
 #include "MFace.h"
 
 #if defined(HAVE_GMSH_EMBEDDED)
-#  include "GmshEmbedded.h"
+#include "GmshEmbedded.h"
 #else
-#  include "Numeric.h"
-#  include "Context.h"
+#include "Numeric.h"
+#include "Context.h"
 #endif
 
 extern Context_T CTX;
diff --git a/Geo/MVertex.cpp b/Geo/MVertex.cpp
index e03508e9e3..2da12d72fe 100644
--- a/Geo/MVertex.cpp
+++ b/Geo/MVertex.cpp
@@ -8,12 +8,7 @@
 #include "MVertex.h"
 #include "GEdge.h"
 #include "GFace.h"
-
-#if defined(HAVE_GMSH_EMBEDDED)
-#  include "GmshEmbedded.h"
-#else
-#  include "Message.h"
-#endif
+#include "Message.h"
 
 int MVertex::_globalNum = 0;
 double MVertexLessThanLexicographic::tolerance = 1.e-6;
diff --git a/Geo/discreteEdge.cpp b/Geo/discreteEdge.cpp
index 0b623acb58..ebc325363b 100644
--- a/Geo/discreteEdge.cpp
+++ b/Geo/discreteEdge.cpp
@@ -4,12 +4,10 @@
 // bugs and problems to <gmsh@geuz.org>.
 
 #include "discreteEdge.h"
+#include "Message.h"
 
-#if defined(HAVE_GMSH_EMBEDDED)
-#  include "GmshEmbedded.h"
-#else
-#  include "Geo.h"
-#  include "Message.h"
+#if !defined(HAVE_GMSH_EMBEDDED)
+#include "Geo.h"
 #endif
 
 discreteEdge::discreteEdge(GModel *model, int num) : GEdge(model, num, 0, 0) 
diff --git a/Geo/discreteFace.cpp b/Geo/discreteFace.cpp
index ec96449916..c80b0f0dd5 100644
--- a/Geo/discreteFace.cpp
+++ b/Geo/discreteFace.cpp
@@ -4,12 +4,10 @@
 // bugs and problems to <gmsh@geuz.org>.
 
 #include "discreteFace.h"
+#include "Message.h"
 
-#if defined(HAVE_GMSH_EMBEDDED)
-#  include "GmshEmbedded.h"
-#else
-#  include "Geo.h"
-#  include "Message.h"
+#if !defined(HAVE_GMSH_EMBEDDED)
+#include "Geo.h"
 #endif
 
 discreteFace::discreteFace(GModel *model, int num) : GFace(model, num)
diff --git a/Geo/gmshFace.cpp b/Geo/gmshFace.cpp
index 6935469d6e..043e7094ea 100644
--- a/Geo/gmshFace.cpp
+++ b/Geo/gmshFace.cpp
@@ -186,7 +186,6 @@ GPoint gmshFace::point(double par1, double par2) const
 
 GPoint gmshFace::closestPoint(const SPoint3 & qp, const double initialGuess[2]) const
 {
-
   if (s->Typ ==  MSH_SURF_PLAN && !s->geometry){
     double XP = qp.x();
     double YP = qp.y();
@@ -279,7 +278,6 @@ GEntity::GeomType gmshFace::geomType() const
   }
 }
 
-
 bool gmshFace::containsPoint(const SPoint3 &pt) const
 { 
   if(geomType() == Plane){
diff --git a/Graphics/Post.cpp b/Graphics/Post.cpp
index 2c3f688b40..efe9b7bde6 100644
--- a/Graphics/Post.cpp
+++ b/Graphics/Post.cpp
@@ -1335,8 +1335,8 @@ class initPView {
     p->va_vectors->finalize();
 
     Msg::Info("Rendering %d vertices", p->va_points->getNumVertices() + 
-        p->va_lines->getNumVertices() + p->va_triangles->getNumVertices() + 
-        p->va_vectors->getNumVertices());
+	      p->va_lines->getNumVertices() + p->va_triangles->getNumVertices() + 
+	      p->va_vectors->getNumVertices());
 
     p->setChanged(false);
   }
@@ -1405,7 +1405,7 @@ class drawPView {
     }
 
     if(opt->RangeType == PViewOptions::Custom){
-      opt->TmpMin = opt->CustomMin;
+       opt->TmpMin = opt->CustomMin;
       opt->TmpMax = opt->CustomMax;
     }
     else if(opt->RangeType == PViewOptions::PerTimeStep){
diff --git a/Graphics/gl2ps.cpp b/Graphics/gl2ps.cpp
index f0427bfb4b..37e5df6f81 100644
--- a/Graphics/gl2ps.cpp
+++ b/Graphics/gl2ps.cpp
@@ -1,8 +1,4 @@
-// Gmsh - Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
-//
-// See the LICENSE.txt file for license information. Please report all
-// bugs and problems to <gmsh@geuz.org>.
-/* $Id: gl2ps.cpp,v 1.115 2008-07-11 16:56:01 geuzaine Exp $ */
+/* $Id: gl2ps.cpp,v 1.116 2008-09-08 19:34:40 geuzaine Exp $ */
 /*
  * GL2PS, an OpenGL to PostScript Printing Library
  * Copyright (C) 1999-2007 Christophe Geuzaine <geuz@geuz.org>
diff --git a/Mesh/Field.cpp b/Mesh/Field.cpp
index f149924c64..c718026a0f 100644
--- a/Mesh/Field.cpp
+++ b/Mesh/Field.cpp
@@ -476,8 +476,8 @@ class ThresholdField : public Field
     options["Sigmoid"] = new FieldOptionBool(sigmoid, "True to interpolate between LcMin "
 					     "and LcMax using a sigmoid, false to "
 					     "interpolate linearly");
-    options["StopAtDistMax"] = new FieldOptionBool(stopAtDistMax, "True to not impose element "
-						   "size outside DistMax");
+    options["StopAtDistMax"] = new FieldOptionBool(stopAtDistMax, "True to not impose "
+						   "element size outside DistMax");
   }
   double operator() (double x, double y, double z)
   {
@@ -826,7 +826,8 @@ class MathEvalExpression
     if(evaluators_id)
       delete evaluators_id;
   }
-  ~MathEvalExpression() {
+  ~MathEvalExpression()
+  {
     free_members();
   }
 };
@@ -838,7 +839,9 @@ class MathEvalField : public Field
  public:
   MathEvalField()
   {
-    options["F"] = new FieldOptionString(f, "Function", &update_needed);
+    options["F"] = new FieldOptionString(f, "Mathematical function (possible arguments: "
+					 "x, y, z for spatial coordinates or F0, F1, "
+					 "..., for field values)", &update_needed);
   }
   double operator() (double x, double y, double z)
   {
diff --git a/Mesh/Partition.cpp b/Mesh/Partition.cpp
index 03873774d4..6da45ea734 100644
--- a/Mesh/Partition.cpp
+++ b/Mesh/Partition.cpp
@@ -327,7 +327,7 @@ int MakeGraph(GModel *const model, Graph &graph, BoElemGrVec *const boElemGrVec)
                             boElemGrVec);
           }
           catch(...) {
-            Message::Error("Exception thrown during graph generation");
+            Msg::Error("Exception thrown during graph generation");
             ier = 2;
           }
         }
@@ -349,7 +349,7 @@ int MakeGraph(GModel *const model, Graph &graph, BoElemGrVec *const boElemGrVec)
                             boElemGrVec);
           }
           catch(...) {
-            Message::Error("Exception thrown during graph generation");
+            Msg::Error("Exception thrown during graph generation");
             ier = 2;
           }
         }
@@ -386,7 +386,7 @@ int MakeGraph(GModel *const model, Graph &graph, BoElemGrVec *const boElemGrVec)
 //             if((*it)->triangles.size() + (*it)->quadrangles.size() > 0)
 //               groups[face][1].push_back(*it);
 //           if(groups[face].size() == 0) {
-//             Message::Error("No mesh elements were found");
+//             Msg::Error("No mesh elements were found");
 //             return;
 //           }
 //         }
@@ -409,7 +409,7 @@ int MakeGraph(GModel *const model, Graph &graph, BoElemGrVec *const boElemGrVec)
 //           }
 //           const int numGrVert = numElem[ElemTypeTri] + numElem[ElemTypeQuad];
 //           if(numGrVert == 0) {
-//             Message::Error("No mesh elements were found");
+//             Msg::Error("No mesh elements were found");
 //             return;
 //           }
 //           const int maxGrEdge =
@@ -441,7 +441,7 @@ int MakeGraph(GModel *const model, Graph &graph, BoElemGrVec *const boElemGrVec)
 //           const int numGrVert = numElem[ElemTypeTetra] + numElem[ElemTypeHexa] +
 //             numElem[ElemTypePrism] + numElem[ElemTypePyramid];
 //           if(numGrVert == 0) {
-//             Message::Error("No mesh elements were found");
+//             Msg::Error("No mesh elements were found");
 //             return;
 //           }
 //           const int maxGrEdge =
diff --git a/Numeric/NumericEmbedded.cpp b/Numeric/NumericEmbedded.cpp
index 84e2a5c535..6daede6b39 100644
--- a/Numeric/NumericEmbedded.cpp
+++ b/Numeric/NumericEmbedded.cpp
@@ -8,12 +8,7 @@
 // Msg)
 
 #include "NumericEmbedded.h"
-
-#if defined(HAVE_GMSH_EMBEDDED)
-#include "GmshEmbedded.h"
-#else
 #include "Message.h"
-#endif
 
 #define SQU(a)      ((a)*(a))
 
diff --git a/doc/texinfo/opt_fields.texi b/doc/texinfo/opt_fields.texi
index 40890a5f5c..f4924bc18d 100644
--- a/doc/texinfo/opt_fields.texi
+++ b/doc/texinfo/opt_fields.texi
@@ -77,7 +77,7 @@ Field index (type: integer; default value: 1)
 Options:
 @table @code
 @item F
-Function (type: string; default value: "")
+Mathematical function (possible arguments: x, y, z for spatial coordinates or F0, F1, ..., for field values) (type: string; default value: "")
 @end table
 @item Max
 
@@ -156,6 +156,8 @@ Element size outside DistMax (type: float; default value: 1)
 Element size inside DistMin (type: float; default value: 0.1)
 @item Sigmoid
 True to interpolate between LcMin and LcMax using a sigmoid, false to interpolate linearly (type: boolean; default value: 0)
+@item StopAtDistMax
+True to not impose element size outside DistMax (type: boolean; default value: 0)
 @end table
 @item UTM
 
diff --git a/utils/embed/GmshEmbedded.h b/utils/embed/GmshEmbedded.h
index d72638b4b7..18726b0364 100644
--- a/utils/embed/GmshEmbedded.h
+++ b/utils/embed/GmshEmbedded.h
@@ -7,7 +7,6 @@
 #define _GMSH_EMBEDDED_H_
 
 #include "NumericEmbedded.h"
-#include "Message.h"
 
 class Context_T{
 public:
diff --git a/utils/embed/Makefile b/utils/embed/Makefile
index e8089c8c94..ff7462c6fe 100644
--- a/utils/embed/Makefile
+++ b/utils/embed/Makefile
@@ -19,6 +19,7 @@ SRC = GModel.cpp\
       MElement.cpp\
         MFace.cpp MVertex.cpp\
       NumericEmbedded.cpp\
+        FunctionSpace.cpp\
       StringUtils.cpp\
       GmshEmbedded.cpp
 
-- 
GitLab