// decide whether we need a
// sequential or a parallel
// distributed policy
+ if (dynamic_cast<const parallel::shared::Triangulation< dim, spacedim>*>
+ (&t)
+ != 0)
+ policy.reset (new internal::DoFHandler::Policy::ParallelShared<dim,spacedim>());
+ else
if (dynamic_cast<const parallel::distributed::Triangulation< dim, spacedim >*>
(&t)
== 0)
// hand things off to the policy
number_cache = policy->distribute_dofs (*this);
+ //since get_subdomain_association querry n_dofs()
+ //the need to re-work locally_owned_dofs outside of policy class
+ if (dynamic_cast<const parallel::shared::Triangulation<dim,spacedim>*>(&*tria) == 0)
+ number_cache.locally_owned_dofs = dealii::DoFTools::locally_owned_dofs_with_subdomain(*this,(*this).get_tria().locally_owned_subdomain() );
// initialize the block info object
// only if this is a sequential
// triangulation. it doesn't work
distribute_dofs (DoFHandler<dim,spacedim> &dof_handler) const
{
NumberCache number_cache = Sequential<dim,spacedim>::distribute_dofs (dof_handler);
- //correct number_cache:
- number_cache.locally_owned_dofs = dealii::DoFTools::locally_owned_dofs_with_subdomain(dof_handler,dof_handler.get_tria().locally_owned_subdomain() );
return number_cache;
}
ExcDimensionMismatch(subdomain_association.size(),
dof_handler.n_dofs()));
+ Assert(dof_handler.n_dofs() > 0,
+ ExcMessage("Number of DoF is not positive. "
+ "This could happen when the function is called before NumberCache is written."));
// preset all values by an invalid value
std::fill_n (subdomain_association.begin(), dof_handler.n_dofs(),
numbers::invalid_subdomain_id);