From acc62c499c3d0c4b93b2347ccc9ee94c44bf83fa Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 8 Jan 2010 23:35:32 +0000 Subject: [PATCH] Instantiate functions as necessary. git-svn-id: https://svn.dealii.org/trunk@20338 0785d39b-7218-0410-832d-ea1e28bc413d --- .../source/multigrid/mg_dof_handler.cc | 571 ++++++++++++------ 1 file changed, 372 insertions(+), 199 deletions(-) diff --git a/deal.II/deal.II/source/multigrid/mg_dof_handler.cc b/deal.II/deal.II/source/multigrid/mg_dof_handler.cc index 3bd542f484..2005947b77 100644 --- a/deal.II/deal.II/source/multigrid/mg_dof_handler.cc +++ b/deal.II/deal.II/source/multigrid/mg_dof_handler.cc @@ -232,6 +232,253 @@ namespace internal return next_free_dof; } + + + + template + static + unsigned int + get_dof_index (const MGDoFHandler<1,spacedim> &mg_dof_handler, + const internal::DoFHandler::DoFLevel<1> &mg_level, + const internal::DoFHandler::DoFFaces<1> &, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index, + const int2type<1>) + { + return mg_level.lines. + get_dof_index (mg_dof_handler, + obj_index, + fe_index, + local_index); + } + + + template + static + void + set_dof_index (const MGDoFHandler<1,spacedim> &mg_dof_handler, + internal::DoFHandler::DoFLevel<1> &mg_level, + internal::DoFHandler::DoFFaces<1> &, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index, + const int2type<1>) + { + mg_level.lines. + set_dof_index (mg_dof_handler, + obj_index, + fe_index, + local_index, + global_index); + + } + + + template + static + unsigned int + get_dof_index(const MGDoFHandler<2,spacedim> &mg_dof_handler, + const internal::DoFHandler::DoFLevel<2> &, + const internal::DoFHandler::DoFFaces<2> &mg_faces, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index, + const int2type<1>) + { + return mg_faces.lines. + get_dof_index (mg_dof_handler, + obj_index, + fe_index, + local_index); + } + + + template + static + void + set_dof_index (const MGDoFHandler<2,spacedim> &mg_dof_handler, + internal::DoFHandler::DoFLevel<2> &, + internal::DoFHandler::DoFFaces<2> &mg_faces, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index, + const int2type<1>) + { + mg_faces.lines. + set_dof_index (mg_dof_handler, + obj_index, + fe_index, + local_index, + global_index); + + } + + + template + static + unsigned int + get_dof_index (const MGDoFHandler<2,spacedim> &mg_dof_handler, + const internal::DoFHandler::DoFLevel<2> &mg_level, + const internal::DoFHandler::DoFFaces<2> &, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index, + const int2type<2>) + { + return mg_level.quads. + get_dof_index (mg_dof_handler, + obj_index, + fe_index, + local_index); + } + + + template + static + void + set_dof_index (const MGDoFHandler<2,spacedim> &mg_dof_handler, + internal::DoFHandler::DoFLevel<2> &mg_level, + internal::DoFHandler::DoFFaces<2> &, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index, + const int2type<2>) + { + mg_level.quads. + set_dof_index (mg_dof_handler, + obj_index, + fe_index, + local_index, + global_index); + + } + + + template + static + unsigned int + get_dof_index (const MGDoFHandler<3,spacedim> &mg_dof_handler, + const internal::DoFHandler::DoFLevel<3> &, + const internal::DoFHandler::DoFFaces<3> &mg_faces, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index, + const int2type<1>) + { + return mg_faces.lines. + get_dof_index (mg_dof_handler, + obj_index, + fe_index, + local_index); + } + + + template + static + void + set_dof_index (const MGDoFHandler<3,spacedim> &mg_dof_handler, + internal::DoFHandler::DoFLevel<3> &, + internal::DoFHandler::DoFFaces<3> &mg_faces, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index, + const int2type<1>) + { + mg_faces.lines. + set_dof_index (mg_dof_handler, + obj_index, + fe_index, + local_index, + global_index); + + } + + + template + static + unsigned int + get_dof_index (const MGDoFHandler<3,spacedim> &mg_dof_handler, + const internal::DoFHandler::DoFLevel<3> &, + const internal::DoFHandler::DoFFaces<3> &mg_faces, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index, + const int2type<2>) + { + return mg_faces.quads. + get_dof_index (mg_dof_handler, + obj_index, + fe_index, + local_index); + } + + + template + static + unsigned int + get_dof_index (const MGDoFHandler<3,spacedim> &mg_dof_handler, + const internal::DoFHandler::DoFLevel<3> &mg_level, + const internal::DoFHandler::DoFFaces<3> &, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index, + const int2type<3>) + { + return mg_level.hexes. + get_dof_index (mg_dof_handler, + obj_index, + fe_index, + local_index); + } + + + template + static + void + set_dof_index (const MGDoFHandler<3,spacedim> &mg_dof_handler, + internal::DoFHandler::DoFLevel<3> &, + internal::DoFHandler::DoFFaces<3> &mg_faces, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index, + const int2type<2>) + { + mg_faces.quads. + set_dof_index (mg_dof_handler, + obj_index, + fe_index, + local_index, + global_index); + + } + + + template + static + void + set_dof_index (const MGDoFHandler<3,spacedim> &mg_dof_handler, + internal::DoFHandler::DoFLevel<3> &mg_level, + internal::DoFHandler::DoFFaces<3> &, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index, + const int2type<3>) + { + mg_level.hexes. + set_dof_index (mg_dof_handler, + obj_index, + fe_index, + local_index, + global_index); + + } }; } } @@ -301,13 +548,15 @@ MGDoFHandler::MGVertexDoFs::operator = (const MGVertexDoFs &) template -unsigned int MGDoFHandler::MGVertexDoFs::get_coarsest_level () const { +unsigned int MGDoFHandler::MGVertexDoFs::get_coarsest_level () const +{ return coarsest_level; } template -unsigned int MGDoFHandler::MGVertexDoFs::get_finest_level () const { +unsigned int MGDoFHandler::MGVertexDoFs::get_finest_level () const +{ return finest_level; } @@ -319,7 +568,8 @@ const unsigned int MGDoFHandler::dimension; template -MGDoFHandler::MGDoFHandler (const Triangulation &tria) : +MGDoFHandler::MGDoFHandler (const Triangulation &tria) + : DoFHandler (tria), mg_faces (NULL) {} @@ -1392,218 +1642,47 @@ MGDoFHandler::last_active_hex () const //--------------------------------------------------------------------------- -#if deal_II_dimension == 1 -template <> -template <> -unsigned int -MGDoFHandler<1>::get_dof_index<1> (const unsigned int obj_level, - const unsigned int obj_index, - const unsigned int fe_index, - const unsigned int local_index) const -{ - return this->mg_levels[obj_level]->lines. - get_dof_index (*this, - obj_index, - fe_index, - local_index); -} - - -template <> -template <> -void -MGDoFHandler<1>::set_dof_index<1> (const unsigned int obj_level, - const unsigned int obj_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index) const -{ - this->mg_levels[obj_level]->lines. - set_dof_index (*this, - obj_index, - fe_index, - local_index, - global_index); - -} -#endif - -#if deal_II_dimension == 2 -template <> -template <> +template +template unsigned int -MGDoFHandler<2>::get_dof_index<1> (const unsigned int , - const unsigned int obj_index, - const unsigned int fe_index, - const unsigned int local_index) const +MGDoFHandler:: +get_dof_index (const unsigned int obj_level, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index) const { - return this->mg_faces->lines. + return internal::MGDoFHandler::Implementation:: get_dof_index (*this, - obj_index, - fe_index, - local_index); -} - - -template <> -template <> -void -MGDoFHandler<2>::set_dof_index<1> (const unsigned int , - const unsigned int obj_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index) const -{ - this->mg_faces->lines. - set_dof_index (*this, + *this->mg_levels[obj_level], + *this->mg_faces, obj_index, fe_index, local_index, - global_index); - + internal::int2type()); } -template <> -template <> -unsigned int -MGDoFHandler<2>::get_dof_index<2> (const unsigned int obj_level, - const unsigned int obj_index, - const unsigned int fe_index, - const unsigned int local_index) const -{ - return this->mg_levels[obj_level]->quads. - get_dof_index (*this, - obj_index, - fe_index, - local_index); -} - -template <> -template <> -void -MGDoFHandler<2>::set_dof_index<2> (const unsigned int obj_level, - const unsigned int obj_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index) const -{ - this->mg_levels[obj_level]->quads. - set_dof_index (*this, - obj_index, - fe_index, - local_index, - global_index); - -} -#endif - -#if deal_II_dimension == 3 -template <> -template <> -unsigned int -MGDoFHandler<3>::get_dof_index<1> (const unsigned int , - const unsigned int obj_index, - const unsigned int fe_index, - const unsigned int local_index) const -{ - return this->mg_faces->lines. - get_dof_index (*this, - obj_index, - fe_index, - local_index); -} - - -template <> -template <> -void -MGDoFHandler<3>::set_dof_index<1> (const unsigned int , - const unsigned int obj_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index) const -{ - this->mg_faces->lines. - set_dof_index (*this, - obj_index, - fe_index, - local_index, - global_index); - -} - - -template <> -template <> -unsigned int -MGDoFHandler<3>::get_dof_index<2> (const unsigned int , - const unsigned int obj_index, - const unsigned int fe_index, - const unsigned int local_index) const -{ - return this->mg_faces->quads. - get_dof_index (*this, - obj_index, - fe_index, - local_index); -} - - -template <> -template <> -unsigned int -MGDoFHandler<3>::get_dof_index<3> (const unsigned int obj_level, - const unsigned int obj_index, - const unsigned int fe_index, - const unsigned int local_index) const -{ - return this->mg_levels[obj_level]->hexes. - get_dof_index (*this, - obj_index, - fe_index, - local_index); -} - - -template <> -template <> -void -MGDoFHandler<3>::set_dof_index<2> (const unsigned int , - const unsigned int obj_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index) const -{ - this->mg_faces->quads. - set_dof_index (*this, - obj_index, - fe_index, - local_index, - global_index); - -} - - -template <> -template <> +template +template void -MGDoFHandler<3>::set_dof_index<3> (const unsigned int obj_level, - const unsigned int obj_index, - const unsigned int fe_index, - const unsigned int local_index, - const unsigned int global_index) const -{ - this->mg_levels[obj_level]->hexes. +MGDoFHandler:: +set_dof_index (const unsigned int obj_level, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index) const +{ + internal::MGDoFHandler::Implementation:: set_dof_index (*this, + *this->mg_levels[obj_level], + *this->mg_faces, obj_index, fe_index, local_index, - global_index); - + global_index, + internal::int2type()); } -#endif template @@ -2167,4 +2246,98 @@ template class MGDoFHandler; template class MGDoFHandler; #endif + +template +unsigned int +MGDoFHandler:: +get_dof_index<1> (const unsigned int obj_level, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index) const; + +template +unsigned int +MGDoFHandler:: +get_dof_index<1> (const unsigned int obj_level, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index) const; + +#if deal_II_dimension >= 2 +template +unsigned int +MGDoFHandler:: +get_dof_index<2> (const unsigned int obj_level, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index) const; + +template +unsigned int +MGDoFHandler:: +get_dof_index<2> (const unsigned int obj_level, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index) const; + +#if deal_II_dimension >= 3 +template +unsigned int +MGDoFHandler:: +get_dof_index<3> (const unsigned int obj_level, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index) const; +#endif +#endif + +template +void +MGDoFHandler:: +set_dof_index<1> (const unsigned int obj_level, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index) const; + +template +void +MGDoFHandler:: +set_dof_index<1> (const unsigned int obj_level, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index) const; + +#if deal_II_dimension >= 2 +template +void +MGDoFHandler:: +set_dof_index<2> (const unsigned int obj_level, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index) const; + +template +void +MGDoFHandler:: +set_dof_index<2> (const unsigned int obj_level, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index) const; + +#if deal_II_dimension >= 3 +template +void +MGDoFHandler:: +set_dof_index<3> (const unsigned int obj_level, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index, + const unsigned int global_index) const; +#endif +#endif + DEAL_II_NAMESPACE_CLOSE -- 2.39.5