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