From 7aef0d62899b2f146374eb75542b2b49da237aeb Mon Sep 17 00:00:00 2001 From: Marc Fehling Date: Sun, 23 Apr 2023 17:51:45 -0600 Subject: [PATCH] Make code compile with deal.II 9.4.0. --- .../CMakeLists.txt | 4 +- .../Distributed_Moving_Laser_Heating.cc | 38 ++++++++++++++----- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/Distributed_Moving_Laser_Heating/CMakeLists.txt b/Distributed_Moving_Laser_Heating/CMakeLists.txt index 4df0795..2e4e2af 100644 --- a/Distributed_Moving_Laser_Heating/CMakeLists.txt +++ b/Distributed_Moving_Laser_Heating/CMakeLists.txt @@ -21,9 +21,9 @@ SET(TARGET_SRC # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.2.0 QUIET +FIND_PACKAGE(deal.II 9.4.0 QUIET HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) IF(NOT ${deal.II_FOUND}) diff --git a/Distributed_Moving_Laser_Heating/Distributed_Moving_Laser_Heating.cc b/Distributed_Moving_Laser_Heating/Distributed_Moving_Laser_Heating.cc index 34c3206..d49ce9b 100644 --- a/Distributed_Moving_Laser_Heating/Distributed_Moving_Laser_Heating.cc +++ b/Distributed_Moving_Laser_Heating/Distributed_Moving_Laser_Heating.cc @@ -224,10 +224,12 @@ void LaserHeating::setup_system () DoFTools::make_hanging_node_constraints (dof_handler, constraints_T); constraints_T.close(); + const unsigned int myid = Utilities::MPI::this_mpi_process (mpi_communicator); DynamicSparsityPattern dsp_T(locally_relevant_dofs); - DoFTools::make_sparsity_pattern (dof_handler, dsp_T,constraints_T,false); + DoFTools::make_sparsity_pattern (dof_handler, dsp_T, constraints_T, false, myid); + SparsityTools::distribute_sparsity_pattern (dsp_T, - dof_handler.n_locally_owned_dofs_per_processor(), + locally_owned_dofs, mpi_communicator, locally_relevant_dofs); @@ -279,11 +281,7 @@ void LaserHeating::assemble_system_matrix_init (double time_step) system_rhs_T = 0; - typename DoFHandler::active_cell_iterator - cell = dof_handler.begin_active(), - endc = dof_handler.end(); - - for (const auto cell : dof_handler.active_cell_iterator()) + for (const auto &cell : dof_handler.active_cell_iterators()) if(cell->is_locally_owned()) { @@ -688,9 +686,29 @@ int main (int argc, char *argv[]) } catch (std::exception &exc) { - std::cerr << std::endl << std::endl - << "--------------------------------------------" - <