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
| 164 | // only gives a nice grid for numbers with even factors since |
| 165 | // we don't search for factors of the number, we just try dividing by two |
| 166 | vec3i computeGrid(int num) |
| 167 | { |
| 168 | vec3i grid(1); |
| 169 | int axis = 0; |
| 170 | int divisor = 0; |
| 171 | while (computeDivisor(num, divisor)) { |
| 172 | grid[axis] *= divisor; |
| 173 | num /= divisor; |
| 174 | axis = (axis + 1) % 3; |
| 175 | } |
| 176 | if (num != 1) { |
| 177 | grid[axis] *= num; |
| 178 | } |
| 179 | return grid; |
| 180 | } |
| 181 | |
| 182 | VolumeBrick makeLocalVolume(const int mpiRank, const int mpiWorldSize) |
| 183 | { |
no test coverage detected