Skip to content

Commit

Permalink
Report the previous fix into the MMG2D and MMGS delPt/delElt functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Algiane committed Dec 5, 2023
1 parent 79331dc commit 41b2e77
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/mmg2d/zaldy_2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ void MMG2D_delPt(MMG5_pMesh mesh,MMG5_int ip) {
ppt->tmp = mesh->npnil;

mesh->npnil = ip;
if ( ip == mesh->np ) mesh->np--;
if ( ip == mesh->np ) {
while ( (!MG_VOK((&mesh->point[mesh->np]))) && mesh->np ) mesh->np--;
}
}

void MMG5_delEdge(MMG5_pMesh mesh,MMG5_int iel) {
Expand Down Expand Up @@ -119,7 +121,9 @@ int MMG2D_delElt(MMG5_pMesh mesh,MMG5_int iel) {
memset(&mesh->adja[iadr],0,3*sizeof(MMG5_int));

mesh->nenil = iel;
if ( iel == mesh->nt ) mesh->nt--;
if ( iel == mesh->nt ) {
while ( (!MG_EOK((&mesh->tria[mesh->nt]))) && mesh->nt ) mesh->nt--;
}
return 1;
}

Expand Down
4 changes: 2 additions & 2 deletions src/mmgs/zaldy_s.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void MMGS_delPt(MMG5_pMesh mesh,MMG5_int ip) {
ppt->tmp = mesh->npnil;
mesh->npnil = ip;
if ( ip == mesh->np ) {
while ( !MG_VOK((&mesh->point[mesh->np])) ) mesh->np--;
while ( (!MG_VOK((&mesh->point[mesh->np]))) && mesh->np ) mesh->np--;
}
}

Expand Down Expand Up @@ -104,7 +104,7 @@ int MMGS_delElt(MMG5_pMesh mesh,MMG5_int iel) {
memset(&mesh->adja[3*(iel-1)+1],0,3*sizeof(MMG5_int));
mesh->nenil = iel;
if ( iel == mesh->nt ) {
while ( !MG_EOK((&mesh->tria[mesh->nt])) ) mesh->nt--;
while ( (!MG_EOK((&mesh->tria[mesh->nt]))) && mesh->nt ) mesh->nt--;
}
return 1;
}
Expand Down

0 comments on commit 41b2e77

Please sign in to comment.