-
-
Notifications
You must be signed in to change notification settings - Fork 88
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
Adaptive Mesh Smoothing #24
Comments
It's called I looked into this topic a couple of years ago. Here's a publication I remember which looked promising:
The crucial point to get a high quality graded mesh, is to weight the new point location by a density function (given a priori, or by a FEM error estimate, or some approximation of the boundary feature size). The current implementation of
|
Thanks a bunch! Both the article and the MATLAB implementation are illuminating. |
Hello Christian, You already linked this paper to my issue. The problem is that is difficult to translate. I've finally made a $40 donation for your help in this project. Hope you can find something easier to translate to C# or a sort of MatLab to C++ translator. Thanks. |
@timoria21 Thanks a bunch for your donation! |
I haven't seen any C# implementation. You can find some C code based on the paper on Ju's homepage, called MESHGEN. I remember thinking about integrating it into https://github.com/wo80/Triangle. I have to see what I did back then and if it's worth having a second look. In general, writing a high quality mesh generator like presented in the papers isn't trivial. The MATLAB code might still be a good starting point to get some inspiration, though direct porting will be difficult. |
Does anybody have access to this MatLab feature? https://www.mathworks.com/videos/automatically-converting-matlab-code-to-c-code-96483.html Having a C version of the code would be a good starting point. Did you try contacting the article author? Just to check if a C++ version of the smoother code is available. |
@timoria21 I don't have access to MATLAB at all, using Octave here. But in general, those automatic converters produce code that is really hard to look at. I've added density function support to the smoother using a simple triangle midpoint quadrature rule. Feel free to fetch the smoother branch and hack around. See example 12 for usage (in the picture below left with constant density, right with higher density around the inner squares): You can still see lower quality around the borders of the geometry, so I guess to achieve high quality, you'd have to come up with some clever extra handling of vertices near the boundary. |
Thanks @wo80, these results are far from optimal. It's difficult to imagine that in the year 2022 there are no open-source options for smoothing graded meshes. There are tons of papers online on the meshing subject. I'm really surprised. I hope that somebody else can provide some help here. |
@timoria21 I guess most FEM packages will have some kind of quality mesh generator. And you could always take a look at https://gmsh.info - there's a mesh optimizer in the |
Are we talking about the MeshOptimizer or the MeshQualityOptimizer here? |
|
So, anybody out there, wrote a graded mesh smoother for Triangle, not even for the C++ version? Hard to believe... |
Because it uses Lloyd's algorithm,
SimpleSmoother
tends to damage adaptive meshes (i.e. meshes with non-uniform element sizes) by "stretching out" smaller triangles towards the bigger ones. On the other hand, bigger triangles shrink a little in order to accommodate more space for the smaller ones.I feel like having at least one smoothing method preserving adaptiveness in meshes as they are smoothed would be nice. Unfortunately, I'm not very prepared on the topic.
The text was updated successfully, but these errors were encountered: