Fix error in CGNS writing by rois1995 · Pull Request #2178 · su2code/SU2

Hello everyone,

I encountered an error in the writing of a CGNS file when no nodes are associated to a given rank. It usually happens when small grids are employed and the simulation is performed on more than one core. have uploaded at the following link the mesh and the config used to reproduce the error.

https://polimi365-my.sharepoint.com/:f:/g/personal/10507725_polimi_it/Ekl88a3uOKhMu4uCLRy3tHIBNNo6_3oMTNiZq97NB6ztDw?e=Hu8pqe

Notice that, if only one heatflux marker is selected to print the results onto, then it does not work when 2 or more cores are used. On the other hand, if both of the heatflux markers are used then it works in parallel.

To solve this issue I just added a check on the number of local points in the function CCGNSFileWriter::WriteField.

PR Checklist

Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson).
  • My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/).
  • I used the pre-commit hook to prevent dirty commits and used pre-commit run --all to format old commits.
  • I have added a test case that demonstrates my contribution, if necessary.
  • I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp), if necessary.