Compute an X x Y x Z grid to have 'num' grid cells, only gives a nice grid for numbers with even factors since we don't search for factors of the number, we just try dividing by two
| 159 | // only gives a nice grid for numbers with even factors since |
| 160 | // we don't search for factors of the number, we just try dividing by two |
| 161 | vec3i computeGrid(int num) |
| 162 | { |
| 163 | vec3i grid(1); |
| 164 | int axis = 0; |
| 165 | int divisor = 0; |
| 166 | while (computeDivisor(num, divisor)) { |
| 167 | grid[axis] *= divisor; |
| 168 | num /= divisor; |
| 169 | axis = (axis + 1) % 3; |
| 170 | } |
| 171 | if (num != 1) { |
| 172 | grid[axis] *= num; |
| 173 | } |
| 174 | return grid; |
| 175 | } |
| 176 | |
| 177 | cpp::Instance makeLocalSpheres( |
| 178 | const int mpiRank, const int mpiWorldSize, box3f &bounds) |
no test coverage detected