Testing the output of GMSH Python code
Say for instance, that I have this routine.
def generate_mesh(parameter):
# Lots of gmsh python API calls
# Generate the geo_unrolled and msh files.
Now I need to write a test for it. My goal is make sure I am generating the same mesh even if I refactor the code within generate_mesh
.
def test_generate_mesh():
# How to test that the output (geo_unrolled file) is reliable?
First, I tried to compare the output of the "geo_unrolled" files between the routine and a "ground-truth" file that I have saved in the repository's test directory. However, the "geo_unrolled" file becomes huge if we use splines with the OpenCASCADE kernel. This is not ideal because I have many "geo_unrolled" files and they would take a lot of space, making my repository huge in size. On the other hand, the "brep" files do not contain any information of the physical regions or the meshing options, so I can't test for that. What options do I have? Is there a light format that can save both the geometry, physical marking and meshing information in a lightweight manner?