From 7d2aefcfcf6f64eec984724c378beae8fcccc3c8 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 28 Apr 2006 14:01:07 +0000 Subject: [PATCH] =?utf8?q?Guard=20a=20bunch=20of=20functions=20with=20deal?= =?utf8?q?=5FII=5Fdimension=3D=3D=3F=3F=3F=20to=20make=20static=20linking?= =?utf8?q?=20possible.?= git-svn-id: https://svn.dealii.org/trunk@12933 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/dofs/dof_accessor.cc | 116 +++++++++++--------- 1 file changed, 64 insertions(+), 52 deletions(-) diff --git a/deal.II/deal.II/source/dofs/dof_accessor.cc b/deal.II/deal.II/source/dofs/dof_accessor.cc index d31c0147c3..68528722e5 100644 --- a/deal.II/deal.II/source/dofs/dof_accessor.cc +++ b/deal.II/deal.II/source/dofs/dof_accessor.cc @@ -445,6 +445,8 @@ DoFObjectAccessor<3,DH>::set_dof_values (const Vector &local_values, // --------------- hp::DoFHandler specializations for 1d objects ----------- +#if deal_II_dimension == 1 + template <> void DoFObjectAccessor<1, hp::DoFHandler<1> >::set_vertex_dof_index (const unsigned int /*vertex*/, const unsigned int /*i*/, @@ -456,6 +458,35 @@ void DoFObjectAccessor<1, hp::DoFHandler<1> >::set_vertex_dof_index (const unsig Assert (false, ExcInternalError()); } +template <> +template +void +DoFObjectAccessor<1,hp::DoFHandler<1> >::get_dof_values (const InputVector &/*values*/, + Vector &/*local_values*/) const +{ + Assert (false, ExcNotImplemented()); +} + +template <> +template +void +DoFObjectAccessor<1,hp::DoFHandler<1> >::set_dof_values (const Vector &/*local_values*/, + OutputVector &/*values*/) const +{ + Assert (false, ExcNotImplemented()); +} + +#endif + + + + +// --------------- hp::DoFHandler specializations for 2d objects ----------- + + + +#if deal_II_dimension == 2 + template <> void DoFObjectAccessor<1, hp::DoFHandler<2> >::set_vertex_dof_index (const unsigned int /*vertex*/, const unsigned int /*i*/, @@ -468,26 +499,16 @@ void DoFObjectAccessor<1, hp::DoFHandler<2> >::set_vertex_dof_index (const unsig } template <> -void DoFObjectAccessor<1, hp::DoFHandler<3> >::set_vertex_dof_index (const unsigned int /*vertex*/, +void DoFObjectAccessor<2, hp::DoFHandler<2> >::set_vertex_dof_index (const unsigned int /*vertex*/, const unsigned int /*i*/, const unsigned int /*index*/, const unsigned int fe_index) const { - Assert (fe_index != hp::DoFHandler<3>::default_fe_index, + Assert (fe_index != hp::DoFHandler<2>::default_fe_index, ExcMessage ("You need to specify a FE index when working with hp DoFHandlers")); Assert (false, ExcInternalError()); } - -template <> -template -void -DoFObjectAccessor<1,hp::DoFHandler<1> >::get_dof_values (const InputVector &/*values*/, - Vector &/*local_values*/) const -{ - Assert (false, ExcNotImplemented()); -} - template <> template void @@ -500,22 +521,12 @@ DoFObjectAccessor<1,hp::DoFHandler<2> >::get_dof_values (const InputVector &/*va template <> template void -DoFObjectAccessor<1,hp::DoFHandler<3> >::get_dof_values (const InputVector &/*values*/, +DoFObjectAccessor<2,hp::DoFHandler<2> >::get_dof_values (const InputVector &/*values*/, Vector &/*local_values*/) const { Assert (false, ExcNotImplemented()); } - -template <> -template -void -DoFObjectAccessor<1,hp::DoFHandler<1> >::set_dof_values (const Vector &/*local_values*/, - OutputVector &/*values*/) const -{ - Assert (false, ExcNotImplemented()); -} - template <> template void @@ -525,28 +536,31 @@ DoFObjectAccessor<1,hp::DoFHandler<2> >::set_dof_values (const Vector &/ Assert (false, ExcNotImplemented()); } + template <> template void -DoFObjectAccessor<1,hp::DoFHandler<3> >::set_dof_values (const Vector &/*local_values*/, +DoFObjectAccessor<2,hp::DoFHandler<2> >::set_dof_values (const Vector &/*local_values*/, OutputVector &/*values*/) const { Assert (false, ExcNotImplemented()); } +#endif -// --------------- hp::DoFHandler specializations for 2d objects ----------- +// --------------- hp::DoFHandler specializations for 3d objects ----------- +#if deal_II_dimension == 3 template <> -void DoFObjectAccessor<2, hp::DoFHandler<2> >::set_vertex_dof_index (const unsigned int /*vertex*/, +void DoFObjectAccessor<1, hp::DoFHandler<3> >::set_vertex_dof_index (const unsigned int /*vertex*/, const unsigned int /*i*/, const unsigned int /*index*/, const unsigned int fe_index) const { - Assert (fe_index != hp::DoFHandler<2>::default_fe_index, + Assert (fe_index != hp::DoFHandler<3>::default_fe_index, ExcMessage ("You need to specify a FE index when working with hp DoFHandlers")); Assert (false, ExcInternalError()); } @@ -563,10 +577,22 @@ void DoFObjectAccessor<2, hp::DoFHandler<3> >::set_vertex_dof_index (const unsig } +template <> +void DoFObjectAccessor<3, hp::DoFHandler<3> >::set_vertex_dof_index (const unsigned int /*vertex*/, + const unsigned int /*i*/, + const unsigned int /*index*/, + const unsigned int fe_index) const +{ + Assert (fe_index != hp::DoFHandler<3>::default_fe_index, + ExcMessage ("You need to specify a FE index when working with hp DoFHandlers")); + Assert (false, ExcInternalError()); +} + + template <> template void -DoFObjectAccessor<2,hp::DoFHandler<2> >::get_dof_values (const InputVector &/*values*/, +DoFObjectAccessor<1,hp::DoFHandler<3> >::get_dof_values (const InputVector &/*values*/, Vector &/*local_values*/) const { Assert (false, ExcNotImplemented()); @@ -583,45 +609,29 @@ DoFObjectAccessor<2,hp::DoFHandler<3> >::get_dof_values (const InputVector &/*va template <> -template +template void -DoFObjectAccessor<2,hp::DoFHandler<2> >::set_dof_values (const Vector &/*local_values*/, - OutputVector &/*values*/) const +DoFObjectAccessor<3,hp::DoFHandler<3> >::get_dof_values (const InputVector &/*values*/, + Vector &/*local_values*/) const { Assert (false, ExcNotImplemented()); } + template <> template void -DoFObjectAccessor<2,hp::DoFHandler<3> >::set_dof_values (const Vector &/*local_values*/, +DoFObjectAccessor<1,hp::DoFHandler<3> >::set_dof_values (const Vector &/*local_values*/, OutputVector &/*values*/) const { Assert (false, ExcNotImplemented()); } - - - -// --------------- hp::DoFHandler specializations for 3d objects ----------- - - template <> -void DoFObjectAccessor<3, hp::DoFHandler<3> >::set_vertex_dof_index (const unsigned int /*vertex*/, - const unsigned int /*i*/, - const unsigned int /*index*/, - const unsigned int fe_index) const -{ - Assert (fe_index != hp::DoFHandler<3>::default_fe_index, - ExcMessage ("You need to specify a FE index when working with hp DoFHandlers")); - Assert (false, ExcInternalError()); -} - -template <> -template +template void -DoFObjectAccessor<3,hp::DoFHandler<3> >::get_dof_values (const InputVector &/*values*/, - Vector &/*local_values*/) const +DoFObjectAccessor<2,hp::DoFHandler<3> >::set_dof_values (const Vector &/*local_values*/, + OutputVector &/*values*/) const { Assert (false, ExcNotImplemented()); } @@ -636,6 +646,8 @@ DoFObjectAccessor<3,hp::DoFHandler<3> >::set_dof_values (const Vector &/ } +#endif + /*------------------------- Functions: DoFCellAccessor -----------------------*/ -- 2.39.5