dilevin / CSC417-a3-finite-elements-3d

The finite element method for 3D elastic objects
51 stars 13 forks source link

Question regarding d2V_linear_tetrahedron_dq2.cpp #14

Open LeoGuo98 opened 4 years ago

LeoGuo98 commented 4 years ago

I am not sure about the purpose of line 18 to line 29 in this file. Should I remove them after implementing neohookean_linear_tet?

dilevin commented 4 years ago

Definitely don’t remove them !!! They ensure that the hessian is symmetric positive definite which ensures the method converges :)

suiyoubi commented 4 years ago

Definitely don’t remove them !!! They ensure that the hessian is symmetric positive definite which ensures the method converges :)

Could you please elaborate on this? I couldn't understand what the code is doing .. Also, why the hessian we computed by using B^T d2psi B is not symmetric positive definite?

The comment says that: "need to change size for hex", but do we really need to change anything for these lines?

dilevin commented 4 years ago

I added some additional comments to the source code to help out but here's some additional description:

The Hessian will be symmetric but not necessarily positive definite (positive definite means that x'Hx > 0 for any x). Newton's method will only converge if the hessian is positive definite and so, to enforce this, we project any small or negative eigenvalues of the Hessian to small positive values. You can show that this won't effect the answer to which the optimization converges (so Newton's method with this perturbed Hessian still minimizes the same optimization problem).

suiyoubi commented 4 years ago

I added some additional comments to the source code to help out but here's some additional description:

The Hessian will be symmetric but not necessarily positive definite (positive definite means that x'Hx > 0 for any x). Newton's method will only converge if the hessian is positive definite and so, to enforce this, we project any small or negative eigenvalues of the Hessian to small positive values. You can show that this won't effect the answer to which the optimization converges (so Newton's method with this perturbed Hessian still minimizes the same optimization problem).

Thanks for the detailed clarification!