dgp icon indicating copy to clipboard operation
dgp copied to clipboard

Zero-coefficients in Laplace-Beltrami matrix

Open alinachin opened this issue 7 years ago • 14 comments

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.)

alinachin avatar Dec 01 '16 03:12 alinachin

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.

taiya avatar Dec 01 '16 04:12 taiya

If you are using something like L=Laplacian::laplace_beltrami(mesh), you'll get a matrix with the value completely different from what you see in the function (no clue about this weird thing). That could cause the all-0 problem (but not sure if it's the same problem you met). My solution is using a temporary variable to get the matrix and then L equal to that variable.

On Wed, Nov 30, 2016 at 7:56 PM, Alina Chin [email protected] wrote:

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.)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ataiya/dgp/issues/29, or mute the thread https://github.com/notifications/unsubscribe-auth/AI3gFH2fd_dAKoZBNgEhi_a0sFq060Fcks5rDkWHgaJpZM4LA-lW .

xuzheng0927 avatar Dec 01 '16 06:12 xuzheng0927

@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.

alinachin avatar Dec 01 '16 12:12 alinachin

I haven't computed the trace of L, so no idea what it would be. But another thing I noticed is that I met some extremely big cotangent values and that can cause a very big trace as well. You may check that.

On Thu, Dec 1, 2016 at 4:21 AM, Alina Chin [email protected] wrote:

@xuzheng0927 https://github.com/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?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ataiya/dgp/issues/29#issuecomment-264160256, or mute the thread https://github.com/notifications/unsubscribe-auth/AI3gFCQfmAN9eed6I4YdypSp-GW0VRonks5rDruzgaJpZM4LA-lW .

xuzheng0927 avatar Dec 01 '16 17:12 xuzheng0927

@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();

alinachin avatar Dec 01 '16 23:12 alinachin

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

nlguillemot avatar Dec 02 '16 02:12 nlguillemot

@nlguillemot https://github.com/nlguillemot I haven't tried that. I've changed the code base quite a bit so it needs some time to check. I'll update when I get my new result.

On Thu, Dec 1, 2016 at 6:12 PM, Nicolas Guillemot [email protected] wrote:

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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ataiya/dgp/issues/29#issuecomment-264354929, or mute the thread https://github.com/notifications/unsubscribe-auth/AI3gFN8X1DQJGkdD20QzhFeNO0BzYbfRks5rD36dgaJpZM4LA-lW .

xuzheng0927 avatar Dec 02 '16 05:12 xuzheng0927

You could always make a Laplacian2 class to try it with, if you don't want to futz around with git checkouts and branches.

alinachin avatar Dec 02 '16 05:12 alinachin

@alinachin https://github.com/alinachin Got that, thanks.

On Thu, Dec 1, 2016 at 9:21 PM, Alina Chin [email protected] wrote:

You could always make a Laplacian2 class to try it with, if you don't want to futz around with git checkouts and branches.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ataiya/dgp/issues/29#issuecomment-264375985, or mute the thread https://github.com/notifications/unsubscribe-auth/AI3gFLcnPmqupCuiyTTHFldN9upaUZ1qks5rD6rEgaJpZM4LA-lW .

xuzheng0927 avatar Dec 02 '16 05:12 xuzheng0927

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...

xuzheng0927 avatar Dec 02 '16 05:12 xuzheng0927

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

alinachin avatar Dec 02 '16 07:12 alinachin

Yes.. my L_uk comes from the permuted L_no_area * area * L_no_area. If the algebra is ok, that might be some problems within my implementation.

On Thu, Dec 1, 2016 at 11:49 PM, Alina Chin [email protected] wrote:

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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ataiya/dgp/issues/29#issuecomment-264394200, or mute the thread https://github.com/notifications/unsubscribe-auth/AI3gFKoeJJSUBMMkR8z9aeYey5mVYRWgks5rD814gaJpZM4LA-lW .

xuzheng0927 avatar Dec 02 '16 16:12 xuzheng0927

You should double-check your algebra for the RHS. One issue is that L_uk already contains the left-multiplied Area.inv(); there's no need to do it again.

alinachin avatar Dec 02 '16 20:12 alinachin

@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.

xuzheng0927 avatar Dec 02 '16 22:12 xuzheng0927