I am trying to generate a structured mesh for a 2-D complete hollow cylinder geometry. It is possible to do it by using mesh mapping. My problem is exactly the same with the one in this closed old topic:
The boundary lines that closes the loop must be merged but I understand that it was not possible. Not sure if it is still not possible.
Eventhough it has an answer, I don’t actually understand what is meant by "iterating over the rectangle mesh and creating new vertices and cells by using MeshEditor. An example for that or an alternative solution to this specific problem would be highly appreciated.
Note: I cannot use another software for generating mesh for this specific problem at the moment.
What Garth means as you are trying to remove vertices, and change the connectivity of each cell, you need to create a new mesh. This can be done with MeshEditor.
How to use MeshEditor has been covered in for instance:
Thank you for your help. I checked the link and repeated the codes you provided. But now I have to ask for more. I understand that since I have double vertices on that line, you suggest me to remove those vertices and re-add vertices exactly to the same spots so that my new mesh would become a continous one.
I change my mesh iteratively in my actual code. So, this procedure is going to be in a loop in my case. But I hope I can handle that once I can do it for a single case.
Here they are constants but actually nt and nr are variables in my actual code. That is why I need to know those vertices everytime I construct a new mesh. Here are my questions:
1- How can I locate vertices of a mesh? I hope there is a single easy function for it (also, if there is an easy way: how can I locate vertices on some specific interface/line etc.)
2- How can I remove vertices?
I think I can then use your method to add necessary vertices that I already would’ve located and removed (doubles).
This is amazing! Thank you very much. But there is still a problem with the interface. Looks like that boundary is seen as a wall when I run my code. I guess I need to specify that new interlayer is a continous part of the domain.
I will try to figure out an example code and a solution if I can. That won’t be easy for me right away. But thank you so much, you have done an amazing favor! I am grateful.
I know the problem is still with that interface because I have checked my solution with standard Circle(), generate_mesh() etc. in Fenics, and got the correct results. I will work on it and hopefuly write later.
Make sure you use the new_mesh, and not mesh the old mesh. You could start by creating a very coarse mesh and tabulating the dof coordinates, and visually inspect them.
This is very funny but it is better that I made that mistake cause others who read this post may make the same. Since you updated the mesh I thought everything was fine and kept solving my problem with the “mesh”, just plugging-in the code. This was super funny and thank you again for guessing my mistake
I changed the mesh to new_mesh you wrote in my code and the solution is perfect now. Thank you!