--- /dev/null
+Changed: The variable level_mg_handler has been renamed
+to mg_level in MatrixFree and its associated AdditionalData.
+<br>
+(Peter Munch, 2019/10/17)
MatrixFree<dim, float>::AdditionalData::none;
additional_data.mapping_update_flags =
(update_gradients | update_JxW_values | update_quadrature_points);
- additional_data.level_mg_handler = level;
+ additional_data.mg_level = level;
std::shared_ptr<MatrixFree<dim, float>> mg_mf_storage_level(
new MatrixFree<dim, float>());
mg_mf_storage_level->reinit(dof_handler,
(update_gradients | update_JxW_values);
additional_data.mapping_update_flags_boundary_faces =
(update_gradients | update_JxW_values);
- additional_data.level_mg_handler = level;
+ additional_data.mg_level = level;
const auto mg_mf_storage_level =
std::make_shared<MatrixFree<dim, float>>();
mg_mf_storage_level->reinit(dof_handler,
std::vector<std::pair<unsigned int, unsigned int>> &cell_levels)
{
use_active_cells =
- additional_data.level_mg_handler == numbers::invalid_unsigned_int;
+ additional_data.mg_level == numbers::invalid_unsigned_int;
# ifdef DEBUG
// safety check
// inside the domain in case of multigrid separately
else if ((dcell->at_boundary(f) == false ||
dcell->has_periodic_neighbor(f)) &&
- additional_data.level_mg_handler !=
+ additional_data.mg_level !=
numbers::invalid_unsigned_int &&
dcell->neighbor_or_periodic_neighbor(f)->level() <
dcell->level())
* local time stepping where one would like to control which elements
* together form a batch of cells. The array `cell_vectorization_categories`
* is accessed by the number given by cell->active_cell_index() when working
- * on the active cells with `level_mg_handler` set to `-1` and by
- * cell->index() for the level cells. By default, the different categories
- * in `cell_vectorization_category` can be mixed and the algorithm is
- * allowed to merge lower category numbers with the next higher categories
+ * on the active cells with `mg_level` set to `numbers::invalid_unsigned_int`
+ * and by cell->index() for the level cells. By default, the different
+ * categories in `cell_vectorization_category` can be mixed and the algorithm
+ * is allowed to merge lower category numbers with the next higher categories
* if it is necessary inside the algorithm, in order to avoid partially
* filled SIMD lanes as much as possible. This gives a better utilization of
* the vectorization but might need special treatment, in particular for
const UpdateFlags mapping_update_flags_boundary_faces = update_default,
const UpdateFlags mapping_update_flags_inner_faces = update_default,
const UpdateFlags mapping_update_flags_faces_by_cells = update_default,
- const unsigned int level_mg_handler = numbers::invalid_unsigned_int,
+ const unsigned int mg_level = numbers::invalid_unsigned_int,
const bool store_plain_indices = true,
const bool initialize_indices = true,
const bool initialize_mapping = true,
, mapping_update_flags_boundary_faces(mapping_update_flags_boundary_faces)
, mapping_update_flags_inner_faces(mapping_update_flags_inner_faces)
, mapping_update_flags_faces_by_cells(mapping_update_flags_faces_by_cells)
- , level_mg_handler(level_mg_handler)
+ , mg_level(mg_level)
+ , level_mg_handler(this->mg_level)
, store_plain_indices(store_plain_indices)
, initialize_indices(initialize_indices)
, initialize_mapping(initialize_mapping)
* to work on a level, its dofs must be distributed by using
* <code>dof_handler.distribute_mg_dofs(fe);</code>.
*/
- unsigned int level_mg_handler;
+ unsigned int mg_level;
+
+ /**
+ * Alias for mg_level
+ *
+ * @deprecated Use mg_level instead.
+ */
+ DEAL_II_DEPRECATED unsigned int &level_mg_handler;
/**
* Controls whether to allow reading from vectors without resolving
* control which elements together form a batch of cells.
*
* This array is accessed by the number given by cell->active_cell_index()
- * when working on the active cells with @p level_mg_handler set to -1 and
+ * when working on the active cells with @p mg_level set to numbers::invalid_unsigned_int and
* by cell->index() for the level cells.
*
* @note This field is empty upon construction of AdditionalData. It is
mapping_initialized() const;
/**
- * Return the level of the mesh to be worked on.
+ * Return the level of the mesh to be worked on. Returns
+ * numbers::invalid_unsigned_int if working on active cells.
*/
unsigned int
- get_level_mg_handler() const;
+ get_mg_level() const;
/**
* Return an approximation of the memory consumption of this class in
/**
* Stored the level of the mesh to be worked on.
*/
- unsigned int level_mg_handler;
+ unsigned int mg_level;
};
template <int dim, typename Number, typename VectorizedArrayType>
inline unsigned int
-MatrixFree<dim, Number, VectorizedArrayType>::get_level_mg_handler() const
+MatrixFree<dim, Number, VectorizedArrayType>::get_mg_level() const
{
- return level_mg_handler;
+ return mg_level;
}
std::vector<IndexSet> locally_owned_sets =
internal::MatrixFreeImplementation::extract_locally_owned_index_sets(
- dof_handlers, additional_data.level_mg_handler);
+ dof_handlers, additional_data.mg_level);
std::vector<hp::QCollection<1>> quad_hp;
quad_hp.emplace_back(quad);
std::vector<IndexSet> locally_owned_sets =
internal::MatrixFreeImplementation::extract_locally_owned_index_sets(
- dof_handlers, additional_data.level_mg_handler);
+ dof_handlers, additional_data.mg_level);
std::vector<hp::QCollection<1>> quad_hp;
quad_hp.emplace_back(quad);
{
std::vector<IndexSet> locally_owned_set =
internal::MatrixFreeImplementation::extract_locally_owned_index_sets(
- dof_handler, additional_data.level_mg_handler);
+ dof_handler, additional_data.mg_level);
std::vector<hp::QCollection<1>> quad_hp;
for (unsigned int q = 0; q < quad.size(); ++q)
quad_hp.emplace_back(quad[q]);
{
std::vector<IndexSet> locally_owned_set =
internal::MatrixFreeImplementation::extract_locally_owned_index_sets(
- dof_handler, additional_data.level_mg_handler);
+ dof_handler, additional_data.mg_level);
std::vector<hp::QCollection<1>> quad_hp;
quad_hp.emplace_back(quad);
internal_reinit(StaticMappingQ1<dim>::mapping,
{
std::vector<IndexSet> locally_owned_set =
internal::MatrixFreeImplementation::extract_locally_owned_index_sets(
- dof_handler, additional_data.level_mg_handler);
+ dof_handler, additional_data.mg_level);
std::vector<hp::QCollection<1>> quad_hp;
quad_hp.emplace_back(quad);
internal_reinit(mapping,
{
std::vector<IndexSet> locally_owned_set =
internal::MatrixFreeImplementation::extract_locally_owned_index_sets(
- dof_handler, additional_data.level_mg_handler);
+ dof_handler, additional_data.mg_level);
std::vector<hp::QCollection<1>> quad_hp;
for (unsigned int q = 0; q < quad.size(); ++q)
quad_hp.emplace_back(quad[q]);
: Subscriptor()
, indices_are_initialized(false)
, mapping_is_initialized(false)
- , level_mg_handler(numbers::invalid_unsigned_int)
+ , mg_level(numbers::invalid_unsigned_int)
{}
task_info = v.task_info;
indices_are_initialized = v.indices_are_initialized;
mapping_is_initialized = v.mapping_is_initialized;
- level_mg_handler = v.level_mg_handler;
+ mg_level = v.mg_level;
}
&additional_data)
{
// Store the level of the mesh to be worked on.
- this->level_mg_handler = additional_data.level_mg_handler;
+ this->mg_level = additional_data.mg_level;
// Reads out the FE information and stores the shape function values,
// gradients and Hessians for quadrature points.
&additional_data)
{
// Store the level of the mesh to be worked on.
- this->level_mg_handler = additional_data.level_mg_handler;
+ this->mg_level = additional_data.mg_level;
// Reads out the FE information and stores the shape function values,
// gradients and Hessians for quadrature points.
{
cell_level_index.clear();
dof_handlers.active_dof_handler = DoFHandlers::usual;
- dof_handlers.level = additional_data.level_mg_handler;
+ dof_handlers.level = additional_data.mg_level;
dof_handlers.n_dof_handlers = dof_handler.size();
dof_handlers.dof_handler.resize(dof_handlers.n_dof_handlers);
for (unsigned int no = 0; no < dof_handlers.n_dof_handlers; ++no)
const Triangulation<dim> &tria =
dof_handlers.dof_handler[0]->get_triangulation();
- const unsigned int level = additional_data.level_mg_handler;
+ const unsigned int level = additional_data.mg_level;
if (level == numbers::invalid_unsigned_int)
{
if (n_mpi_procs == 1)
{
cell_level_index.clear();
dof_handlers.active_dof_handler = DoFHandlers::hp;
- dof_handlers.level = additional_data.level_mg_handler;
+ dof_handlers.level = additional_data.mg_level;
Assert(dof_handlers.level == numbers::invalid_unsigned_int,
ExcNotImplemented());
dof_handlers.n_dof_handlers = dof_handler.size();
for (unsigned int no = 0; no < n_fe; ++no)
{
if (do_face_integrals &&
- additional_data.level_mg_handler != numbers::invalid_unsigned_int)
+ additional_data.mg_level != numbers::invalid_unsigned_int)
{
// in case of adaptivity, go through the cells on the next finer
// level and check whether we need to get read access to some of
// those entries for the mg flux matrices
const DoFHandler<dim> &dof_handler = *dof_handlers.dof_handler[no];
std::vector<types::global_dof_index> dof_indices;
- if (additional_data.level_mg_handler + 1 <
+ if (additional_data.mg_level + 1 <
dof_handler.get_triangulation().n_global_levels())
for (typename DoFHandler<dim>::cell_iterator cell =
- dof_handler.begin(additional_data.level_mg_handler + 1);
- cell !=
- dof_handler.end(additional_data.level_mg_handler + 1);
+ dof_handler.begin(additional_data.mg_level + 1);
+ cell != dof_handler.end(additional_data.mg_level + 1);
++cell)
if (cell->level_subdomain_id() == task_info.my_pid)
for (unsigned int f = 0;
mg_additional_data;
mg_additional_data.tasks_parallel_scheme =
MatrixFree<dim, LevelNumberType>::AdditionalData::partition_color;
- mg_additional_data.level_mg_handler = level;
+ mg_additional_data.mg_level = level;
mg_additional_data.mapping_update_flags =
update_values | update_gradients | update_JxW_values |
update_quadrature_points;
.cell_vectorization_category[cell->index()] = cell->material_id();
}
- mg_additional_data[level].level_mg_handler = level;
+ mg_additional_data[level].mg_level = level;
}
std::vector<std::shared_ptr<MatrixFree<dim, float>>> mg_mf_data(max_level +
{
std::cout << "Compare level indices." << std::endl;
- const unsigned int level = tria.n_global_levels() - 1;
- additional_data.level_mg_handler = level;
+ const unsigned int level = tria.n_global_levels() - 1;
+ additional_data.mg_level = level;
mf_data->reinit(dof, constraints, quad, additional_data);
compare_indices(mf_data.get());
}
addit_data.tasks_parallel_scheme =
MatrixFree<dim, number>::AdditionalData::none;
addit_data.tasks_block_size = 3;
- addit_data.level_mg_handler = level;
+ addit_data.mg_level = level;
addit_data.mapping_update_flags_inner_faces =
update_JxW_values | update_normal_vectors | update_jacobians;
addit_data.mapping_update_flags_boundary_faces =
for (unsigned int level = 0; level < tria.n_global_levels(); ++level)
{
MatrixFree<dim> mf_data;
- data.level_mg_handler = level;
+ data.mg_level = level;
mf_data.reinit(dof, constraints, quad, data);
std::vector<unsigned int> n_inner_faces(2 * dim),
n_inner_other_faces(2 * dim), n_boundary_faces(2 * dim);
mg_constraints[level].add_line(*bc_it);
mg_constraints[level].close();
typename MatrixFree<dim>::AdditionalData data;
- data.level_mg_handler = level;
+ data.mg_level = level;
mg_matrices[level].reinit(
mapping, dof, mg_constraints[level], quad, data);
addit_data.tasks_parallel_scheme =
MatrixFree<dim, number>::AdditionalData::none;
addit_data.tasks_block_size = 3;
- addit_data.level_mg_handler = level;
+ addit_data.mg_level = level;
addit_data.mapping_update_flags_inner_faces =
(update_gradients | update_JxW_values);
addit_data.mapping_update_flags_boundary_faces =
addit_data.tasks_parallel_scheme =
MatrixFree<dim, number>::AdditionalData::none;
addit_data.tasks_block_size = 3;
- addit_data.level_mg_handler = level;
+ addit_data.mg_level = level;
addit_data.mapping_update_flags_inner_faces =
(update_gradients | update_JxW_values);
addit_data.mapping_update_flags_boundary_faces =
addit_data.tasks_parallel_scheme =
MatrixFree<dim, number>::AdditionalData::none;
addit_data.tasks_block_size = 3;
- addit_data.level_mg_handler = level;
+ addit_data.mg_level = level;
addit_data.mapping_update_flags_inner_faces =
update_JxW_values | update_normal_vectors | update_jacobians;
addit_data.mapping_update_flags_boundary_faces =
typename MatrixFree<dim, number>::AdditionalData addit_data;
addit_data.tasks_parallel_scheme =
MatrixFree<dim, number>::AdditionalData::none;
- addit_data.level_mg_handler = level;
+ addit_data.mg_level = level;
// extract the constraints due to Dirichlet boundary conditions
AffineConstraints<double> constraints;
typename MatrixFree<dim, number>::AdditionalData mg_additional_data;
mg_additional_data.tasks_parallel_scheme =
MatrixFree<dim, number>::AdditionalData::none;
- mg_additional_data.level_mg_handler = level;
+ mg_additional_data.mg_level = level;
AffineConstraints<double> level_constraints;
IndexSet relevant_dofs;
addit_data.tasks_parallel_scheme =
MatrixFree<dim, number>::AdditionalData::none;
addit_data.tasks_block_size = 3;
- addit_data.level_mg_handler = level;
+ addit_data.mg_level = level;
AffineConstraints<double> constraints;
if (level == numbers::invalid_unsigned_int)
{
mg_additional_data.tasks_parallel_scheme =
MatrixFree<dim, number>::AdditionalData::none;
mg_additional_data.tasks_block_size = 3;
- mg_additional_data.level_mg_handler = level;
+ mg_additional_data.mg_level = level;
AffineConstraints<double> level_constraints;
IndexSet relevant_dofs;
addit_data.tasks_parallel_scheme =
MatrixFree<dim, number>::AdditionalData::none;
addit_data.tasks_block_size = 3;
- addit_data.level_mg_handler = level;
+ addit_data.mg_level = level;
AffineConstraints<double> constraints;
if (level == numbers::invalid_unsigned_int)
{
mg_additional_data.tasks_parallel_scheme =
MatrixFree<dim, number>::AdditionalData::none;
mg_additional_data.tasks_block_size = 3;
- mg_additional_data.level_mg_handler = level;
+ mg_additional_data.mg_level = level;
AffineConstraints<double> level_constraints;
IndexSet relevant_dofs;
addit_data.tasks_parallel_scheme =
MatrixFree<dim, number>::AdditionalData::none;
addit_data.tasks_block_size = 3;
- addit_data.level_mg_handler = level;
+ addit_data.mg_level = level;
AffineConstraints<double> constraints;
if (level == numbers::invalid_unsigned_int)
{
mg_additional_data.tasks_parallel_scheme =
MatrixFree<dim, number>::AdditionalData::none;
mg_additional_data.tasks_block_size = 3;
- mg_additional_data.level_mg_handler = level;
+ mg_additional_data.mg_level = level;
AffineConstraints<double> level_constraints;
IndexSet relevant_dofs;
mg_additional_data.tasks_parallel_scheme =
MatrixFree<dim, number>::AdditionalData::none;
mg_additional_data.tasks_block_size = 3;
- mg_additional_data.level_mg_handler = level;
+ mg_additional_data.mg_level = level;
AffineConstraints<double> level_constraints;
IndexSet relevant_dofs;
mg_additional_data.tasks_parallel_scheme =
MatrixFree<dim, number>::AdditionalData::none;
mg_additional_data.tasks_block_size = 3;
- mg_additional_data.level_mg_handler = level;
+ mg_additional_data.mg_level = level;
std::vector<AffineConstraints<double>> level_constraints(dof.size());
std::vector<const AffineConstraints<double> *> level_constraints_ptrs(
mg_additional_data.tasks_parallel_scheme =
MatrixFree<dim, number>::AdditionalData::none;
mg_additional_data.tasks_block_size = 3;
- mg_additional_data.level_mg_handler = level;
+ mg_additional_data.mg_level = level;
AffineConstraints<double> level_constraints;
IndexSet relevant_dofs;
typename MatrixFree<dim, number>::AdditionalData addit_data;
addit_data.tasks_parallel_scheme =
MatrixFree<dim, number>::AdditionalData::none;
- addit_data.level_mg_handler = level;
+ addit_data.mg_level = level;
// extract the constraints due to Dirichlet boundary conditions
AffineConstraints<double> constraints;
typename MatrixFree<dim, number>::AdditionalData addit_data;
addit_data.tasks_parallel_scheme =
MatrixFree<dim, number>::AdditionalData::none;
- addit_data.level_mg_handler = level;
+ addit_data.mg_level = level;
// extract the constraints due to Dirichlet boundary conditions
AffineConstraints<double> constraints;
MatrixFree<dim, float>::AdditionalData::none;
additional_data.mapping_update_flags =
(update_gradients | update_JxW_values | update_quadrature_points);
- additional_data.level_mg_handler = level;
+ additional_data.mg_level = level;
std::shared_ptr<MatrixFree<dim, float>> mg_mf_storage_level(
new MatrixFree<dim, float>());
mg_mf_storage_level->reinit(dof_handler,
typename MatrixFree<dim, number>::AdditionalData additional_data;
additional_data.tasks_parallel_scheme =
MatrixFree<dim, number>::AdditionalData::partition_color;
- additional_data.level_mg_handler = level;
+ additional_data.mg_level = level;
additional_data.mapping_update_flags =
(update_gradients | update_JxW_values | update_quadrature_points);
data.reinit(dof_handler,
MatrixFree<dim, double>::AdditionalData::none;
additional_data.mapping_update_flags =
(update_gradients | update_JxW_values | update_quadrature_points);
- additional_data.level_mg_handler = level;
+ additional_data.mg_level = level;
std::shared_ptr<MatrixFree<dim, double>> mg_mf_storage_level(
new MatrixFree<dim, double>());
mg_mf_storage_level->reinit(dof_handler_u,
MatrixFree<dim, float>::AdditionalData::none;
additional_data.mapping_update_flags =
(update_gradients | update_JxW_values | update_quadrature_points);
- additional_data.level_mg_handler = level;
+ additional_data.mg_level = level;
std::shared_ptr<MatrixFree<dim, float>> mg_mf_storage_level(
new MatrixFree<dim, float>());
mg_mf_storage_level->reinit(dof_handler,