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

Vector diffusion in corners #167

Open
VaitkusM opened this issue Dec 10, 2023 · 1 comment
Open

Vector diffusion in corners #167

VaitkusM opened this issue Dec 10, 2023 · 1 comment

Comments

@VaitkusM
Copy link

VaitkusM commented Dec 10, 2023

While attempting to smooth out vector and line fields (actually Hopf differentials of a tessellated Bézier surface) with the vertex-based connection Laplacian, I repeatedly found outlying values in boundary corners - as can be seen on these pictures, where Q (in red) is the original line field, while Q (smoothed) (in blue) is the result of 1 step of implicit smoothing with the usual h^2 timestep:

image
image

As far as I an tell, I weight everything correctly with the Mass matrix.
It happens whether or not the corner has a single "flapping" triangle.
I have no boundary conditions (so I guess I implicitly prescribe zero Neumann).

What could be the cause of this phenomenon?

Edit: Tried switching lumped mass matrix to Galerkin, weak Laplacian to strong form, as well as various timesteps (smaller/bigger than h^2, and also keeping it to unity) - the corners (and to a lesser extent boundaries) always stand out...

Edit 2: Also tried the uniform weights in place of cotans with and without degree-based mass - the issue remains.
I suspect the problem might be the alignment of the vertex tangent basis vectors: they are everywhere aligned with an outgoing halfedge, except at such corners.
image

image

@VaitkusM
Copy link
Author

The source of the problem might be the scaling of corner scaled angles at boundary vertices in the IntrinsicGeometryInterface class, which (intrinsically) flattens out the corners:

// Corner scaled angles
void IntrinsicGeometryInterface::computeCornerScaledAngles() {
cornerAnglesQ.ensureHave();
vertexAngleSumsQ.ensureHave();
cornerScaledAngles = CornerData<double>(mesh);
for (Corner c : mesh.corners()) {
if (c.vertex().isBoundary()) {
double s = PI / vertexAngleSums[c.vertex()];
cornerScaledAngles[c] = s * cornerAngles[c];
} else {
double s = 2.0 * PI / vertexAngleSums[c.vertex()];
cornerScaledAngles[c] = s * cornerAngles[c];
}
}
}

Setting the scaling for boundary vertices to 1 seems to fix the vertex tangent basis, as well as the connection Laplacian at corners.

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

1 participant