]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Clarify the intent of a piece of code. 3465/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 4 Nov 2016 20:31:09 +0000 (14:31 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 4 Nov 2016 20:31:09 +0000 (14:31 -0600)
The code uses integer division, followed by a double precision multiplication.
It is admittedly not immediately obvious what it is supposed to do. Clarify
that we really mean the integer division.

source/base/quadrature.cc

index 21bc38dc08f0bd79ed03bc5625a8cd40b0d1dcd8..2da3f1d76fcfbed63d9ae8d16ebc286b04b44298 100644 (file)
@@ -663,17 +663,17 @@ QProjector<3>::project_to_subface (const Quadrature<2>    &quadrature,
     {
     case RefinementCase<dim-1>::cut_x:
       xi_scale=0.5;
-      xi_translation=subface_no%2 * 0.5;
+      xi_translation = subface_no%2 * 0.5;
       break;
     case RefinementCase<dim-1>::cut_y:
       eta_scale=0.5;
-      eta_translation=subface_no%2 * 0.5;
+      eta_translation = subface_no%2 * 0.5;
       break;
     case RefinementCase<dim-1>::cut_xy:
       xi_scale= 0.5;
       eta_scale=0.5;
-      xi_translation =subface_no%2 * 0.5;
-      eta_translation=subface_no/2 * 0.5;
+      xi_translation  = int(subface_no%2) * 0.5;
+      eta_translation = int(subface_no/2) * 0.5;
       break;
     default:
       Assert(false,ExcInternalError());

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.