hpgem / nanomesh

Python workflow tool for generating meshes from 2D and 3D image data
http://nanomesh.readthedocs.org
Apache License 2.0
28 stars 5 forks source link

How can i set subdomains to apply boundary conditions? #296

Open MFV-PS opened 1 month ago

MFV-PS commented 1 month ago

Hi, I'm working with Stokes flow in porous medium. I'm using irregular porous medium so i tried to figure out how to tag properly the fields generated. The tag 1 correspond to porous space and 2 to inner solids. image however, when i write the .msh file there's a warning "Warning: Appending zeros to replace the missing physical tag data. Warning: Appending zeros to replace the missing geometrical tag data." I supposed this data is important to differentiate the solids (where i tried to apply Non-Slip condition).
Thanks in advance.

stefsmeets commented 1 month ago

Hi @MFV-PS , the warning is generated by meshio when writing to certain formats. gmsh requires the tag to be set, and if it is empty, it will simply put zeros to have something.

If you use the to_meshio method, you can work with the meshio mesh directly to tweak the tags (see here for more info).

Hope this helps.

MFV-PS commented 1 month ago

Hi @stefsmeets, I have this doubt, When I generated the contour of some irregular shapes two or more straight lines appear between the contours, how can i solve this issue? image

stefsmeets commented 1 month ago

It's likely a bug in the visualizer, it does not handle segments that span from one side to the other very well. The line mesh is a closed loop that goes from A->B->C->D->A, so it will draw a line from one side to the other. If it is for visualization, you may want to drop this segment from the mesh.