From cc29237655e8b90706ef5ad4350cadb018e3ad12 Mon Sep 17 00:00:00 2001 From: hartmann Date: Fri, 5 Aug 2005 12:58:26 +0000 Subject: [PATCH] Simplify code by using the GeometryInfo::face_to_cell_vertices and face_to_cell_lines functions. git-svn-id: https://svn.dealii.org/trunk@11230 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/source/fe/fe_q_hierarchical.cc | 59 +++---------------- 1 file changed, 9 insertions(+), 50 deletions(-) diff --git a/deal.II/deal.II/source/fe/fe_q_hierarchical.cc b/deal.II/deal.II/source/fe/fe_q_hierarchical.cc index 6bc2343da6..3068b5c4aa 100644 --- a/deal.II/deal.II/source/fe/fe_q_hierarchical.cc +++ b/deal.II/deal.II/source/fe/fe_q_hierarchical.cc @@ -810,37 +810,14 @@ FE_Q_Hierarchical::has_support_on_face (const unsigned int shape_index, // one dof per vertex, so // shape_index==vertex_number. check // whether this vertex is - // on the given face. thus, - // for each face, give a - // list of vertices + // on the given face const unsigned int vertex_no = shape_index; Assert (vertex_no < GeometryInfo::vertices_per_cell, ExcInternalError()); - switch (dim) - { - case 2: - { - static const unsigned int face_vertices[4][2] = - { {0,1},{1,2},{2,3},{0,3} }; - return ((face_vertices[face_index][0] == vertex_no) - || - (face_vertices[face_index][1] == vertex_no)); - }; - - case 3: - { - static const unsigned int face_vertices[6][4] = - { {0,1,2,3},{4,5,6,7},{0,1,5,4}, - {1,5,6,2},{3,2,6,7},{0,4,7,3} }; - return ((face_vertices[face_index][0] == vertex_no)|| - (face_vertices[face_index][1] == vertex_no)|| - (face_vertices[face_index][2] == vertex_no)|| - (face_vertices[face_index][3] == vertex_no)); - }; - - default: - Assert (false, ExcNotImplemented()); - }; + for (unsigned int i=0; i::vertices_per_face; ++i) + if (GeometryInfo::face_to_cell_vertices(face_index,i) == vertex_no) + return true; + return false; } else if (shape_index < this->first_quad_index) // ok, dof is on a line @@ -850,28 +827,10 @@ FE_Q_Hierarchical::has_support_on_face (const unsigned int shape_index, Assert (line_index < GeometryInfo::lines_per_cell, ExcInternalError()); - // in 2d, the line is the - // face, so get the line - // index - if (dim == 2) - return (line_index == face_index); - else if (dim == 3) - { - // see whether the - // given line is on the - // given face. use - // table technique - // again - static const unsigned int face_lines[6][4] = - { {0,1,2,3},{4,5,6,7},{0,8,9,4}, - {1,9,5,10},{2,10,6,11},{3,8,7,11} }; - return ((face_lines[face_index][0] == line_index)|| - (face_lines[face_index][1] == line_index)|| - (face_lines[face_index][2] == line_index)|| - (face_lines[face_index][3] == line_index)); - } - else - Assert (false, ExcNotImplemented()); + for (unsigned int i=0; i::lines_per_face; ++i) + if (GeometryInfo::face_to_cell_lines(face_index,i) == line_index) + return true; + return false; } else if (shape_index < this->first_hex_index) // dof is on a quad -- 2.39.5