good_mg_cell_nr

emg3d.meshes.good_mg_cell_nr(max_nr=1024, max_prime=5, min_div=3)[source]

Returns ‘good’ cell numbers for the multigrid method.

‘Good’ cell numbers are numbers which can be divided by 2 as many times as possible. At the end there will be a low prime number.

The function adds all numbers \(p 2^n \leq M\) for \(p={2, 3, ..., p_\text{max}}\) and \(n={n_\text{min}, n_\text{min}+1, ..., \infty}\); \(M, p_\text{max}, n_\text{min}\) correspond to max_nr, max_prime, and min_div, respectively.

Parameters:
max_nr : int, optional

Maximum number of cells. Default is 1024.

max_prime : int, optional

Highest permitted prime number p for p*2^n. {2, 3, 5, 7} are good upper limits in order to avoid too big lowest grids in the multigrid method. Default is 5.

min_div : int, optional

Minimum times the number can be divided by two. Default is 3.

Returns:
numbers : array

Array containing all possible cell numbers from lowest to highest.