Hi!
There is a bug in the current way of handling choosing the meshing algorithm in GmshMeshGenerator. If the user is using the GMSH module, then the current implementation has several issues.
First, it is only setting a value in the options without specifying which key, which should be either Mesh.Algorithm or Mesh.Algorithm3d.
Second, as per the GSMH documentation, Mesh.Algorithm and Mesh.Algorithm3d take integer values, not strings.
As such, I think a better implementation in calfem/mesh.py, replacing lines [431-433], would be
if self.meshing_algorithm is not None:
algos2d = {
"auto": 2,
"meshadapt": 1,
"del2d": 5,
"front2d": 6,
"delquad": 8,
"quadqs": 11,
"initial2d": 3
}
algos3d = {
"del3d": 1,
"front3d": 4,
"mmg3d": 7,
"hxt": 10,
"initial3d": 3,
}
if self.meshing_algorithm in algos3d.keys():
gmsh.option.setNumber("Mesh.Algorithm3d", algos3d[self.meshing_algorithm])
else:
gmsh.option.setNumber("Mesh.Algorithm", algos2d[self.meshing_algorithm])
Note that GMSH themselves only allow for these keys in the commandline arg -alog for some reason, as such, I chose to only include those to avoid conflict with the case when use_gmsh_module = False
As a side note, I do not want to open a separate issue for this, but please expose the parameter cmap (for color maps) in draw_nodal_values_shaded and similar functions. Thanks!
Hi!
There is a bug in the current way of handling choosing the meshing algorithm in
GmshMeshGenerator. If the user is using the GMSH module, then the current implementation has several issues.First, it is only setting a value in the options without specifying which key, which should be either
Mesh.AlgorithmorMesh.Algorithm3d.Second, as per the GSMH documentation,
Mesh.AlgorithmandMesh.Algorithm3dtake integer values, not strings.As such, I think a better implementation in
calfem/mesh.py, replacing lines [431-433], would beNote that GMSH themselves only allow for these keys in the commandline arg
-alogfor some reason, as such, I chose to only include those to avoid conflict with the case whenuse_gmsh_module = FalseAs a side note, I do not want to open a separate issue for this, but please expose the parameter
cmap(for color maps) indraw_nodal_values_shadedand similar functions. Thanks!