@ti.func
def periodic_index2(vct_loc):
loc_out = vct_loc
if vct_loc[0]<0: loc_out[0] = lx-1
if vct_loc[0]>lx-1: loc_out[0] = 0
if vct_loc[1]<0: loc_out[1] = ly-1
if vct_loc[1]>ly-1: loc_out[1] = 0
if vct_loc[2]<0: loc_out[2] = lz-1
if vct_loc[2]>lz-1: loc_out[2] = 0
return loc_out[0],loc_out[1],loc_out[2]
The simulation crushes after tens of steps. In one specific step, the f_r_1 get a large value which does not come from f_r (same for f_b), where the error generates the first time.
It looks like an overflow error, while it does not happen in the initial several steps. Could you please help me with any suggestions? Thank you ahead.
Hello,
In this Kernel, particles from neighbor lattices stream towards the local lattice:
With all fields defined in sparse structure:
Also the function:
The simulation crushes after tens of steps. In one specific step, the f_r_1 get a large value which does not come from f_r (same for f_b), where the error generates the first time.
It looks like an overflow error, while it does not happen in the initial several steps. Could you please help me with any suggestions? Thank you ahead.