From 28ee015f60777b716e1c8f8d746c0e3370c78498 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Wed, 4 Nov 2020 08:44:16 -0500 Subject: [PATCH] step-7: mark some ints as doubles --- examples/step-7/step-7.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/step-7/step-7.cc b/examples/step-7/step-7.cc index 14e0b40630..91628c7b47 100644 --- a/examples/step-7/step-7.cc +++ b/examples/step-7/step-7.cc @@ -254,7 +254,7 @@ namespace Step7 // add up multiples of this distance vector, where the factor is given // by the exponentials. return_value += - (-2 / (this->width * this->width) * + (-2. / (this->width * this->width) * std::exp(-x_minus_xi.norm_square() / (this->width * this->width)) * x_minus_xi); } @@ -293,8 +293,8 @@ namespace Step7 // The first contribution is the Laplacian: return_value += - ((2 * dim - - 4 * x_minus_xi.norm_square() / (this->width * this->width)) / + ((2. * dim - + 4. * x_minus_xi.norm_square() / (this->width * this->width)) / (this->width * this->width) * std::exp(-x_minus_xi.norm_square() / (this->width * this->width))); // And the second is the solution itself: @@ -967,15 +967,15 @@ namespace Step7 { if (cycle == 0) { - GridGenerator::hyper_cube(triangulation, -1, 1); + GridGenerator::hyper_cube(triangulation, -1., 1.); triangulation.refine_global(3); for (const auto &cell : triangulation.cell_iterators()) for (const auto &face : cell->face_iterators()) { const auto center = face->center(); - if ((std::fabs(center(0) - (-1)) < 1e-12) || - (std::fabs(center(1) - (-1)) < 1e-12)) + if ((std::fabs(center(0) - (-1.0)) < 1e-12) || + (std::fabs(center(1) - (-1.0)) < 1e-12)) face->set_boundary_id(1); } } -- 2.39.5