dilevin / CSC417-a4-cloth-simulation

Cloth simulation using co-rotational linear elasticity
54 stars 15 forks source link

usage of dsvd #9

Open wenzhengchen opened 5 years ago

wenzhengchen commented 5 years ago

In the dsvd.h, it says:

//Input: // F - this function computes the gradient of svd(F), where F is a 3x3 matrix. //Output (for the definition of the tensorial types, see EigenTypes.h): // dU - the 3x3x3x3 derivative of U wrt to F. dU[x][y][i][j] contains the derivative of U[x][y] wrt to F[i][j] // dV - the 3x3x3x3 derivative of U wrt to F. dV[x][y][i][j] contains the derivative of V[x][y] wrt to F[i][j] // dS - the 3x3x3 derivative of the singular values wrt to F. dS[x][i][j] contains the derivative of the x^{th} singlar value wrt to F[i][j]

Does it mean: 1) dU/dFij = dU[i][j] ? 2) dpsi2 / dF2 = first term + second term + U S (dV/dFij)T so for the last term, first we get dV/dFij, then simply transpose it and multiply U * S with it?

Thank you!

dilevin commented 5 years ago

sorry for the slow reply, I've updated the documentation so it's clear how to access the resulting tensors.

For my code, dU[i][j] produces the matrix dU/dF_ij