- Thank you received: 6
Question on remeshing (OptimizeMesh2d)
- Guosheng Fu
-
Topic Author
- Offline
- Elite Member
-
Less
More
5 years 7 months ago #2273
by Guosheng Fu
Question on remeshing (OptimizeMesh2d) was created by Guosheng Fu
Hello,
I am working on ALE solver for two-phase flow. So I need to remesh when the mesh quality became low.
I found in Michael's particle_remesh.py file ( at ngsolve.org/user-meeting2019/ ) a procedure to remesh an affine mesh, which involves two steps:
(1) copy mesh and move points
(2) copy mesh and optimize it using OptimizeMesh2d
I have two questions regarding these steps:
(1) How to manually copy a higher order curved mesh with deformation to a high-order temporary mesh?
(2) What does OptimizeMesh2d do internally? Can it generate curved mesh? I also found it sometimes generates invalid mesh (with an extra node), see this one:
[attachment=undefined]mesh.png[/attachment]
Attached is the code that generate this invalid mesh.
Thanks in advance! Best,
Guosheng
I am working on ALE solver for two-phase flow. So I need to remesh when the mesh quality became low.
I found in Michael's particle_remesh.py file ( at ngsolve.org/user-meeting2019/ ) a procedure to remesh an affine mesh, which involves two steps:
(1) copy mesh and move points
(2) copy mesh and optimize it using OptimizeMesh2d
I have two questions regarding these steps:
(1) How to manually copy a higher order curved mesh with deformation to a high-order temporary mesh?
(2) What does OptimizeMesh2d do internally? Can it generate curved mesh? I also found it sometimes generates invalid mesh (with an extra node), see this one:
[attachment=undefined]mesh.png[/attachment]
Attached is the code that generate this invalid mesh.
Thanks in advance! Best,
Guosheng
- Guosheng Fu
-
Topic Author
- Offline
- Elite Member
-
Less
More
- Thank you received: 6
5 years 7 months ago #2274
by Guosheng Fu
Replied by Guosheng Fu on topic Question on remeshing (OptimizeMesh2d)
Opps.... The code and the mesh.
- Guosheng Fu
-
Topic Author
- Offline
- Elite Member
-
Less
More
- Thank you received: 6
5 years 7 months ago #2275
by Guosheng Fu
Replied by Guosheng Fu on topic Question on remeshing (OptimizeMesh2d)
The code.........
Attachments:
5 years 7 months ago #2280
by joachim
Replied by joachim on topic Question on remeshing (OptimizeMesh2d)
Hi Guosheng,
the illegal meshes are fixed in the coming nightly, thanks for the report.
Arbitrary order curved meshes are treated differently than second-order curved meshes (obtained by mesh.SecondOrder), which use edge mid-points. For second-order your Python mesh manipulation could work.
Joachim
the illegal meshes are fixed in the coming nightly, thanks for the report.
Arbitrary order curved meshes are treated differently than second-order curved meshes (obtained by mesh.SecondOrder), which use edge mid-points. For second-order your Python mesh manipulation could work.
Joachim
- Guosheng Fu
-
Topic Author
- Offline
- Elite Member
-
Less
More
- Thank you received: 6
5 years 7 months ago #2283
by Guosheng Fu
Replied by Guosheng Fu on topic Question on remeshing (OptimizeMesh2d)
Hi Joachim,
Thanks for the quick fix.
Now I get a seg. fault when I want to optimize a second order mesh:
So, what is the underlining algorithm for OptimizeMesh2d? Can you give me a quick explanation or a reference to look into?
Best,
Guosheng
Thanks for the quick fix.
Now I get a seg. fault when I want to optimize a second order mesh:
Code:
tmpngmesh.SecondOrder()
...
tmpngmesh.OptimizeMesh2d()
So, what is the underlining algorithm for OptimizeMesh2d? Can you give me a quick explanation or a reference to look into?
Best,
Guosheng
5 years 7 months ago #2287
by matthiash
Replied by matthiash on topic Question on remeshing (OptimizeMesh2d)
Hi Guosheng,
There was a bug in 2d mesh optimization, which was only triggered on second-order curved meshes. It's fixed on the master branch since commit
github.com/NGSolve/netgen/commit/e26f0f3...8ec884618dba175ab953
Best,
Matthias
There was a bug in 2d mesh optimization, which was only triggered on second-order curved meshes. It's fixed on the master branch since commit
github.com/NGSolve/netgen/commit/e26f0f3...8ec884618dba175ab953
Best,
Matthias
Time to create page: 0.134 seconds