Closed krober10nd closed 3 years ago
This pull request introduces 1 alert when merging b0238e94db981f4428985abcbfbb4e8817bf5a62 into 8e77d0538179c923013dc5d1f41257e8a2cc6916 - view on LGTM.com
new alerts:
Hey @nschloe I'm trying to implement the stretching for SDFs in both 2D (and 3D) following basically what you did here https://github.com/nschloe/dmsh/blob/main/dmsh/geometry/stretch.py
seems to work great in 2D, but in 3D it starts doing some strange stuff. Mesh sizes are altered (even though the mesh is supposed to be uniform) and quality is not good.
Any ideas what that may causing that?
I suspect it may be because the stretching distorts the element sizes and the projection back to the unstretched space to evaluate the SDF leads to poor quality triangles.
Any ideas or help would be greatly appreciated!
Are you stretching the geometry or the mesh?
Geometry.
Then mesh sizes should not me affected at all of course. The generator itself shouldn't know if if the geometry was created using a stretch or in any other way. I'd probably take a stretched geometry that exhibits the strange behavior and try to reproduce the geometry without stretching. (Think cube + stretch = cuboid.)
That make sense. Will try to do that and see what happens. Thanks!
@nschloe was a simple typo in the application of the stretching for 3D. I also made a simple domain.show()
method that can help you figure out what the 0-level set looks like.
domain.show()
looks suspiciously like ParaView. ;)
heh.
This is domain.show()
very primitive.
Perhaps it'd be more informative if you only showed the points with values below zero, i.e., the actual domain.
Yes. Could be a lot easier to see especially when you start intersecting them in 3d.
Alright, this just plots the points near the 0-level set.
import meshio
from SeismicMesh import *
domain = Rectangle((0.0, 1.0, 0.0, 1.0), stretch=[2.0, 1.0], rotate=0.3 * 3.14)
domain.show(samples=1000000)
points, cells = generate_mesh(domain=domain, edge_length=0.10)
meshio.write_points_cells("test.vtk", points, [("triangle", cells)])
This looks very good.