From 17d6a1380a0126d7015d592055fbb3cec9a2ef61 Mon Sep 17 00:00:00 2001 From: wolf Date: Thu, 12 Apr 2001 21:31:40 +0000 Subject: [PATCH] use the same value for PI in all places and add a comment to unify all these places into one central place. git-svn-id: https://svn.dealii.org/trunk@4456 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/source/data_out_base.cc | 3 ++- deal.II/deal.II/source/grid/grid_generator.cc | 3 ++- deal.II/deal.II/source/grid/grid_out.cc | 3 ++- deal.II/deal.II/source/numerics/data_out_rotation.cc | 3 ++- deal.II/deal.II/source/numerics/derivative_approximation.cc | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/deal.II/base/source/data_out_base.cc b/deal.II/base/source/data_out_base.cc index 4efcdc5cbd..a5bfe2405f 100644 --- a/deal.II/base/source/data_out_base.cc +++ b/deal.II/base/source/data_out_base.cc @@ -1231,7 +1231,8 @@ void DataOutBase::write_eps (const typename std::vector > &p // the height field, I don't know // it. EpsCell2d eps_cell; - const double pi = 3.1415926536; +//TODO:[?] Unify the various places where PI is defined to a central instance + const double pi = 3.141592653589793238462; const double cx = -cos(pi-flags.azimut_angle * 2*pi / 360.), cz = -cos(flags.turn_angle * 2*pi / 360.), sx = sin(pi-flags.azimut_angle * 2*pi / 360.), diff --git a/deal.II/deal.II/source/grid/grid_generator.cc b/deal.II/deal.II/source/grid/grid_generator.cc index 73b87fab77..d7bf33148a 100644 --- a/deal.II/deal.II/source/grid/grid_generator.cc +++ b/deal.II/deal.II/source/grid/grid_generator.cc @@ -311,7 +311,8 @@ void GridGenerator::hyper_shell<> (Triangulation<2> &tria, Assert ((inner_radius > 0) && (inner_radius < outer_radius), ExcInvalidRadii ()); - const double pi = 3.14159265358979323846; +//TODO:[?] Unify the various places where PI is defined to a central instance + const double pi = 3.141592653589793238462; // determine the number of cells // for the grid. if not provided by diff --git a/deal.II/deal.II/source/grid/grid_out.cc b/deal.II/deal.II/source/grid/grid_out.cc index 023d020e37..8de92ec918 100644 --- a/deal.II/deal.II/source/grid/grid_out.cc +++ b/deal.II/deal.II/source/grid/grid_out.cc @@ -679,9 +679,10 @@ void GridOut::write_eps (const Triangulation &tria, // is in direction of the viewer, but // I am too tired at present to fix // this +//TODO:[?] Unify the various places where PI is defined to a central instance + const double pi = 3.141592653589793238462; const double z_angle = eps_flags_3.azimut_angle; const double turn_angle = eps_flags_3.turn_angle; - const double pi = 3.1415926536; const Point view_direction(-sin(z_angle * 2.*pi / 360.) * sin(turn_angle * 2.*pi / 360.), +sin(z_angle * 2.*pi / 360.) * cos(turn_angle * 2.*pi / 360.), -cos(z_angle * 2.*pi / 360.)); diff --git a/deal.II/deal.II/source/numerics/data_out_rotation.cc b/deal.II/deal.II/source/numerics/data_out_rotation.cc index 4aa135e855..39081edcbd 100644 --- a/deal.II/deal.II/source/numerics/data_out_rotation.cc +++ b/deal.II/deal.II/source/numerics/data_out_rotation.cc @@ -67,7 +67,8 @@ void DataOutRotation::build_some_patches (Data data) // place. for simplicity add the // initial direction at the end // again - const double pi = 3.14159265358979323846; +//TODO:[?] Unify the various places where PI is defined to a central instance + const double pi = 3.141592653589793238462; std::vector > angle_directions (n_patches_per_circle+1); for (unsigned int i=0; i<=n_patches_per_circle; ++i) { diff --git a/deal.II/deal.II/source/numerics/derivative_approximation.cc b/deal.II/deal.II/source/numerics/derivative_approximation.cc index 439c5b09c7..053ad80c8d 100644 --- a/deal.II/deal.II/source/numerics/derivative_approximation.cc +++ b/deal.II/deal.II/source/numerics/derivative_approximation.cc @@ -275,7 +275,8 @@ C DEFINE A TEST MATRIX */ - const double pi = 3.141592653587932384; +//TODO:[?] Unify the various places where PI is defined to a central instance + const double pi = 3.141592653589793238462; const double am = trace(d) / 3.; // s := d - trace(d) I -- 2.39.5