getfem-commits
[Top][All Lists]
Advanced

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

[Getfem-commits] r5020 - in /trunk/getfem: interface/tests/python/demo_w


From: Yves . Renard
Subject: [Getfem-commits] r5020 - in /trunk/getfem: interface/tests/python/demo_wheel_contact.py src/getfem_generic_assembly.cc
Date: Mon, 01 Jun 2015 15:22:30 -0000

Author: renard
Date: Mon Jun  1 17:22:29 2015
New Revision: 5020

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

Modified:
    trunk/getfem/interface/tests/python/demo_wheel_contact.py
    trunk/getfem/src/getfem_generic_assembly.cc

Modified: trunk/getfem/interface/tests/python/demo_wheel_contact.py
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/interface/tests/python/demo_wheel_contact.py?rev=5020&r1=5019&r2=5020&view=diff
==============================================================================
--- trunk/getfem/interface/tests/python/demo_wheel_contact.py   (original)
+++ trunk/getfem/interface/tests/python/demo_wheel_contact.py   Mon Jun  1 
17:22:29 2015
@@ -42,9 +42,9 @@
 #
 # Numerical parameters
 #
-h = 1                      # Approximate mesh size
-elements_degree = 2        # Degree of the finite element methods
-gamma0 = 1./E;             # Augmentation parameter for the augmented 
Lagrangian 
+h = 1                    # Approximate mesh size
+elements_degree = 2      # Degree of the finite element methods
+gamma0 = 1./E;           # Augmentation parameter for the augmented Lagrangian 
 
 #
 # Mesh generation. Meshes can also been imported from several formats.
@@ -53,7 +53,7 @@
 mo2 = gf.MesherObject('ball', [0., 15.], 8.)
 mo3 = gf.MesherObject('set minus', mo1, mo2)
 
-print 'Meshes generation'
+print ('Meshes generation')
 gf.util('trace level', 1)   # No trace for mesh generation nor for assembly
 mesh1 = gf.Mesh('generate', mo3, h, 2)
 mesh2 = 
gf.Mesh('import','structured','GT="GT_PK(2,1)";SIZES=[30,10];NOISED=0;NSUBDIV=[%d,%d];'
 % (int(30/h)+1, int(10/h)+1));
@@ -127,18 +127,25 @@
 md.add_nonlinear_generic_assembly_brick(mim1, '-(gamma0*element_size)*(lambda1 
+ 
neg_part(lambda1+(1/(gamma0*element_size))*((u1-Interpolate(u2,Proj1)+X-Interpolate(X,Proj1)).[0;1])))*Test_lambda1',
 CONTACT_BOUND);
 
 # Prescribed force in the hole
+
+# md.add_initialized_data('DData', [0., -1.0])
+# md.add_Dirichlet_condition_with_multipliers(mim1, 'u1', elements_degree-1, 
HOLE_BOUND, 'DData');
+
 md.add_filtered_fem_variable('lambda_D', mflambda, HOLE_BOUND)
 md.add_initialized_data('F', [applied_force/(8*2*np.pi)])
 md.add_variable('alpha_D', 1)
-md.add_linear_generic_assembly_brick(mim1, 'lambda_D.Test_u1 + (u1 - 
alpha_D*[0;1]).Test_lambda_D + (lambda_D.[0;1]-F)*Test_alpha_D', HOLE_BOUND)
+md.add_linear_generic_assembly_brick(mim1, 'lambda_D.Test_u1 + (alpha_D*[0;1] 
- u1).Test_lambda_D + (lambda_D.[0;1] - F)*Test_alpha_D', HOLE_BOUND)
 
 #
 # Model solve
 #
 
 print 'Solve problem with ', md.nbdof(), ' dofs'
-md.solve('max_res', 1E-9, 'max_iter', 100, 'noisy') # , 'lsearch', 'simplest', 
 'alpha min', 0.8)
-
+print 'alpha_D = ', md.variable('alpha_D')[0]
+md.test_tangent_matrix(1e-4, 10, 0.001);
+md.solve('max_res', 1E-9, 'max_iter', 20, 'noisy') # , 'lsearch', 'simplest',  
'alpha min', 0.8)
+print 'alpha_D = ', md.variable('alpha_D')[0]
+md.test_tangent_matrix(1e-4, 10, 0.001);
 
 #
 # Solution export

