From: Wolfgang Bangerth Date: Tue, 27 Jun 2017 14:22:39 +0000 (-0600) Subject: Make the sequential policy class compile for hp::DoFHandler. X-Git-Tag: v9.0.0-rc1~1456^2~5 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f50f5115ffc74f5144dfc405a1e25b5c99a27b2a;p=dealii.git Make the sequential policy class compile for hp::DoFHandler. Do so by making some code generic, and providing stubs for functions that will be moved from the hp::DoFHandler class properly. --- diff --git a/source/dofs/dof_handler_policy.cc b/source/dofs/dof_handler_policy.cc index 66a4aca156..2cd9303f1d 100644 --- a/source/dofs/dof_handler_policy.cc +++ b/source/dofs/dof_handler_policy.cc @@ -56,6 +56,10 @@ namespace internal // the following using dealii::DoFHandler; + namespace hp + { + using dealii::hp::DoFHandler; + } namespace @@ -281,23 +285,70 @@ namespace internal } + + // same for the hp::DoFHandler + template + static + types::global_dof_index + distribute_dofs_on_cell (const hp::DoFHandler<1,spacedim> &dof_handler, + const typename hp::DoFHandler<1,spacedim>::active_cell_iterator &cell, + types::global_dof_index next_free_dof) + { + (void)dof_handler; + (void)cell; + (void)next_free_dof; + return 0; + } + + + + template + static + types::global_dof_index + distribute_dofs_on_cell (const hp::DoFHandler<2,spacedim> &dof_handler, + const typename hp::DoFHandler<2,spacedim>::active_cell_iterator &cell, + types::global_dof_index next_free_dof) + { + (void)dof_handler; + (void)cell; + (void)next_free_dof; + return 0; + } + + + + template + static + types::global_dof_index + distribute_dofs_on_cell (const hp::DoFHandler<3,spacedim> &dof_handler, + const typename hp::DoFHandler<3,spacedim>::active_cell_iterator &cell, + types::global_dof_index next_free_dof) + { + (void)dof_handler; + (void)cell; + (void)next_free_dof; + return 0; + } + + + /** * Distribute degrees of freedom on all cells, or on cells with the * correct subdomain_id if the corresponding argument is not equal to * numbers::invalid_subdomain_id. Return the total number of dofs * distributed. */ - template + template static types::global_dof_index distribute_dofs (const types::subdomain_id subdomain_id, - DoFHandler &dof_handler) + DoFHandlerType &dof_handler) { Assert (dof_handler.get_triangulation().n_levels() > 0, ExcMessage("Empty triangulation")); types::global_dof_index next_free_dof = 0; - typename DoFHandler::active_cell_iterator + typename DoFHandlerType::active_cell_iterator cell = dof_handler.begin_active(), endc = dof_handler.end(); @@ -483,13 +534,62 @@ namespace internal - template + // same for the hp::DoFHandler + template + static + types::global_dof_index + distribute_mg_dofs_on_cell (const hp::DoFHandler<1,spacedim> &dof_handler, + const typename hp::DoFHandler<1,spacedim>::active_cell_iterator &cell, + types::global_dof_index next_free_dof) + { + (void)dof_handler; + (void)cell; + (void)next_free_dof; + return 0; + } + + + + template + static + types::global_dof_index + distribute_mg_dofs_on_cell (const hp::DoFHandler<2,spacedim> &dof_handler, + const typename hp::DoFHandler<2,spacedim>::active_cell_iterator &cell, + types::global_dof_index next_free_dof) + { + (void)dof_handler; + (void)cell; + (void)next_free_dof; + return 0; + } + + + + template + static + types::global_dof_index + distribute_mg_dofs_on_cell (const hp::DoFHandler<3,spacedim> &dof_handler, + const typename hp::DoFHandler<3,spacedim>::active_cell_iterator &cell, + types::global_dof_index next_free_dof) + { + (void)dof_handler; + (void)cell; + (void)next_free_dof; + return 0; + } + + + + template static types::global_dof_index distribute_dofs_on_level (const types::subdomain_id level_subdomain_id, - DoFHandler &dof_handler, + DoFHandlerType &dof_handler, const unsigned int level) { + const unsigned int dim = DoFHandlerType::dimension; + const unsigned int spacedim = DoFHandlerType::space_dimension; + const dealii::Triangulation &tria = dof_handler.get_triangulation(); Assert (tria.n_levels() > 0, ExcMessage("Empty triangulation")); @@ -943,6 +1043,32 @@ namespace internal } + + template + static + void + renumber_dofs (const std::vector &/*new_numbers*/, + const IndexSet &/*indices*/, + hp::DoFHandler &/*dof_handler*/, + const bool /*check_validity*/) + { + Assert (false, ExcNotImplemented()); + } + + + + template + static + void + renumber_mg_dofs (const std::vector &/*new_numbers*/, + const IndexSet &/*indices*/, + hp::DoFHandler &/*dof_handler*/, + const unsigned int /*level*/, + const bool /*check_validity*/) + { + Assert (false, ExcNotImplemented()); + } + }; diff --git a/source/dofs/dof_handler_policy.inst.in b/source/dofs/dof_handler_policy.inst.in index 1c75b7be97..c9cddc1536 100644 --- a/source/dofs/dof_handler_policy.inst.in +++ b/source/dofs/dof_handler_policy.inst.in @@ -24,12 +24,14 @@ for (deal_II_dimension : DIMENSIONS) \{ template class PolicyBase; template class Sequential >; + template class Sequential >; template class ParallelShared; template class ParallelDistributed; #if deal_II_dimension==1 || deal_II_dimension==2 template class PolicyBase; template class Sequential >; + template class Sequential >; template class ParallelShared; template class ParallelDistributed; #endif @@ -37,6 +39,7 @@ for (deal_II_dimension : DIMENSIONS) #if deal_II_dimension==3 template class PolicyBase<1,3>; template class Sequential >; + template class Sequential >; template class ParallelShared<1,3>; template class ParallelDistributed<1,3>; #endif