onera / Cassiopee

CFD pre- and post-processing python modules
https://onera.github.io/Cassiopee/
GNU Lesser General Public License v3.0
19 stars 12 forks source link

Generator: closeMesh: conditionally export vertex indirection table #180

Closed vincentcasseau closed 3 weeks ago

vincentcasseau commented 3 weeks ago

Define an empty list, indices, and pass it in the form of a keyworded argument to G.close or G._close as

# Let t be a PyTree
indices = []
G._close(t, tol=1.e-12, indices=indices)

indices will contain the vertex indirection table following mesh cleaning. If indices is set to None (or not passed), the vertex indirection table is not returned. This could be used to update boundary face indices post-cleaning without resorting to C.identifyNodes

benoit128 commented 3 weeks ago

It is very good! Can you add the new argument to function doc in Generator.rst? Thanks!

frabasi commented 3 weeks ago

Hi @vincentcasseau , I know it is already merged, but I wanted to let you know that I have tested it on several cases and compared to what I would obtain with a geometrical identification of the new and old nodes, and it seems to work perfectly! Thank you for developing this functionality, it is going to be super useful :)

vincentcasseau commented 3 weeks ago

Alright, I'll update the doc now that it's approved! @frabasi: good to know, thanks! If there are other bottlenecks in your code, we could talk about it as it may benefit other tools as well.