Skip to content

Duplicate nodes and surfaces #417

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

Open
uttamcadambi07 opened this issue Feb 5, 2021 · 3 comments
Open

Duplicate nodes and surfaces #417

uttamcadambi07 opened this issue Feb 5, 2021 · 3 comments

Comments

@uttamcadambi07
Copy link

Hi,
I am using pygmsh to create a mesh and save it using mesh.write('mesh.geo_unrolled). I use a nested for loop for the creation of my geometry which is a half channel with a cube at the bottom wall. I take user input for a bunch of parameters and the output is nx and nz number of cubes in x and z direction respectively and a half channel around it.
In the loop, the creation of nodes, line loops, surfaces, surface loops, volumes, transfinite line, surface, volume and surface recombination takes place. However, this is done not for the whole domain at once - but it is done cube by cube.
Because of this this, I run in to the risk of duplicate elements - since after the creation of one channel, when the code moves to the next channel, the order of creation is such that either the first two or the last two elements invariably overlap.
Since I could not find a work around for this while creating, I decided to use Coherence Mesh; in my *.geo file after it is written out by the pygmsh API. This does not seem to work, since I am still getting a face ordering problem when I use gmshToFoam <filename.msh> and sometimes, the faces are different on opposite sides of the domain (I need to set them to cyclic)
Is there any workaround for this? Any command I can probably use in pygmsh or perhaps there is a more elegant way of creating 'repeating units' which I am not able to see? Attached my code here for reference.
automate_gmsh.zip

@nschloe
Copy link
Owner

nschloe commented Feb 6, 2021

The pygmsh API does no longer writer out geo files. You must be using an old version. Try upgrading.

@uttamcadambi07
Copy link
Author

Right. So I have a very recent version of pygmsh API. However, I wanted to work on the mesh by picking it up later in gmsh. Which is why I went through the process of creating a .*geo file. Actually, another reason to do it was it forcefully remove duplication. Let me try another way for this.

@nschloe
Copy link
Owner

nschloe commented Apr 12, 2021

You can always store a mesh with geom.save_geometry("my.geo").

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

2 participants