Skip to content

Commit

Permalink
Merge pull request kronbichler#82 from MeltPoolDG/fix_extract_constan…
Browse files Browse the repository at this point in the history
…t_modes

Fix compatibility of DoFTools::extract_constant_modes
  • Loading branch information
peterrum authored Jul 5, 2023
2 parents a4880e4 + 0f249d9 commit 3c8110f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion source/navier_stokes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1415,7 +1415,7 @@ NavierStokes<dim>::interpolate_pressure_field(
// set DG0 components to zero
std::vector<std::vector<bool>> constant_modes;
DoFTools::extract_constant_modes(dof_handler_p,
std::vector<bool>(1, true),
ComponentMask(std::vector<bool>(1, true)),
constant_modes);
AssertDimension(constant_modes.size(), 2);
for (unsigned int i = 0; i < pressure_vector.locally_owned_size(); ++i)
Expand Down
2 changes: 1 addition & 1 deletion source/navier_stokes_matrix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ NavierStokesMatrix<dim>::initialize(const MatrixFree<dim> &matrix_free_in,

std::vector<std::vector<bool>> constant_modes;
DoFTools::extract_constant_modes(matrix_free->get_dof_handler(dof_index_p),
std::vector<bool>(1, true),
ComponentMask(std::vector<bool>(1, true)),
constant_modes);

for (unsigned int mode = 0; mode < 2; ++mode)
Expand Down
6 changes: 3 additions & 3 deletions source/navier_stokes_preconditioner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@ NavierStokesPreconditioner<dim>::initialize_matrices(
{
std::vector<std::vector<bool>> constant_modes;
DoFTools::extract_constant_modes(dof_handler_p,
std::vector<bool>(1, true),
ComponentMask(std::vector<bool>(1, true)),
constant_modes);
AssertDimension(constant_modes.size(), 2);
int min_local_index = std::numeric_limits<int>::min();
Expand Down Expand Up @@ -1387,12 +1387,12 @@ NavierStokesPreconditioner<dim>::initialize_matrices(
if (parameters.precondition_velocity == FlowParameters::u_amg ||
parameters.precondition_velocity == FlowParameters::u_amg_linear)
DoFTools::extract_constant_modes(dof_handler_u,
std::vector<bool>(dim, true),
ComponentMask(std::vector<bool>(dim, true)),
constant_modes_u);

if (parameters.density > 0 || parameters.augmented_taylor_hood)
DoFTools::extract_constant_modes(dof_handler_p,
std::vector<bool>(1, true),
ComponentMask(std::vector<bool>(1, true)),
constant_modes_p);


Expand Down

0 comments on commit 3c8110f

Please sign in to comment.