jlchan / StartUpDG.jl

Initializes and sets up reference elements and physical meshes for DG.
MIT License
28 stars 9 forks source link

NODETOL in build_periodic_boundary_maps! #45

Closed masonamccallum closed 1 year ago

masonamccallum commented 1 year ago

In build_periodic_boundary_maps! NODETOL seems to be too tight of a tolerance. When using uniform_mesh(Tri(),16)...,rd) I get the required tolerance to successfully build periodic boundary maps 4e-14. When importing via GMSH I Get only 4e-12.

src/connectivity_functions.jl

Current code: Line 160: NODETOL = 100 * max(eps.((LX, LY))...) Potential fix: Line 160: NODETOL = 10000 * max(eps.((LX, LY))...)

jlchan commented 1 year ago

Thanks for catching this! I think to make things flexible, it might be best to add a tol keyword argument to build_periodic_boundary_maps and make_periodic. I should have a fix up in a sec.

jlchan commented 1 year ago

What Gmsh mesh does the old tolerance fail for?

jlchan commented 1 year ago

Added in https://github.com/jlchan/StartUpDG.jl/commit/a8572c051313c206e07f5fa1fade2ad7c675361d.

If it's easy to add the Gmsh mesh for which periodicity fails, let me know - I'd like to add it in the test suite.

jlchan commented 1 year ago

Closed by https://github.com/jlchan/StartUpDG.jl/pull/46

jlchan commented 1 year ago

@masonamccallum this should be available in https://github.com/JuliaRegistries/General/pull/71246 when the new version is accepted.

Looking at the Gmsh file, it seems like the coordinates just have a little more roundoff error in them than the uniform_meshes that we create by hand.