[SCM] Gmsh packaging. Gmsh is an automatic 3D finite element mesh generator. branch, master, updated. debian/2.6.0-1-5-g1b998a3

Anton Gladky gladky.anton at gmail.com
Wed Jun 20 17:00:09 UTC 2012


The following commit has been merged in the master branch:
commit d9902a5519ee45747148dc135363459fc343082d
Author: Anton Gladky <gladky.anton at gmail.com>
Date:   Wed Jun 20 18:58:46 2012 +0200

    Add alauzet patch, refresh other patches.

diff --git a/debian/patches/alauzet.patch b/debian/patches/alauzet.patch
new file mode 100644
index 0000000..c78e136
--- /dev/null
+++ b/debian/patches/alauzet.patch
@@ -0,0 +1,261 @@
+Description: <short summary of the patch>
+Author: Christophe Trophime <christophe.trophime at lncmi.cnrs.fr>
+Reviewed-by: Anton Gladky <gladky.anton at gmail.com>
+Last-Update: 2012-06-20
+
+
+--- a/Mesh/Field.cpp
++++ b/Mesh/Field.cpp
+@@ -479,6 +479,55 @@
+   }
+ };
+ 
++class SphereField : public Field
++{
++  double v_in, v_out;
++  double xc,yc,zc;
++  double R;
++
++ public:
++  std::string getDescription()
++  {
++    return "The value of this field is VIn inside a sphere, VOut outside. "
++      "The sphere is given by\n\n"
++      "  ||dX||^2 < R^2 &&\n"
++      "  dX = (X - XC)^2 + (Y-YC)^2 + (Z-ZC)^2";
++  }
++  SphereField()
++  {
++    v_in = v_out = xc = yc = zc = R = 0;
++
++    options["VIn"] = new FieldOptionDouble
++      (v_in, "Value inside the sphere");
++    options["VOut"] = new FieldOptionDouble
++      (v_out, "Value outside the sphere");
++
++    options["XCenter"] = new FieldOptionDouble
++      (xc, "X coordinate of the sphere center");
++    options["YCenter"] = new FieldOptionDouble
++      (yc, "Y coordinate of the sphere center");
++    options["ZCenter"] = new FieldOptionDouble
++      (zc, "Z coordinate of the sphere center");
++
++
++    options["Radius"] = new FieldOptionDouble
++      (R,"Radius");
++
++  }
++  const char *getName()
++  {
++    return "Sphere";
++  }
++  double operator() (double x, double y, double z, GEntity *ge=0)
++  {
++    double dx = x-xc;
++    double dy = y-yc;
++    double dz = z-zc;
++
++    return ( (dx*dx + dy*dy + dz*dz < R*R) ) ? v_in : v_out;
++  }
++};
++
+ class FrustumField : public Field
+ {
+   double x1,y1,z1;
+@@ -1280,17 +1329,21 @@
+   }
+   virtual void operator() (double x, double y, double z, SMetric3 &metr, GEntity *ge=0)
+   {
++    std::cout << "MinAnisoField idlist=" << idlist.size() << "\n";
+     SMetric3 v (1./MAX_LC);
+     for(std::list<int>::iterator it = idlist.begin(); it != idlist.end(); it++) {
+       Field *f = (GModel::current()->getFields()->get(*it));
++      std::cout << "Field[" << *it << "]\n";
+       SMetric3 ff;
+       if(f && *it != id) {
+ 	if (f->isotropic()){
+ 	  double l = (*f) (x, y, z, ge);
+ 	  ff = SMetric3(1./(l*l));
++	  //printf("ff=[%g %g %g %g %g %g]\n",ff(0,0),ff(1,1),ff(2,2),ff(0,1),ff(0,2),ff(1,2));
+ 	}
+ 	else{
+ 	  (*f) (x, y, z, ff, ge);
++	  //printf("ff_iso=[%g %g %g %g %g %g]\n",ff(0,0),ff(1,1),ff(2,2),ff(0,1),ff(0,2),ff(1,2));
+ 	}
+ 	v = intersection_conserve_mostaniso(v,ff);
+       }
+@@ -1328,6 +1381,77 @@
+   }
+ };
+ 
++class IntersectAnisoField : public Field
++{
++  std::list<int> idlist;
++ public:
++  IntersectAnisoField()
++  {
++    options["FieldsList"] = new FieldOptionList
++      (idlist, "Field indices", &update_needed);
++  }
++  virtual bool isotropic () const {return false;}
++  std::string getDescription()
++  {
++    return "Take the intersection of 2 anisotropic fields according to Alauzet.";
++  }
++  virtual void operator() (double x, double y, double z, SMetric3 &metr, GEntity *ge=0)
++  {
++    // check if idlist contains 2 elements other error message    
++    SMetric3 v;
++    for(std::list<int>::iterator it = idlist.begin(); it != idlist.end(); it++) {
++      Field *f = (GModel::current()->getFields()->get(*it));
++      SMetric3 ff;
++      if(f && *it != id) {
++	if (f->isotropic()){
++	  double l = (*f) (x, y, z, ge);
++	  ff = SMetric3(1./(l*l));
++	}
++	else{
++	  (*f) (x, y, z, ff, ge);
++	}
++	if (it == idlist.begin()) 
++	   v = ff;
++	else
++	   v = intersection_alauzet(v,ff);
++      }
++    }
++    metr = v;
++  }
++  double operator() (double x, double y, double z, GEntity *ge=0)
++  {
++    // check if idlist contains 2 elements other error message
++    SMetric3 metr;
++    double v = MAX_LC;
++    for(std::list<int>::iterator it = idlist.begin(); it != idlist.end(); it++) {
++      Field *f = (GModel::current()->getFields()->get(*it));
++      SMetric3 m;
++      if(f && *it != id){
++        if (!f->isotropic()){
++          (*f)(x, y, z, m, ge);
++        }
++	else {
++          double L = (*f)(x, y, z, ge);
++          for (int i = 0; i < 3; i++)
++            m(i,i) = 1. / (L*L);
++	}
++      }
++	if (it == idlist.begin()) 
++	   metr = m;
++	else
++	   metr = intersection_alauzet(metr,m);
++    }
++    fullMatrix<double> V(3,3);
++    fullVector<double> S(3);
++    metr.eig(V, S, 1);
++    return sqrt(1./S(2)); //S(2) is largest eigenvalue
++  }
++  const char *getName()
++  {
++    return "IntersectAniso";
++  }
++};
++
+ class MinField : public Field
+ {
+   std::list<int> idlist;
+@@ -1346,7 +1470,18 @@
+     double v = MAX_LC;
+     for(std::list<int>::iterator it = idlist.begin(); it != idlist.end(); it++) {
+       Field *f = (GModel::current()->getFields()->get(*it));
+-      if(f && *it != id) v = std::min(v, (*f) (x, y, z, ge));
++      if(f && *it != id) {
++        if (f->isotropic())
++	   v = std::min(v, (*f) (x, y, z, ge));
++	else{
++	   SMetric3 ff;
++	   (*f) (x, y, z, ff, ge);
++	   fullMatrix<double> V(3,3);
++	   fullVector<double> S(3);
++	   ff.eig(V, S, 1);
++	   v = std::min(v, sqrt(1./S(2))); //S(2) is largest eigenvalue
++	}
++      }	
+     }
+     return v;
+   }
+@@ -1374,7 +1509,18 @@
+     double v = -MAX_LC;
+     for(std::list<int>::iterator it = idlist.begin(); it != idlist.end(); it++) {
+       Field *f = (GModel::current()->getFields()->get(*it));
+-      if(f && *it != id) v = std::max(v, (*f) (x, y, z, ge));
++      if(f && *it != id) {
++        if (f->isotropic())
++	   v = std::max(v, (*f) (x, y, z, ge));
++	else{
++	   SMetric3 ff;
++	   (*f) (x, y, z, ff, ge);
++	   fullMatrix<double> V(3,3);
++	   fullVector<double> S(3);
++	   ff.eig(V, S, 1);
++	   v = std::max(v, sqrt(1./S(0))); //S(0) is smallest eigenvalue
++	}
++      }
+     }
+     return v;
+   }
+@@ -2038,6 +2184,7 @@
+ #endif
+   map_type_name["Box"] = new FieldFactoryT<BoxField>();
+   map_type_name["Cylinder"] = new FieldFactoryT<CylinderField>();
++  map_type_name["Sphere"] = new FieldFactoryT<SphereField>();
+   map_type_name["Frustum"] = new FieldFactoryT<FrustumField>();
+   map_type_name["LonLat"] = new FieldFactoryT<LonLatField>();
+ #if defined(HAVE_POST)
+@@ -2047,6 +2194,7 @@
+   map_type_name["Restrict"] = new FieldFactoryT<RestrictField>();
+   map_type_name["Min"] = new FieldFactoryT<MinField>();
+   map_type_name["MinAniso"] = new FieldFactoryT<MinAnisoField>();
++  map_type_name["IntersectAniso"] = new FieldFactoryT<IntersectAnisoField>();
+   map_type_name["Max"] = new FieldFactoryT<MaxField>();
+   map_type_name["UTM"] = new FieldFactoryT<UTMField>();
+   map_type_name["Laplacian"] = new FieldFactoryT<LaplacianField>();
+--- a/Geo/STensor3.h
++++ b/Geo/STensor3.h
+@@ -171,6 +171,8 @@
+ // compute the largest inscribed ellipsoid...
+ SMetric3 intersection (const SMetric3 &m1,
+                        const SMetric3 &m2);
++SMetric3 intersection_alauzet (const SMetric3 &m1,
++                       const SMetric3 &m2);
+ SMetric3 interpolation (const SMetric3 &m1,
+                         const SMetric3 &m2,
+                         const double t);
+--- a/Geo/STensor3.cpp
++++ b/Geo/STensor3.cpp
+@@ -39,6 +39,27 @@
+   return iv;
+ }
+ 
++SMetric3 intersection_alauzet (const SMetric3 &m1, const SMetric3 &m2)
++{
++  SMetric3 im1 = m1.invert();
++  fullMatrix<double> V(3,3);
++  fullVector<double> S(3);
++  im1 *= m2;
++  im1.eig(V,S,true);
++  SVector3 v0(V(0,0),V(1,0),V(2,0));
++  SVector3 v1(V(0,1),V(1,1),V(2,1));
++  SVector3 v2(V(0,2),V(1,2),V(2,2));
++  // is this required??
++  v0.normalize();
++  v1.normalize();
++  v2.normalize();
++  double l0 = std::max(dot(v0,m1,v0),dot(v0,m2,v0));
++  double l1 = std::max(dot(v1,m1,v1),dot(v1,m2,v1));
++  double l2 = std::max(dot(v2,m1,v2),dot(v2,m2,v2));
++  SMetric3 iv(l0,l1,l2,v0,v1,v2);
++  return iv;
++}
++
+ // preserve orientation of m1 !!!
+ SMetric3 intersection_conserveM1 (const SMetric3 &m1, const SMetric3 &m2)
+ {
diff --git a/debian/patches/delete_gl2ps_from_source.patch b/debian/patches/delete_gl2ps_from_source.patch
index f310afd..96ee511 100644
--- a/debian/patches/delete_gl2ps_from_source.patch
+++ b/debian/patches/delete_gl2ps_from_source.patch
@@ -14,7 +14,7 @@ Last-Update: 2011-12-09
    gl2png.cpp
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -1060,7 +1060,7 @@
+@@ -1070,7 +1070,7 @@
    add_executable(gmsh_dynamic EXCLUDE_FROM_ALL Common/Main.cpp)
    target_link_libraries(gmsh_dynamic shared)
  endif(HAVE_FLTK)
diff --git a/debian/patches/fix_FTBFS_linking.patch b/debian/patches/fix_FTBFS_linking.patch
index 9821688..b6f0432 100644
--- a/debian/patches/fix_FTBFS_linking.patch
+++ b/debian/patches/fix_FTBFS_linking.patch
@@ -4,7 +4,7 @@ Last-Update: 2012-04-08
 
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -1061,7 +1061,7 @@
+@@ -1071,7 +1071,7 @@
    message("WARNING: By enabling ENABLE_MSVC_STATIC_RUNTIME, shared library wont link. "
            "Change in msvc /MT flag to /MD in the shared project properties")
  endif(MSVC AND ENABLE_MSVC_STATIC_RUNTIME)		  
diff --git a/debian/patches/series b/debian/patches/series
index 8213b23..826079e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,4 @@ api_demos.patch
 fix_FTBFS_linking.patch
 cgns.patch
 pedantic.patch
+alauzet.patch
diff --git a/debian/patches/skip_license_file.patch b/debian/patches/skip_license_file.patch
index 224ed4d..bb83d12 100644
--- a/debian/patches/skip_license_file.patch
+++ b/debian/patches/skip_license_file.patch
@@ -4,7 +4,7 @@ Last-Update: 2011-12-09
 
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -1102,7 +1102,7 @@
+@@ -1112,7 +1112,7 @@
  endif(UNIX)
  
  set(WELCOME_FILE ${CMAKE_CURRENT_SOURCE_DIR}/doc/WELCOME.txt)
@@ -13,7 +13,7 @@ Last-Update: 2011-12-09
  set(CREDITS_FILE ${CMAKE_CURRENT_SOURCE_DIR}/doc/CREDITS.txt)
  file(GLOB TUTORIAL_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tutorial/?*.*)
  file(GLOB DEMO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/demos/?*.*)
-@@ -1197,7 +1197,7 @@
+@@ -1207,7 +1207,7 @@
  if(MAKEINFO AND TEXI2PDF)
    add_custom_target(doc COMMAND ${CMAKE_COMMAND} -E tar zcf 
                      ${CMAKE_CURRENT_BINARY_DIR}/gmsh-${GMSH_VERSION}-doc.tgz

-- 
Gmsh packaging. Gmsh is an automatic 3D finite element mesh generator. 



More information about the debian-science-commits mailing list