Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zero-coefficients in Laplace-Beltrami matrix #29

Open
alinachin opened this issue Dec 1, 2016 · 14 comments
Open

Zero-coefficients in Laplace-Beltrami matrix #29

alinachin opened this issue Dec 1, 2016 · 14 comments

Comments

@alinachin
Copy link

I can't get the bi-Laplacian to work in part 1 with the Laplace-Beltrami matrix. (Queried whether the solver successfully factorized the matrix using solver.info(); also printed out some coefficients which were all 0.) Is this because the test meshes are both planar?

Should I test part 1 on a different mesh, or is it okay to just use the graph Laplacian for part 1?

And I haven't started coding part 2, but it seems I might run into the same problem with the bi-Laplacian when smoothing the mesh?

(I don't think it has to do with L being non-symmetric (L = DM) and my D^-1 matrix looks fine.)

@taiya
Copy link
Owner

taiya commented Dec 1, 2016

Hi Alina, yes the matrix M (cotangent coefficients, not areas/mass matrix) are shared between all exercises. On a relatively uniform mesh the graph Laplacian will work. Please see @nlguillemot if you still have trouble, I'll be away next week.

@xuzheng0927
Copy link

xuzheng0927 commented Dec 1, 2016 via email

@alinachin
Copy link
Author

alinachin commented Dec 1, 2016

@xuzheng0927 I am assigning to L directly, but I don't think I'm having that problem. I'm getting a trace of -2.91481e+07 (L.diagonal().sum()) for the woody mesh, so it's not all zeroes. Is that the same in yours?

edit to clarify: The Laplace-Beltrami I get for the quad is all zeroes, but not for the woody mesh. Regardless, I still can't factorize either matrix with D^-1*L or D^-1*L*L.

@xuzheng0927
Copy link

xuzheng0927 commented Dec 1, 2016 via email

@alinachin
Copy link
Author

@nlguillemot I got the Laplacian-Beltrami working for both meshes! The key issue was two of the vectors, d_ib and d_ia, were flipped.

Changes I made:

line 42:

Point p_i, p_j, p_b, p_a, d_bi, d_ai, d_aj, d_bj, d_ij;

line 75:

d_bi = p_i - p_b;
d_ai = p_i - p_a;
d_aj = p_j - p_a;
d_bj = p_j - p_b;
d_ij = p_j - p_i;

cotanAlpha = d_ai.dot(d_aj) / d_ai.cross(d_aj).norm();
cotanBeta = d_bi.dot(d_bj) / d_bi.cross(d_bj).norm();

line 92:

area += (1 / 6.0f) * (d_ai.cross(d_aj)).norm();

@nlguillemot
Copy link
Collaborator

@alinachin That's awesome! Thank you for sharing. @xuzheng0927 , do these changes help with the problems you encountered?

@xuzheng0927
Copy link

xuzheng0927 commented Dec 2, 2016 via email

@alinachin
Copy link
Author

alinachin commented Dec 2, 2016 via email

@xuzheng0927
Copy link

xuzheng0927 commented Dec 2, 2016 via email

@xuzheng0927
Copy link

Still getting bad result on woody.obj. I have no clue. I used L_uu of the permuted (L_no_area * area * L_no_area) in Cholesky solver, and the RHS is area_uu.inv() * L_uk * v_k.

Maybe my algebra is not correct. I'll give a couple of tries later...

@alinachin
Copy link
Author

Um... does your L_uk also come from the permuted (L_no_area * area * L_no_area)?

@xuzheng0927
Copy link

xuzheng0927 commented Dec 2, 2016 via email

@alinachin
Copy link
Author

alinachin commented Dec 2, 2016 via email

@xuzheng0927
Copy link

@alinachin You are right, there shouldn't be Area.inv() multiplied to L_uk again. It's weird that I have to use one of my former versions of Laplacian.h to get it worked (I was getting weird results using yours). Anyway thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants