getfem-commits
[Top][All Lists]
Advanced

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

[Getfem-commits] r4903 - /trunk/getfem/interface/src/gf_asm.cc


From: logari81
Subject: [Getfem-commits] r4903 - /trunk/getfem/interface/src/gf_asm.cc
Date: Wed, 25 Mar 2015 11:19:14 -0000

Author: logari81
Date: Wed Mar 25 12:19:13 2015
New Revision: 4903

URL: http://svn.gna.org/viewcvs/getfem?rev=4903&view=rev
Log:
fix small bug in gf.asm_generic method when a model is provided

Modified:
    trunk/getfem/interface/src/gf_asm.cc

Modified: trunk/getfem/interface/src/gf_asm.cc
URL: 
http://svn.gna.org/viewcvs/getfem/trunk/getfem/interface/src/gf_asm.cc?rev=4903&r1=4902&r2=4903&view=diff
==============================================================================
--- trunk/getfem/interface/src/gf_asm.cc        (original)
+++ trunk/getfem/interface/src/gf_asm.cc        Wed Mar 25 12:19:13 2015
@@ -426,6 +426,7 @@
   if (in.remaining() && in.front().is_model()) {
     md = &(in.pop().to_getfemint_model()->model());
     with_model = true;
+    nbdof = md->nb_dof();
   }
   getfem::ga_workspace workspace2(*md);
   getfem::ga_workspace *pworkspace = with_model ? &workspace2 : &workspace1;
@@ -442,8 +443,13 @@
       mimd = in.pop().to_const_mesh_im_data();
     }
     darray U = in.pop().to_darray();
-    GMM_ASSERT1(vectors.find(varname) == vectors.end(),
-                "The same variable/constant name is repeated twice")
+    GMM_ASSERT1(vectors.find(varname) == vectors.end() &&
+                (md == 0 || !md->variable_exists(varname)),
+                "The same variable/constant name is repeated twice: "
+                 << varname)
+    GMM_ASSERT1(!with_model || !md->variable_exists(varname),
+                "The same variable/constant name is already defined in "
+                "the model: " << varname)
     gmm::resize(vectors[varname], U.size());
     gmm::copy(U, vectors[varname]);
     if (is_cte) {
@@ -1078,7 +1084,7 @@
       tangent (matrix) (order = 2) is to be computed. 
 
       `model` is an optional parameter allowing to take into account
-      all the variable and data of a model.
+      all variables and data of a model.
       
       The variables and constant (data) are listed after the
       region number (or optionally the model).
@@ -1096,7 +1102,8 @@
       Note that if several variables are given, the assembly of the
       tangent matrix/residual vector will be done considering the order
       in the call of the function (the degrees of freedom of the first
-      variable, then of the second, and so on).
+      variable, then of the second, and so on). If a model is provided,
+      all degrees of freedom of the model will be counted first.
 
       For example, the L2 norm of a vector field "u" can be computed with::
 




reply via email to

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