]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use reproducible random numbers in tests
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Tue, 19 Jan 2016 19:04:30 +0000 (20:04 +0100)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Tue, 19 Jan 2016 19:05:31 +0000 (20:05 +0100)
tests/multigrid/transfer_matrix_free_01.cc
tests/multigrid/transfer_matrix_free_02.cc
tests/multigrid/transfer_matrix_free_03.cc
tests/multigrid/transfer_matrix_free_03.with_mpi=true.with_p4est=true.mpirun=5.output
tests/multigrid/transfer_matrix_free_04.cc
tests/multigrid/transfer_matrix_free_05.cc
tests/multigrid/transfer_matrix_free_06.cc

index 3d7f7f618d7137d98d99ef752b26ec6eb898e1ac..9f3169fc6bcaa1bbb23dd6b64f764655322ef079 100644 (file)
@@ -87,7 +87,7 @@ void check(const unsigned int fe_degree)
           v2.reinit(mgdof.locally_owned_mg_dofs(level), MPI_COMM_WORLD);
           v3.reinit(mgdof.locally_owned_mg_dofs(level), MPI_COMM_WORLD);
           for (unsigned int i=0; i<v1.local_size(); ++i)
-            v1.local_element(i) = (double)rand()/RAND_MAX;
+            v1.local_element(i) = (double)Testing::rand()/RAND_MAX;
           v1_cpy = v1;
           transfer.prolongate(level, v2, v1);
           transfer_ref.prolongate(level, v3, v1_cpy);
@@ -105,7 +105,7 @@ void check(const unsigned int fe_degree)
           v2.reinit(mgdof.locally_owned_mg_dofs(level-1), MPI_COMM_WORLD);
           v3.reinit(mgdof.locally_owned_mg_dofs(level-1), MPI_COMM_WORLD);
           for (unsigned int i=0; i<v1.local_size(); ++i)
-            v1.local_element(i) = (double)rand()/RAND_MAX;
+            v1.local_element(i) = (double)Testing::rand()/RAND_MAX;
           v1_cpy = v1;
           transfer.restrict_and_add(level, v2, v1);
           transfer_ref.restrict_and_add(level, v3, v1_cpy);
index d93be7a5cba7cd2f64666b7f557abaf83a3a0701..844b0af0f2630e167fd79448c89a685f9538d159 100644 (file)
@@ -113,7 +113,7 @@ void check(const unsigned int fe_degree)
           v2.reinit(mgdof.locally_owned_mg_dofs(level), MPI_COMM_WORLD);
           v3.reinit(mgdof.locally_owned_mg_dofs(level), MPI_COMM_WORLD);
           for (unsigned int i=0; i<v1.local_size(); ++i)
-            v1.local_element(i) = (double)rand()/RAND_MAX;
+            v1.local_element(i) = (double)Testing::rand()/RAND_MAX;
           v1_cpy = v1;
           transfer.prolongate(level, v2, v1);
           transfer_ref.prolongate(level, v3, v1_cpy);
@@ -131,7 +131,7 @@ void check(const unsigned int fe_degree)
           v2.reinit(mgdof.locally_owned_mg_dofs(level-1), MPI_COMM_WORLD);
           v3.reinit(mgdof.locally_owned_mg_dofs(level-1), MPI_COMM_WORLD);
           for (unsigned int i=0; i<v1.local_size(); ++i)
-            v1.local_element(i) = (double)rand()/RAND_MAX;
+            v1.local_element(i) = (double)Testing::rand()/RAND_MAX;
           v1_cpy = v1;
           transfer.restrict_and_add(level, v2, v1);
           transfer_ref.restrict_and_add(level, v3, v1_cpy);
index cadbbb9bde631e81e2b26eca887f6623c1ca4375..e73521812e24cce4208c65df6d0bcc07f8397665 100644 (file)
@@ -90,7 +90,7 @@ void check(const unsigned int fe_degree)
           v2.reinit(mgdof.locally_owned_mg_dofs(level), MPI_COMM_WORLD);
           v3.reinit(mgdof.locally_owned_mg_dofs(level), MPI_COMM_WORLD);
           for (unsigned int i=0; i<v1.local_size(); ++i)
-            v1.local_element(i) = (double)rand()/RAND_MAX;
+            v1.local_element(i) = (double)Testing::rand()/RAND_MAX;
           v1_cpy = v1;
           transfer.prolongate(level, v2, v1);
           transfer_ref.prolongate(level, v3, v1_cpy);
@@ -108,7 +108,7 @@ void check(const unsigned int fe_degree)
           v2.reinit(mgdof.locally_owned_mg_dofs(level-1), MPI_COMM_WORLD);
           v3.reinit(mgdof.locally_owned_mg_dofs(level-1), MPI_COMM_WORLD);
           for (unsigned int i=0; i<v1.local_size(); ++i)
-            v1.local_element(i) = (double)rand()/RAND_MAX;
+            v1.local_element(i) = (double)Testing::rand()/RAND_MAX;
           v1_cpy = v1;
           transfer.restrict_and_add(level, v2, v1);
           transfer_ref.restrict_and_add(level, v3, v1_cpy);
