From dbf1c2909d0e8477c4fd4d829cb3b0bf75a592a8 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 23 May 2024 14:37:07 -0600 Subject: [PATCH] Minor edits to step-55. --- examples/step-55/step-55.cc | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/examples/step-55/step-55.cc b/examples/step-55/step-55.cc index 8c07ab9a5c..745faeeeca 100644 --- a/examples/step-55/step-55.cc +++ b/examples/step-55/step-55.cc @@ -302,9 +302,9 @@ namespace Step55 void refine_grid(); void output_results(const unsigned int cycle) const; - unsigned int velocity_degree; - double viscosity; - MPI_Comm mpi_communicator; + const unsigned int velocity_degree; + const double viscosity; + MPI_Comm mpi_communicator; const FESystem fe; parallel::distributed::Triangulation triangulation; @@ -387,15 +387,13 @@ namespace Step55 // into two IndexSets based on how we want to create the block matrices // and vectors. const IndexSet &locally_owned_dofs = dof_handler.locally_owned_dofs(); - owned_partitioning.resize(2); - owned_partitioning[0] = locally_owned_dofs.get_view(0, n_u); - owned_partitioning[1] = locally_owned_dofs.get_view(n_u, n_u + n_p); + owned_partitioning = {locally_owned_dofs.get_view(0, n_u), + locally_owned_dofs.get_view(n_u, n_u + n_p)}; const IndexSet locally_relevant_dofs = DoFTools::extract_locally_relevant_dofs(dof_handler); - relevant_partitioning.resize(2); - relevant_partitioning[0] = locally_relevant_dofs.get_view(0, n_u); - relevant_partitioning[1] = locally_relevant_dofs.get_view(n_u, n_u + n_p); + relevant_partitioning = {locally_relevant_dofs.get_view(0, n_u), + locally_relevant_dofs.get_view(n_u, n_u + n_p)}; // Setting up the constraints for boundary conditions and hanging nodes // is identical to step-40. Even though we don't have any hanging nodes -- 2.39.5