Skip to content

Commit

Permalink
Merge pull request #17149 from peterrum/mft_distribute_local_to_global
Browse files Browse the repository at this point in the history
MatrixFreeTools::compute_matrix(): specialize assembly of diagonal blocks
  • Loading branch information
kronbichler committed Jun 22, 2024
2 parents 80c1d07 + 8998572 commit ebdf897
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions include/deal.II/matrix_free/tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -2221,11 +2221,20 @@ namespace MatrixFreeTools

for (unsigned int v = 0; v < n_filled_lanes; ++v)
for (unsigned int bi = 0; bi < n_blocks; ++bi)
constraints.distribute_local_to_global(
matrices[bi][bj][v],
dof_indices_mf[bi][v],
dof_indices_mf[bj][v],
matrix);
if (bi == bj)
// specialization for blocks on the diagonal
// to writing into diagonal elements of the
// matrix if the corresponding degree of freedom
// is constrained, see also the documentation
// of AffineConstraints::distribute_local_to_global()
constraints.distribute_local_to_global(
matrices[bi][bi][v], dof_indices_mf[bi][v], matrix);
else
constraints.distribute_local_to_global(
matrices[bi][bj][v],
dof_indices_mf[bi][v],
dof_indices_mf[bj][v],
matrix);
}
}
};
Expand Down

0 comments on commit ebdf897

Please sign in to comment.