Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions particle_filling/filling.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,20 +256,6 @@ def compute_particle_volume(
particle_vol[pi] = (grid_dx * grid_dx * grid_dx) / grid[i, j, k]


@ti.kernel
def assign_particle_to_grid(
pos: ti.template(),
grid: ti.template(),
grid_dx: float,
):
for pi in range(pos.shape[0]):
p = pos[pi]
i = ti.floor(p[0] / grid_dx, dtype=int)
j = ti.floor(p[1] / grid_dx, dtype=int)
k = ti.floor(p[2] / grid_dx, dtype=int)
ti.atomic_add(grid[i, j, k], 1)


def get_particle_volume(pos, grid_n: int, grid_dx: float, unifrom: bool = False):
ti_pos = ti.Vector.field(n=3, dtype=float, shape=pos.shape[0])
ti_pos.from_torch(pos.reshape(-1, 3))
Expand Down