]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix two bugs when coarsening 3d grids.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 31 Mar 1999 16:07:20 +0000 (16:07 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 31 Mar 1999 16:07:20 +0000 (16:07 +0000)
git-svn-id: https://svn.dealii.org/trunk@1068 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/grid/tria.cc

index a9acc7b694003f71b7e8a2753b8b26ae81097f64..8367d88ae37dbd617ceef220e7afb4a9d153a81a 100644 (file)
@@ -179,6 +179,27 @@ void Triangulation<dim>::copy_triangulation (const Triangulation<dim> &old_tria)
 
 
 
+template <int dim>
+void Triangulation<dim>::block_write (ostream &out) const 
+{
+                                  // write out the level information
+  out << levels.size() << endl << '[';
+  for (unsigned int level=0; level<levels.size(); ++level)
+    levels[level]->block_write (out);
+  out << ']';
+  
+                                  // write out the vertices
+  out << '[';
+  out.write (reinterpret_cast<const char*>(vertices.begin()),
+            reinterpret_cast<const char*>(vertices.end())
+            - reinterpret_cast<const char*>(vertices.begin()));
+  out << ']';
+
+  write_bool_vector (0, vertices_used, 0, out);
+};
+
+  
+
 #if deal_II_dimension == 1
 
 template <>
@@ -3697,8 +3718,8 @@ void Triangulation<1>::print_gnuplot (ostream &out,
                                      const active_cell_iterator & cell) const {
   AssertThrow (out, ExcIO());
   
-  out << cell->vertex(0) << " " << cell->level() << endl
-      << cell->vertex(1) << " " << cell->level() << endl
+  out << cell->vertex(0) << ' ' << cell->level() << endl
+      << cell->vertex(1) << ' ' << cell->level() << endl
       << endl;
 
   AssertThrow (out, ExcIO());
@@ -3714,11 +3735,11 @@ void Triangulation<2>::print_gnuplot (ostream &out,
                                      const active_cell_iterator & cell) const {
   AssertThrow (out, ExcIO());
   
-  out << cell->vertex(0) << " " << cell->level() << endl
-      << cell->vertex(1) << " " << cell->level() << endl
-      << cell->vertex(2) << " " << cell->level() << endl
-      << cell->vertex(3) << " " << cell->level() << endl
-      << cell->vertex(0) << " " << cell->level() << endl
+  out << cell->vertex(0) << ' ' << cell->level() << endl
+      << cell->vertex(1) << ' ' << cell->level() << endl
+      << cell->vertex(2) << ' ' << cell->level() << endl
+      << cell->vertex(3) << ' ' << cell->level() << endl
+      << cell->vertex(0) << ' ' << cell->level() << endl
       << endl  // double new line for gnuplot 3d plots
       << endl;
 
@@ -3736,32 +3757,32 @@ void Triangulation<3>::print_gnuplot (ostream &out,
   AssertThrow (out, ExcIO());
 
                                   // front face
-  out << cell->vertex(0) << " " << cell->level() << endl
-      << cell->vertex(1) << " " << cell->level() << endl
-      << cell->vertex(2) << " " << cell->level() << endl
-      << cell->vertex(3) << " " << cell->level() << endl
-      << cell->vertex(0) << " " << cell->level() << endl
+  out << cell->vertex(0) << ' ' << cell->level() << endl
+      << cell->vertex(1) << ' ' << cell->level() << endl
+      << cell->vertex(2) << ' ' << cell->level() << endl
+      << cell->vertex(3) << ' ' << cell->level() << endl
+      << cell->vertex(0) << ' ' << cell->level() << endl
       << endl;
                                   // back face
-  out << cell->vertex(4) << " " << cell->level() << endl
-      << cell->vertex(5) << " " << cell->level() << endl
-      << cell->vertex(6) << " " << cell->level() << endl
-      << cell->vertex(7) << " " << cell->level() << endl
-      << cell->vertex(4) << " " << cell->level() << endl
+  out << cell->vertex(4) << ' ' << cell->level() << endl
+      << cell->vertex(5) << ' ' << cell->level() << endl
+      << cell->vertex(6) << ' ' << cell->level() << endl
+      << cell->vertex(7) << ' ' << cell->level() << endl
+      << cell->vertex(4) << ' ' << cell->level() << endl
       << endl;
 
                                   // now for the four connecting lines
-  out << cell->vertex(0) << " " << cell->level() << endl
-      << cell->vertex(4) << " " << cell->level() << endl
+  out << cell->vertex(0) << ' ' << cell->level() << endl
+      << cell->vertex(4) << ' ' << cell->level() << endl
       << endl;
-  out << cell->vertex(1) << " " << cell->level() << endl
-      << cell->vertex(5) << " " << cell->level() << endl
+  out << cell->vertex(1) << ' ' << cell->level() << endl
+      << cell->vertex(5) << ' ' << cell->level() << endl
       << endl;
-  out << cell->vertex(2) << " " << cell->level() << endl
-      << cell->vertex(6) << " " << cell->level() << endl
+  out << cell->vertex(2) << ' ' << cell->level() << endl
+      << cell->vertex(6) << ' ' << cell->level() << endl
       << endl;
-  out << cell->vertex(3) << " " << cell->level() << endl
-      << cell->vertex(7) << " " << cell->level() << endl
+  out << cell->vertex(3) << ' ' << cell->level() << endl
+      << cell->vertex(7) << ' ' << cell->level() << endl
       << endl;
 
   AssertThrow (out, ExcIO());
@@ -7047,7 +7068,7 @@ void Triangulation<3>::delete_cell (cell_iterator &cell) {
        make_pair(cell->line(7), false),
        make_pair(cell->line(8), false),
        make_pair(cell->line(9), false),
-       make_pair(cell->line(0), false),
+       make_pair(cell->line(10), false),
        make_pair(cell->line(11), false)  };
                                   // next make a map out of this for simpler
                                   // access to the flag associated with a
@@ -7081,7 +7102,7 @@ void Triangulation<3>::delete_cell (cell_iterator &cell) {
              line_is_needed[cell->face(nb)->line(i)] = true;
            };
                                           // ok for this neighbor
-         break;
+         continue;
        };
 
                                       // if the neighbor is not refined,
@@ -7129,8 +7150,6 @@ void Triangulation<3>::delete_cell (cell_iterator &cell) {
        };
     };
 
-  Assert (line_is_needed.size()==12, ExcInternalError());
-
   
                                   // now, if the lines are not marked as
                                   // needed, we may delete their children
@@ -7178,9 +7197,9 @@ void Triangulation<dim>::write_bool_vector (const unsigned int  magic_number1,
                                   // 1. number of flags
                                   // 2. the flags
                                   // 3. magic number
-  out << magic_number1 << " " << N << endl;
+  out << magic_number1 << ' ' << N << endl;
   for (unsigned int i=0; i<N/8+1; ++i) 
-    out << static_cast<unsigned int>(flags[i]) << " ";
+    out << static_cast<unsigned int>(flags[i]) << ' ';
   
   out << endl << magic_number2 << endl;
   

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.