#undef __PRETTY_FUNCTION__
-
+/**
+ * Have a namespace into which we declare some numeric constants, such
+ * as pi. Unfortunately, these are not always available, on all systems
+ * or depending on compiler flags, so we duplicate their declarations
+ * here to make them unconditionally available to all other parts of the
+ * library.
+ *
+ * The constants defined here are a subset of the constants sometimes
+ * declared in the system include file , but without the
+ * prefix .
+ */
+namespace deal_II_numbers {
+ /**
+ * e
+ */
+ static const double E = 2.7182818284590452354;
+
+ /**
+ * log_2 e
+ */
+ static const double LOG2E = 1.4426950408889634074;
+
+ /**
+ * log_10 e
+ */
+ static const double LOG10E = 0.43429448190325182765;
+
+ /**
+ * log_e 2
+ */
+ static const double LN2 = 0.69314718055994530942;
+
+ /**
+ * log_e 10
+ */
+ static const double LN10 = 2.30258509299404568402;
+
+ /**
+ * pi
+ */
+ static const double PI = 3.14159265358979323846;
+
+ /**
+ * pi/2
+ */
+ static const double PI_2 = 1.57079632679489661923;
+
+ /**
+ * pi/4
+ */
+ static const double PI_4 = 0.78539816339744830962;
+
+ /**
+ * sqrt(2)
+ */
+ static const double SQRT2 = 1.41421356237309504880;
+
+ /**
+ * 1/sqrt(2)
+ */
+ static const double SQRT1_2 = 0.70710678118654752440;
+};
#endif
// the height field, I don't know
// it.
EpsCell2d eps_cell;
-//TODO:[?] Unify the various places where PI is defined to a central instance
- const double pi = 3.141592653589793238462;
+ const double pi = deal_II_numbers::PI;
const double cx = -std::cos(pi-flags.azimut_angle * 2*pi / 360.),
cz = -std::cos(flags.turn_angle * 2*pi / 360.),
sx = std::sin(pi-flags.azimut_angle * 2*pi / 360.),
#include <cmath>
-// in strict ANSI C mode, the following constants are not defined by
-// default, so we do it ourselves
-//TODO:[?] Unify the various places where PI is defined to a central instance
-#ifndef M_PI
-# define M_PI 3.14159265358979323846
-#endif
-
-#ifndef M_PI_2
-# define M_PI_2 1.57079632679489661923
-#endif
-
-#ifndef M_E
-# define M_E 2.7182818284590452354
-#endif
namespace Functions
{
if (d>=r)
return 0.;
const double e = -r*r/(r*r-d*d);
- return ((e<-50) ? 0. : M_E * exp(e));
+ return ((e<-50) ? 0. : deal_II_numbers::E * exp(e));
}
return 0.;
}
values[i] = 0.;
} else {
const double e = -r*r/(r*r-d*d);
- values[i] = (e<-50) ? 0. : M_E * exp(e);
+ values[i] = (e<-50) ? 0. : deal_II_numbers::E * exp(e);
}
}
else
{
e = -r*r/(r*r-d*d);
if (e>-50)
- val = M_E * exp(e);
+ val = deal_II_numbers::E * exp(e);
}
if (this->selected==CutOffFunctionBase<dim>::no_component)
#! /bin/sh
-# From configure.in Revision: 1.119 .
+# From configure.in Revision: 1.120 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.53a.
#
AH_BOTTOM(
[
-
+/**
+ * Have a namespace into which we declare some numeric constants, such
+ * as pi. Unfortunately, these are not always available, on all systems
+ * or depending on compiler flags, so we duplicate their declarations
+ * here to make them unconditionally available to all other parts of the
+ * library.
+ *
+ * The constants defined here are a subset of the @p{M_XXX} constants sometimes
+ * declared in the system include file @p{math.h}, but without the
+ * prefix @p{M_}.
+ */
+namespace deal_II_numbers {
+ /**
+ * e
+ */
+ static const double E = 2.7182818284590452354;
+
+ /**
+ * log_2 e
+ */
+ static const double LOG2E = 1.4426950408889634074;
+
+ /**
+ * log_10 e
+ */
+ static const double LOG10E = 0.43429448190325182765;
+
+ /**
+ * log_e 2
+ */
+ static const double LN2 = 0.69314718055994530942;
+
+ /**
+ * log_e 10
+ */
+ static const double LN10 = 2.30258509299404568402;
+
+ /**
+ * pi
+ */
+ static const double PI = 3.14159265358979323846;
+
+ /**
+ * pi/2
+ */
+ static const double PI_2 = 1.57079632679489661923;
+
+ /**
+ * pi/4
+ */
+ static const double PI_4 = 0.78539816339744830962;
+
+ /**
+ * sqrt(2)
+ */
+ static const double SQRT2 = 1.41421356237309504880;
+
+ /**
+ * 1/sqrt(2)
+ */
+ static const double SQRT1_2 = 0.70710678118654752440;
+};
#endif
])
Assert ((inner_radius > 0) && (inner_radius < outer_radius),
ExcInvalidRadii ());
-//TODO:[?] Unify the various places where PI is defined to a central instance
- const double pi = 3.141592653589793238462;
+ const double pi = deal_II_numbers::PI;
// determine the number of cells
// for the grid. if not provided by
Assert ((inner_radius > 0) && (inner_radius < outer_radius),
ExcInvalidRadii ());
- const double pi = 3.14159265359;
+ const double pi = deal_II_numbers::PI;
// determine the number of cells
// for the grid. if not provided by
// the user determine it such that
// 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 pi = deal_II_numbers::PI;
const double z_angle = eps_flags_3.azimut_angle;
const double turn_angle = eps_flags_3.turn_angle;
const Point<dim> view_direction(-std::sin(z_angle * 2.*pi / 360.) * std::sin(turn_angle * 2.*pi / 360.),
// place. for simplicity add the
// initial direction at the end
// again
-//TODO:[?] Unify the various places where PI is defined to a central instance
- const double pi = 3.141592653589793238462;
std::vector<Point<dim+1> > angle_directions (n_patches_per_circle+1);
for (unsigned int i=0; i<=n_patches_per_circle; ++i)
{
- angle_directions[i][0] = std::cos(2*pi*i/n_patches_per_circle);
- angle_directions[i][1] = std::sin(2*pi*i/n_patches_per_circle);
+ angle_directions[i][0] = std::cos(2*deal_II_numbers::PI *
+ i/n_patches_per_circle);
+ angle_directions[i][1] = std::sin(2*deal_II_numbers::PI *
+ i/n_patches_per_circle);
};
unsigned int cell_number = 0;
- typename std::vector< ::DataOutBase::Patch<dim+1> >::iterator patch = this->patches.begin();
+ typename std::vector< ::DataOutBase::Patch<dim+1> >::iterator
+ patch = this->patches.begin();
typename DoFHandler<dim>::cell_iterator cell=first_cell();
// get first cell in this thread
*/
-//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
{
const double theta = std::acos(XX) / 3.;
EE[0] = am + R*std::cos(theta);
- EE[1] = am + R*std::cos(theta + 2./3.*pi);
- EE[2] = am + R*std::cos(theta + 4./3.*pi);
+ EE[1] = am + R*std::cos(theta + 2./3.*deal_II_numbers::PI);
+ EE[2] = am + R*std::cos(theta + 4./3.*deal_II_numbers::PI);
};
};