Fix bug ci test 12 in ParMmg + improve consistencies of functions#226
Fix bug ci test 12 in ParMmg + improve consistencies of functions#226Algiane merged 4 commits intoMmgTools:developfrom
Conversation
…+ improve comments + factorize code
Algiane
left a comment
There was a problem hiding this comment.
Thanks,
See my review ;-).
Best
|
|
||
| return; |
There was a problem hiding this comment.
As this deletion is useless, it introduces a diff with no reason: please, remove this modification.
There was a problem hiding this comment.
Done. Sorry for that.
src/mmg3d/split_3d.c
Outdated
| double vold,vnew; | ||
| uint8_t tau[4]; | ||
| const uint8_t *taued; | ||
| const uint8_t *taued=NULL; |
There was a problem hiding this comment.
Are you adding this because your compiler raises a warning?
(In practice, taued will always be initialized even without the default affctation. The only case when it is not initialized in MMG3D_split*_cfg is when element volume is to low and in this case taued will not be use as we will refuse the split.)
I find it more readable to not initialized it to NULL (it means that it is always initialized in another location and that it has no sense to use this variable with a NULL value).
The same remark holds for other taued initializations.
There was a problem hiding this comment.
Done - I reversed this. I did that for consistency with other split functions initializing taued like this.
| pt[0]->flag = 0; | ||
| newtet[0]=k; | ||
|
|
||
| /* Determine tau, taued and imin the condition for vertices permutation */ |
There was a problem hiding this comment.
Maybe add a comment to explain that vGlobNum is setted to pt->v when we come from split2sf and this value may point to a wrong memory address if the tetra array is reallocated before the use of vGlobNum (MMG3D_crea_newTetra may reallocate the tetra array and vGlobNum is used inside split2sf_cfg) because the pt pointer may become invalid. Thus, it is mandatory to call split*_cfg before newTetra function.
…of useless return;. Add comments to explain why MMG3D_split*_cfg should be before MMG3D_crea_newTetra.
|
Thanks! |
This PR fixes a bug in the ci test 12 in ParMmg when compile without SCOTCH library (Point 1). This PR also fixes some minor typos/style inconsistencies (Points 2-5) and factorizes some part of the code (Point 6).
In
src/mmg3d/split_3d.c:MMG3D_split*_cfgfunction before creation of new tetraMMG3D_crea_NewTetra. This fixes the bug in ci test 12 of ParMmg.MMG3D_configSplit5byMMG3D_split5_cfgfor name consistency with the otherMMG3D_split*_cfgfunctions.return;at the end of functionMMG3D_split1_cfg,MMG3D_split3op_cfgandMMG3D_update_qualas they are defined asvoidand thereturn;is at the end of the function and does nothing (and for consistency with the otherMMG3D_split*_cfgfunctions).tauedasNULLin all functions.MMG3D_split3cone_simuses now directly the functionMMG3D_split3cone_cfg.