Missing header in .lon file using mesher
Summary
The case in which we want to generate a block with no thickness (size[2] = 0) the mesher fails in writing the header of the .lon file.
The error is in mesher.cc in the function Grid2D::build_mesh.
The solution might be to add these lines:
num_axes = f_def.withSheets()?2:1;
lon_os << num_axes << std::endl;
What version of openCARP are you using?
commit 72e9d154
What operating system and processor architecture are you using?
ubuntu 20.04, gcc
Steps to reproduce
mesher -size[0] 1.0 -size[1] 1.0 -size[2] 0.0 -bath[0] -0.0 -bath[1] -0.0 -bath[2] -0.0 -center[0] 0.5 -center[1] 0.5 -center[2] 0.0 -resolution[0] 300.0 -resolution[1] 300.0 -resolution[2] 300.0 -mesh meshes/2021-02-23_HglGPzWkBu/block -Elem3D 0 -fibers.rotEndo 0.0 -fibers.rotEpi 0.0 -fibers.sheetEndo 90.0 -fibers.sheetEpi 90.0 -periodic 0 -periodic_tag 1234
Output:
1 0 0\n
1 0 0\n
...
What is the current bug behavior?
Missing header (number of axis) in the .lon file
What is the expected correct behavior?
Number of axis in the .lon file
Relevant logs and/or screenshots
(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's tough to read otherwise.)
Possible fixes
The error is in mesher.cc in the function Grid2D::build_mesh.
The solution might be to add these lines:
num_axes = f_def.withSheets()?2:1;
lon_os << num_axes << std::endl;