Allow the 3d swapper to create tetrahedra with 4 boundary vertices when not in FEM mode#301
Allow the 3d swapper to create tetrahedra with 4 boundary vertices when not in FEM mode#301mpotse wants to merge 2 commits intoMmgTools:developfrom
Conversation
|
Following up on the discussion I had with Corentin last week, I confirm that the test for FEM mode in this MR is not strong enough. It behaves differently when I use if(0). There may also be an issue with the test for mesh->info.fem on line 150 in the same function, which I had used as example. |
|
Further update: either by replacing both of the mesh->info.fem by 0 here or by checking (mesh->info.fem == typchk) instead I get the desired behaviour when I don't want a FEM mesh. Evidence:
Doing this only with the second of the two mesh->info.fem flags produced intermediate results. The test for (mesh->info.fem==typchk) changes the behaviour in FEM mode too but I cannot tell if the result is more or less "FEM". In any case the difference was minor. Bottom line: don't merge this as is; I trust that the idea will be integrated in the reorganization of the fem flag. |
…fem being nonzero
|
As discussed with Corentin this week, I'm pushing the commit that allows to completely enable/disable FEM mode in the 3d swapper. I believe that this can be merged before the proposed changes to the (no)fem option. |
MMG5_chkswpgen() does not allow the creation of tetrahedra with 4 boundary vertices. I think this restriction should only be made in FEM mode, just like the restriction on creating edges between boundary points is only made in FEM mode (further up in the same function) and anatet4() is only called in FEM mode.
I made this modification because we need it for the meshes we create for the MICROCARD project. These meshes have lots of internal boundaries, often with only one layer of tetrahedra between them, and we don't want to have more layers because the space is very thin. Thus it is perfectly normal to have tetrahedra with all of their vertices on either of two boundaries. The refusal of these swaps costs me a factor 5 in quality for the worst 10% of tetrahedra.
I wrote the change such that it makes minimal changes to the blame.