* This class implements the policy for operations when we use a
* parallel::shared::Triangulation object.
*/
- template <int dim, int spacedim>
- class ParallelShared : public PolicyBase<dim,spacedim>
+ template <typename DoFHandlerType>
+ class ParallelShared : public PolicyBase<DoFHandlerType::dimension,DoFHandlerType::space_dimension>
{
public:
/**
* @param dof_handler The DoFHandler object upon which this
* policy class is supposed to work.
*/
- ParallelShared (dealii::DoFHandler<dim,spacedim> &dof_handler);
+ ParallelShared (DoFHandlerType &dof_handler);
/**
* Distribute degrees of freedom on the object given as first
/**
* The DoFHandler object on which this policy object works.
*/
- SmartPointer<dealii::DoFHandler<dim,spacedim> > dof_handler;
+ SmartPointer<DoFHandlerType> dof_handler;
};
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 typename dealii::internal::DoFHandler::Policy::ParallelShared<dim,spacedim>*>(&policy))
+ else if (dynamic_cast<const typename dealii::internal::DoFHandler::Policy::ParallelShared<dealii::DoFHandler<dim,spacedim> >*>(&policy))
policy_name = "Policy::ParallelShared<";
else
AssertThrow(false, ExcNotImplemented());
if (dynamic_cast<const parallel::shared::Triangulation< dim, spacedim>*>
(&tria)
!= nullptr)
- policy.reset (new internal::DoFHandler::Policy::ParallelShared<dim,spacedim>(*this));
+ policy.reset (new internal::DoFHandler::Policy::ParallelShared<DoFHandler<dim,spacedim> >(*this));
else if (dynamic_cast<const parallel::distributed::Triangulation< dim, spacedim >*>
(&tria)
== nullptr)
if (dynamic_cast<const parallel::shared::Triangulation< dim, spacedim>*>
(&t)
!= nullptr)
- policy.reset (new internal::DoFHandler::Policy::ParallelShared<dim,spacedim>(*this));
+ policy.reset (new internal::DoFHandler::Policy::ParallelShared<DoFHandler<dim,spacedim> >(*this));
else if (dynamic_cast<const parallel::distributed::Triangulation< dim, spacedim >*>
(&t)
== nullptr)
/* --------------------- class ParallelShared ---------------- */
- template <int dim, int spacedim>
- ParallelShared<dim,spacedim>::
- ParallelShared (dealii::DoFHandler<dim,spacedim> &dof_handler)
+ template <class DoFHandlerType>
+ ParallelShared<DoFHandlerType>::
+ ParallelShared (DoFHandlerType &dof_handler)
:
dof_handler (&dof_handler)
{}
- template <int dim, int spacedim>
+ template <class DoFHandlerType>
NumberCache
- ParallelShared<dim,spacedim>::
+ ParallelShared<DoFHandlerType>::
distribute_dofs () const
{
+ const unsigned int dim = DoFHandlerType::dimension;
+ const unsigned int spacedim = DoFHandlerType::space_dimension;
+
const parallel::shared::Triangulation<dim, spacedim> *tr =
(dynamic_cast<const parallel::shared::Triangulation<dim, spacedim>*> (&this->dof_handler->get_triangulation()));
Assert(tr != nullptr, ExcInternalError());
- template <int dim, int spacedim>
+ template <class DoFHandlerType>
std::vector<NumberCache>
- ParallelShared<dim,spacedim>::
+ ParallelShared<DoFHandlerType>::
distribute_mg_dofs () const
{
// this is not currently implemented; the algorithm should work
- template <int dim, int spacedim>
+ template <class DoFHandlerType>
NumberCache
- ParallelShared<dim,spacedim>::
+ ParallelShared<DoFHandlerType>::
renumber_dofs (const std::vector<types::global_dof_index> &new_numbers) const
{
Assert (false, ExcNotImplemented());
return NumberCache();
#else
+ const unsigned int dim = DoFHandlerType::dimension;
+ const unsigned int spacedim = DoFHandlerType::space_dimension;
+
// Similar to distribute_dofs() we need to have a special treatment in
// case artificial cells are present.
const parallel::shared::Triangulation<dim, spacedim> *tr =
- template <int dim, int spacedim>
+ template <class DoFHandlerType>
NumberCache
- ParallelShared<dim,spacedim>::
+ ParallelShared<DoFHandlerType>::
renumber_mg_dofs (const unsigned int /*level*/,
const std::vector<types::global_dof_index> &/*new_numbers*/) const
{
template class PolicyBase<deal_II_dimension,deal_II_dimension>;
template class Sequential<dealii::DoFHandler<deal_II_dimension,deal_II_dimension> >;
template class Sequential<dealii::hp::DoFHandler<deal_II_dimension,deal_II_dimension> >;
- template class ParallelShared<deal_II_dimension,deal_II_dimension>;
+ template class ParallelShared<dealii::DoFHandler<deal_II_dimension,deal_II_dimension> >;
+ template class ParallelShared<dealii::hp::DoFHandler<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<dealii::DoFHandler<deal_II_dimension,deal_II_dimension+1> >;
template class Sequential<dealii::hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> >;
- template class ParallelShared<deal_II_dimension,deal_II_dimension+1>;
+ template class ParallelShared<dealii::DoFHandler<deal_II_dimension,deal_II_dimension+1> >;
+ template class ParallelShared<dealii::hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> >;
template class ParallelDistributed<deal_II_dimension,deal_II_dimension+1>;
#endif
template class PolicyBase<1,3>;
template class Sequential<dealii::DoFHandler<1,3> >;
template class Sequential<dealii::hp::DoFHandler<1,3> >;
- template class ParallelShared<1,3>;
+ template class ParallelShared<dealii::DoFHandler<1,3> >;
+ template class ParallelShared<dealii::hp::DoFHandler<1,3> >;
template class ParallelDistributed<1,3>;
#endif
\}