* the object given as last argument.
*/
virtual
- void
+ NumberCache
distribute_dofs (dealii::DoFHandler<dim,spacedim> &dof_handler,
- NumberCache &number_cache) const = 0;
+ NumberCache &number_cache_current) const = 0;
/**
* Distribute the multigrid dofs on each level
* the object given as last argument.
*/
virtual
- void
+ NumberCache
distribute_dofs (dealii::DoFHandler<dim,spacedim> &dof_handler,
- NumberCache &number_cache) const;
+ NumberCache &number_cache_current) const;
/**
* Distribute multigrid DoFs.
* number_cache.locally_owned_dofs are updated consistently.
*/
virtual
- void
+ NumberCache
distribute_dofs (dealii::DoFHandler<dim,spacedim> &dof_handler,
- NumberCache & number_cache) const;
+ NumberCache & number_cache_current) const;
/**
* This function is not yet implemented.
* the object given as last argument.
*/
virtual
- void
+ NumberCache
distribute_dofs (dealii::DoFHandler<dim,spacedim> &dof_handler,
NumberCache &number_cache) const;
template <int dim, int spacedim>
- void
+ NumberCache
Sequential<dim,spacedim>::
distribute_dofs (DoFHandler<dim,spacedim> &dof_handler,
- NumberCache & number_cache ) const
+ NumberCache & number_cache_current ) const
{
const types::global_dof_index n_dofs =
Implementation::distribute_dofs (0,
// now set the elements of the
// number cache appropriately
+ NumberCache number_cache;
number_cache.n_global_dofs = n_dofs;
number_cache.n_locally_owned_dofs = number_cache.n_global_dofs;
number_cache.locally_owned_dofs_per_processor
= std::vector<IndexSet> (1,
number_cache.locally_owned_dofs);
+ return number_cache;
}
/* --------------------- class ParallelSequential ---------------- */
template <int dim, int spacedim>
- void
+ NumberCache
ParallelShared<dim,spacedim>::
distribute_dofs (DoFHandler<dim,spacedim> &dof_handler,
- NumberCache & number_cache) const
+ NumberCache & number_cache_current) const
{
- Sequential<dim,spacedim>::distribute_dofs (dof_handler,number_cache);
+ NumberCache number_cache = Sequential<dim,spacedim>::distribute_dofs (dof_handler,number_cache_current);
+ //update current number cache in DoFHandler
+ number_cache_current = number_cache;
DoFRenumbering::subdomain_wise (dof_handler);
const parallel::shared::Triangulation<dim,spacedim> *shared_tr = dynamic_cast<const parallel::shared::Triangulation<dim,spacedim>*>(&dof_handler.get_tria());
const unsigned int n_mpi_processes = Utilities::MPI::n_mpi_processes( shared_tr->get_communicator () );
for (unsigned int i=0; i<n_mpi_processes; ++i)
number_cache.n_locally_owned_dofs_per_processor[i] = DoFTools::count_dofs_with_subdomain_association (dof_handler, i);
number_cache.locally_owned_dofs = dealii::DoFTools::locally_owned_dofs_with_subdomain(dof_handler,dof_handler.get_tria().locally_owned_subdomain() );
+ return number_cache;
}
template <int dim, int spacedim>
template <int dim, int spacedim>
- void
+ NumberCache
ParallelDistributed<dim, spacedim>::
distribute_dofs (DoFHandler<dim,spacedim> &dof_handler,
- NumberCache &number_cache) const
+ NumberCache &number_cache_current) const
{
+ NumberCache number_cache;
#ifndef DEAL_II_WITH_P4EST
(void)dof_handler;
#endif // DEBUG
#endif // DEAL_II_WITH_P4EST
+ return number_cache;
}