getfem-commits
[Top][All Lists]
Advanced

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

[Getfem-commits] r4753 - in /trunk/getfem: src/ src/getfem/ tests/


From: Yves . Renard
Subject: [Getfem-commits] r4753 - in /trunk/getfem: src/ src/getfem/ tests/
Date: Mon, 25 Aug 2014 10:46:17 -0000

Author: renard
Date: Mon Aug 25 12:46:17 2014
New Revision: 4753

URL: http://svn.gna.org/viewcvs/getfem?rev=4753&view=rev
Log:
some other small fix for time integration schemes

Modified:
    trunk/getfem/src/getfem/getfem_models.h
    trunk/getfem/src/getfem_contact_and_friction_large_sliding.cc
    trunk/getfem/src/getfem_models.cc
    trunk/getfem/src/getfem_nonlinear_elasticity.cc
    trunk/getfem/tests/heat_equation.cc
    trunk/getfem/tests/heat_equation.pl

Modified: trunk/getfem/src/getfem/getfem_models.h
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem/getfem_models.h?rev=4753&r1=4752&r2=4753&view=diff
==============================================================================
--- trunk/getfem/src/getfem/getfem_models.h     (original)
+++ trunk/getfem/src/getfem/getfem_models.h     Mon Aug 25 12:46:17 2014
@@ -113,10 +113,14 @@
   typedef gmm::row_matrix<model_complex_sparse_vector>
   model_complex_row_sparse_matrix;
 
-  inline std::string sup_previous_to_varname(const std::string &v) {
+  inline std::string sup_previous_and_dot_to_varname(std::string v) {
     if (!(v.compare(0, 8, "Previous")) && (v[8] == '_' || v[9] == '_')) {
-      return v.substr((v[8] == '_') ? 9 : 10);
-    } else return v;
+      v = v.substr((v[8] == '_') ? 9 : 10);
+    }
+    if (!(v.compare(0, 3, "Dot")) && (v[3] == '_' || v[4] == '_')) {
+      v = v.substr((v[3] == '_') ? 4 : 5);
+    }
+    return v;
   }
 
   /** ``Model'' variables store the variables, the data and the
@@ -262,11 +266,11 @@
       
       term_description(const std::string &v)
         : is_matrix_term(false), is_symmetric(false),
-          is_global(false), var1(sup_previous_to_varname(v)) {}
+          is_global(false), var1(sup_previous_and_dot_to_varname(v)) {}
       term_description(const std::string &v1, const std::string &v2,
                        bool issym)
         : is_matrix_term(true), is_symmetric(issym), is_global(false),
-          var1(sup_previous_to_varname(v1)), var2(v2) {}
+          var1(sup_previous_and_dot_to_varname(v1)), var2(v2) {}
       term_description(bool ism, bool issym)
         : is_matrix_term(ism), is_symmetric(issym), is_global(true) {}
     };

Modified: trunk/getfem/src/getfem_contact_and_friction_large_sliding.cc
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem_contact_and_friction_large_sliding.cc?rev=4753&r1=4752&r2=4753&view=diff
==============================================================================
--- trunk/getfem/src/getfem_contact_and_friction_large_sliding.cc       
(original)
+++ trunk/getfem/src/getfem_contact_and_friction_large_sliding.cc       Mon Aug 
25 12:46:17 2014
@@ -2319,9 +2319,9 @@
                               const std::string &u,
                               const std::string &lambda,
                               const std::string &w = "") {
-      std::string test_u = "Test_" + sup_previous_to_varname(u);
-      std::string test_u_group = "Test_" + sup_previous_to_varname(u_group);
-      std::string test_lambda = "Test_" + sup_previous_to_varname(lambda);
+      std::string test_u = "Test_" + sup_previous_and_dot_to_varname(u);
+      std::string test_u_group = "Test_" + 
sup_previous_and_dot_to_varname(u_group);
+      std::string test_lambda = "Test_" + 
sup_previous_and_dot_to_varname(lambda);
       GMM_ASSERT1(is_slave || is_master, "The contact boundary should be "
                   "either master, slave or both");
       const mesh_fem *mf = md.pmesh_fem_of_variable(u);

Modified: trunk/getfem/src/getfem_models.cc
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem_models.cc?rev=4753&r1=4752&r2=4753&view=diff
==============================================================================
--- trunk/getfem/src/getfem_models.cc   (original)
+++ trunk/getfem/src/getfem_models.cc   Mon Aug 25 12:46:17 2014
@@ -2057,7 +2057,7 @@
           it2 = variables.find(term.var2);
           I2 = it2->second.I;
           if (!(it2->second.is_variable)) {
-            std::string vorgname = sup_previous_to_varname(term.var2);
+            std::string vorgname = sup_previous_and_dot_to_varname(term.var2);
             VAR_SET::iterator it3 = variables.find(vorgname);
             GMM_ASSERT1(it3->second.is_variable,
                         "Assembly of data not allowed");
@@ -2225,6 +2225,7 @@
           }
         } else {
           if (term.is_matrix_term && (version & BUILD_MATRIX) && !isprevious) {
+            cout << "adding a matrix term with alpha = " << alpha << endl;
             gmm::add(gmm::scaled(brick.rmatlist[j], alpha),
                      gmm::sub_matrix(rTM, I1, I2));
             if (term.is_symmetric && I1.first() != I2.first()) {
@@ -2885,7 +2886,7 @@
     
     for (size_type i = 0; i < vl.size(); ++i) {
       for (size_type j = 0; j < orgs.size(); ++j) 
-        GMM_ASSERT1(vl[i].compare(orgs[j]), "Linear generic brick linkink an "
+        GMM_ASSERT1(vl[i].compare(orgs[j]), "Linear generic brick linking an "
                     "affine dependent variable and its original variable is "
                     "not allowed. Split the brick");
     }

Modified: trunk/getfem/src/getfem_nonlinear_elasticity.cc
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem_nonlinear_elasticity.cc?rev=4753&r1=4752&r2=4753&view=diff
==============================================================================
--- trunk/getfem/src/getfem_nonlinear_elasticity.cc     (original)
+++ trunk/getfem/src/getfem_nonlinear_elasticity.cc     Mon Aug 25 12:46:17 2014
@@ -2238,7 +2238,7 @@
   (model &md, const mesh_im &mim, const std::string &varname,
    const std::string &lawname, const std::string &params,
    size_type region) {
-    std::string test_varname = "Test_" + sup_previous_to_varname(varname);
+    std::string test_varname = "Test_" + 
sup_previous_and_dot_to_varname(varname);
     size_type N = mim.linked_mesh().dim();
     GMM_ASSERT1(N >= 2 && N <= 3,
                 "Finite strain elasticity brick works only in 2D or 3D");
@@ -2263,8 +2263,8 @@
   size_type add_finite_strain_incompressibility_brick
   (model &md, const mesh_im &mim, const std::string &varname,
    const std::string &multname, size_type region) {
-    std::string test_varname = "Test_" + sup_previous_to_varname(varname);
-    std::string test_multname = "Test_" + sup_previous_to_varname(multname);
+    std::string test_varname = "Test_" + 
sup_previous_and_dot_to_varname(varname);
+    std::string test_multname = "Test_" + 
sup_previous_and_dot_to_varname(multname);
 
     std::string expr
       = "(" + test_multname+ ")*(1-Det(Id(meshdim)+Grad_" + varname + "))"

Modified: trunk/getfem/tests/heat_equation.cc
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/tests/heat_equation.cc?rev=4753&r1=4752&r2=4753&view=diff
==============================================================================
--- trunk/getfem/tests/heat_equation.cc (original)
+++ trunk/getfem/tests/heat_equation.cc Mon Aug 25 12:46:17 2014
@@ -80,7 +80,7 @@
   (not mandatory, just to gather the variables)
 */
 
