getfem-commits
[Top][All Lists]
Advanced

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

[Getfem-commits] r5190 - in /trunk/getfem: interface/src/ interface/test


From: Yves . Renard
Subject: [Getfem-commits] r5190 - in /trunk/getfem: interface/src/ interface/tests/matlab/ src/ src/getfem/
Date: Tue, 15 Dec 2015 12:21:40 -0000

Author: renard
Date: Tue Dec 15 13:21:39 2015
New Revision: 5190

URL: http://svn.gna.org/viewcvs/getfem?rev=5190&view=rev
Log:
bug fix

Modified:
    trunk/getfem/interface/src/getfemint_misc.cc
    trunk/getfem/interface/tests/matlab/demo_plasticity.m
    trunk/getfem/src/getfem/getfem_plasticity.h
    trunk/getfem/src/getfem_generic_assembly.cc
    trunk/getfem/src/getfem_plasticity.cc

Modified: trunk/getfem/interface/src/getfemint_misc.cc
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/interface/src/getfemint_misc.cc?rev=5190&r1=5189&r2=5190&view=diff
==============================================================================
--- trunk/getfem/interface/src/getfemint_misc.cc        (original)
+++ trunk/getfem/interface/src/getfemint_misc.cc        Tue Dec 15 13:21:39 2015
@@ -783,11 +783,13 @@
 
 
 
-  /** This function return the right projection type chosen which could only 
be for the moment the Von Mises projection. */
-  const getfem::pconstraints_projection 
&abstract_constraints_projection_from_name(const std::string &projname) {
+  /** This function return the right projection type chosen which could only
+      be for the moment the Von Mises projection. */
+  const getfem::pconstraints_projection &
+  abstract_constraints_projection_from_name(const std::string &projname) {
 
     static getfem::pconstraints_projection
-      VM_proj = std::shared_ptr<getfem::VM_projection>(0);
+      VM_proj = std::make_shared<getfem::VM_projection>();
 
     if (cmd_strmatch(projname, "Von Mises") ||
         cmd_strmatch(projname, "VM")) return VM_proj;
@@ -797,7 +799,6 @@
                  "Valid names are: Von mises or VM");
 
     return VM_proj;
-
   }
 
 

Modified: trunk/getfem/interface/tests/matlab/demo_plasticity.m
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/interface/tests/matlab/demo_plasticity.m?rev=5190&r1=5189&r2=5190&view=diff
==============================================================================
--- trunk/getfem/interface/tests/matlab/demo_plasticity.m       (original)
+++ trunk/getfem/interface/tests/matlab/demo_plasticity.m       Tue Dec 15 
13:21:39 2015
@@ -27,7 +27,7 @@
 % of the domain and an easy computed Neumann Condition on the right
 
 
-with_hardening = 0;
+with_hardening = 1;
 bi_material = false;
 test_tangent_matrix = false;
 do_plot = true;

Modified: trunk/getfem/src/getfem/getfem_plasticity.h
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem/getfem_plasticity.h?rev=5190&r1=5189&r2=5190&view=diff
==============================================================================
--- trunk/getfem/src/getfem/getfem_plasticity.h (original)
+++ trunk/getfem/src/getfem/getfem_plasticity.h Tue Dec 15 13:21:39 2015
@@ -56,7 +56,7 @@
   /** Abstract projection of a stress tensor onto a set of admissible
       stress tensors.
   */
-  class abstract_constraints_projection  {
+  class abstract_constraints_projection {
   protected :
     size_type flag_hyp;
 

Modified: trunk/getfem/src/getfem_generic_assembly.cc
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem_generic_assembly.cc?rev=5190&r1=5189&r2=5190&view=diff
==============================================================================
--- trunk/getfem/src/getfem_generic_assembly.cc (original)
+++ trunk/getfem/src/getfem_generic_assembly.cc Tue Dec 15 13:21:39 2015
@@ -6432,7 +6432,19 @@
             pnode->qdim1 = child0->qdim1;
             pnode->qdim2 = child0->qdim2;
 
-            if (option == 2 && !compatible) {
+           // simplification if one of the two operands is constant and zero
+            if (child0->tensor_is_zero()) {
+              if (pnode->op_type == GA_MINUS) {
+                pnode->op_type = GA_UNARY_MINUS;
+                tree.clear_node(child0);
+              } else {
+                tree.replace_node_by_child(pnode, 1);
+                pnode = child1;
+              }
+            } else if (child1->tensor_is_zero()) {
+              tree.replace_node_by_child(pnode, 0);
+              pnode = child0;
+            } else if (option == 2 && !compatible) {
               bool child0_compatible = true, child1_compatible = true;
               if (pnode->test_function_type & 1) {
                 if 
(child0->name_test1.compare(workspace.selected_test1.varname)
@@ -6474,20 +6486,6 @@
                   pnode = child1;
                 }
               }
-            }
-
-            // simplification if one of the two operands is constant and zero
-            if (child0->tensor_is_zero()) {
-              if (pnode->op_type == GA_MINUS) {
-                pnode->op_type = GA_UNARY_MINUS;
-                tree.clear_node(child0);
-              } else {
-                tree.replace_node_by_child(pnode, 1);
-                pnode = child1;
-              }
-            } else if (child1->tensor_is_zero()) {
-              tree.replace_node_by_child(pnode, 0);
-              pnode = child0;
             }
           }
         }

Modified: trunk/getfem/src/getfem_plasticity.cc
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem_plasticity.cc?rev=5190&r1=5189&r2=5190&view=diff
==============================================================================
--- trunk/getfem/src/getfem_plasticity.cc       (original)
+++ trunk/getfem/src/getfem_plasticity.cc       Tue Dec 15 13:21:39 2015
@@ -43,7 +43,7 @@
     const mesh_fem &mf_u;
     const mesh_fem &mf_sigma;
     const mesh_fem *pmf_data;
-    model_real_plain_vector U_n,U_np1;
+    model_real_plain_vector U_n, U_np1;
     model_real_plain_vector Sigma_n;
     model_real_plain_vector threshold, lambda, mu;
     const abstract_constraints_projection &t_proj;




reply via email to

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