From a82f2c328cb0f0200cf47eb6a0ad9925d342c51c Mon Sep 17 00:00:00 2001 From: Corentin Prigent Date: Tue, 16 Apr 2024 16:06:52 +0200 Subject: [PATCH] added permtria array to mmg --- src/mmg3d/hash_3d.c | 7 +++++-- src/mmg3d/libmmg3d_private.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mmg3d/hash_3d.c b/src/mmg3d/hash_3d.c index a55554c78..50fa9080f 100644 --- a/src/mmg3d/hash_3d.c +++ b/src/mmg3d/hash_3d.c @@ -1560,7 +1560,7 @@ int MMG5_chkBdryTria(MMG5_pMesh mesh) { // that are stored more that once. ier = MMG5_chkBdryTria_flagExtraTriangles(mesh,&ntpres,&hashElt); // Delete flagged triangles - ier = MMG5_chkBdryTria_deleteExtraTriangles(mesh); + ier = MMG5_chkBdryTria_deleteExtraTriangles(mesh,NULL); } ntmesh +=ntpres; @@ -1855,7 +1855,7 @@ int MMG5_chkBdryTria_flagExtraTriangles(MMG5_pMesh mesh, MMG5_int* ntpres, MMG5_ return 1; } -int MMG5_chkBdryTria_deleteExtraTriangles(MMG5_pMesh mesh) { +int MMG5_chkBdryTria_deleteExtraTriangles(MMG5_pMesh mesh, MMG5_int* permtria) { MMG5_pTria ptt, pttnew; MMG5_int nt, nbl, k; @@ -1869,6 +1869,9 @@ int MMG5_chkBdryTria_deleteExtraTriangles(MMG5_pMesh mesh) { ++nt; if ( k!=nbl ) { pttnew = &mesh->tria[nbl]; + if ( permtria ) { + permtria[k] = nbl; + } memcpy(pttnew,ptt,sizeof(MMG5_Tria)); } ++nbl; diff --git a/src/mmg3d/libmmg3d_private.h b/src/mmg3d/libmmg3d_private.h index 949d4252b..6b841411f 100644 --- a/src/mmg3d/libmmg3d_private.h +++ b/src/mmg3d/libmmg3d_private.h @@ -237,7 +237,7 @@ int MMG5_chkBdryTria_countBoundaries(MMG5_pMesh mesh, MMG5_int *ntmesh, MMG5_in int MMG5_chkBdryTria_hashBoundaries(MMG5_pMesh mesh, MMG5_int ntmesh, MMG5_Hash *hashElt); int MMG5_chkBdryTria_flagExtraTriangles(MMG5_pMesh mesh, MMG5_int* ntpres, MMG5_Hash* hashElt); int MMG5_chkBdryTria_addMissingTriangles(MMG5_pMesh mesh, MMG5_int ntmesh, MMG5_int ntpres); -int MMG5_chkBdryTria_deleteExtraTriangles(MMG5_pMesh mesh); +int MMG5_chkBdryTria_deleteExtraTriangles(MMG5_pMesh mesh, MMG5_int* permtria); int MMG5_mmg3dBezierCP(MMG5_pMesh mesh,MMG5_Tria *pt,MMG5_pBezier pb,int8_t ori); extern int MMG5_BezierTgt(double c1[3],double c2[3],double n1[3],double n2[3],double t1[3],double t2[3]); extern double MMG5_BezierGeod(double c1[3], double c2[3], double t1[3], double t2[3]);