Skip to content

mirrorMesh not mirroring cellLevel and pointLevel fields

Summary

The mirrorMesh utility, does not mirror cellLevel and pointLevel data generated by snappyHexMesh while meshing. this breaks the possibility of using some tools such as renumberMesh or redistributePar.

Steps to reproduce

Create a mesh using snappyHexMesh, mirror it using mirrorMesh and then try to use renumberMesh the last one will give an error about the size is not equal in cellLevel

What is the current bug behaviour?

the cellLevel and pointLevel are not being mirrored

What is the expected correct behavior?

the cellLevel and pointLevel should be mirrored and added to each field

Relevant logs and/or images

the error part of the log for renumberMesh for example:

[49] 
[49] 
[49] --> FOAM FATAL IO ERROR: (openfoam-2206)
[49] size 15139 is not equal to the expected length 30278
[49] 
[49] file: processor49/0/cellLevel at line 19 to 88.
[49] 
[49]     From Foam::Field<Type>::Field(const Foam::word&, const Foam::dictionary&, Foam::label) [with Type = double; Foam::label = long int]
[49]     in file /local1/openfoam/OpenFOAM-v2206/src/OpenFOAM/lnInclude/Field.C at line 218.
[49] 
FOAM parallel run exiting

Environment information

  • OpenFOAM version :v2206
  • Operating system :centOS
  • Hardware info :
  • Compiler :precompiled package for redhat

Possible fixes

right now the easy solution, in case that we dont need the cellLevel and pointLevel fields, as for the case of renumberMesh, we can simply delete this fields by for example rm -f processor*/0/cellLevels nevertheless this fields are necessary in other cases. this issue has been discussed and adressed in the fondation vr (issue 0002712)