-
-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Increased diagnostic output and added a few lines of documentation #238
base: develop
Are you sure you want to change the base?
Conversation
…ilface warnings, print problem location, min mesh quality in %g format, a few lines of documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
Thanks for this contribution.
I would prefer to increase the verbosity of Mmg only in debug mode if you agree.
Best
MMG5_show_tet_location(mesh, pt, start); | ||
if(0) mmgWarn0 = 1; // disabled, I want to see how many there are! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that it is not obvious so I prefer to explain this a little: the number of times the message is displayed does not reflect the number of edges for which an error is detected.
The function that may raise this warning is called only:
- when attempting to swap a boundary edge;
- when attempting to split such an edge.
In consequence:
- It is possible to have an erroneous edge without seeing this warning;
- a single erroneous edge may raise lot of warnings because:
- this edge may be seen by the swapping and/or splitting operator;
- the edge will probably be seen during multiple remeshing iterations;
- at each iteration and for each operator we will see the edge from all the elements to which it belongs (and as the edge is not modified, we will try to do something and fail each time we will see it);
As the number of warning that is printed is not really meaningful, and as lot of users doesn't need to have the message more than once, I propose to keep this proposition of higher level of verbosity only in debug mode (-d
command line option of Mmg):
if ( mesh->info.ddebug ) {
// print indices and coordinates of the vertices of one tet.
MMG5_show_tet_location(mesh, pt, start);
} else {
// disable warnings for this error as the message has already been printed once
mmgWarn0 = 1;
}
src/mmg3d/mmg3d.c
Outdated
|
||
|
||
|
||
/* -------------------------------------- Mark's hacks --------------------------------------------- */ | ||
|
||
// Print the indices and coordinates of the vertices of one tet. This is to | ||
// inform the user about the location of a problem when the tet index is not | ||
// helpful, for example because it does not correpond to the input or output | ||
// mesh. | ||
// | ||
void MMG5_show_tet_location(MMG5_pMesh mesh, MMG5_pTetra pt, int iel) | ||
{ | ||
fprintf(stderr, " ## tet index %d\n", iel); | ||
for(int j=0; j<4; j++){ | ||
double U[3], *S = mesh->point[pt->v[j]].c; // unscaled and scaled coords | ||
for(int i=0; i<3; i++) U[i] = S[i]*mesh->info.delta + mesh->info.min[i]; | ||
fprintf(stderr, " ## vertex %d at (%f,%f,%f)\n", pt->v[j], U[0], U[1], U[2]); | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, it can be useful.
Just for your information, we also have debugging tools to print the packed indices of tetra and points (which means the indices they will have in the output mesh):
- the
MMG3D_indElt(mesh,k)
function gives you the index of tetrak
inside the output mesh; - the
MMG3D_indPt(mesh,k)
function gives you the index of pointk
inside the output mesh;
Note that it is useful and trustable only if you save the mesh immediately after calling these functions (because tetra and points indices will be modified if we continue the remeshing so, even if the targetted point/tetra are not touched, the mesh packing will be different).
@@ -625,16 +625,24 @@ MMG5_int MMG5_swpmsh(MMG5_pMesh mesh,MMG5_pSol met,MMG3D_pPROctree PROctree, int | |||
|
|||
ret = MMG5_coquilface(mesh,k,i,ia,list,&it1,&it2,0); | |||
ilist = ret / 2; | |||
if ( ret < 0 ) return -1; | |||
if ( ret < 0 ){ | |||
MMG5_show_tet_location(mesh, pt, k); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, keep this in debug mode only (-d
command line option, mesh->info.ddebug
variable inside the code) :
if ( mesh->info.ddebug ) {
MMG5_show_tet_location(mesh, pt, k);
}
if ( ier < 0 ){ | ||
MMG5_show_tet_location(mesh, pt, k); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, keep this in debug mode only (-d
command line option, mesh->info.ddebug
variable inside the code) :
if ( mesh->info.ddebug ) {
MMG5_show_tet_location(mesh, pt, k);
}
else if ( ier ) { | ||
ier = MMG5_swpbdy(mesh,met,list,ret,it1,PROctree,typchk); | ||
if ( ier > 0 ) ns++; | ||
else if ( ier < 0 ) return -1; | ||
else if ( ier < 0 ){ | ||
MMG5_show_tet_location(mesh, pt, k); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, keep this in debug mode only (-d
command line option, mesh->info.ddebug
variable inside the code) :
if ( mesh->info.ddebug ) {
MMG5_show_tet_location(mesh, pt, k);
}
} | ||
} | ||
else { | ||
if (MMG5_boulesurfvolp(mesh,k,ip,i, | ||
list,&ilist,lists,&ilists,p0->tag & MG_NOM) < 0 ) | ||
list,&ilist,lists,&ilists,p0->tag & MG_NOM) < 0 ){ | ||
MMG5_show_tet_location(mesh, pt, k); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, keep this in debug mode only (-d
command line option, mesh->info.ddebug
variable inside the code) :
if ( mesh->info.ddebug ) {
MMG5_show_tet_location(mesh, pt, k);
}
@@ -1134,13 +1166,19 @@ static int MMG5_coltet(MMG5_pMesh mesh,MMG5_pSol met,int8_t typchk) { | |||
|
|||
if ( ilist > 0 ) { | |||
ier = MMG5_colver(mesh,met,list,ilist,iq,typchk); | |||
if ( ier < 0 ) return -1; | |||
if ( ier < 0 ){ | |||
MMG5_show_tet_location(mesh, pt, k); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, keep this in debug mode only (-d
command line option, mesh->info.ddebug
variable inside the code) :
if ( mesh->info.ddebug ) {
MMG5_show_tet_location(mesh, pt, k);
}
else if ( ier ) { | ||
MMG3D_delPt(mesh,ier); | ||
break; | ||
} | ||
} | ||
else if (ilist < 0 ) return -1; | ||
else if (ilist < 0 ){ | ||
MMG5_show_tet_location(mesh, pt, k); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, keep this in debug mode only (-d
command line option, mesh->info.ddebug
variable inside the code) :
if ( mesh->info.ddebug ) {
MMG5_show_tet_location(mesh, pt, k);
}
@@ -2593,6 +2631,7 @@ MMG3D_anatets_iso(MMG5_pMesh mesh,MMG5_pSol met,int8_t typchk) { | |||
fprintf(stderr,"\n ## Warning: %s: surfacic pattern: unable to find" | |||
" a valid split for at least 1 point. Point(s) deletion.\n", | |||
__func__ ); | |||
MMG5_show_tet_location(mesh, pt, k); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, keep this in debug mode only (-d
command line option, mesh->info.ddebug
variable inside the code) :
if ( mesh->info.ddebug ) {
MMG5_show_tet_location(mesh, pt, k);
}
@@ -3188,7 +3227,7 @@ int MMG5_anatet(MMG5_pMesh mesh,MMG5_pSol met,int8_t typchk, int patternMode) { | |||
if ( !mesh->info.noinsert ) { | |||
nc = MMG5_coltet(mesh,met,typchk); | |||
if ( nc < 0 ) { | |||
fprintf(stderr,"\n ## Unable to collapse mesh. Exiting.\n"); | |||
fprintf(stderr,"\n ## Unable to collapse mesh in MMG5_anatet: nc=%d. Exiting.\n", nc); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we pass here, nc
is equal to -1
no ?
…next tet instead of returning to the caller. Also changed more return values so I can see where errors come from.
distinguish harmful from harmless returns from MMG5_boulesurfvolpNom()
…that it is also available in the library version
Hi @mpotse , |
This reverses one line of commit ba87623 where it was argued that this is a "parallel tag" which is to be removed from faces that are not parallel faces. It may have been necessary for ParMmg but it erases all RequiredTriangles from mmg3d output, and I rely on them in the "mmg3d -ls ..." calls in WP7/synthetic/mason.sh
…nger than 128 chars correctly)
Increased diagnostic output and added a few lines of documentation.