Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions genesis/engine/solvers/rigid/collider_decomp.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,7 @@ def func_contact_sphere_sdf(
i_b,
geoms_state: array_class.GeomsState,
geoms_info: array_class.GeomsInfo,
rigid_global_info: array_class.RigidGlobalInfo,
collider_static_config: ti.template(),
sdf_info: array_class.SDFInfo,
):
Expand Down
1 change: 1 addition & 0 deletions genesis/engine/solvers/rigid/constraint_noslip.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ def func_cost_change(

@ti.kernel(fastcache=gs.use_fastcache)
def compute_A_diag(
entities_info: array_class.EntitiesInfo,
rigid_global_info: array_class.RigidGlobalInfo,
constraint_state: array_class.ConstraintState,
static_rigid_sim_config: ti.template(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -995,9 +995,9 @@ def _func_update_gradient(self, island, i_b):
self.grad,
self.Mgrad,
array_class.PLACEHOLDER,
entities_info=entities_info,
rigid_global_info=rigid_global_info,
static_rigid_sim_config=static_rigid_sim_config,
entities_info=self.entities_info,
rigid_global_info=self._solver.data_manager.rigid_global_info,
static_rigid_sim_config=self._solver._static_rigid_sim_config,
is_backward=False,
)
for i_e in range(self._solver.n_entities):
Expand Down
2 changes: 1 addition & 1 deletion genesis/engine/solvers/sph_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ def _kernel_compute_DFSPH_factor(self, f: ti.i32):
ret = ti.Vector.zero(gs.ti_float, 4)

self.sh.for_all_neighbors(
i, self.particles_reordered.pos, self._support_radius, ret, self._task_compute_DFSPH_factor
i_p, self.particles_reordered.pos, self._support_radius, ret, self._task_compute_DFSPH_factor
)

sum_grad_p_k = ret[3]
Expand Down
12 changes: 6 additions & 6 deletions genesis/utils/geom.py
Original file line number Diff line number Diff line change
Expand Up @@ -1777,13 +1777,13 @@ def compute_reordered_idx(self, n, pos, active, reordered_idx):
self.slot_start[i_s, i_b] -= self.slot_size[i_s, i_b]

@ti.func
def for_all_neighbors(self, i, pos, task_range, ret: ti.template(), task: ti.template(), i_b):
def for_all_neighbors(self, i_p, pos, task_range, ret: ti.template(), task: ti.template(), i_b):
"""
Iterates over all neighbors of a given position and performs a task on each neighbor.
Elements are considered neighbors if they are within task_range.

Parameters:
i (int) : Index of the querying particle.
i_p (int) : Index of the querying particle.
pos : Template for the positions of all particles.
task : Template for the task to be performed on each neighbor of the querying particle.
task_range : Range within which the task should be performed.
Expand All @@ -1792,14 +1792,14 @@ def for_all_neighbors(self, i, pos, task_range, ret: ti.template(), task: ti.tem
Returns:
None
"""
base = self.pos_to_grid(pos[i, i_b])
base = self.pos_to_grid(pos[i_p, i_b])
for offset in ti.grouped(ti.ndrange((-1, 2), (-1, 2), (-1, 2))):
slot_idx = self.grid_to_slot(base + offset)
for j in range(
for j_p in range(
self.slot_start[slot_idx, i_b], self.slot_size[slot_idx, i_b] + self.slot_start[slot_idx, i_b]
):
if i != j and (pos[i, i_b] - pos[j, i_b]).norm() < task_range:
task(i, j, ret, i_b)
if i_p != j_p and (pos[i_p, i_b] - pos[j_p, i_b]).norm() < task_range:
task(i_p, j_p, ret, i_b)

@ti.func
def pos_to_grid(self, pos):
Expand Down