getfem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Getfem-commits] r4939 - /trunk/getfem/src/getfem_contact_and_friction_c


From: logari81
Subject: [Getfem-commits] r4939 - /trunk/getfem/src/getfem_contact_and_friction_common.cc
Date: Mon, 06 Apr 2015 06:42:06 -0000

Author: logari81
Date: Mon Apr  6 08:42:05 2015
New Revision: 4939

URL: http://svn.gna.org/viewcvs/getfem?rev=4939&view=rev
Log:
revert caching of normals in computation of influence boxes in contact

Modified:
    trunk/getfem/src/getfem_contact_and_friction_common.cc

Modified: trunk/getfem/src/getfem_contact_and_friction_common.cc
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem_contact_and_friction_common.cc?rev=4939&r1=4938&r2=4939&view=diff
==============================================================================
--- trunk/getfem/src/getfem_contact_and_friction_common.cc      (original)
+++ trunk/getfem/src/getfem_contact_and_friction_common.cc      Mon Apr  6 
08:42:05 2015
@@ -605,7 +605,6 @@
 
         dal::bit_vector points_already_interpolated;
         std::vector<base_node> transformed_points(m.nb_max_points());
-        std::vector<base_node> normals(m.nb_max_points());
         for (getfem::mr_visitor v(region,m); !v.finished(); ++v) {
           size_type cv = v.cv();
           bgeot::pgeometric_trans pgt = m.trans_of_convex(cv);
@@ -629,8 +628,8 @@
             size_type ind = m.ind_points_of_convex(cv)[ip];
 
             // computation of transformed vertex
+            ctx.set_ii(ip);
             if (!(points_already_interpolated.is_in(ind))) {
-              ctx.set_ii(ip);
               if (!ref_conf) {
                 pf_s->interpolation(ctx, coeff, val, dim_type(N));
                 val += ctx.xreal();
@@ -639,20 +638,15 @@
                 transformed_points[ind] = ctx.xreal();
               }
               points_already_interpolated.add(ind);
-              // computation of unit normal vector if the vertex is on the face
-              if (points_on_face[ip]) {
-                compute_normal(ctx, v.f(), ref_conf, coeff, n0, n, grad);
-                n /= gmm::vect_norm2(n);
-                normals[ind] = n;
-                n_mean += n;
-                ++nb_pt_on_face;
-              }
             } else {
               val = transformed_points[ind];
-              if (points_on_face[ip]) {
-                n_mean += normals[ind];
-                ++nb_pt_on_face;
-              }
+            }
+            // computation of unit normal vector if the vertex is on the face
+            if (points_on_face[ip]) {
+              compute_normal(ctx, v.f(), ref_conf, coeff, n0, n, grad);
+              n /= gmm::vect_norm2(n);
+              n_mean += n;
+              ++nb_pt_on_face;
             }
 
             if (ip == 0) // computation of bounding box
@@ -1394,7 +1388,6 @@
           
           dal::bit_vector points_already_interpolated;
           std::vector<base_node> transformed_points(m.nb_max_points());
-          std::vector<base_node> normals(m.nb_max_points());
           for (getfem::mr_visitor v(region,m); !v.finished(); ++v) {
             size_type cv = v.cv();
             bgeot::pgeometric_trans pgt = m.trans_of_convex(cv);
@@ -1416,21 +1409,19 @@
               size_type ind = m.ind_points_of_convex(cv)[ip];
               
               // computation of transformed vertex
+              ctx.set_ii(ip);
               if (!(points_already_interpolated.is_in(ind))) {
-                ctx.set_ii(ip);
                 pf_s->interpolation(ctx, coeff, val, dim_type(N));
                 val += ctx.xreal();
                 transformed_points[ind] = val;
                 points_already_interpolated.add(ind);
-                // computation of unit normal vector if the vertex is on the 
face
-                compute_normal(ctx, v.f(), false, coeff, n0_x, n_x, grad);
-                n_x /= gmm::vect_norm2(n_x);
-                normals[ind] = n_x;
-                n_mean += n_x;
               } else {
                 val = transformed_points[ind];
-                n_mean += normals[ind];
               }
+              // computation of unit normal vector if the vertex is on the face
+              compute_normal(ctx, v.f(), false, coeff, n0_x, n_x, grad);
+              n_x /= gmm::vect_norm2(n_x);
+              n_mean += n_x;
               
               if (k == 0) // computation of bounding box
                 bmin = bmax = val;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]