unsigned int n_samples_inside = 0;
const unsigned int n_samples = 200000;
- std::uniform_real_distribution<> uniform_distribution(-1., 1.);
- std::mt19937 rng;
-
for (unsigned int n = 0; n < n_samples; ++n)
{
// Choose a random point in the box [-1,1]^d that contains all
// of our reference cells:
Point<dim> p;
for (unsigned int d = 0; d < dim; ++d)
- p[d] = uniform_distribution(rng);
+ p[d] = random_value<double>(-1, 1);
if (reference_cell.contains_point(p))
++n_samples_inside;
DEAL:1D::ReferenceCell: Line
DEAL:1D:: self-reported volume = 1.00000
-DEAL:1D:: computed approximate volume = 1.00091
+DEAL:1D:: computed approximate volume = 1.00076
DEAL:2D::ReferenceCell: Quad
DEAL:2D:: self-reported volume = 1.00000
-DEAL:2D:: computed approximate volume = 0.998800
+DEAL:2D:: computed approximate volume = 1.00358
DEAL:2D::ReferenceCell: Tri
DEAL:2D:: self-reported volume = 0.500000
-DEAL:2D:: computed approximate volume = 0.498940
+DEAL:2D:: computed approximate volume = 0.497740
DEAL:3D::ReferenceCell: Tet
DEAL:3D:: self-reported volume = 0.166667
-DEAL:3D:: computed approximate volume = 0.166560
+DEAL:3D:: computed approximate volume = 0.169240
DEAL:3D::ReferenceCell: Pyramid
DEAL:3D:: self-reported volume = 1.33333
-DEAL:3D:: computed approximate volume = 1.33892
+DEAL:3D:: computed approximate volume = 1.34152
DEAL:3D::ReferenceCell: Wedge
DEAL:3D:: self-reported volume = 0.500000
-DEAL:3D:: computed approximate volume = 0.496800
+DEAL:3D:: computed approximate volume = 0.499080
DEAL:3D::ReferenceCell: Hex
DEAL:3D:: self-reported volume = 1.00000
-DEAL:3D:: computed approximate volume = 0.994000
+DEAL:3D:: computed approximate volume = 1.00820