From aed91d592b5ad3663341811b8bc16b75eaf34b1e Mon Sep 17 00:00:00 2001 From: bangerth Date: Sun, 3 Sep 2006 21:04:27 +0000 Subject: [PATCH] Provide one function that we now need in creating hanging node constraints git-svn-id: https://svn.dealii.org/trunk@13822 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/dofs/dof_accessor.h | 11 +++ .../include/dofs/dof_accessor.templates.h | 84 +++++++++++++++++++ 2 files changed, 95 insertions(+) diff --git a/deal.II/deal.II/include/dofs/dof_accessor.h b/deal.II/deal.II/include/dofs/dof_accessor.h index 7636d16570..1e547a2776 100644 --- a/deal.II/deal.II/include/dofs/dof_accessor.h +++ b/deal.II/deal.II/include/dofs/dof_accessor.h @@ -446,6 +446,17 @@ class DoFAccessor : public DoFObjectAccessor_Inheritancefe_index_is_active(fe_index) + * must return true. + */ + const FiniteElement & + get_fe (const unsigned int fe_index) const; + /** * Exceptions for child classes * diff --git a/deal.II/deal.II/include/dofs/dof_accessor.templates.h b/deal.II/deal.II/include/dofs/dof_accessor.templates.h index 19f0d14240..552a58701c 100644 --- a/deal.II/deal.II/include/dofs/dof_accessor.templates.h +++ b/deal.II/deal.II/include/dofs/dof_accessor.templates.h @@ -257,6 +257,90 @@ DoFAccessor::fe_index_is_active (const unsigned int fe_index) const } + +template +inline +const FiniteElement & +DoFAccessor::get_fe (const unsigned int fe_index) const +{ + Assert (fe_index_is_active (fe_index) == true, + ExcMessage ("This message can only be called for active fe indices")); + + return this->dof_handler->get_fe()[fe_index]; +} + + + +template <> +inline +const FiniteElement<1> & +DoFAccessor<1,::DoFHandler<1> >::get_fe (const unsigned int fe_index) const +{ + Assert (fe_index_is_active (fe_index) == true, + ExcMessage ("This message can only be called for active fe indices")); + return this->dof_handler->get_fe(); +} + + + +template <> +inline +const FiniteElement<2> & +DoFAccessor<1,::DoFHandler<2> >::get_fe (const unsigned int fe_index) const +{ + Assert (fe_index_is_active (fe_index) == true, + ExcMessage ("This message can only be called for active fe indices")); + return this->dof_handler->get_fe(); +} + + + +template <> +inline +const FiniteElement<3> & +DoFAccessor<1,::DoFHandler<3> >::get_fe (const unsigned int fe_index) const +{ + Assert (fe_index_is_active (fe_index) == true, + ExcMessage ("This message can only be called for active fe indices")); + return this->dof_handler->get_fe(); +} + + + +template <> +inline +const FiniteElement<2> & +DoFAccessor<2,::DoFHandler<2> >::get_fe (const unsigned int fe_index) const +{ + Assert (fe_index_is_active (fe_index) == true, + ExcMessage ("This message can only be called for active fe indices")); + return this->dof_handler->get_fe(); +} + + + +template <> +inline +const FiniteElement<3> & +DoFAccessor<2,::DoFHandler<3> >::get_fe (const unsigned int fe_index) const +{ + Assert (fe_index_is_active (fe_index) == true, + ExcMessage ("This message can only be called for active fe indices")); + return this->dof_handler->get_fe(); +} + + + +template <> +inline +const FiniteElement<3> & +DoFAccessor<3,::DoFHandler<3> >::get_fe (const unsigned int fe_index) const +{ + Assert (fe_index_is_active (fe_index) == true, + ExcMessage ("This message can only be called for active fe indices")); + return this->dof_handler->get_fe(); +} + /*------------------------- Functions: DoFObjectAccessor<1,dim> -----------------------*/ -- 2.39.5