Modified: trunk/getfem/src/getfem_generic_assembly.cc
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem_generic_assembly.cc?rev=5020&r1=5019&r2=5020&view=diff
==============================================================================
--- trunk/getfem/src/getfem_generic_assembly.cc (original)
+++ trunk/getfem/src/getfem_generic_assembly.cc Mon Jun  1 17:22:29 2015
@@ -8802,8 +8802,8 @@
 
        case GA_PLUS:
          if (pnode->t.size() == 1) {
-           GA_DEBUG_ASSERT(pnode->nb_test_functions() == 0,
-                           "Internal error: non zero number of test 
functions");
+           // GA_DEBUG_ASSERT(pnode->nb_test_functions() == 0,
+           //               "Internal error: non zero number of test 
functions");
            GA_DEBUG_ASSERT(child0->t.size() == 1,
                            "Internal error: child0 not scalar");
            GA_DEBUG_ASSERT(child1->t.size() == 1,
@@ -8818,8 +8818,8 @@
 
        case GA_MINUS:
          if (pnode->t.size() == 1) {
-           GA_DEBUG_ASSERT(pnode->nb_test_functions() == 0,
-                           "Internal error: non zero number of test 
functions");
+           // GA_DEBUG_ASSERT(pnode->nb_test_functions() == 0,
+           //              "Internal error: non zero number of test 
functions");
            GA_DEBUG_ASSERT(child0->t.size() == 1,
                            "Internal error: child0 not scalar");
            GA_DEBUG_ASSERT(child1->t.size() == 1,
@@ -8855,9 +8855,10 @@
                (pnode->op_type == GA_MULT && dim1 <= 1) ||
                child0->t.size() == 1 || child1->t.size() == 1) {
 
-             if (child0->t.size() == 1 && child1->t.size() == 1)
+             if (child0->t.size() == 1 && child1->t.size() == 1) {
                pgai = new ga_instruction_scalar_scalar_mult
                  (pnode->t[0], child0->t[0], child1->t[0]);
+             }
              else if (child0->t.size() == 1)
                pgai = new ga_instruction_scalar_mult
                  (pnode->t, child1->t, child0->t[0]);
@@ -8967,8 +8968,8 @@
 
        case GA_DIV:
          if (child0->t.size() == 1 && child1->t.size() == 1) {
-           GA_DEBUG_ASSERT(pnode->nb_test_functions() == 0,
-                           "Internal error");
+           // GA_DEBUG_ASSERT(pnode->nb_test_functions() == 0,
+           //                "Internal error");
            pgai = new ga_instruction_scalar_scalar_div
              (pnode->t[0], child0->t[0], child1->t[0]);
          } else if (child1->t.size() == 1) {
@@ -9015,8 +9016,7 @@
        case GA_DOTMULT:
 
          if (child0->t.size() == 1 && child1->t.size() == 1) {
-           GA_DEBUG_ASSERT(pnode->nb_test_functions() == 0,
-                           "Internal error");
+           // GA_DEBUG_ASSERT(pnode->nb_test_functions() == 0, "Internal 
error");
            pgai = new ga_instruction_scalar_scalar_mult
              (pnode->t[0], child0->t[0], child1->t[0]);
          } else if (child0->t.size() == 1)
@@ -9044,8 +9044,7 @@
 
        case GA_DOTDIV:
          if (child0->t.size() == 1 && child1->t.size() == 1) {
-           GA_DEBUG_ASSERT(pnode->nb_test_functions() == 0,
-                           "Internal error");
+           // GA_DEBUG_ASSERT(pnode->nb_test_functions() == 0, "Internal 
error");
            pgai = new ga_instruction_scalar_scalar_div
              (pnode->t[0], child0->t[0], child1->t[0]);
          } else if (child1->t.size() == 1) {
@@ -9061,8 +9060,7 @@
 
        case GA_TMULT:
          if (child0->t.size() == 1 && child1->t.size() == 1) {
-           GA_DEBUG_ASSERT(pnode->nb_test_functions() == 0,
-                           "Internal error");
+           // GA_DEBUG_ASSERT(pnode->nb_test_functions() == 0, "Internal 
error");
            pgai = new ga_instruction_scalar_scalar_mult
              (pnode->t[0], child0->t[0], child1->t[0]);
          } else if (child0->t.size() == 1)




reply via email to

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