Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding option for mesh refinement #100

Open
jon-proximafusion opened this issue Nov 18, 2024 · 0 comments
Open

Adding option for mesh refinement #100

jon-proximafusion opened this issue Nov 18, 2024 · 0 comments

Comments

@jon-proximafusion
Copy link
Collaborator

Mesh refinement might be useful in some cases

Here is an example but it might be best if the user does the mesh manually in this the case that they need mesh refinement

optional mesh refinement example
refine_distance = 50  # Distance within which to refine the mesh
refine_mesh_size = 2  # Mesh size within the refine distance
# Define a distance field for mesh refinement
gmsh.model.mesh.field.add("Distance", 1)
gmsh.model.mesh.field.setNumbers(1, "NodesList", [1,2,3,4])
# Define a threshold field to refine the mesh within a certain distance
gmsh.model.mesh.field.add("Threshold", 2)
gmsh.model.mesh.field.setNumber(2, "InField", 1)
gmsh.model.mesh.field.setNumber(2, "SizeMin", refine_mesh_size)
gmsh.model.mesh.field.setNumber(2, "SizeMax", 40)
gmsh.model.mesh.field.setNumber(2, "DistMin", 0)
gmsh.model.mesh.field.setNumber(2, "DistMax", refine_distance)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant