]> https://gitweb.dealii.org/ - dealii.git/commitdiff
switch y and z.
authorRalf Hartmann <Ralf.Hartmann@dlr.de>
Wed, 28 Sep 2005 12:44:58 +0000 (12:44 +0000)
committerRalf Hartmann <Ralf.Hartmann@dlr.de>
Wed, 28 Sep 2005 12:44:58 +0000 (12:44 +0000)
git-svn-id: https://svn.dealii.org/trunk@11539 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/grid/grid_in.cc

index 1c0a776c9b1e0718e882aea9c716e45e2f6f59f7..7bc64f851d16660d7bcb42dc1c2581fc69fab1e8 100644 (file)
@@ -1102,9 +1102,19 @@ void GridIn<3>::read_netcdf (const std::string &filename)
              static_cast<int>(n_vertices), ExcIO());
   std::vector<std::vector<double> > point_values(
     3, std::vector<double> (n_vertices));
+                                  // we switch y and z
+  const bool switch_y_z=true;
   points_xc->get(&*point_values[0].begin(), n_vertices);
-  points_yc->get(&*point_values[1].begin(), n_vertices);
-  points_zc->get(&*point_values[2].begin(), n_vertices);
+  if (switch_y_z)
+    {
+      points_yc->get(&*point_values[2].begin(), n_vertices);
+      points_zc->get(&*point_values[1].begin(), n_vertices);
+    }
+  else
+    {
+      points_yc->get(&*point_values[1].begin(), n_vertices);
+      points_zc->get(&*point_values[2].begin(), n_vertices);
+    }
 
                                   // and fill the vertices
   std::vector<Point<dim> > vertices (n_vertices);
@@ -1123,6 +1133,8 @@ void GridIn<3>::read_netcdf (const std::string &filename)
 
   SubCellData subcelldata;
   GridTools::delete_unused_vertices(vertices, cells, subcelldata);
+  if (switch_y_z)
+    GridReordering<dim>::invert_all_cells_of_negative_grid (vertices, cells);
   GridReordering<dim>::reorder_cells (cells);
   tria->create_triangulation (vertices, cells, subcelldata);  
 #endif

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.