const std::vector<bool>& selected = std::vector<bool>(),
const std::vector<unsigned int>& target_component
= std::vector<unsigned int>());
-
/**
* Adjust vectors on all levels
* to correct size. Count the
*
* The argument
* @p target_component allows to
- * re-sort and group components
+ * re-sort and groupt components
* as in
* DoFRenumbering::component_wise.
*/
MGLevelObject<Vector<number> > &v,
const std::vector<bool> &selected,
const std::vector<unsigned int> &target_component,
- const std::vector<std::vector<unsigned int> >& cached_sizes
+ std::vector<std::vector<unsigned int> >& cached_sizes
= std::vector<std::vector<unsigned int> >());
};
#include <lac/compressed_sparsity_pattern.h>
#include <lac/sparsity_pattern.h>
#include <lac/block_vector.h>
-#include <lac/vector.h>
#include <grid/tria.h>
#include <grid/tria_iterator.h>
#include <multigrid/mg_dof_handler.h>
MGLevelObject<Vector<number> > &v,
const std::vector<bool> &selected,
const std::vector<unsigned int> &target_component,
- const std::vector<std::vector<unsigned int> >& cached_dofs)
+ std::vector<std::vector<unsigned int> >& ndofs)
{
Assert (selected.size() == target_component.size(),
ExcDimensionMismatch(selected.size(), target_component.size()));
while (!selected[selected_block])
++selected_block;
- std::vector<std::vector<unsigned int> >
- n_dofs(mg_dof.get_tria().n_levels(),
- std::vector<unsigned int>(target_component.size()));
-
- if (cached_dofs.size() == 0)
- count_dofs_per_component (mg_dof, n_dofs, target_component);
- else
- n_dofs = cached_dofs;
+ if (ndofs.size() == 0)
+ {
+ std::vector<std::vector<unsigned int> >
+ new_dofs(mg_dof.get_tria().n_levels(),
+ std::vector<unsigned int>(target_component.size()));
+ std::swap(ndofs, new_dofs);
+ count_dofs_per_component (mg_dof, ndofs, target_component);
+ }
for (unsigned int level=v.get_minlevel();
level<=v.get_maxlevel();++level)
{
- v[level].reinit(n_dofs[level][selected_block]);
+ v[level].reinit(ndofs[level][selected_block]);
}
}
MGLevelObject<Vector<double> >&,
const std::vector<bool>&,
const std::vector<unsigned int>&,
- const std::vector<std::vector<unsigned int> >&);
+ std::vector<std::vector<unsigned int> >&);
template void MGTools::reinit_vector<deal_II_dimension> (
const MGDoFHandler<deal_II_dimension>&,
MGLevelObject<Vector<float> >&,
const std::vector<bool>&,
const std::vector<unsigned int>&,
- const std::vector<std::vector<unsigned int> >&);
+ std::vector<std::vector<unsigned int> >&);
template void MGTools::count_dofs_per_component<deal_II_dimension> (