From 51f5e72c5bfca81f86aa88b4a1f14dca3ead83e2 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 12 Aug 2011 20:55:03 +0000 Subject: [PATCH] Make a couple things compile for 1d face quadrature as well. git-svn-id: https://svn.dealii.org/trunk@24051 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/source/base/quadrature.cc | 65 ++++++++++++++++--------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/deal.II/source/base/quadrature.cc b/deal.II/source/base/quadrature.cc index 4b8a0210b4..1925c7e146 100644 --- a/deal.II/source/base/quadrature.cc +++ b/deal.II/source/base/quadrature.cc @@ -43,7 +43,7 @@ namespace template <> Quadrature<0>::Quadrature (const unsigned int n_q) : - quadrature_points (n_q, Point<0>()), + quadrature_points (n_q), weights (n_q, 0) {} @@ -1094,36 +1094,9 @@ face (const unsigned int face_no, const bool face_rotation, const unsigned int n_quadrature_points) { - Assert (dim != 1, ExcInternalError()); Assert (face_no < GeometryInfo::faces_per_cell, ExcInternalError()); - // in 3d, we have to account for faces that - // have non-standard face orientation, flip - // and rotation. thus, we have to store - // _eight_ data sets per face or subface - - // set up a table with the according offsets - // for non-standard orientation, first index: - // face_orientation (standard true=1), second - // index: face_flip (standard false=0), third - // index: face_rotation (standard false=0) - // - // note, that normally we should use the - // obvious offsets 0,1,2,3,4,5,6,7. However, - // prior to the changes enabling flipped and - // rotated faces, in many places of the - // library the convention was used, that the - // first dataset with offset 0 corresponds to - // a face in standard orientation. therefore - // we use the offsets 4,5,6,7,0,1,2,3 here to - // stick to that (implicit) convention - static const unsigned int offset[2][2][2]= - {{{4*GeometryInfo::faces_per_cell, 5*GeometryInfo::faces_per_cell}, // face_orientation=false; face_flip=false; face_rotation=false and true - {6*GeometryInfo::faces_per_cell, 7*GeometryInfo::faces_per_cell}}, // face_orientation=false; face_flip=true; face_rotation=false and true - {{0*GeometryInfo::faces_per_cell, 1*GeometryInfo::faces_per_cell}, // face_orientation=true; face_flip=false; face_rotation=false and true - {2*GeometryInfo::faces_per_cell, 3*GeometryInfo::faces_per_cell}}}; // face_orientation=true; face_flip=true; face_rotation=false and true - switch (dim) { case 1: @@ -1132,10 +1105,38 @@ face (const unsigned int face_no, case 3: - return ((face_no - + offset[face_orientation][face_flip][face_rotation]) - * n_quadrature_points); - + { + // in 3d, we have to account for faces that + // have non-standard face orientation, flip + // and rotation. thus, we have to store + // _eight_ data sets per face or subface + + // set up a table with the according offsets + // for non-standard orientation, first index: + // face_orientation (standard true=1), second + // index: face_flip (standard false=0), third + // index: face_rotation (standard false=0) + // + // note, that normally we should use the + // obvious offsets 0,1,2,3,4,5,6,7. However, + // prior to the changes enabling flipped and + // rotated faces, in many places of the + // library the convention was used, that the + // first dataset with offset 0 corresponds to + // a face in standard orientation. therefore + // we use the offsets 4,5,6,7,0,1,2,3 here to + // stick to that (implicit) convention + static const unsigned int offset[2][2][2]= + {{{4*GeometryInfo::faces_per_cell, 5*GeometryInfo::faces_per_cell}, // face_orientation=false; face_flip=false; face_rotation=false and true + {6*GeometryInfo::faces_per_cell, 7*GeometryInfo::faces_per_cell}}, // face_orientation=false; face_flip=true; face_rotation=false and true + {{0*GeometryInfo::faces_per_cell, 1*GeometryInfo::faces_per_cell}, // face_orientation=true; face_flip=false; face_rotation=false and true + {2*GeometryInfo::faces_per_cell, 3*GeometryInfo::faces_per_cell}}}; // face_orientation=true; face_flip=true; face_rotation=false and true + + return ((face_no + + offset[face_orientation][face_flip][face_rotation]) + * n_quadrature_points); + } + default: Assert (false, ExcInternalError()); } -- 2.39.5