]> https://gitweb.dealii.org/ - code-gallery.git/commitdiff
Make code compile with deal.II 9.4.0.
authorMarc Fehling <mafehling.git@gmail.com>
Sun, 23 Apr 2023 23:51:45 +0000 (17:51 -0600)
committerMarc Fehling <mafehling.git@gmail.com>
Thu, 27 Apr 2023 06:07:47 +0000 (00:07 -0600)
Distributed_Moving_Laser_Heating/CMakeLists.txt
Distributed_Moving_Laser_Heating/Distributed_Moving_Laser_Heating.cc

index 4df07957f38e9e036a352bca8131a09254ce2627..2e4e2af6e05089bd04876ccd330c91d9d0f08bcc 100644 (file)
@@ -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})
index 34c32064bd18a3ef1eeb3bf8c1c6bcaa9be12540..d49ce9b176fbe7b80ea10536e6df7e633a1150e8 100644 (file)
@@ -224,10 +224,12 @@ void LaserHeating<dim>::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<dim>::assemble_system_matrix_init (double time_step)
 
   system_rhs_T = 0;
 
-  typename DoFHandler<dim>::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
-            << "--------------------------------------------"
-            <<std::endl;
+      std::cerr << std::endl
+                << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+      std::cerr << "Exception on processing: " << std::endl
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
+      return 1;
+    }
+    catch (...)
+    {
+      std::cerr << std::endl
+                << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+      std::cerr << "Unknown exception!" << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+      return 1;
     }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.