Skip to content

snappyHexMesh :: Prediction of maxNewCells wrong with new code

Summary

Hey everybody, in v2306, the balancing method within snappy was improved based on the code snippet I provided to L2. !607 (merged)

The issue appears now due to a one-liner change from Mattijs:

Hence, the calculation of maxLocalCells is wrong (as it is zero all the time and the trigger value will never be taken into account). However, this value is mainly necessary if e.g., locally on one single proc a refinement happens significantly (imagine a refinement based on the surfaceFeatureAngle while using a level (4 6) refinement for example.

The discrepancy at the moment is:

  • The balancing factor is calculated correctly (in previous versions we were over predicting the nNewCells value due to the fact that the refinement took place alreads)
  • On the other hand, the balancing trigger value maxLocalCells is zero now (if refineAndBalance is used) and thus, the trigger will not be used anymore

Steps to reproduce

To check that the values of maxLocalCells are always zero, simply execute snappyHexMesh while having maxLocalCells 100000000; to explicitly go step into the refineAndBalance function rather than balanceAndRefine.

What is the current bug behaviour?

Described in the summary.

What is the expected correct behavior?

If we use refineAndBalance the maxLocalCells should be calculated correctly.

Edited by Tobias Holzmann