From: wolf Date: Mon, 25 Jul 2005 20:22:27 +0000 (+0000) Subject: Fix things for 2+1d. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84ac08c69a979edb520ecaf4a186e9fdee31ebd8;p=dealii-svn.git Fix things for 2+1d. git-svn-id: https://svn.dealii.org/trunk@11197 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/numerics/data_out_stack.cc b/deal.II/deal.II/source/numerics/data_out_stack.cc index 4e0bae0aa7..75915ed45c 100644 --- a/deal.II/deal.II/source/numerics/data_out_stack.cc +++ b/deal.II/deal.II/source/numerics/data_out_stack.cc @@ -246,7 +246,11 @@ void DataOutStack::build_patches (const unsigned int n_subdivisions) std::vector > patch_values_system (n_q_points, Vector(n_components)); - // add the required number of patches + // add the required number of + // patches. first initialize a template + // patch with n_q_points (in the the plane + // of the cells) times n_subdivisions+1 (in + // the time direction) points ::DataOutBase::Patch default_patch; default_patch.n_subdivisions = n_subdivisions; default_patch.data.reinit (n_datasets, n_q_points*(n_subdivisions+1)); @@ -277,24 +281,67 @@ void DataOutStack::build_patches (const unsigned int n_subdivisions) break; case 2: + // below, when we fill the + // data, we want to make sure + // that the parameter + // direction is in the + // z-direction in the local + // coordinate direction of + // cells. + // + // we do so by some index + // juggling: for the 3d unit + // cell + // + // 7-------6 7-------6 + // /| | / /| + // / | | / / | + // / | | / / | + // 3 | | 3-------2 | + // | 4-------5 | | 5 + // | / / | | / + // | / / | | / + // |/ / | |/ + // 0-------1 0-------1 + // + // + // with the z-direction + // running in direction from + // vertex 0 to 3, we have to + // map to this the 2d unit + // cell to both the bottom + // and top surfaces: + // + // 3-------2 + // / / + // / / + // / / + // 0-------1 + // + // i.e. the 3d vertex indices + // 0, 1, ..., 7 are mapped to + // the 2d indices 0, 1, 1, 0, + // 3, 2, 2, 3, but with + // different z-coordinates patch->vertices[0] = Point(cell->vertex(0)(0), cell->vertex(0)(1), parameter-parameter_step); patch->vertices[1] = Point(cell->vertex(1)(0), cell->vertex(1)(1), parameter-parameter_step); - patch->vertices[2] = Point(cell->vertex(2)(0), - cell->vertex(2)(1), - parameter-parameter_step); - patch->vertices[3] = Point(cell->vertex(3)(0), - cell->vertex(3)(1), - parameter-parameter_step); - patch->vertices[4] = Point(cell->vertex(0)(0), - cell->vertex(0)(1), - parameter); - patch->vertices[5] = Point(cell->vertex(1)(0), + patch->vertices[2] = Point(cell->vertex(1)(0), cell->vertex(1)(1), parameter); + patch->vertices[3] = Point(cell->vertex(0)(0), + cell->vertex(0)(1), + parameter); + + patch->vertices[4] = Point(cell->vertex(3)(0), + cell->vertex(3)(1), + parameter-parameter_step); + patch->vertices[5] = Point(cell->vertex(2)(0), + cell->vertex(2)(1), + parameter-parameter_step); patch->vertices[6] = Point(cell->vertex(2)(0), cell->vertex(2)(1), parameter);