Please insert copyright, licence and build instructions in the top comment in the C++ file.
nl variable (lines 44-51) in the file is in fact not a number of layers in z-direction but number of blocks in the mesh (well, this can be corrected after merge).
From Martin Vymazal martin.vymazal@vki.ac.be
How to compile: g++ convert_flat_plate_mesh.cpp -o convert_flat_plate_mesh