getfem-commits
[Top][All Lists]
Advanced

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

[Getfem-commits] r5460 - in /trunk/getfem: interface/src/gf_model_set.cc


From: Yves . Renard
Subject: [Getfem-commits] r5460 - in /trunk/getfem: interface/src/gf_model_set.cc src/bgeot_geometric_trans.cc
Date: Fri, 04 Nov 2016 13:54:25 -0000

Author: renard
Date: Fri Nov  4 14:54:24 2016
New Revision: 5460

URL: http://svn.gna.org/viewcvs/getfem?rev=5460&view=rev
Log:
minor fixes

Modified:
    trunk/getfem/interface/src/gf_model_set.cc
    trunk/getfem/src/bgeot_geometric_trans.cc

Modified: trunk/getfem/interface/src/gf_model_set.cc
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/interface/src/gf_model_set.cc?rev=5460&r1=5459&r2=5460&view=diff
==============================================================================
--- trunk/getfem/interface/src/gf_model_set.cc  (original)
+++ trunk/getfem/interface/src/gf_model_set.cc  Fri Nov  4 14:54:24 2016
@@ -3519,7 +3519,7 @@
         dispname, lambda, wname);
        );
 
-       /address@hidden ind = ('add Nitsche large sliding contact brick 
raytracing', @bool unbiased_version @str dataname_r, @scalar release_distance, 
[, @str dataname_fr[, @str dataname_alpha[, @int version]]])
+       /address@hidden ind = ('add Nitsche large sliding contact brick 
raytracing', @bool unbiased_version, @str dataname_r, @scalar 
release_distance[, @str dataname_fr[, @str dataname_alpha[, @int version]]])
       Adds a large sliding contact with friction brick to the model based on 
the Nitsche's method.
       This brick is able to deal with self-contact, contact between
       several deformable bodies and contact with rigid obstacles.
@@ -3611,7 +3611,7 @@
         dispname, sigma, wname);
        );
 
-    /address@hidden ('add master slave contact boundary to unbiased Nitsche's 
large sliding contact brick', @int indbrick, @tmim mim, @int region, @str 
dispname, @str lambdaname[, @str wname])
+    /address@hidden ('add contact boundary to unbiased Nitsche large sliding 
contact brick', @int indbrick, @tmim mim, @int region, @str dispname, @str 
lambdaname[, @str wname])
       Adds a contact boundary to an existing unbiased Nitschelarge sliding 
contact
       with friction brick which is both master and slave. @*/
     sub_command
@@ -3647,4 +3647,4 @@
   }
   else bad_cmd(init_cmd);
 
-}
+}

Modified: trunk/getfem/src/bgeot_geometric_trans.cc
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/bgeot_geometric_trans.cc?rev=5460&r1=5459&r2=5460&view=diff
==============================================================================
--- trunk/getfem/src/bgeot_geometric_trans.cc   (original)
+++ trunk/getfem/src/bgeot_geometric_trans.cc   Fri Nov  4 14:54:24 2016
@@ -52,14 +52,16 @@
   // Multiply the matrix A of size MxN by B of size NxP in C of size MxP
   void mat_mult(const scalar_type *A, const scalar_type *B, scalar_type *C,
                size_type M, size_type N, size_type P) {
-    auto itC = C; auto itB = B;
-    for (size_type j = 0; j < P; ++j, itB += N)
-      for (size_type i = 0; i < M; ++i, ++itC) {
-       auto itA = A+i, itB1 = itB;
-       *itC = (*itA) * (*itB1);
-       for (size_type k = 1; k < N; ++k)
-         { itA += M; ++itB1; *itC += (*itA) * (*itB1); }
-      }
+    if (N != 0) {
+      auto itC = C; auto itB = B;
+      for (size_type j = 0; j < P; ++j, itB += N)
+       for (size_type i = 0; i < M; ++i, ++itC) {
+         auto itA = A+i, itB1 = itB;
+         *itC = (*itA) * (*itB1);
+         for (size_type k = 1; k < N; ++k)
+           { itA += M; ++itB1; *itC += (*itA) * (*itB1); }
+       }
+    } else std::fill(C, C+M*P, scalar_type(0));
   }
 
   // Optimized matrix mult for small matrices.




reply via email to

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