Skip to content

Commit

Permalink
Error correction in the MMG3D_Set_tetrahedron API function when a tet…
Browse files Browse the repository at this point in the history
…rahedron is provided with a wrong orientation.
  • Loading branch information
Algiane committed Nov 8, 2017
1 parent 19f0663 commit ac0f0ff
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ MARK_AS_ADVANCED ( CI_DIR )
###############################################################################
SET (CMAKE_RELEASE_VERSION_MAJOR "5" )
SET (CMAKE_RELEASE_VERSION_MINOR "3" )
SET (CMAKE_RELEASE_VERSION_PATCH "4" )
SET (CMAKE_RELEASE_VERSION_PATCH "5" )
SET (CMAKE_RELEASE_DATE "Apr. 10, 2017" )

SET (CMAKE_RELEASE_VERSION
Expand Down
2 changes: 1 addition & 1 deletion src/mmg3d/API_functions_3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ int MMG3D_Set_tetrahedron(MMG5_pMesh mesh, int v0, int v1, int v2, int v3, int r
mesh->point[pt->v[3]].tag &= ~MG_NUL;

vol = _MMG5_orvol(mesh->point,pt->v);
if ( vol <= _MMG5_EPSD2 ) {
if ( fabs(vol) <= _MMG5_EPSD2 ) {
fprintf(stderr,"\n ## Error: %s: tetrahedron %d has volume null.\n",
__func__,pos);
for ( ip=0; ip<4; ip++ ) {
Expand Down
5 changes: 3 additions & 2 deletions src/mmg3d/libmmg3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,9 @@ int MMG3D_mmg3dlib(MMG5_pMesh mesh,MMG5_pSol met) {

_MMG3D_Set_commonFunc();


_MMG5_warnOrientation(mesh);

/** Free topologic tables (adja, xpoint, xtetra) resulting from a previous
* run */
_MMG3D_Free_topoTables(mesh);
Expand Down Expand Up @@ -597,8 +600,6 @@ int MMG3D_mmg3dlib(MMG5_pMesh mesh,MMG5_pSol met) {
_MMG5_warnScotch(mesh);
#endif

_MMG5_warnOrientation(mesh);

chrono(OFF,&(ctim[1]));
printim(ctim[1].gdif,stim);
if ( mesh->info.imprim )
Expand Down
4 changes: 2 additions & 2 deletions src/mmg3d/mmg3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -464,12 +464,12 @@ static inline
void _MMG5_warnOrientation(MMG5_pMesh mesh) {
if ( mesh->xt ) {
if ( mesh->xt != mesh->ne ) {
fprintf(stderr," ## Warning: %s: %d tetra on %d reoriented.\n",
fprintf(stderr,"\n ## Warning: %s: %d tetra on %d reoriented.\n",
__func__,mesh->xt,mesh->ne);
fprintf(stderr," Your mesh may be non-conform.\n");
}
else {
fprintf(stderr," ## Warning: %s: all tetra reoriented.\n",__func__);
fprintf(stderr,"\n ## Warning: %s: all tetra reoriented.\n",__func__);
}
}
mesh->xt = 0;
Expand Down

0 comments on commit ac0f0ff

Please sign in to comment.