Also adjust all of the places where the class is used.
This change by itself is not useful, but will become useful when also
using the policy class from hp::DoFHandler. Similar changes will at a
later time be made for the ParallelShared and ParallelDistributed
policies.
* This class implements the default policy for sequential operations,
* i.e. for the case where all cells get degrees of freedom.
*/
- template <int dim, int spacedim>
- class Sequential : public PolicyBase<dim,spacedim>
+ template <typename DoFHandlerType>
+ class Sequential : public PolicyBase<DoFHandlerType::dimension,DoFHandlerType::space_dimension>
{
public:
/**
* @param dof_handler The DoFHandler object upon which this
* policy class is supposed to work.
*/
- Sequential (dealii::DoFHandler<dim,spacedim> &dof_handler);
+ Sequential (DoFHandlerType &dof_handler);
// documentation is inherited
virtual
/**
* The DoFHandler object on which this policy object works.
*/
- SmartPointer<dealii::DoFHandler<dim,spacedim> > dof_handler;
+ SmartPointer<DoFHandlerType> dof_handler;
};
/**
std::string policy_to_string(const dealii::internal::DoFHandler::Policy::PolicyBase<dim,spacedim> &policy)
{
std::string policy_name;
- if (dynamic_cast<const typename dealii::internal::DoFHandler::Policy::Sequential<dim,spacedim>*>(&policy))
+ if (dynamic_cast<const typename dealii::internal::DoFHandler::Policy::Sequential<dealii::DoFHandler<dim,spacedim> >*>(&policy))
policy_name = "Policy::Sequential<";
else if (dynamic_cast<const typename dealii::internal::DoFHandler::Policy::ParallelDistributed<dim,spacedim>*>(&policy))
policy_name = "Policy::ParallelDistributed<";
else if (dynamic_cast<const parallel::distributed::Triangulation< dim, spacedim >*>
(&tria)
== nullptr)
- policy.reset (new internal::DoFHandler::Policy::Sequential<dim,spacedim>(*this));
+ policy.reset (new internal::DoFHandler::Policy::Sequential<DoFHandler<dim,spacedim> >(*this));
else
policy.reset (new internal::DoFHandler::Policy::ParallelDistributed<dim,spacedim>(*this));
}
else if (dynamic_cast<const parallel::distributed::Triangulation< dim, spacedim >*>
(&t)
== nullptr)
- policy.reset (new internal::DoFHandler::Policy::Sequential<dim,spacedim>(*this));
+ policy.reset (new internal::DoFHandler::Policy::Sequential<DoFHandler<dim,spacedim> >(*this));
else
policy.reset (new internal::DoFHandler::Policy::ParallelDistributed<dim,spacedim>(*this));
- template <int dim, int spacedim>
- Sequential<dim,spacedim>::
- Sequential (dealii::DoFHandler<dim,spacedim> &dof_handler)
+ template <typename DoFHandlerType>
+ Sequential<DoFHandlerType>::
+ Sequential (DoFHandlerType &dof_handler)
:
dof_handler (&dof_handler)
{}
- template <int dim, int spacedim>
+ template <typename DoFHandlerType>
NumberCache
- Sequential<dim,spacedim>::
+ Sequential<DoFHandlerType>::
distribute_dofs () const
{
const types::global_dof_index n_dofs =
- template <int dim, int spacedim>
+ template <typename DoFHandlerType>
std::vector<NumberCache>
- Sequential<dim,spacedim>::
+ Sequential<DoFHandlerType>::
distribute_mg_dofs () const
{
std::vector<bool> user_flags;
dof_handler->get_triangulation().save_user_flags (user_flags);
- const_cast<dealii::Triangulation<dim, spacedim>&>(dof_handler->get_triangulation()).clear_user_flags ();
+ const_cast<dealii::Triangulation<DoFHandlerType::dimension, DoFHandlerType::space_dimension>&>
+ (dof_handler->get_triangulation()).clear_user_flags ();
std::vector<NumberCache> number_caches;
number_caches.reserve (dof_handler->get_triangulation().n_levels());
number_caches.emplace_back (NumberCache(n_level_dofs));
}
- const_cast<dealii::Triangulation<dim, spacedim>&>(dof_handler->get_triangulation()).load_user_flags (user_flags);
+ const_cast<dealii::Triangulation<DoFHandlerType::dimension, DoFHandlerType::space_dimension>&>
+ (dof_handler->get_triangulation()).load_user_flags (user_flags);
return number_caches;
}
- template <int dim, int spacedim>
+ template <typename DoFHandlerType>
NumberCache
- Sequential<dim,spacedim>::
+ Sequential<DoFHandlerType>::
renumber_dofs (const std::vector<types::global_dof_index> &new_numbers) const
{
Implementation::renumber_dofs (new_numbers, IndexSet(0),
namespace Policy
\{
template class PolicyBase<deal_II_dimension,deal_II_dimension>;
- template class Sequential<deal_II_dimension,deal_II_dimension>;
+ template class Sequential<dealii::DoFHandler<deal_II_dimension,deal_II_dimension> >;
template class ParallelShared<deal_II_dimension,deal_II_dimension>;
template class ParallelDistributed<deal_II_dimension,deal_II_dimension>;
#if deal_II_dimension==1 || deal_II_dimension==2
template class PolicyBase<deal_II_dimension,deal_II_dimension+1>;
- template class Sequential<deal_II_dimension,deal_II_dimension+1>;
+ template class Sequential<dealii::DoFHandler<deal_II_dimension,deal_II_dimension+1> >;
template class ParallelShared<deal_II_dimension,deal_II_dimension+1>;
template class ParallelDistributed<deal_II_dimension,deal_II_dimension+1>;
#endif
#if deal_II_dimension==3
template class PolicyBase<1,3>;
- template class Sequential<1,3>;
+ template class Sequential<dealii::DoFHandler<1,3> >;
template class ParallelShared<1,3>;
template class ParallelDistributed<1,3>;
#endif