-bool with_new_time_integration = false;
+bool with_new_time_integration = true;
 
 struct heat_equation_problem {
 
@@ -244,6 +244,7 @@
   if (with_new_time_integration) {
     getfem::add_theta_method_for_first_order(model, "u", theta);
     getfem::add_mass_brick(model, mim, "Dot_u");
+    // getfem::add_nonlinear_generic_assembly_brick(model, mim, 
"Dot_u*Test_u");
   } else {
     model.add_initialized_scalar_data("dt", dt);
     getfem::add_basic_d_on_dt_brick(model, mim, "u", "dt");
@@ -309,7 +310,7 @@
   cout << "L2 error = " << getfem::asm_L2_norm(mim, mf_rhs, V) << endl
        << "H1 error = " << getfem::asm_H1_norm(mim, mf_rhs, V) << endl
        << "Linfty error = " << gmm::vect_norminf(V) << endl;
-  GMM_ASSERT1(gmm::vect_norminf(V) < 0.01, "Error too large");
+  GMM_ASSERT1(gmm::vect_norminf(V) < 0.02, "Error too large");
 }
 
 /**************************************************************************/

Modified: trunk/getfem/tests/heat_equation.pl
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/tests/heat_equation.pl?rev=4753&r1=4752&r2=4753&view=diff
==============================================================================
--- trunk/getfem/tests/heat_equation.pl (original)
+++ trunk/getfem/tests/heat_equation.pl Mon Aug 25 12:46:17 2014
@@ -63,7 +63,7 @@
   #    print $_;
       ($a, $b) = split('=', $_);
       # print "La norme en question :", $b;
-      if ($b > 0.0006) {
+      if ($b > 0.002) {
        print "\nError too large: $b\n";
        print "./heat_equation $tmp $def 2>&1 failed\n";
        $er = 1; 




reply via email to

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