getfem-commits
[Top][All Lists]
Advanced

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

[Getfem-commits] (no subject)


From: Tetsuo Koyama
Subject: [Getfem-commits] (no subject)
Date: Wed, 4 Sep 2019 13:38:18 -0400 (EDT)

branch: devel-tetsuo-clean
commit 6c2271c14d96b90d95e73a4f0e6769ed298bb5e0
Author: Tetsuo Koyama <address@hidden>
Date:   Thu Sep 5 02:35:48 2019 +0900

    Clean resize_fixed_size_variable and add_fem_data
---
 src/getfem_models.cc | 21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)

diff --git a/src/getfem_models.cc b/src/getfem_models.cc
index 8c8d711..9639709 100644
--- a/src/getfem_models.cc
+++ b/src/getfem_models.cc
@@ -687,14 +687,9 @@ namespace getfem {
 
   void model::resize_fixed_size_variable(const std::string &name,
                                          size_type size) {
-    GMM_ASSERT1(!(variables[name].is_fem_dofs),
-                "Cannot explicitly resize a fem variable or data");
-    GMM_ASSERT1(variables[name].imd == 0,
-                "Cannot explicitly resize an im data");
-    GMM_ASSERT1(size, "Variables of null size are not allowed");
-    variables[name].qdims.resize(1);
-    variables[name].qdims[0] = size;
-    variables[name].set_size();
+    bgeot::multi_index sizes(1);
+    sizes[0] = size;
+    resize_fixed_size_variable(name, sizes);
   }
 
   void model::resize_fixed_size_variable(const std::string &name,
@@ -811,13 +806,9 @@ namespace getfem {
 
   void model::add_fem_data(const std::string &name, const mesh_fem &mf,
                            dim_type qdim, size_type niter) {
-    check_name_validity(name);
-    variables.emplace(name, var_description(false, is_complex(), &mf, 0, niter,
-                                            VDESCRFILTER_NO));
-    variables[name].qdims[0] = qdim;
-    GMM_ASSERT1(qdim, "Data of null size are not allowed");
-    variables[name].set_size();
-    add_dependency(mf);
+    bgeot::multi_index sizes(1);
+    sizes[0] = qdim;
+    add_fem_data(name, mf, sizes, niter);
   }
 
   void model::add_fem_data(const std::string &name, const mesh_fem &mf,



reply via email to

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