]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix quick_tests 6912/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Wed, 11 Jul 2018 11:46:24 +0000 (13:46 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Wed, 11 Jul 2018 16:00:33 +0000 (18:00 +0200)
tests/quick_tests/hdf5.cc
tests/quick_tests/step-petsc.cc
tests/quick_tests/step-slepc.cc
tests/quick_tests/sundials-ida.cc
tests/quick_tests/tbb.cc

index 8ff072827d1cbbf24939ca7ba7385dd08ae69548..595a616a9dcfbe2f7f73a0d7857796825194d058 100644 (file)
 // Test HDF5. Copy-paste from
 // https://support.hdfgroup.org/HDF5/Tutor/crtfile.html
 
+#include <deal.II/base/exceptions.h>
+
 #include <hdf5.h>
 
 #include <cstdio>
-
 int
 main()
 {
@@ -31,5 +32,6 @@ main()
 
   /* Terminate access to the file. */
   status = H5Fclose(file_id);
+  AssertThrow(status >= 0, dealii::ExcInternalError());
   std::remove("file.h5");
 }
index b620e8b967bb5d841630b1ed3a250fdc6d802ff7..b9a2f90ef84dad7320585e7e4f028504823d61ca 100644 (file)
@@ -66,9 +66,9 @@ private:
   FE_Q<2>          fe;
   DoFHandler<2>    dof_handler;
 
-  PETScWrappers::SparseMatrix A;
-  PETScWrappers::MPI::Vector  b, x;
-  AffineConstraints<double>   constraints;
+  PETScWrappers::SparseMatrix    A;
+  PETScWrappers::MPI::Vector     b, x;
+  AffineConstraints<PetscScalar> constraints;
 
   TableHandler output_table;
 };
@@ -111,8 +111,8 @@ LaplaceProblem::assemble_system()
   const unsigned int dofs_per_cell = fe.dofs_per_cell;
   const unsigned int n_q_points    = quadrature_formula.size();
 
-  FullMatrix<double> cell_A(dofs_per_cell, dofs_per_cell);
-  Vector<double>     cell_b(dofs_per_cell);
+  FullMatrix<PetscScalar> cell_A(dofs_per_cell, dofs_per_cell);
+  Vector<PetscScalar>     cell_b(dofs_per_cell);
 
   std::vector<types::global_dof_index> local_dof_indices(dofs_per_cell);
 
index 7150d84e5fd86f5bec1fef1af4dda55c7e200651..e07fc5fb91440984a03429c436bc5b8407fb3cf7 100644 (file)
@@ -67,8 +67,8 @@ private:
 
   PETScWrappers::SparseMatrix             A, B;
   std::vector<PETScWrappers::MPI::Vector> x;
-  std::vector<double>                     lambda;
-  AffineConstraints<double>               constraints;
+  std::vector<PetscScalar>                lambda;
+  AffineConstraints<PetscScalar>          constraints;
 
   TableHandler output_table;
 };
@@ -117,8 +117,8 @@ LaplaceEigenspectrumProblem::assemble_system()
   const unsigned int dofs_per_cell = fe.dofs_per_cell;
   const unsigned int n_q_points    = quadrature_formula.size();
 
-  FullMatrix<double> cell_A(dofs_per_cell, dofs_per_cell);
-  FullMatrix<double> cell_B(dofs_per_cell, dofs_per_cell);
+  FullMatrix<PetscScalar> cell_A(dofs_per_cell, dofs_per_cell);
+  FullMatrix<PetscScalar> cell_B(dofs_per_cell, dofs_per_cell);
 
   std::vector<types::global_dof_index> local_dof_indices(dofs_per_cell);
 
@@ -187,8 +187,8 @@ LaplaceEigenspectrumProblem::solve()
 
 
   // some output
-  output_table.add_value("lambda", lambda[0]);
-  output_table.add_value("error", std::fabs(2. - lambda[0]));
+  output_table.add_value("lambda", std::abs(lambda[0]));
+  output_table.add_value("error", std::fabs(2. - std::abs(lambda[0])));
 }
 
 void
@@ -209,9 +209,9 @@ LaplaceEigenspectrumProblem::run()
       solve();
 
       // check energy convergence with previous result
-      AssertThrow(lambda[0] < old_lambda,
+      AssertThrow(std::abs(lambda[0]) < old_lambda,
                   ExcMessage("solution is not converging"));
-      old_lambda = lambda[0];
+      old_lambda = std::abs(lambda[0]);
     }
 
   // push back analytic result
index b8c8a15217533e075c26e32ee6f8970887893773..38d9878a3d997ec45d8695fb0f532be4792d3ecf 100644 (file)
@@ -74,7 +74,7 @@ public:
 
     typedef Vector<double> VectorType;
 
-    time_stepper.residual = [&](const double      t,
+    time_stepper.residual = [&](const double /*t*/,
                                 const VectorType &y,
                                 const VectorType &y_dot,
                                 VectorType &      res) -> int {
@@ -105,10 +105,10 @@ public:
       return 0;
     };
 
-    time_stepper.output_step = [&](const double       t,
-                                   const VectorType & sol,
-                                   const VectorType & sol_dot,
-                                   const unsigned int step_number) -> int {
+    time_stepper.output_step = [&](const double /*t*/,
+                                   const VectorType & /*sol*/,
+                                   const VectorType & /*sol_dot*/,
+                                   const unsigned int /*step_number*/) -> int {
       // In this test, don't output anything.
       return 0;
     };
index 7c84bcd09ffebba7d8b6bd90a7c69927f1c1cfd7..8afd0b10df4c214f51e2b500d0418fd4c4fa6b00 100644 (file)
@@ -51,8 +51,8 @@ struct copy_data
 
 void
 assemble(const std::vector<int>::iterator &it,
-         scratch_data &                    scratch,
-         copy_data &                       data)
+         scratch_data & /*scratch*/,
+         copy_data &data)
 {
   data.value = (*it);
 }

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.