From: wolf Date: Thu, 13 Jun 2002 13:35:34 +0000 (+0000) Subject: Do the right thing in 1d for has_support_on_face also for FE_DGQ X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3efa862ea1d5f3e04302f7fe3e9d127fe37d525;p=dealii-svn.git Do the right thing in 1d for has_support_on_face also for FE_DGQ git-svn-id: https://svn.dealii.org/trunk@6096 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/fe/fe_dgq.cc b/deal.II/deal.II/source/fe/fe_dgq.cc index 01dab334a3..af9b968ecf 100644 --- a/deal.II/deal.II/source/fe/fe_dgq.cc +++ b/deal.II/deal.II/source/fe/fe_dgq.cc @@ -627,10 +627,19 @@ FE_DGQ::has_support_on_face (const unsigned int shape_index, switch (dim) { case 1: - // This is not correct, but it - // should not matter in 1D. - return true; + { + // in 1d, things are simple. since + // there is only one degree of + // freedom per vertex in this + // class, the first is on vertex 0 + // (==face 0 in some sense), the + // second on face 1: + return (((shape_index == 0) && (face_index == 0)) || + ((shape_index == 1) && (face_index == 1))); + }; + case 2: + { if (face_index==0 && shape_index < n) return true; if (face_index==1 && (shape_index % n) == degree) @@ -640,31 +649,35 @@ FE_DGQ::has_support_on_face (const unsigned int shape_index, if (face_index==3 && (shape_index % n) == 0) return true; return false; + }; + case 3: - if (true) - { - const unsigned int in2 = shape_index % n2; - - // y=0 - if (face_index==0 && in2 < n ) - return true; - // y=1 - if (face_index==1 && in2 >= n2-n) - return true; - // z=0 - if (face_index==2 && shape_index < n2) - return true; - // x=1 - if (face_index==3 && (shape_index % n) == n-1) - return true; - // z=1 - if (face_index==4 && shape_index >= dofs_per_cell - n2) - return true; - // x=0 - if (face_index==5 && (shape_index % n) == 0) - return true; - return false; - } + { + const unsigned int in2 = shape_index % n2; + + // y=0 + if (face_index==0 && in2 < n ) + return true; + // y=1 + if (face_index==1 && in2 >= n2-n) + return true; + // z=0 + if (face_index==2 && shape_index < n2) + return true; + // x=1 + if (face_index==3 && (shape_index % n) == n-1) + return true; + // z=1 + if (face_index==4 && shape_index >= dofs_per_cell - n2) + return true; + // x=0 + if (face_index==5 && (shape_index % n) == 0) + return true; + return false; + }; + + default: + Assert (false, ExcNotImplemented()); } return true; } diff --git a/deal.II/doc/news/2002/c-3-4.html b/deal.II/doc/news/2002/c-3-4.html index 30dbab888e..4ccf3a98b6 100644 --- a/deal.II/doc/news/2002/c-3-4.html +++ b/deal.II/doc/news/2002/c-3-4.html @@ -109,7 +109,9 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK class="member">FE_Q::has_support_on_face always returned true in 1d, partly because faces are not really an issue in 1d. It now does so only when the support point of the - respective shape function is actually the requested vertex. + respective shape function is actually the requested vertex. The + same applied to FE_DGQ::has_support_on_face
(WB 2002/06/13)