Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
FantasyVR committed Oct 8, 2021
1 parent c5de737 commit 032c006
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/simulation/implicit_mass_spring.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ def compute_Jacobians(self):
l = dx.norm()
if l != 0.0:
l = 1.0 / l
self.Jx[i] = (I - self.rest_len[i] * l * (I - dxtdx * l**2)) * self.ks
self.Jx[i] = (I - self.rest_len[i] * l *
(I - dxtdx * l**2)) * self.ks
self.Jv[i] = self.kd * I

@ti.kernel
Expand Down Expand Up @@ -185,7 +186,7 @@ def assemble_D(self, D: ti.sparse_matrix_builder()):
def updatePosVel(self, h: ti.f32, dv: ti.ext_arr()):
for i in self.pos:
if self.invMass[i] != 0.0:
self.vel[i] += ti.Vector([dv[2*i], dv[2*i+1]])
self.vel[i] += ti.Vector([dv[2 * i], dv[2 * i + 1]])
self.pos[i] += h * self.vel[i]

def update(self, h):
Expand Down

0 comments on commit 032c006

Please sign in to comment.