Diff of /src/Mesh.cc [72633d] .. [b67de1]  Maximize  Restore

Switch to side-by-side view

--- a/src/Mesh.cc
+++ b/src/Mesh.cc
@@ -129,7 +129,7 @@
 
       // store information associated with e
       msh->init (D - 1);
-      dolfin::MeshValueCollection<std::size_t> facet (D - 1);
+      dolfin::MeshValueCollection<std::size_t> facet(*msh, D - 1);
       std::size_t num_side_edges = e.cols ();
 
       if (D == 2)
@@ -144,7 +144,9 @@
                       || (*f).entities(0)[0] == e.xelem (1, i) - 1
                       && (*f).entities(0)[1] == e.xelem (0, i) - 1)
                     {
-                      facet.set_value ((*f).index (), e.xelem (4, i), *msh);
+                      std::pair <std::size_t, std::size_t>
+                        idxvl ((*f).index (), e.xelem (4, i));
+                      msh->domains ().set_marker (idxvl, D - 1);
                       break;
                     }
                 }
@@ -179,17 +181,17 @@
                       && (*f).entities(0)[1] == e.xelem (1, i) - 1
                       && (*f).entities(0)[2] == e.xelem (0, i) - 1)
                     {
-                      facet.set_value ((*f).index (), e.xelem (9, i), *msh);
+                      std::pair <std::size_t, std::size_t> 
+                        idxvl ((*f).index (), e.xelem (9, i));
+                      msh->domains ().set_marker (idxvl, D - 1);
                       break;
                     }
                 }
             }
         }
 
-      *(msh->domains ().markers (D - 1)) = facet;
-
-      // store information associated with t
-      dolfin::MeshValueCollection<std::size_t> cell (D);
+
+      dolfin::MeshValueCollection<std::size_t> cell (*msh, D);
       std::size_t num_cells = t.cols ();
 
       if (D == 2)
@@ -218,7 +220,9 @@
                       && (*f).entities(0)[1] == t.xelem (1, i) - 1
                       && (*f).entities(0)[2] == t.xelem (0, i) - 1)
                     {
-                      cell.set_value ((*f).index (), t.xelem (3, i), *msh);
+                      std::pair <std::size_t, std::size_t>
+                        idxvl ((*f).index (), t.xelem (3, i));
+                      msh->domains ().set_marker (idxvl, D);
                       break;
                     }
                 }
@@ -334,14 +338,14 @@
                        && (*f).entities(0)[2] == t.xelem (1, i) - 1
                        && (*f).entities(0)[3] == t.xelem (0, i) - 1)
                     {
-                      cell.set_value ((*f).index (), t.xelem (4, i), *msh);
+                      std::pair <std::size_t, std::size_t>
+                        idxvl ((*f).index (), t.xelem (4, i));
+                      msh->domains ().set_marker (idxvl, D);
                       break;
                     }
                 }
             }
         }
-
-      *(msh->domains ().markers (D)) = cell;
 
      pmsh = msh;
     }

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks