From de2a51af0a5a474cac3001e97996449c448159e0 Mon Sep 17 00:00:00 2001 From: Ralf Hartmann Date: Mon, 14 Mar 2005 16:57:21 +0000 Subject: [PATCH] Remove vertices_adjacent_to_line function. Doc update. git-svn-id: https://svn.dealii.org/trunk@10128 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/grid/geometry_info.h | 231 +++++-------------- 1 file changed, 59 insertions(+), 172 deletions(-) diff --git a/deal.II/deal.II/include/grid/geometry_info.h b/deal.II/deal.II/include/grid/geometry_info.h index 029383857d..169446576d 100644 --- a/deal.II/deal.II/include/grid/geometry_info.h +++ b/deal.II/deal.II/include/grid/geometry_info.h @@ -230,11 +230,18 @@ struct GeometryInfo * line line, e.g. * GeometryInfo<2>::line_to_cell_vertices(2,0)=3. * - * This function is useful and - * implemented for dim=2 - * and dim=3, only. For - * dim=2 this call is - * simply passed down to the + * The order of the lines, as + * well as their direction (which + * in turn determines which is + * the first and which the second + * vertex on a line) is the + * canonical one in deal.II, as + * described in the documentation + * of the Triangulation + * class. + * + * For dim=2 this call + * is simply passed down to the * face_to_cell_vertices() * function. */ @@ -292,34 +299,6 @@ struct GeometryInfo */ static Point unit_cell_vertex (const unsigned int vertex); - /** - * Report, for vertex=0,1 the - * indices of the two vertices - * adjacent to the line with - * index @p line among the lines - * forming this cell. In 1d, the - * only line is the cell itself, - * while in 2d and 3d there are 4 - * and 12 lines, respectively. - * - * The positions of these - * vertices in the unit cell can - * be obtained using the - * @p unit_cell_vertex function. - * - * The order of the lines, as - * well as their direction (which - * in turn determines which is - * the first and which the second - * vertex on a line) is the - * canonical one in deal.II, as - * described in the documentation - * of the Triangulation - * class. - */ - static unsigned int vertices_adjacent_to_line (const unsigned int line, - const unsigned int vertex); - /** * Given a point @p p in unit * coordinates, return the number @@ -685,6 +664,18 @@ struct GeometryInfo<1> */ static unsigned int child_cell_on_face (const unsigned int face, const unsigned int subface); + + /** + * Map line vertex number to cell + * vertex number. + * + * As in 1d there is only one + * line (the cell itself), this + * function simply returns @p + * vertex. + */ + static unsigned int line_to_cell_vertices (const unsigned int line, + const unsigned int vertex); /** * Return the position of the @@ -697,34 +688,6 @@ struct GeometryInfo<1> */ static Point<1> unit_cell_vertex (const unsigned int vertex); - /** - * Report, for vertex=0,1 the - * indices of the two vertices - * adjacent to the line with - * index @p line among the lines - * forming this cell. In 1d, the - * only line is the cell itself, - * while in 2d and 3d there are 4 - * and 12 lines, respectively. - * - * The positions of these - * vertices in the unit cell can - * be obtained using the - * @p unit_cell_vertex function. - * - * The order of the lines, as - * well as their direction (which - * in turn determines which is - * the first and which the second - * vertex on a line) is the - * canonical one in deal.II, as - * described in the documentation - * of the Triangulation - * class. - */ - static unsigned int vertices_adjacent_to_line (const unsigned int line, - const unsigned int vertex); - /** * Given a point @p p in unit * coordinates, return the number @@ -1003,8 +966,18 @@ struct GeometryInfo<2> * line line, e.g. * GeometryInfo<2>::line_to_cell_vertices(2,0)=3. * - * This call is simply passed - * down to the + * The order of the lines, as + * well as their direction (which + * in turn determines which is + * the first and which the second + * vertex on a line) is the + * canonical one in deal.II, as + * described in the documentation + * of the Triangulation + * class. + * + * In 2d this function is simply + * passes down to the * face_to_cell_vertices() * function. */ @@ -1043,34 +1016,6 @@ struct GeometryInfo<2> */ static Point<2> unit_cell_vertex (const unsigned int i); - /** - * Report, for vertex=0,1 the - * indices of the two vertices - * adjacent to the line with - * index @p line among the lines - * forming this cell. In 1d, the - * only line is the cell itself, - * while in 2d and 3d there are 4 - * and 12 lines, respectively. - * - * The positions of these - * vertices in the unit cell can - * be obtained using the - * @p unit_cell_vertex function. - * - * The order of the lines, as - * well as their direction (which - * in turn determines which is - * the first and which the second - * vertex on a line) is the - * canonical one in deal.II, as - * described in the documentation - * of the Triangulation - * class. - */ - static unsigned int vertices_adjacent_to_line (const unsigned int line, - const unsigned int vertex); - /** * Given a point @p p in unit * coordinates, return the number @@ -1348,6 +1293,16 @@ struct GeometryInfo<3> * vertexth vertex of * line line, e.g. * GeometryInfo<3>::line_to_cell_vertices(10,1)=6. + * + * The order of the lines, as + * well as their direction (which + * in turn determines which is + * the first and which the second + * vertex on a line) is the + * canonical one in deal.II, as + * described in the documentation + * of the Triangulation + * class. */ static unsigned int line_to_cell_vertices (const unsigned int line, const unsigned int vertex); @@ -1395,34 +1350,6 @@ struct GeometryInfo<3> */ static Point<3> unit_cell_vertex (const unsigned int i); - /** - * Report, for vertex=0,1 the - * indices of the two vertices - * adjacent to the line with - * index @p line among the lines - * forming this cell. In 1d, the - * only line is the cell itself, - * while in 2d and 3d there are 4 - * and 12 lines, respectively. - * - * The positions of these - * vertices in the unit cell can - * be obtained using the - * @p unit_cell_vertex function. - * - * The order of the lines, as - * well as their direction (which - * in turn determines which is - * the first and which the second - * vertex on a line) is the - * canonical one in deal.II, as - * described in the documentation - * of the Triangulation - * class. - */ - static unsigned int vertices_adjacent_to_line (const unsigned int line, - const unsigned int vertex); - /** * Given a point @p p in unit * coordinates, return the number @@ -1619,59 +1546,6 @@ GeometryInfo<3>::unit_cell_vertex (const unsigned int vertex) -inline -unsigned int -GeometryInfo<1>::vertices_adjacent_to_line (const unsigned int line, - const unsigned int vertex) -{ - Assert (line < lines_per_cell, - ExcIndexRange (line, 0, lines_per_cell)); - Assert (vertex < vertices_per_cell, - ExcIndexRange (vertex, 0, 2)); - - return vertex; -} - - - -inline -unsigned int -GeometryInfo<2>::vertices_adjacent_to_line (const unsigned int line, - const unsigned int vertex) -{ - Assert (line < lines_per_cell, - ExcIndexRange (line, 0, lines_per_cell)); - Assert (vertex < vertices_per_cell, - ExcIndexRange (vertex, 0, 2)); - - static const unsigned int vertex_indices[lines_per_cell][2] = - { {0, 1}, {1, 2}, {3, 2}, {0, 3} }; - - return vertex_indices[line][vertex]; -} - - - -inline -unsigned int -GeometryInfo<3>::vertices_adjacent_to_line (const unsigned int line, - const unsigned int vertex) -{ - Assert (line < lines_per_cell, - ExcIndexRange (line, 0, lines_per_cell)); - Assert (vertex < vertices_per_cell, - ExcIndexRange (vertex, 0, 2)); - - static const unsigned int vertex_indices[lines_per_cell][2] = - { {0, 1}, {1, 2}, {3, 2}, {0, 3}, - {4, 5}, {5, 6}, {7, 6}, {4, 7}, - {0, 4}, {1, 5}, {2, 6}, {3, 7} }; - - return vertex_indices[line][vertex]; -} - - - inline unsigned int GeometryInfo<1>::child_cell_from_point (const Point<1> &p) @@ -1844,6 +1718,19 @@ GeometryInfo<3>::is_inside_unit_cell (const Point<3> &p) +inline +unsigned int +GeometryInfo<1>::line_to_cell_vertices (const unsigned int line, + const unsigned int vertex) +{ + Assert (line::line_to_cell_vertices (const unsigned int line, -- 2.39.5