Skip to content

Commit

Permalink
Avoid use of old AffineConstraints functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
bangerth committed Sep 22, 2023
1 parent e7059fb commit a5f35f6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions include/deal.II/multigrid/mg_constrained_dofs.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,15 @@ MGConstrainedDoFs::initialize(
{
if (user_level_dofs)
{
level_constraints[l].reinit(level_relevant_dofs[l]);
level_constraints[l].reinit(dof.locally_owned_mg_dofs(l),
level_relevant_dofs[l]);
}
else
{
const IndexSet relevant_dofs =
DoFTools::extract_locally_relevant_level_dofs(dof, l);
level_constraints[l].reinit(relevant_dofs);
level_constraints[l].reinit(dof.locally_owned_mg_dofs(l),
relevant_dofs);
}

// Loop through relevant cells and faces finding those which are periodic
Expand Down Expand Up @@ -478,7 +480,9 @@ MGConstrainedDoFs::add_user_constraints(
// Get the relevant DoFs from level_constraints if
// the user constraint matrix has not been initialized
if (user_constraints[level].get_local_lines().size() == 0)
user_constraints[level].reinit(level_constraints[level].get_local_lines());
user_constraints[level].reinit(
level_constraints[level].get_locally_owned_indices(),
level_constraints[level].get_local_lines());

user_constraints[level].merge(
constraints_on_level,
Expand Down Expand Up @@ -613,7 +617,7 @@ MGConstrainedDoFs::merge_constraints(AffineConstraints<Number> &constraints,
index_set.add_indices(
this->get_user_constraint_matrix(level).get_local_lines());

constraints.reinit(index_set);
constraints.reinit(constraints.get_locally_owned_indices(), index_set);

// merge constraints
if (add_boundary_indices && this->have_boundary_indices())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@ namespace VectorTools
const Mapping<dim, spacedim> &mapping)
{
AffineConstraints<double> no_normal_flux_constraints(
constraints.get_local_lines());
constraints.get_locally_owned_indices(), constraints.get_local_lines());
compute_nonzero_normal_flux_constraints(dof_handler,
first_vector_component,
boundary_ids,
Expand Down
2 changes: 1 addition & 1 deletion source/dofs/dof_renumbering.cc
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ namespace DoFRenumbering
// reordering with constraints is not yet implemented on a level basis
Assert(reorder_level_dofs == false, ExcNotImplemented());

constraints.reinit(locally_relevant_dofs);
constraints.reinit(locally_owned_dofs, locally_relevant_dofs);
DoFTools::make_hanging_node_constraints(dof_handler, constraints);
}
constraints.close();
Expand Down

0 comments on commit a5f35f6

Please sign in to comment.