From 8b2a678e22ab8f7bf6e06f33e463d271dc0e425f Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Fri, 3 Apr 2020 23:46:50 +0200 Subject: [PATCH] Simplify instantiation of DoFHandler and hp::DoFHandler --- source/dofs/dof_handler.inst.in | 152 +++++--------------------------- source/hp/dof_handler.inst.in | 127 +++++--------------------- 2 files changed, 47 insertions(+), 232 deletions(-) diff --git a/source/dofs/dof_handler.inst.in b/source/dofs/dof_handler.inst.in index 39a5ff67ed..42ee541349 100644 --- a/source/dofs/dof_handler.inst.in +++ b/source/dofs/dof_handler.inst.in @@ -14,142 +14,36 @@ // --------------------------------------------------------------------- -for (deal_II_dimension : DIMENSIONS) +for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : DIMENSIONS) { - namespace internal - \{ - template const types::global_dof_index * - dummy(); - template std::string - policy_to_string( - const dealii::internal::DoFHandlerImplementation::Policy:: - PolicyBase &); +#if deal_II_dimension <= deal_II_space_dimension + template class DoFHandler; -#if deal_II_dimension < 3 - template const types::global_dof_index * - dummy(); - template std::string - policy_to_string( - const dealii::internal::DoFHandlerImplementation::Policy:: - PolicyBase &); + template std::string internal::policy_to_string( + const dealii::internal::DoFHandlerImplementation::Policy:: + PolicyBase &policy); #endif - \} - - - template class DoFHandler; - -#if deal_II_dimension < 3 - template class DoFHandler; -#endif - -#if deal_II_dimension == 3 - template class DoFHandler<1, deal_II_dimension>; - - template types::global_dof_index DoFHandler<1, 3>::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; -#endif - - template types::global_dof_index - DoFHandler::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 < 3 - template types::global_dof_index - DoFHandler::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; -#endif - -#if deal_II_dimension >= 2 - template types::global_dof_index - DoFHandler::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 types::global_dof_index - DoFHandler::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; -# endif -# if deal_II_dimension >= 3 +for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : DIMENSIONS; + deal_II_component : DIMENSIONS) + { +#if deal_II_component <= deal_II_dimension && \ + deal_II_dimension <= deal_II_space_dimension template types::global_dof_index - DoFHandler::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 - DoFHandler::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 types::global_dof_index global_index) const; - -#if deal_II_dimension < 3 - template void - DoFHandler::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 types::global_dof_index global_index) const; -#endif - -#if deal_II_dimension < 2 - template void - DoFHandler::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 types::global_dof_index global_index) const; -#endif - -#if deal_II_dimension >= 2 - template void - DoFHandler::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 types::global_dof_index global_index) const; - -# if deal_II_dimension < 3 - template void - DoFHandler::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 types::global_dof_index global_index) const; -# endif + DoFHandler::get_dof_index< + deal_II_component>(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 void - DoFHandler::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 types::global_dof_index global_index) const; -# endif + DoFHandler::set_dof_index< + deal_II_component>(const unsigned int obj_level, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index, + const types::global_dof_index global_index) const; #endif } diff --git a/source/hp/dof_handler.inst.in b/source/hp/dof_handler.inst.in index 039f6f2518..87a0ac500a 100644 --- a/source/hp/dof_handler.inst.in +++ b/source/hp/dof_handler.inst.in @@ -13,114 +13,35 @@ // // --------------------------------------------------------------------- - -for (deal_II_dimension : DIMENSIONS) +for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : DIMENSIONS) { +#if deal_II_dimension <= deal_II_space_dimension namespace hp \{ - template class DoFHandler; - -#if deal_II_dimension != 3 - template class DoFHandler; - - template types::global_dof_index - DoFHandler::get_dof_index<1>( - const unsigned int, - const unsigned int, - const unsigned int, - const unsigned int) const; - - template void - DoFHandler::set_dof_index<1>( - const unsigned int, - const unsigned int, - const unsigned int, - const unsigned int, - const types::global_dof_index) const; - -# if deal_II_dimension >= 2 - template types::global_dof_index - DoFHandler::get_dof_index<2>( - const unsigned int, - const unsigned int, - const unsigned int, - const unsigned int) const; - - template void - DoFHandler::set_dof_index<2>( - const unsigned int, - const unsigned int, - const unsigned int, - const unsigned int, - const types::global_dof_index) const; -# endif -#endif - -#if deal_II_dimension == 3 - template class DoFHandler<1, 3>; - - template types::global_dof_index - DoFHandler<1, 3>::get_dof_index<1>(const unsigned int, - const unsigned int, - const unsigned int, - const unsigned int) const; - - template void - DoFHandler<1, 3>::set_dof_index<1>(const unsigned int, - const unsigned int, - const unsigned int, - const unsigned int, - const types::global_dof_index) const; -#endif - - template types::global_dof_index - DoFHandler::get_dof_index<1>(const unsigned int, - const unsigned int, - const unsigned int, - const unsigned int) const; - -#if deal_II_dimension >= 2 - template types::global_dof_index - DoFHandler::get_dof_index<2>(const unsigned int, - const unsigned int, - const unsigned int, - const unsigned int) const; - -# if deal_II_dimension >= 3 - template types::global_dof_index - DoFHandler::get_dof_index<3>(const unsigned int, - const unsigned int, - const unsigned int, - const unsigned int) const; -# endif + template class DoFHandler; + \} #endif + } - template void - DoFHandler::set_dof_index<1>( - const unsigned int, - const unsigned int, - const unsigned int, - const unsigned int, - const types::global_dof_index) const; - -#if deal_II_dimension >= 2 - template void - DoFHandler::set_dof_index<2>( - const unsigned int, - const unsigned int, - const unsigned int, - const unsigned int, - const types::global_dof_index) const; -# if deal_II_dimension >= 3 - template void - DoFHandler::set_dof_index<3>( - const unsigned int, - const unsigned int, - const unsigned int, - const unsigned int, - const types::global_dof_index) const; -# endif +for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : DIMENSIONS; + deal_II_component : DIMENSIONS) + { +#if deal_II_component <= deal_II_dimension && \ + deal_II_dimension <= deal_II_space_dimension + template types::global_dof_index + hp::DoFHandler::get_dof_index< + deal_II_component>(const unsigned int obj_level, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index) const; + + template void + hp::DoFHandler::set_dof_index< + deal_II_component>(const unsigned int obj_level, + const unsigned int obj_index, + const unsigned int fe_index, + const unsigned int local_index, + const types::global_dof_index global_index) const; #endif - \} } -- 2.39.5