Conversation
…h option -xreg [val] (MMG3D)
…h option -xreg [val] (MMGS and MMG2D)
Algiane
left a comment
There was a problem hiding this comment.
Hi,
Thanks for this PR. I have few questions an the variable name choice and the value of coefficients.
| MMG5_pPar par; | ||
| double dhd,hmin,hmax,hsiz,hgrad,hgradreq,hausd; | ||
| double min[3],max[3],delta,ls,rmc; | ||
| double min[3],max[3],delta,ls,lxreg,rmc; |
There was a problem hiding this comment.
Why have you name the variable lxreg and not xreg?
There was a problem hiding this comment.
There already is a attribute of struct info that is called xreg: an integer to tell whether the option is activated or not. Hence, xreg is always an integer, lxreg is always a double.
There was a problem hiding this comment.
Then, in other occurences, lxreg is used to keep consistency, even if there would be no conflict with the name xreg.
src/common/mmgcommon_private.h
Outdated
| #define MMG5_LAG -1 /**< default value for lagrangian option */ | ||
| #define MMG5_NR -1 /**< no ridge detection */ | ||
| #define MMG5_LS 0.0 /**< default level-set to discretize */ | ||
| #define MMG5_LXREG 0.4 /**< default relaxation parameter for coordinate regularization */ |
There was a problem hiding this comment.
Why have you name the variable lxreg and not xreg?
src/mmg3d/libmmg3d.h
Outdated
| MMG3D_DPARAM_hgrad, /*!< [val], Control gradation */ | ||
| MMG3D_DPARAM_hgradreq, /*!< [val], Control gradation on required entites (advanced usage) */ | ||
| MMG3D_DPARAM_ls, /*!< [val], Value of level-set */ | ||
| MMG3D_DPARAM_lxreg, /*!< [val], Value of relaxation parameter for coordinates regularization (0<val<1) */ |
There was a problem hiding this comment.
Why have you name the variable lxreg and not xreg?
src/mmg2d/analys_2d.c
Outdated
| lm1 = 0.4; | ||
| lm2 = 0.399; | ||
| lm1 = mesh->info.lxreg; | ||
| lm2 = lm1; |
There was a problem hiding this comment.
I guess that the slight difference between the lm1 and lm2 values is here to avoid cases of oscillations during regularization... Is it possible to check that (by reading the code because it may be hard and quite random to reproduce oscillations)?
There was a problem hiding this comment.
To avoid oscillations, i changed the computation of lm2 so that it is always slightly lower than lm1 .
…s in coordinate regularization
|
Thanks for this improvement. |
Added the possibility of choosing a value val for the regularization of coordinates when using option -xreg val :
Let P be a point to regularize. Let Q be the mean of surrounding points on manifold. New point R is computed as:
R = val * Q + (1 - val) * P
Default value is val = 0.4. Given value should be comprised between 0 and 1.
One CI test for each software has been added as well.