Spatially varying mesh density with generate_mesh in mshr from .stl or .off

8 months ago by
Dear All,

This is a problem of creating a mesh from .stl with generate_mesh in mshr. The following MWE does produce a mesh from the given .stl file. However I want the mesh to take exactly the nodal points as specified in the .stl file together with additional interior points to create the 3D mesh. Below is also a picture of the same .stl but visulized as a closed surface with a CAD software. In my real example I wish to have a much denser mesh at the bottom (the physical ground with buildings etc.) of the domain to get an accurate representation of surface roughness. My real .stl have a much denser sampling at the bottom. Cranking up the density parameter produces a denser mesh throughout the domain and its size is cumbersome so I want to avoid this. Thankful for any help or ideas.

from dolfin import *
from mshr import *
domain = Surface3D("test_16x16x10.stl")
mesh = generate_mesh(domain,10)
plot(mesh, interactive=True)

File attached: test_16x16x10.stl (4.11 KB)

Community: FEniCS Project
Please login to add an answer/comment or follow this question.

Similar posts:
Search »