distribute_mg_dofs () const = 0;
/**
- * Renumber degrees of freedom as specified by the first argument. The
- * reference to the NumberCache of the DoFHandler object has to be
- * passed in a second argument. It could then be modified to make
- * DoFHandler related functions work properly when called within the
- * policies classes. The updated NumberCache is written to that
- * argument.
+ * Renumber degrees of freedom as specified by the first argument.
+ *
+ * Return an updated NumberCache for the DoFHandler after renumbering.
*/
virtual
- void
- renumber_dofs (const std::vector<types::global_dof_index> &new_numbers,
- NumberCache &number_cache) const = 0;
+ NumberCache
+ renumber_dofs (const std::vector<types::global_dof_index> &new_numbers) const = 0;
};
// documentation is inherited
virtual
- void
- renumber_dofs (const std::vector<types::global_dof_index> &new_numbers,
- NumberCache &number_cache) const;
+ NumberCache
+ renumber_dofs (const std::vector<types::global_dof_index> &new_numbers) const;
protected:
/**
* The input argument @p new_numbers may either have as many entries
* as there are global degrees of freedom (i.e. dof_handler.n_dofs() )
* or dof_handler.locally_owned_dofs().n_elements(). Therefore it can
- * be utilised with renumbering functions implemented for the
+ * be utilized with renumbering functions implemented for the
* parallel::distributed case.
*/
virtual
- void
- renumber_dofs (const std::vector<types::global_dof_index> &new_numbers,
- NumberCache &number_cache) const;
+ NumberCache
+ renumber_dofs (const std::vector<types::global_dof_index> &new_numbers) const;
};
// documentation is inherited
virtual
- void
- renumber_dofs (const std::vector<types::global_dof_index> &new_numbers,
- NumberCache &number_cache) const;
+ NumberCache
+ renumber_dofs (const std::vector<types::global_dof_index> &new_numbers) const;
private:
/**
template <int dim, int spacedim>
- void
+ NumberCache
Sequential<dim,spacedim>::
- renumber_dofs (const std::vector<types::global_dof_index> &new_numbers,
- NumberCache &number_cache_current) const
+ renumber_dofs (const std::vector<types::global_dof_index> &new_numbers) const
{
Implementation::renumber_dofs (new_numbers, IndexSet(0),
*dof_handler, true);
number_cache.locally_owned_dofs_per_processor
= std::vector<IndexSet> (1,
number_cache.locally_owned_dofs);
- number_cache_current = std::move(number_cache);
+ return number_cache;
}
// version of the function because we do things on all
// cells and all cells have their subdomain ids and DoFs
// correctly set
- this->Sequential<dim, spacedim>::renumber_dofs (new_dof_indices, number_cache);
+ number_cache = this->Sequential<dim, spacedim>::renumber_dofs (new_dof_indices);
// update the number cache. for this, we first have to find the subdomain
template <int dim, int spacedim>
- void
+ NumberCache
ParallelShared<dim,spacedim>::
- renumber_dofs (const std::vector<types::global_dof_index> &new_numbers,
- NumberCache &number_cache) const
+ renumber_dofs (const std::vector<types::global_dof_index> &new_numbers) const
{
#ifndef DEAL_II_WITH_MPI
(void)new_numbers;
- (void)number_cache;
Assert (false, ExcNotImplemented());
+ return NumberCache();
#else
// Similar to distribute_dofs() we need to have a special treatment in
// case artificial cells are present.
std::vector<unsigned int> flag_2 (this->dof_handler->n_dofs (), 0);
for (unsigned int i = 0; i < n_cpu; i++)
{
- const IndexSet &iset =
- number_cache.locally_owned_dofs_per_processor[i];
+ const IndexSet iset =
+ this->dof_handler->locally_owned_dofs_per_processor()[i];
for (types::global_dof_index ind = 0;
ind < iset.n_elements (); ind++)
{
ExcInternalError());
}
- this->Sequential<dim, spacedim>::renumber_dofs (global_gathered_numbers, number_cache);
+ NumberCache number_cache
+ = this->Sequential<dim, spacedim>::renumber_dofs (global_gathered_numbers);
// correct number_cache:
number_cache.locally_owned_dofs_per_processor =
DoFTools::locally_owned_dofs_per_subdomain (*this->dof_handler);
if (tr->with_artificial_cells())
for (unsigned int index=0; cell != endc; cell++, index++)
cell->set_subdomain_id(current_subdomain_ids[index]);
+
+ return number_cache;
#endif
}
template <int dim, int spacedim>
- void
+ NumberCache
ParallelDistributed<dim, spacedim>::
- renumber_dofs (const std::vector<dealii::types::global_dof_index> &new_numbers,
- NumberCache &number_cache_current) const
+ renumber_dofs (const std::vector<dealii::types::global_dof_index> &new_numbers) const
{
(void)new_numbers;
}
#endif
- number_cache_current = std::move(number_cache);
+ return number_cache;
}
}
}