r46746 - /packages/gmsh-tetgen/trunk/debian/patches/alauzet.patch

trophime-guest at users.alioth.debian.org trophime-guest at users.alioth.debian.org
Tue Jun 24 13:54:46 UTC 2014


Author: trophime-guest
Date: Tue Jun 24 13:54:46 2014
New Revision: 46746

URL: http://svn.debian.org/wsvn/debian-science/?sc=1&rev=46746
Log:
fix alauzet patch

Modified:
    packages/gmsh-tetgen/trunk/debian/patches/alauzet.patch

Modified: packages/gmsh-tetgen/trunk/debian/patches/alauzet.patch
URL: http://svn.debian.org/wsvn/debian-science/packages/gmsh-tetgen/trunk/debian/patches/alauzet.patch?rev=46746&op=diff
==============================================================================
--- packages/gmsh-tetgen/trunk/debian/patches/alauzet.patch	(original)
+++ packages/gmsh-tetgen/trunk/debian/patches/alauzet.patch	Tue Jun 24 13:54:46 2014
@@ -2,63 +2,7 @@
 ===================================================================
 --- gmsh-tetgen-2.8.5~svn18983.orig/Mesh/Field.cpp
 +++ gmsh-tetgen-2.8.5~svn18983/Mesh/Field.cpp
-@@ -534,6 +534,55 @@ class SphereField : public Field
-   }
- };
- 
-+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;
-@@ -1340,17 +1389,21 @@ class MinAnisoField : public Field
+@@ -1340,17 +1340,21 @@ class MinAnisoField : public Field
    }
    virtual void operator() (double x, double y, double z, SMetric3 &metr, GEntity *ge=0)
    {
@@ -80,84 +24,6 @@
  	}
  	v = intersection_conserve_mostaniso(v,ff);
        }
-@@ -1449,6 +1502,77 @@ class IntersectAnisoField : public Field
-     }
-     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 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
-   }
 Index: gmsh-tetgen-2.8.5~svn18983/Geo/STensor3.h
 ===================================================================
 --- gmsh-tetgen-2.8.5~svn18983.orig/Geo/STensor3.h




More information about the debian-science-commits mailing list