getfem-commits
[Top][All Lists]
Advanced

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

[Getfem-commits] (no subject)


From: Yves Renard
Subject: [Getfem-commits] (no subject)
Date: Thu, 23 Nov 2017 07:29:21 -0500 (EST)

branch: master
commit d834c69655358a720fa470f664fa4a5133c9bad5
Author: Yves Renard <address@hidden>
Date:   Thu Nov 23 13:28:47 2017 +0100

    fix a problem affecting the use of variable groups
---
 src/getfem_generic_assembly.cc |  7 +++----
 src/getfem_models.cc           | 20 +++++++++++++++-----
 2 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/src/getfem_generic_assembly.cc b/src/getfem_generic_assembly.cc
index 128dc11..f872ff6 100644
--- a/src/getfem_generic_assembly.cc
+++ b/src/getfem_generic_assembly.cc
@@ -11271,6 +11271,9 @@ namespace getfem {
         gmm::vect_size(workspace.value(varname));
       gis.var_intervals[varname]=gmm::sub_interval(gis.nb_dof, nd);
       gis.nb_dof += nd;
+      gis.max_dof = gis.nb_dof;
+    } else {
+      gis.max_dof = workspace.interval_of_variable(varname).last();
     }
   }
 
@@ -12147,8 +12150,6 @@ namespace getfem {
           if (pgai) rmi.instructions.push_back(std::move(pgai));
         }
         add_interval_to_gis(workspace, pnode->name, gis);
-        gis.max_dof = std::max
-          (gis.max_dof, workspace.interval_of_variable(pnode->name).last());
       }
       break;
 
@@ -12191,8 +12192,6 @@ namespace getfem {
         }
         rmi.instructions.push_back(std::move(pgai));
         add_interval_to_gis(workspace, pnode->name, gis);
-        gis.max_dof = std::max
-          (gis.max_dof, workspace.interval_of_variable(pnode->name).last());
       }
       break;
 
diff --git a/src/getfem_models.cc b/src/getfem_models.cc
index 9ebe7b9..ded2a43 100644
--- a/src/getfem_models.cc
+++ b/src/getfem_models.cc
@@ -692,11 +692,10 @@ namespace getfem {
       ost << "Model with no variable nor data" << endl;
     else {
       ost << "List of model variables and data:" << endl;
-      for (VAR_SET::const_iterator it = variables.begin();
-           it != variables.end(); ++it) {
-        if (it->second.is_variable) ost << "Variable ";
-        else ost << "Data     ";
-        ost << std::setw(20) << std::left << it->first;
+      for (auto it = variables.begin(); it != variables.end(); ++it) {
+        if (it->second.is_variable) ost << "Variable       ";
+        else ost << "Data           ";
+        ost << std::setw(30) << std::left << it->first;
         if (it->second.n_iter == 1)
           ost << " 1 copy   ";
         else
@@ -715,6 +714,17 @@ namespace getfem {
         if (it->second.is_affine_dependent) ost << "\t (is affine dependent)";
         ost << endl;
       }
+      for (auto it = variable_groups.begin();
+          it != variable_groups.end(); ++it) {
+       ost << "Variable group " << std::setw(30) << std::left
+           << it->first;
+       if (it->second.size()) {
+         auto it2 = it->second.begin();
+         ost << " " << *it2; ++it2;
+         for (; it2 != it->second.end(); ++it2) ost << ", " << *it2;
+         ost << endl;
+       } else ost << " empty" << endl;
+      }
     }
   }
 



reply via email to

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