Closed krober10nd closed 3 years ago
I solved it by just scaling the cell_size by a fraction. The cell_size is not the same size as the edge_size.
Let's reopen this. It should be possible to set no edge_size and have the mesh generation unaffected by it.
Okay fair enough. Thanks for looking into this and starting the issue there.
Hello,
I'm am trying to use
pygalmesh
to build a variable resolution 3d mesh of a unit cube, I'd like to specify a variable field of space for thecell_size
. However, if I'm building a domain with the cuboid object, the API requires anedge_size
parameter that cannot be a function of space. If I do not specifyedge_size
it fails. And if I specify a constantedge_size
my mesh develops high valency edge connectivity near the boundary where it does not respect thecell_size
function but does respect theedge_size
function. If I makeedge_size
large this leads to badly shaped elements where mesh resolution is finer.HMIN = 0.025 GRADE = HMIN / 1.0
class Field(pygalmesh.SizingFieldBase): def eval(self, x): return (1 - x[0]) * GRADE + HMIN
mesh = pygalmesh.generate_mesh( pygalmesh.Cuboid([0.0, 0.0, 0.0], [1.0, 1.0, 1.0]), cell_size=Field(), edge_size=HMIN, )
mesh.write("cgal_cuboid.vtk")
edge_size
produces elements that do not respectcell_size
becauseedge_size
is constant.