MGLevelObject<VectorType> &dst,
const InVector &src) const
{
+ AssertIndexRange(dst.max_level(), mg_dof_handler.get_triangulation().n_global_levels());
+ AssertIndexRange(dst.min_level(), dst.max_level()+1);
reinit_vector(mg_dof_handler, component_to_block_map, dst);
bool first = true;
#ifdef DEBUG_OUTPUT
internal::copy_vector(copy_indices[dst.max_level()], src, dst[dst.max_level()]);
// do the initial restriction
- for (unsigned int level=mg_dof_handler.get_triangulation().n_global_levels()-1; level != 0; )
+ for (unsigned int level=dst.max_level(); level != dst.min_level(); )
{
--level;
this->restrict_and_add (level+1, dst[level], dst[level+1]);
return;
}
- for (unsigned int level=mg_dof_handler.get_triangulation().n_global_levels(); level != 0;)
+ for (unsigned int level=dst.max_level()+1; level != dst.min_level(); )
{
--level;
#ifdef DEBUG_OUTPUT
OutVector &dst,
const MGLevelObject<VectorType> &src) const
{
+ AssertIndexRange(src.max_level(), mg_dof_handler.get_triangulation().n_global_levels());
+ AssertIndexRange(src.min_level(), src.max_level()+1);
if (perform_plain_copy)
{
AssertDimension(dst.size(), src[src.max_level()].size());
// attention, since they belong to the coarse level, but have fine level
// basis functions
dst = 0;
- for (unsigned int level=0; level<mg_dof_handler.get_triangulation().n_global_levels(); ++level)
+ for (unsigned int level=src.min_level(); level<=src.max_level(); ++level)
{
#ifdef DEBUG_OUTPUT
MPI_Barrier(MPI_COMM_WORLD);
// For non-DG: degrees of freedom in the refinement face may need special
// attention, since they belong to the coarse level, but have fine level
// basis functions
- for (unsigned int level=0; level<mg_dof_handler.get_triangulation().n_global_levels(); ++level)
+ for (unsigned int level=src.min_level(); level<=src.max_level(); ++level)
{
typedef std::vector<std::pair<types::global_dof_index, types::global_dof_index> >::const_iterator dof_pair_iterator;
const VectorType &src_level = src[level];
MGLevelObject<parallel::distributed::Vector<Number> > &dst,
const parallel::distributed::Vector<Number2> &src) const
{
+ AssertIndexRange(dst.max_level(), mg_dof_handler.get_triangulation().n_global_levels());
+ AssertIndexRange(dst.min_level(), dst.max_level()+1);
reinit_vector(mg_dof_handler, component_to_block_map, dst);
bool first = true;
static_cast<Vector<Number> &>(dst_view) = static_cast<Vector<Number2> &>(src_view);
// do the initial restriction
- for (unsigned int level=mg_dof_handler.get_triangulation().n_global_levels()-1; level != 0; )
+ for (unsigned int level=dst.max_level(); level != dst.min_level(); )
{
--level;
this->restrict_and_add (level+1, dst[level], dst[level+1]);
ghosted_global_vector = src;
ghosted_global_vector.update_ghost_values();
- for (unsigned int level=mg_dof_handler.get_triangulation().n_global_levels(); level != 0;)
+ for (unsigned int level=dst.max_level()+1; level != dst.min_level();)
{
--level;
parallel::distributed::Vector<Number2> &dst,
const MGLevelObject<parallel::distributed::Vector<Number> > &src) const
{
+ AssertIndexRange(src.max_level(), mg_dof_handler.get_triangulation().n_global_levels());
+ AssertIndexRange(src.min_level(), src.max_level()+1);
if (perform_plain_copy)
{
// In this case, we can simply copy the local range (in parallel by
// basis functions
dst = 0;
- for (unsigned int level=0; level<mg_dof_handler.get_triangulation().n_global_levels(); ++level)
+ for (unsigned int level=src.min_level(); level<=src.max_level(); ++level)
{
typedef std::vector<std::pair<unsigned int, unsigned int> >::const_iterator dof_pair_iterator;
// basis functions
dst.zero_out_ghosts();
- for (unsigned int level=0; level<mg_dof_handler.get_triangulation().n_global_levels(); ++level)
+ for (unsigned int level=src.min_level(); level<=src.max_level(); ++level)
{
typedef std::vector<std::pair<unsigned int, unsigned int> >::const_iterator dof_pair_iterator;