Why do you re-compute dF in the for-loop rather than using the already computed dF?
I tried to change some code according to algorithm 2 in SIGGRAPH 2012 FEM Course based on your code. The simulation still works.
for n in range(4):
for dim in range(self.dim):
for i in ti.static(range(self.dim)):
for j in ti.static(range(self.dim)):
dF = self.dF[e,n,dim]
dF_T = dF.transpose()
dTr = (F_1 @ dF).trace()
dP_dFij = self.mu * dF + (self.mu - self.la * ti.log(J)) * F_1_T @ dF_T @ F_1_T + self.la * dTr * F_1_T
self.dP[e, n, dim] += dP_dFij
When computing
dP(F:\delta F)
, there are some differences between your implementation and the SIGGRAPH 2012 FEM Course https://github.com/YuCrazing/Taichi/blob/a8df2239e359550bd63ec3320a6a7a9b39524fa5/fem_3d_imp/fem-3d-implicit.py#L263Why do you re-compute dF in the for-loop rather than using the already computed dF?
I tried to change some code according to algorithm 2 in SIGGRAPH 2012 FEM Course based on your code. The simulation still works.