From 0b9e336ad7b2e9f2144edf00bcd7dbb35daa3d90 Mon Sep 17 00:00:00 2001 From: heister Date: Fri, 22 Nov 2013 14:42:37 +0000 Subject: [PATCH] rework r31759 to my liking and fix a few more places git-svn-id: https://svn.dealii.org/trunk@31761 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/aniso/anisotropic_crash.cc | 2 +- tests/aniso/refine_and_coarsen_anisotropic.cc | 6 +++--- tests/base/full_tensor_10.cc | 2 +- tests/base/geometry_info_1.cc | 2 +- tests/base/index_set_14.cc | 4 ++-- tests/base/index_set_15.cc | 4 ++-- tests/base/index_set_17.cc | 2 +- tests/base/index_set_18.cc | 2 +- tests/base/index_set_19.cc | 2 +- tests/base/index_set_20.cc | 4 ++-- tests/base/index_set_22.cc | 2 +- tests/base/polynomial_lagrange_ops.cc | 18 ++++++++--------- tests/base/polynomial_lagrange_order.cc | 2 +- tests/base/polynomial_lagrange_product.cc | 2 +- tests/base/symmetric_tensor_19.cc | 2 +- tests/base/symmetric_tensor_25.cc | 2 +- tests/base/symmetric_tensor_26.cc | 4 ++-- tests/bits/chunk_sparse_matrix_15.cc | 2 +- tests/bits/fe_q_constraints.cc | 4 ++-- tests/bits/find_cell_6.cc | 4 ++-- tests/bits/full_matrix_56.cc | 2 +- tests/bits/joa_1.cc | 4 ++-- tests/bits/point_value_hp_01.cc | 2 +- tests/bits/point_value_hp_02.cc | 2 +- tests/bits/rt_2.cc | 2 +- tests/bits/step-15.cc | 2 +- tests/deal.II/coarsening_02.cc | 2 +- tests/deal.II/coarsening_02_1d.cc | 2 +- tests/deal.II/constraint_graph.cc | 2 +- tests/deal.II/constraints_local_to_global.cc | 2 +- .../constraints_local_to_global_chunk.cc | 2 +- tests/deal.II/dof_handler_number_cache.cc | 2 +- tests/deal.II/dof_handler_number_cache_02.cc | 2 +- tests/distributed_grids/2d_coarsening_02.cc | 2 +- tests/distributed_grids/2d_coarsening_03.cc | 2 +- tests/distributed_grids/2d_coarsening_05.cc | 2 +- tests/distributed_grids/2d_refinement_02.cc | 2 +- tests/distributed_grids/2d_refinement_03.cc | 2 +- tests/distributed_grids/2d_refinement_05.cc | 2 +- tests/distributed_grids/3d_coarsening_02.cc | 2 +- tests/distributed_grids/3d_coarsening_03.cc | 2 +- tests/distributed_grids/3d_coarsening_04.cc | 2 +- tests/distributed_grids/3d_coarsening_05.cc | 2 +- tests/distributed_grids/3d_refinement_02.cc | 2 +- tests/distributed_grids/3d_refinement_03.cc | 2 +- tests/distributed_grids/3d_refinement_05.cc | 2 +- tests/distributed_grids/3d_refinement_08.cc | 2 +- .../count_dofs_per_block_01.cc | 2 +- .../dof_handler_number_cache.cc | 2 +- .../distributed_grids/solution_transfer_03.cc | 4 ++-- tests/fail/abf_approximation_01.cc | 4 ++-- tests/fail/hp-step-15.cc | 2 +- tests/fail/vectors_boundary_rhs_hp_02.cc | 2 +- tests/fail/vectors_rhs_hp_02.cc | 2 +- tests/fe/rt_8.cc | 2 +- tests/fe/rt_9.cc | 2 +- tests/fe/rt_approximation_01.cc | 4 ++-- tests/fe/rt_normal_02.cc | 2 +- tests/hp/count_dofs_per_block_01.cc | 2 +- tests/hp/count_dofs_per_block_02.cc | 2 +- tests/hp/crash_06.cc | 2 +- tests/hp/crash_10.cc | 4 ++-- tests/hp/crash_16.cc | 2 +- tests/hp/create_laplace_matrix_01.cc | 2 +- tests/hp/create_laplace_matrix_01b.cc | 2 +- tests/hp/create_laplace_matrix_02.cc | 2 +- tests/hp/create_laplace_matrix_02b.cc | 2 +- tests/hp/create_laplace_matrix_03.cc | 2 +- tests/hp/create_laplace_matrix_03b.cc | 2 +- tests/hp/create_laplace_matrix_04.cc | 2 +- tests/hp/create_laplace_matrix_04b.cc | 2 +- .../create_laplace_matrix_constraints_02.cc | 2 +- .../create_laplace_matrix_constraints_02b.cc | 2 +- tests/hp/create_mass_matrix_01.cc | 2 +- tests/hp/create_mass_matrix_01b.cc | 2 +- tests/hp/create_mass_matrix_02.cc | 2 +- tests/hp/create_mass_matrix_02b.cc | 2 +- tests/hp/create_mass_matrix_03.cc | 2 +- tests/hp/create_mass_matrix_03b.cc | 2 +- tests/hp/create_mass_matrix_04.cc | 2 +- tests/hp/create_mass_matrix_04b.cc | 2 +- tests/hp/create_mass_matrix_05.cc | 2 +- tests/hp/create_mass_matrix_constraints_02.cc | 2 +- .../hp/create_mass_matrix_constraints_02b.cc | 2 +- tests/hp/dof_handler_number_cache.cc | 2 +- tests/hp/get_active_fe_indices.cc | 2 +- tests/hp/hp_constraints_common.h | 8 ++++---- tests/hp/hp_hanging_nodes_02.cc | 2 +- tests/hp/integrate_difference.cc | 2 +- tests/hp/integrate_difference_02.cc | 2 +- tests/hp/matrices_hp.cc | 2 +- tests/hp/n_active_fe_indices.cc | 2 +- tests/hp/random.cc | 2 +- tests/hp/solution_transfer.cc | 12 +++++------ tests/hp/step-3b.cc | 2 +- tests/hp/step-3c.cc | 2 +- tests/hp/vectors_boundary_rhs_01.cc | 2 +- tests/hp/vectors_boundary_rhs_02.cc | 2 +- tests/hp/vectors_boundary_rhs_03.cc | 2 +- tests/hp/vectors_boundary_rhs_hp_01.cc | 2 +- tests/hp/vectors_boundary_rhs_hp_03.cc | 2 +- tests/hp/vectors_point_source_01.cc | 2 +- tests/hp/vectors_point_source_hp_01.cc | 2 +- tests/hp/vectors_rhs_01.cc | 2 +- tests/hp/vectors_rhs_02.cc | 2 +- tests/hp/vectors_rhs_03.cc | 2 +- tests/hp/vectors_rhs_hp_01.cc | 2 +- tests/hp/vectors_rhs_hp_03.cc | 2 +- tests/lac/full_matrix.cc | 2 +- tests/lac/full_matrix_04.cc | 8 ++++---- tests/lac/gmres_reorthogonalize_01.cc | 2 +- tests/lac/gmres_reorthogonalize_03.cc | 2 +- tests/lac/precondition_chebyshev_01.cc | 2 +- tests/lac/sparse_ilu.cc | 2 +- tests/lac/sparse_ilu_t.cc | 2 +- tests/lac/sparse_matrix_Tmmult_01.cc | 6 +++--- tests/lac/sparse_matrix_Tmmult_02.cc | 8 ++++---- tests/lac/sparse_matrix_mmult_01.cc | 6 +++--- tests/lac/sparse_matrix_mmult_02.cc | 8 ++++---- tests/lac/sparse_mic.cc | 2 +- tests/lac/vector_accumulation.cc | 4 ++-- tests/matrix_free/copy.cc | 2 +- tests/matrix_free/evaluate_1d_shape.cc | 6 +++--- .../matrix_free/evaluate_1d_shape_evenodd.cc | 6 +++--- tests/matrix_free/get_functions_common.h | 2 +- tests/matrix_free/get_functions_gl.cc | 2 +- tests/matrix_free/get_functions_mappingq.cc | 2 +- tests/matrix_free/get_functions_multife.cc | 2 +- tests/matrix_free/get_functions_multife2.cc | 2 +- .../get_functions_q_hierarchical.cc | 2 +- tests/matrix_free/get_functions_rect.cc | 2 +- tests/matrix_free/get_functions_variants.cc | 2 +- tests/matrix_free/get_values_plain.cc | 2 +- tests/matrix_free/integrate_functions.cc | 4 ++-- .../integrate_functions_multife.cc | 8 ++++---- .../integrate_functions_multife2.cc | 8 ++++---- tests/matrix_free/matrix_vector_10.cc | 2 +- tests/matrix_free/matrix_vector_11.cc | 2 +- tests/matrix_free/matrix_vector_12.cc | 4 ++-- tests/matrix_free/matrix_vector_13.cc | 4 ++-- tests/matrix_free/matrix_vector_common.h | 2 +- tests/matrix_free/matrix_vector_curl.cc | 2 +- tests/matrix_free/matrix_vector_div.cc | 2 +- tests/matrix_free/matrix_vector_hp.cc | 4 ++-- tests/matrix_free/matrix_vector_mg.cc | 4 ++-- tests/matrix_free/matrix_vector_stokes.cc | 2 +- .../matrix_vector_stokes_noflux.cc | 4 ++-- tests/matrix_free/no_index_initialize.cc | 2 +- tests/matrix_free/thread_correctness.cc | 2 +- tests/matrix_free/thread_correctness_hp.cc | 6 +++--- tests/matrix_free/update_mapping_only.cc | 2 +- tests/mpi/constraint_matrix_trilinos_bug.cc | 2 +- tests/mpi/count_dofs_per_block_02.cc | 2 +- tests/mpi/crash_03.cc | 2 +- tests/mpi/dof_handler_number_cache.cc | 2 +- tests/mpi/mg_05.cc | 2 +- tests/mpi/mg_06.cc | 2 +- tests/mpi/p4est_2d_constraintmatrix_03.cc | 2 +- tests/mpi/p4est_2d_constraintmatrix_04.cc | 6 +++--- tests/mpi/p4est_2d_dofhandler_02.cc | 2 +- tests/mpi/p4est_2d_dofhandler_03.cc | 2 +- tests/mpi/p4est_2d_dofhandler_04.cc | 2 +- tests/mpi/p4est_2d_refine_03.cc | 2 +- tests/mpi/p4est_3d_constraintmatrix_01.cc | 2 +- tests/mpi/p4est_3d_constraintmatrix_02.cc | 2 +- tests/mpi/p4est_3d_constraintmatrix_03.cc | 6 +++--- tests/mpi/p4est_3d_refine_01.cc | 2 +- tests/mpi/trilinos_matvec_01.cc | 2 +- tests/mpi/trilinos_matvec_02.cc | 2 +- tests/mpi/trilinos_matvec_03.cc | 2 +- tests/petsc/66.cc | 6 +++--- tests/petsc/67.cc | 6 +++--- tests/petsc/68.cc | 8 ++++---- tests/petsc/69.cc | 8 ++++---- tests/petsc/slowness_04.cc | 20 +++++++++---------- tests/tests.h | 12 ++++++----- tests/trilinos/66.cc | 6 +++--- tests/trilinos/67.cc | 6 +++--- tests/trilinos/68.cc | 8 ++++---- tests/trilinos/69.cc | 8 ++++---- tests/trilinos/slowness_04.cc | 20 +++++++++---------- 181 files changed, 290 insertions(+), 288 deletions(-) diff --git a/tests/aniso/anisotropic_crash.cc b/tests/aniso/anisotropic_crash.cc index 9429c1d5b7..35f33a1635 100644 --- a/tests/aniso/anisotropic_crash.cc +++ b/tests/aniso/anisotropic_crash.cc @@ -55,7 +55,7 @@ int main() Triangulation<2>::active_cell_iterator cell = tri.begin_active(), end = tri.end(); for ( ; cell != end; ++cell ) { - switch (myrand()%4) + switch (Testing::rand()%4) { /// If a randomly drawn /// number is 0 or 1 we diff --git a/tests/aniso/refine_and_coarsen_anisotropic.cc b/tests/aniso/refine_and_coarsen_anisotropic.cc index be0f76b27a..85f1d215dd 100644 --- a/tests/aniso/refine_and_coarsen_anisotropic.cc +++ b/tests/aniso/refine_and_coarsen_anisotropic.cc @@ -81,10 +81,10 @@ void test_isotropic (int type, std::ostream *logfile) { cell = tria.begin_active(); for (; cell!=endc; ++cell) - if (myrand()%5==0) + if (Testing::rand()%5==0) { - if (myrand()%2==0) - cell->set_refine_flag(ref_cases[myrand()% + if (Testing::rand()%2==0) + cell->set_refine_flag(ref_cases[Testing::rand()% RefinementCase::isotropic_refinement]); } else diff --git a/tests/base/full_tensor_10.cc b/tests/base/full_tensor_10.cc index 3f45efeeda..5d9d4598b6 100644 --- a/tests/base/full_tensor_10.cc +++ b/tests/base/full_tensor_10.cc @@ -33,7 +33,7 @@ void test () // as in symmetric_tensor_10 for (unsigned int i=0; i indices; is1.fill_index_vector (indices); diff --git a/tests/base/index_set_20.cc b/tests/base/index_set_20.cc index 7e985b391d..0a3021a70b 100644 --- a/tests/base/index_set_20.cc +++ b/tests/base/index_set_20.cc @@ -86,8 +86,8 @@ void test() IndexSet b(size); for (unsigned int i=0; i<9*a.size()/10; ++i) { - a.add_index (myrand() % a.size()); - b.add_index (myrand() % a.size()); + a.add_index (Testing::rand() % a.size()); + b.add_index (Testing::rand() % a.size()); } testor(a, b, false); } diff --git a/tests/base/index_set_22.cc b/tests/base/index_set_22.cc index ea0ffe37b7..906d4eb1e1 100644 --- a/tests/base/index_set_22.cc +++ b/tests/base/index_set_22.cc @@ -35,7 +35,7 @@ void test () // set, some of which may be // repetitions of previous ones for (unsigned int i=0; i<9*is1.size()/10; ++i) - is1.add_index (myrand() % is1.size()); + is1.add_index (Testing::rand() % is1.size()); std::vector zeros_and_ones(is1.size()); is1.fill_binary_vector (zeros_and_ones); diff --git a/tests/base/polynomial_lagrange_ops.cc b/tests/base/polynomial_lagrange_ops.cc index 4a4d662f23..75898a59d3 100644 --- a/tests/base/polynomial_lagrange_ops.cc +++ b/tests/base/polynomial_lagrange_ops.cc @@ -37,8 +37,8 @@ void check_scale (const std::vector > &p) for (unsigned int i=0; i q = p[i]; - double x = (double)myrand()/RAND_MAX; - double factor = 5.*(double)myrand()/RAND_MAX; + double x = (double)Testing::rand()/RAND_MAX; + double factor = 5.*(double)Testing::rand()/RAND_MAX; q.scale (factor); double value1 = p[i].value (factor * x); double value2 = q .value (x); @@ -62,8 +62,8 @@ void check_shift (const std::vector > &p) for (unsigned int i=0; i q = p[i]; - double x = (double)myrand()/RAND_MAX; - double a = 10.*(-1.+2.*(double)myrand()/RAND_MAX); + double x = (double)Testing::rand()/RAND_MAX; + double a = 10.*(-1.+2.*(double)Testing::rand()/RAND_MAX); q.shift (a); double value1 = p[i].value (x+a); double value2 = q .value (x); @@ -83,8 +83,8 @@ void check_mult_scalar (const std::vector > &p) for (unsigned int i=0; i q = p[i]; - double x = (double)myrand()/RAND_MAX; - double a = (double)myrand()/RAND_MAX; + double x = (double)Testing::rand()/RAND_MAX; + double a = (double)Testing::rand()/RAND_MAX; q *= a; double value1 = p[i].value (x) * a; double value2 = q .value (x); @@ -107,7 +107,7 @@ void check_mult (const std::vector > &p) { Polynomial q = p[i]; q *= p[j]; - double x = (double)myrand()/RAND_MAX; + double x = (double)Testing::rand()/RAND_MAX; double value1 = p[i].value (x) * p[j].value(x); double value2 = q .value (x); if (std::fabs(value1-value2) > std::max(1e-13,1e-13*std::fabs(value1))) @@ -139,7 +139,7 @@ void check_expand (const std::vector > &p) for (unsigned int i=0; i q = p[i]; - double x = (double)myrand()/RAND_MAX; + double x = (double)Testing::rand()/RAND_MAX; q += zero; double value1 = p[i].value (x); double value2 = q .value (x); @@ -166,7 +166,7 @@ void check_mult_expand (const std::vector > &p) Polynomial q = p[i]; q += zero; q *= p[j]; - double x = (double)myrand()/RAND_MAX; + double x = (double)Testing::rand()/RAND_MAX; double value1 = p[i].value (x) * p[j].value(x); double value2 = q .value (x); if (std::fabs(value1-value2) > std::max(1e-10,1e-10*std::fabs(value1))) diff --git a/tests/base/polynomial_lagrange_order.cc b/tests/base/polynomial_lagrange_order.cc index 9899f14182..0f55292bc5 100644 --- a/tests/base/polynomial_lagrange_order.cc +++ b/tests/base/polynomial_lagrange_order.cc @@ -68,7 +68,7 @@ void check_constant (const std::vector > &p) deallog << "Representation of one at random points"; for (unsigned int j=0; j<12; ++j) { - double x = (double)myrand()/RAND_MAX; + double x = (double)Testing::rand()/RAND_MAX; double value = 0; for (unsigned int i=0; i > &p, Monomial zero (0,0); for (unsigned int j=0; j q = p[j]; q += zero; diff --git a/tests/base/symmetric_tensor_19.cc b/tests/base/symmetric_tensor_19.cc index 64d7b96a60..fe782feb38 100644 --- a/tests/base/symmetric_tensor_19.cc +++ b/tests/base/symmetric_tensor_19.cc @@ -112,7 +112,7 @@ void test () for (unsigned int j=0; j<3; ++j) for (unsigned int k=0; k<3; ++k) for (unsigned int l=0; l<3; ++l) - A[i][j][k][l] = 1.*myrand()/RAND_MAX; + A[i][j][k][l] = 1.*Testing::rand()/RAND_MAX; break; default: diff --git a/tests/base/symmetric_tensor_25.cc b/tests/base/symmetric_tensor_25.cc index 46026f214f..e9bf54a9ce 100644 --- a/tests/base/symmetric_tensor_25.cc +++ b/tests/base/symmetric_tensor_25.cc @@ -33,7 +33,7 @@ void check () { SymmetricTensor<2,dim> S; for (unsigned int i=0; i::faces_per_cell; ++f) { - if (cell->face(f)->at_boundary() && (myrand()%5)==1) + if (cell->face(f)->at_boundary() && (Testing::rand()%5)==1) cell->set_refine_flag(); } diff --git a/tests/bits/full_matrix_56.cc b/tests/bits/full_matrix_56.cc index b5c0546b7c..daf064bfaa 100644 --- a/tests/bits/full_matrix_56.cc +++ b/tests/bits/full_matrix_56.cc @@ -45,7 +45,7 @@ void random_matrix(FullMatrix &A) for (unsigned int i=0; i::run () // points inside a radius of 0.9) for (int i=0; i<1000; i++) { - double r = sqrt((0.9*myrand()/RAND_MAX)); - double phi = 2*3.14*(1.0*myrand()/RAND_MAX); + double r = sqrt((0.9*Testing::rand()/RAND_MAX)); + double phi = 2*3.14*(1.0*Testing::rand()/RAND_MAX); double x = r*cos(phi); double y = r*sin(phi); Point<2> p(x,y); diff --git a/tests/bits/point_value_hp_01.cc b/tests/bits/point_value_hp_01.cc index 683840a2b3..b99d1564ed 100644 --- a/tests/bits/point_value_hp_01.cc +++ b/tests/bits/point_value_hp_01.cc @@ -123,7 +123,7 @@ check () endc = dof_handler.end(); for (; cell!=endc; ++cell) { - cell->set_active_fe_index (myrand() % fe.size()); + cell->set_active_fe_index (Testing::rand() % fe.size()); } dof_handler.distribute_dofs (fe); diff --git a/tests/bits/point_value_hp_02.cc b/tests/bits/point_value_hp_02.cc index 6d27e90f51..9b7d41d7cd 100644 --- a/tests/bits/point_value_hp_02.cc +++ b/tests/bits/point_value_hp_02.cc @@ -132,7 +132,7 @@ check () endc = dof_handler.end(); for (; cell!=endc; ++cell) { - cell->set_active_fe_index (myrand() % fe.size()); + cell->set_active_fe_index (Testing::rand() % fe.size()); } dof_handler.distribute_dofs (fe); diff --git a/tests/bits/rt_2.cc b/tests/bits/rt_2.cc index 2a41f81990..308b5d3b23 100644 --- a/tests/bits/rt_2.cc +++ b/tests/bits/rt_2.cc @@ -158,7 +158,7 @@ int main () // values between 0 and 1. Vector solution(dof_handler.n_dofs ()); for (unsigned int i = 0; i < dof_handler.n_dofs (); ++i) - solution(i) = (double) myrand() / (double) RAND_MAX; + solution(i) = (double) Testing::rand() / (double) RAND_MAX; // Now check if the function is // continuous in normal direction diff --git a/tests/bits/step-15.cc b/tests/bits/step-15.cc index b74fac85e6..31b7279a8f 100644 --- a/tests/bits/step-15.cc +++ b/tests/bits/step-15.cc @@ -85,7 +85,7 @@ double InitializationValues::value (const Point<1> &p, const unsigned int) const { const double base = std::pow(p(0), 1./3.); - const double random = 2.*myrand()/RAND_MAX-1; + const double random = 2.*Testing::rand()/RAND_MAX-1; return std::max (base+.1*random, 0.); } diff --git a/tests/deal.II/coarsening_02.cc b/tests/deal.II/coarsening_02.cc index 7454364b96..df24077c2b 100644 --- a/tests/deal.II/coarsening_02.cc +++ b/tests/deal.II/coarsening_02.cc @@ -85,7 +85,7 @@ void test() // refine one-fifth of cells randomly std::vector flags (triangulation.n_active_cells(), false); for (unsigned int k=0; k flags (triangulation.n_active_cells(), false); for (unsigned int k=0; k::active_cell_iterator cell = dof_handler.begin_active(); cell != dof_handler.end(); ++cell) - cell->set_active_fe_index (myrand() % fe_collection.size()); + cell->set_active_fe_index (Testing::rand() % fe_collection.size()); dof_handler.distribute_dofs(fe_collection); diff --git a/tests/deal.II/constraints_local_to_global.cc b/tests/deal.II/constraints_local_to_global.cc index 22d806f836..a171d265b8 100644 --- a/tests/deal.II/constraints_local_to_global.cc +++ b/tests/deal.II/constraints_local_to_global.cc @@ -90,7 +90,7 @@ void test () if (counter % 42 == 0) local_mat(i,j) = 0; else - local_mat (i,j) = (double)myrand() / RAND_MAX; + local_mat (i,j) = (double)Testing::rand() / RAND_MAX; cell->get_dof_indices (local_dof_indices); constraints.distribute_local_to_global (local_mat, local_dof_indices, sparse); diff --git a/tests/deal.II/constraints_local_to_global_chunk.cc b/tests/deal.II/constraints_local_to_global_chunk.cc index 5d2bfa6b6d..b9ad731dac 100644 --- a/tests/deal.II/constraints_local_to_global_chunk.cc +++ b/tests/deal.II/constraints_local_to_global_chunk.cc @@ -94,7 +94,7 @@ void test (unsigned int chunk_size) if (counter % 42 == 0) local_mat(i,j) = 0; else - local_mat (i,j) = (double)myrand() / RAND_MAX; + local_mat (i,j) = (double)Testing::rand() / RAND_MAX; cell->get_dof_indices (local_dof_indices); constraints.distribute_local_to_global (local_mat, local_dof_indices, sparse); diff --git a/tests/deal.II/dof_handler_number_cache.cc b/tests/deal.II/dof_handler_number_cache.cc index 5e8ee38ae3..72744cd7ba 100644 --- a/tests/deal.II/dof_handler_number_cache.cc +++ b/tests/deal.II/dof_handler_number_cache.cc @@ -57,7 +57,7 @@ void test() // refine one-fifth of cells randomly std::vector flags (triangulation.n_active_cells(), false); for (unsigned int k=0; k flags (triangulation.n_active_cells(), false); for (unsigned int k=0; k flags (tr.n_active_cells(), false); for (unsigned int k=0; k flags (tr.n_active_cells(), false); for (unsigned int k=0; k flags (tr.n_active_cells(), false); { - const unsigned int x = myrand() % flags.size(); + const unsigned int x = Testing::rand() % flags.size(); deallog << "Refining cell " << x << std::endl; flags[x] = true; } diff --git a/tests/distributed_grids/2d_refinement_03.cc b/tests/distributed_grids/2d_refinement_03.cc index e9b78a1912..b4079a2621 100644 --- a/tests/distributed_grids/2d_refinement_03.cc +++ b/tests/distributed_grids/2d_refinement_03.cc @@ -83,7 +83,7 @@ void test(std::ostream & /*out*/) { std::vector flags (tr.n_active_cells()); for (unsigned int j=0; j > intergrid_map; intergrid_map.make_mapping (tr, tr2); diff --git a/tests/distributed_grids/2d_refinement_05.cc b/tests/distributed_grids/2d_refinement_05.cc index 83a8ad1f1a..5c1ac4d15a 100644 --- a/tests/distributed_grids/2d_refinement_05.cc +++ b/tests/distributed_grids/2d_refinement_05.cc @@ -61,7 +61,7 @@ void test(std::ostream & /*out*/) // time (but at least one) for (unsigned int i=0; i flags (tr.n_active_cells(), false); for (unsigned int k=0; k flags (tr.n_active_cells(), false); for (unsigned int k=0; k flags (tr.n_active_cells(), false); for (unsigned int k=0; k flags (tr.n_active_cells(), false); { - const unsigned int x = myrand() % flags.size(); + const unsigned int x = Testing::rand() % flags.size(); deallog << "Refining cell " << x << std::endl; flags[x] = true; } diff --git a/tests/distributed_grids/3d_refinement_03.cc b/tests/distributed_grids/3d_refinement_03.cc index 2b41275641..a38f8d9925 100644 --- a/tests/distributed_grids/3d_refinement_03.cc +++ b/tests/distributed_grids/3d_refinement_03.cc @@ -63,7 +63,7 @@ void test(std::ostream & /*out*/) { std::vector flags (tr.n_active_cells()); for (unsigned int j=0; j > intergrid_map; intergrid_map.make_mapping (tr, tr2); diff --git a/tests/distributed_grids/3d_refinement_05.cc b/tests/distributed_grids/3d_refinement_05.cc index 03b7552abb..c8536fd96d 100644 --- a/tests/distributed_grids/3d_refinement_05.cc +++ b/tests/distributed_grids/3d_refinement_05.cc @@ -62,7 +62,7 @@ void test(std::ostream & /*out*/) // time (but at least one) for (unsigned int i=0; i flags (triangulation.n_active_cells(), false); for (unsigned int k=0; k flags (triangulation.n_active_cells(), false); for (unsigned int k=0; khas_children() && !(myrand() % 3)) + if (cell->has_children() && !(Testing::rand() % 3)) for (unsigned int c=0; c::max_children_per_cell; ++c) if (!cell->child(c)->has_children()) cell->child(c)->set_coarsen_flag(); @@ -94,7 +94,7 @@ void test(std::ostream & /*out*/) cell = tr.begin_active(); cell != tr.end(); ++cell) { - if (!(myrand() % 3)) + if (!(Testing::rand() % 3)) { cell->clear_coarsen_flag(); cell->set_refine_flag(); diff --git a/tests/fail/abf_approximation_01.cc b/tests/fail/abf_approximation_01.cc index d98354cfcb..6419a1bc72 100644 --- a/tests/fail/abf_approximation_01.cc +++ b/tests/fail/abf_approximation_01.cc @@ -293,7 +293,7 @@ public: { for (unsigned int i=0; i < deg; ++i) { - double c = ((double) myrand()) / ((double) RAND_MAX + 1); + double c = ((double) Testing::rand()) / ((double) RAND_MAX + 1); coeff[i] = c; } polys.push_back (Polynomials::Polynomial (coeff)); @@ -518,7 +518,7 @@ int main () // Try arbitrary deformation ... for (unsigned int i=0; i < deformation.size (); ++i) { - double c = ((double) myrand()) / ((double) RAND_MAX + 1); + double c = ((double) Testing::rand()) / ((double) RAND_MAX + 1); deformation (i) = 0.35 * (c - 0.5); } diff --git a/tests/fail/hp-step-15.cc b/tests/fail/hp-step-15.cc index 6d050878a8..a76e365331 100644 --- a/tests/fail/hp-step-15.cc +++ b/tests/fail/hp-step-15.cc @@ -86,7 +86,7 @@ double InitializationValues::value (const Point<1> &p, const unsigned int) const { const double base = std::pow(p(0), 1./3.); - const double random = 2.*myrand()/RAND_MAX-1; + const double random = 2.*Testing::rand()/RAND_MAX-1; return std::max (base+.1*random, 0.); } diff --git a/tests/fail/vectors_boundary_rhs_hp_02.cc b/tests/fail/vectors_boundary_rhs_hp_02.cc index 590e3b7197..8dc62a8b24 100644 --- a/tests/fail/vectors_boundary_rhs_hp_02.cc +++ b/tests/fail/vectors_boundary_rhs_hp_02.cc @@ -91,7 +91,7 @@ check () hp::DoFHandler dof(tr); for (typename hp::DoFHandler::active_cell_iterator cell = dof.begin_active(); cell!=dof.end(); ++cell) - cell->set_active_fe_index (myrand() % element.size()); + cell->set_active_fe_index (Testing::rand() % element.size()); dof.distribute_dofs(element); diff --git a/tests/fail/vectors_rhs_hp_02.cc b/tests/fail/vectors_rhs_hp_02.cc index 577b2870ff..71712cddc5 100644 --- a/tests/fail/vectors_rhs_hp_02.cc +++ b/tests/fail/vectors_rhs_hp_02.cc @@ -91,7 +91,7 @@ check () hp::DoFHandler dof(tr); for (typename hp::DoFHandler::active_cell_iterator cell = dof.begin_active(); cell!=dof.end(); ++cell) - cell->set_active_fe_index (myrand() % element.size()); + cell->set_active_fe_index (Testing::rand() % element.size()); dof.distribute_dofs(element); diff --git a/tests/fe/rt_8.cc b/tests/fe/rt_8.cc index a4526be072..fa2c573579 100644 --- a/tests/fe/rt_8.cc +++ b/tests/fe/rt_8.cc @@ -87,7 +87,7 @@ test (const unsigned int degree) Vector tmp1(dofs_per_cell), tmp2(dofs_per_cell); for (unsigned int i=0; i