From: Ralf Hartmann Date: Wed, 28 Sep 2005 12:44:58 +0000 (+0000) Subject: switch y and z. X-Git-Tag: v8.0.0~13064 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd79512cc73aa6c3e3133febb7a8b30746761807;p=dealii.git switch y and z. git-svn-id: https://svn.dealii.org/trunk@11539 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/grid/grid_in.cc b/deal.II/deal.II/source/grid/grid_in.cc index 1c0a776c9b..7bc64f851d 100644 --- a/deal.II/deal.II/source/grid/grid_in.cc +++ b/deal.II/deal.II/source/grid/grid_in.cc @@ -1102,9 +1102,19 @@ void GridIn<3>::read_netcdf (const std::string &filename) static_cast(n_vertices), ExcIO()); std::vector > point_values( 3, std::vector (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 > 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::invert_all_cells_of_negative_grid (vertices, cells); GridReordering::reorder_cells (cells); tria->create_triangulation (vertices, cells, subcelldata); #endif