index 013d2b2c13eb6eb69d865c2929fe0b400c5c088f..105861d4e3d6cfe1103a026a45ffb7e4f1c1727f 100644 (file)
@@ -1,4 +1,4 @@
-JobId mklap4 Mon Jan 11 11:42:13 2016
+
 DEAL::FE: FE_Q<2>(1)
 DEAL::no. cells: 12 on 2 levels
 DEAL::Diff prolongate   l1: 0
index 74b05c575fef38b4623eb8dc556752f45fc53015..d4de6be0f33d3a989b6bfa36c02158755070a15b 100644 (file)
@@ -80,7 +80,7 @@ void check(const unsigned int fe_degree)
           v2.reinit(mgdof.locally_owned_mg_dofs(level), MPI_COMM_WORLD);
           v3.reinit(mgdof.locally_owned_mg_dofs(level), MPI_COMM_WORLD);
           for (unsigned int i=0; i<v1.local_size(); ++i)
-            v1.local_element(i) = (double)rand()/RAND_MAX;
+            v1.local_element(i) = (double)Testing::rand()/RAND_MAX;
           v1_cpy = v1;
           transfer.prolongate(level, v2, v1);
           transfer_ref.prolongate(level, v3, v1_cpy);
@@ -98,7 +98,7 @@ void check(const unsigned int fe_degree)
           v2.reinit(mgdof.locally_owned_mg_dofs(level-1), MPI_COMM_WORLD);
           v3.reinit(mgdof.locally_owned_mg_dofs(level-1), MPI_COMM_WORLD);
           for (unsigned int i=0; i<v1.local_size(); ++i)
-            v1.local_element(i) = (double)rand()/RAND_MAX;
+            v1.local_element(i) = (double)Testing::rand()/RAND_MAX;
           v1_cpy = v1;
           transfer.restrict_and_add(level, v2, v1);
           transfer_ref.restrict_and_add(level, v3, v1_cpy);
index a92af759e2e2e6e1717e9418b2b2947bb6ea006b..1edef737268fb5c646f46ca6a5a4b80ffffd7795 100644 (file)
@@ -99,7 +99,7 @@ void check(const unsigned int fe_degree)
           v2.reinit(mgdof.locally_owned_mg_dofs(level), MPI_COMM_WORLD);
           v3.reinit(mgdof.locally_owned_mg_dofs(level), MPI_COMM_WORLD);
           for (unsigned int i=0; i<v1.local_size(); ++i)
-            v1.local_element(i) = (double)rand()/RAND_MAX;
+            v1.local_element(i) = (double)Testing::rand()/RAND_MAX;
           v1_cpy = v1;
           transfer.prolongate(level, v2, v1);
           transfer_ref.prolongate(level, v3, v1_cpy);
@@ -117,7 +117,7 @@ void check(const unsigned int fe_degree)
           v2.reinit(mgdof.locally_owned_mg_dofs(level-1), MPI_COMM_WORLD);
           v3.reinit(mgdof.locally_owned_mg_dofs(level-1), MPI_COMM_WORLD);
           for (unsigned int i=0; i<v1.local_size(); ++i)
-            v1.local_element(i) = (double)rand()/RAND_MAX;
+            v1.local_element(i) = (double)Testing::rand()/RAND_MAX;
           v1_cpy = v1;
           transfer.restrict_and_add(level, v2, v1);
           transfer_ref.restrict_and_add(level, v3, v1_cpy);
index dbfba6d2d775c16f09bedf729d39b30b1e1232bc..12f2d9e4238691abde125a610b3785d6d5777c02 100644 (file)
@@ -115,7 +115,7 @@ void check(const unsigned int fe_degree)
           v2.reinit(mgdof.locally_owned_mg_dofs(level), MPI_COMM_WORLD);
           v3.reinit(mgdof.locally_owned_mg_dofs(level), MPI_COMM_WORLD);
           for (unsigned int i=0; i<v1.local_size(); ++i)
-            v1.local_element(i) = (double)rand()/RAND_MAX;
+            v1.local_element(i) = (double)Testing::rand()/RAND_MAX;
           v1_cpy = v1;
           transfer.prolongate(level, v2, v1);
           transfer_ref.prolongate(level, v3, v1_cpy);
@@ -133,7 +133,7 @@ void check(const unsigned int fe_degree)
           v2.reinit(mgdof.locally_owned_mg_dofs(level-1), MPI_COMM_WORLD);
           v3.reinit(mgdof.locally_owned_mg_dofs(level-1), MPI_COMM_WORLD);
           for (unsigned int i=0; i<v1.local_size(); ++i)
-            v1.local_element(i) = (double)rand()/RAND_MAX;
+            v1.local_element(i) = (double)Testing::rand()/RAND_MAX;
           v1_cpy = v1;
           transfer.restrict_and_add(level, v2, v1);
           transfer_ref.restrict_and_add(level, v3, v1_cpy);

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.