def add_density(x: ti.i32, y: ti.i32, r: ti.i32, value: ti.f32): for index in range((2 * r + 1) * (2 * r + 1)): i = index // (2 * r + 1) - r j = ti.mod(index, 2 * r + 1) - r den = density_pair.cur[x + i, y + j] + value * smooth_step( r * r, 0.0, i * i + j * j) density_pair.cur[x + i, y + j] = den
def __mod__(self, other): import taichi as ti return ti.mod(self, other)
def __imod__(self, other): import taichi as ti self.assign(ti.mod(self, other)) return self
def __rmod__(self, other): import taichi as ti return ti.mod(other, self)
def __rmod__(self, other): _taichi_skip_traceback = 1 return ti.mod(other, self)
def __imod__(self, other): _taichi_skip_traceback = 1 self.assign(ti.mod(self, other)) return self
def __rmod__(self, other): import taichi as ti _taichi_skip_traceback = 1 return ti.mod(other, self)