getfem-commits
[Top][All Lists]
Advanced

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

[Getfem-commits] [getfem-commits] branch master updated: Separate region


From: Yves Renard
Subject: [Getfem-commits] [getfem-commits] branch master updated: Separate regions of identical numbers in gmsh
Date: Tue, 17 Nov 2020 15:10:11 -0500

This is an automated email from the git hooks/post-receive script.

renard pushed a commit to branch master
in repository getfem.

The following commit(s) were added to refs/heads/master by this push:
     new 9c653c4  Separate regions of identical numbers in gmsh
9c653c4 is described below

commit 9c653c48e67c14f17d2a9535bb84bce05e118253
Author: Yves Renard <Yves.Renard@insa-lyon.fr>
AuthorDate: Tue Nov 17 21:10:02 2020 +0100

    Separate regions of identical numbers in gmsh
---
 src/getfem_import.cc | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/getfem_import.cc b/src/getfem_import.cc
index 4ee7fb4..bd8ab50 100644
--- a/src/getfem_import.cc
+++ b/src/getfem_import.cc
@@ -326,13 +326,20 @@ namespace getfem {
     // cout << "nb_bloc = " << nb_block << " nb_cv = " << nb_cv << endl;
      
     std::vector<gmsh_cv_info> cvlst; cvlst.reserve(nb_cv);
+    dal::bit_vector reg;
     for (size_type block=0; block < nb_block; ++block) {
       unsigned type, region;
-      if (version >= 4.) /* Format version 4 */
+      if (version >= 4.) { /* Format version 4 */
         f >> region >> dummy >> type >> nb_cv;
-
       
-
+        if (reg.is_in(region)) {
+          GMM_WARNING2("Two regions have the same number, "
+                       "modifying the region number");
+          reg.add(0); reg.add(1); 
+          region = unsigned(reg.first_false());
+        }
+        reg.add(region);
+      }
       for (size_type cv=0; cv < nb_cv; ++cv) {
 
         cvlst.push_back(gmsh_cv_info());



reply via email to

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