YuCrazing / Taichi

Taichi demos

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to compute the stiffness matrix K?

FantasyVR opened this issue · comments

When computing dP(F:\delta F) , there are some differences between your implementation and the SIGGRAPH 2012 FEM Course

self.dP[e, n, dim] += dP_dFij * dFij_ndim

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 

self.dF means dF/dx, and the second dF means dF/dF_{ij}.

And the meaning of my code is

png latex-2

You can check whether it is equivalent to your code. 🙂