From: kanschat Date: Fri, 9 Jan 2009 21:21:16 +0000 (+0000) Subject: more cleaning of FE_RT X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04b58a0884db12335b7c0ee27246a25221f64a9c;p=dealii-svn.git more cleaning of FE_RT git-svn-id: https://svn.dealii.org/trunk@18166 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/fe/fe_raviart_thomas.h b/deal.II/deal.II/include/fe/fe_raviart_thomas.h index fde8131c31..28f609f87e 100644 --- a/deal.II/deal.II/include/fe/fe_raviart_thomas.h +++ b/deal.II/deal.II/include/fe/fe_raviart_thomas.h @@ -387,6 +387,17 @@ class FE_RaviartThomasNodal */ static std::vector get_ria_vector (const unsigned int degree); + /** + * Check whether a shape function + * may be non-zero on a face. + * + * Right now, this is only + * implemented for RT0 in + * 1D. Otherwise, returns always + * @p true. + */ + virtual bool has_support_on_face (const unsigned int shape_index, + const unsigned int face_index) const; /** * Initialize the * FiniteElement::generalized_support_points diff --git a/deal.II/deal.II/source/fe/fe_raviart_thomas.cc b/deal.II/deal.II/source/fe/fe_raviart_thomas.cc index cf158ff4b2..4ab6e9f1b0 100644 --- a/deal.II/deal.II/source/fe/fe_raviart_thomas.cc +++ b/deal.II/deal.II/source/fe/fe_raviart_thomas.cc @@ -416,10 +416,12 @@ FE_RaviartThomas::initialize_restriction() template <> std::vector -FE_RaviartThomas<1>::get_dpo_vector (const unsigned int) +FE_RaviartThomas<1>::get_dpo_vector (const unsigned int deg) { - Assert (false, ExcImpossibleInDim(1)); - return std::vector(); + std::vector dpo(2); + dpo[0] = 1; + dpo[1] = deg; + return dpo; } #endif @@ -427,20 +429,17 @@ FE_RaviartThomas<1>::get_dpo_vector (const unsigned int) template std::vector -FE_RaviartThomas::get_dpo_vector (const unsigned int rt_order) +FE_RaviartThomas::get_dpo_vector (const unsigned int deg) { - // the element is face-based (not - // to be confused with George - // W. Bush's Faith Based - // Initiative...), and we have - // (rt_order+1)^(dim-1) DoFs per face + // the element is face-based and we have + // (deg+1)^(dim-1) DoFs per face unsigned int dofs_per_face = 1; - for (unsigned int d=0; d dpo(dim+1); dpo[dim-1] = dofs_per_face; @@ -498,7 +497,6 @@ FE_RaviartThomas::has_support_on_face (const unsigned int shape_index, } - template void FE_RaviartThomas::interpolate( @@ -509,7 +507,6 @@ FE_RaviartThomas::interpolate( } - template void FE_RaviartThomas::interpolate( diff --git a/deal.II/deal.II/source/fe/fe_raviart_thomas_nodal.cc b/deal.II/deal.II/source/fe/fe_raviart_thomas_nodal.cc index 8eb0fa196c..738fad80ff 100644 --- a/deal.II/deal.II/source/fe/fe_raviart_thomas_nodal.cc +++ b/deal.II/deal.II/source/fe/fe_raviart_thomas_nodal.cc @@ -272,6 +272,35 @@ FE_RaviartThomasNodal::get_ria_vector (const unsigned int deg) } +template +bool +FE_RaviartThomasNodal::has_support_on_face ( + const unsigned int shape_index, + const unsigned int face_index) const +{ + Assert (shape_index < this->dofs_per_cell, + ExcIndexRange (shape_index, 0, this->dofs_per_cell)); + Assert (face_index < GeometryInfo::faces_per_cell, + ExcIndexRange (face_index, 0, GeometryInfo::faces_per_cell)); + + // The first degrees of freedom are + // on the faces and each face has + // degree degrees. + const unsigned int support_face = shape_index / this->degree; + + // The only thing we know for sure + // is that shape functions with + // support on one face are zero on + // the opposite face. + if (support_face < GeometryInfo::faces_per_cell) + return (face_index != GeometryInfo::opposite_face[support_face]); + + // In all other cases, return true, + // which is safe + return true; +} + + template void FE_RaviartThomasNodal::interpolate( @@ -330,7 +359,6 @@ FE_RaviartThomasNodal::interpolate( } - template void FE_RaviartThomasNodal::interpolate(