From 4c7b9c7b7d85c9d41d50763bab08d251b4168d08 Mon Sep 17 00:00:00 2001 From: heister Date: Mon, 11 Nov 2013 18:27:45 +0000 Subject: [PATCH] tests: use deal.II constant for PI, might fix tests on cygwin git-svn-id: https://svn.dealii.org/trunk@31629 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/base/function_parser.cc | 2 +- tests/bits/find_cell_alt_7.cc | 2 +- tests/bits/parsed_function.cc | 2 +- tests/fe/rt_approximation_01.cc | 2 +- tests/multigrid/mg_output.cc | 2 +- tests/multigrid/mg_renumbered_01.cc | 2 +- tests/multigrid/mg_renumbered_02.cc | 2 +- tests/multigrid/mg_renumbered_03.cc | 2 +- tests/multigrid/step-16-02.cc | 3 ++- tests/multigrid/transfer_03.cc | 2 +- 10 files changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/base/function_parser.cc b/tests/base/function_parser.cc index 10c49aa7d7..c82bc72bf3 100644 --- a/tests/base/function_parser.cc +++ b/tests/base/function_parser.cc @@ -38,7 +38,7 @@ int main () // Define some constants that will be used by the function parser std::map constants; - constants["pi"] = M_PI; + constants["pi"] = numbers::PI; // Define the variables that will be used inside the expressions std::string variables = "x,y"; diff --git a/tests/bits/find_cell_alt_7.cc b/tests/bits/find_cell_alt_7.cc index d141bfff66..be2a769410 100644 --- a/tests/bits/find_cell_alt_7.cc +++ b/tests/bits/find_cell_alt_7.cc @@ -40,7 +40,7 @@ void check (Triangulation<2> &tria) // Test for a number of points, every ten degrees for (unsigned int i=0; i<200; i++) { - Point<2> p(std::sin((double)i/100.*M_PI), std::cos((double)i/100.*M_PI)); + Point<2> p(std::sin((double)i/100.*numbers::PI), std::cos((double)i/100.*PI)); p *= 1.-1e-8; std::pair::active_cell_iterator, Point<2> > cell diff --git a/tests/bits/parsed_function.cc b/tests/bits/parsed_function.cc index 647f052f92..4d17dd742c 100644 --- a/tests/bits/parsed_function.cc +++ b/tests/bits/parsed_function.cc @@ -82,7 +82,7 @@ void Test() double delta=0.; for (unsigned int di=0; di 1e-10) deallog << "p(" << di << "): " << vertices[j] << ", delta: " << delta << std::endl; diff --git a/tests/fe/rt_approximation_01.cc b/tests/fe/rt_approximation_01.cc index 8cd27d1632..04978dbc61 100644 --- a/tests/fe/rt_approximation_01.cc +++ b/tests/fe/rt_approximation_01.cc @@ -490,7 +490,7 @@ int main () MappingQ1Eulerian<2> mapping_euler (deformation, *dof_handler_def); // Try rotating the elements - for (double rotat = 0; rotat < 2 * M_PI; rotat += 0.25 * M_PI) + for (double rotat = 0; rotat < 2 * numbers::PI; rotat += 0.25 * numbers::PI) { // Rotate element VectorTools::project (*dof_handler_def, hn_constraints_def, diff --git a/tests/multigrid/mg_output.cc b/tests/multigrid/mg_output.cc index 39c5e72e06..c82d8560e2 100644 --- a/tests/multigrid/mg_output.cc +++ b/tests/multigrid/mg_output.cc @@ -81,7 +81,7 @@ void refine_mesh (Triangulation &triangulation) Point(0,0) : Point(0,0,0)); const double dist = p.distance(origin); - if (dist<0.25/M_PI) + if (dist<0.25/numbers::PI) { cell->set_refine_flag (); cell_refined = true; diff --git a/tests/multigrid/mg_renumbered_01.cc b/tests/multigrid/mg_renumbered_01.cc index d860d13c06..e906286c7b 100644 --- a/tests/multigrid/mg_renumbered_01.cc +++ b/tests/multigrid/mg_renumbered_01.cc @@ -439,7 +439,7 @@ void LaplaceProblem::refine_local () Point(0,0) : Point(0,0,0)); const double dist = p.distance(origin); - if (dist<0.25/M_PI) + if (dist<0.25/numbers::PI) { cell->set_refine_flag (); cell_refined = true; diff --git a/tests/multigrid/mg_renumbered_02.cc b/tests/multigrid/mg_renumbered_02.cc index fda0e5a06b..2a95e8ab48 100644 --- a/tests/multigrid/mg_renumbered_02.cc +++ b/tests/multigrid/mg_renumbered_02.cc @@ -317,7 +317,7 @@ void LaplaceProblem::refine_local () Point(0,0) : Point(0,0,0)); const double dist = p.distance(origin); - if (dist<0.25/M_PI) + if (dist<0.25/numbers::PI) { cell->set_refine_flag (); cell_refined = true; diff --git a/tests/multigrid/mg_renumbered_03.cc b/tests/multigrid/mg_renumbered_03.cc index 9bcb1b87fc..007066aecb 100644 --- a/tests/multigrid/mg_renumbered_03.cc +++ b/tests/multigrid/mg_renumbered_03.cc @@ -385,7 +385,7 @@ void LaplaceProblem::refine_local () Point(0,0) : Point(0,0,0)); const double dist = p.distance(origin); - if (dist<0.25/M_PI) + if (dist<0.25/numbers::PI) { cell->set_refine_flag (); cell_refined = true; diff --git a/tests/multigrid/step-16-02.cc b/tests/multigrid/step-16-02.cc index 66a9e22e6c..60e181bcf9 100644 --- a/tests/multigrid/step-16-02.cc +++ b/tests/multigrid/step-16-02.cc @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -519,7 +520,7 @@ void LaplaceProblem::refine_grid (const std::string& reftype) Point(0,0) : Point(0,0,0)); const double dist = p.distance(origin); - if(dist<0.25/M_PI) + if(dist<0.25/numbers::PI) { cell->set_refine_flag (); cell_refined = true; diff --git a/tests/multigrid/transfer_03.cc b/tests/multigrid/transfer_03.cc index c7c0f700a5..c5bd165476 100644 --- a/tests/multigrid/transfer_03.cc +++ b/tests/multigrid/transfer_03.cc @@ -80,7 +80,7 @@ void refine_mesh (Triangulation &triangulation) Point(0,0) : Point(0,0,0)); const double dist = p.distance(origin); - if (dist<0.25/M_PI) + if (dist<0.25/numbers::PI) { cell->set_refine_flag (); cell_refined = true; -- 2.39.5