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

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

A few curious lines of code in the stiffness matrix computation #4

Open qiongsiwu opened 5 years ago

qiongsiwu commented 5 years ago

After calling quadrature_single_point, the code constructs a solver, computes some eigenvalues and eigen vectors, and reassigns H.

What is this code doing? I am not sure where in the notes/lecture this was discussed. Help/pointers are appreciated!

https://github.com/dilevin/CSC2549-a3-finite-elements-3d/blob/98c2e373e8a5c779da31eb7106a2c40530a98fea/src/d2V_linear_tetrahedron_dq2.cpp#L17-L29

dilevin commented 5 years ago

We will talk about this general trick next class but this is ensuring that the hessian for Newton’s method is positive definite. This guarantees that the newton search direction is, locally, a descent direction and helps make the solver more robust.

Thanks for asking this, it’s a great question.

dilevin commented 5 years ago

As an aside, I wanted to provide the code for these little tricks since I figure everyone already has enough to implement in this class :) but I can add a comment to the source code to make it less opaque.