From 1d19b631a8bad52b5a6fa9368cf4a9b165c3631b Mon Sep 17 00:00:00 2001 From: luca Date: Sun, 20 Dec 2020 19:30:20 +0100 Subject: [PATCH 001/838] Test beta on manifold and interior points. --- cmake/testing/mmg_tests.cmake | 4 +- src/common/anisosiz.c | 150 ++++++++++++++++++---------------- src/mmg3d/anisosiz_3d.c | 68 ++++++++------- 3 files changed, 119 insertions(+), 103 deletions(-) diff --git a/cmake/testing/mmg_tests.cmake b/cmake/testing/mmg_tests.cmake index 1bcfbb4c1..262637174 100644 --- a/cmake/testing/mmg_tests.cmake +++ b/cmake/testing/mmg_tests.cmake @@ -126,8 +126,8 @@ FOREACH(EXEC ${LISTEXEC_MMG}) ) SET ( args - "-v 5 -hgrad 1.15" - "-v 5 -hgrad 1.15" + "-v 5 -hgrad 1.25" + "-v 5 -hgrad 1.25" ) ADD_RUN_AGAIN_TESTS ( ${EXEC} "${test_names}" "${args}" "${input_files}" ) diff --git a/src/common/anisosiz.c b/src/common/anisosiz.c index 591c7ba04..1cb13251a 100644 --- a/src/common/anisosiz.c +++ b/src/common/anisosiz.c @@ -1111,44 +1111,48 @@ int MMG5_grad2metSurf(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria pt, int np1, mm1[kmin] += beta; } else{ - /* Update the metric eigenvalue associated to the main metric direction - * which is closest to our edge direction (because this is the one that is - * the more influent on our edge length). */ - mu[0] = lambda[0]; - mu[1] = lambda[1]; - mu[2] = mr1[5]; - - mu[ichg] += beta; - - mtan1[0] = mu[0]*vp[0][0]*vp[0][0] + mu[1]*vp[1][0]*vp[1][0]; - mtan1[1] = mu[0]*vp[0][0]*vp[0][1] + mu[1]*vp[1][0]*vp[1][1]; - mtan1[2] = mu[0]*vp[0][1]*vp[0][1] + mu[1]*vp[1][1]*vp[1][1]; - - /* Return in initial basis */ - /* Because of the rotation, we know that: - * mr.[2] = mr.[4]= 0 */ - mtmp[0][0] = mtan1[0]*r1[0][0] + mtan1[1]*r1[1][0]; - mtmp[0][1] = mtan1[0]*r1[0][1] + mtan1[1]*r1[1][1]; - mtmp[0][2] = mtan1[0]*r1[0][2] + mtan1[1]*r1[1][2]; - - mtmp[1][0] = mtan1[1]*r1[0][0] + mtan1[2]*r1[1][0]; - mtmp[1][1] = mtan1[1]*r1[0][1] + mtan1[2]*r1[1][1]; - mtmp[1][2] = mtan1[1]*r1[0][2] + mtan1[2]*r1[1][2]; - - mtmp[2][0] = mr1[5]*r1[2][0]; - mtmp[2][1] = mr1[5]*r1[2][1]; - mtmp[2][2] = mr1[5]*r1[2][2]; - - m1[0] = r1[0][0]*mtmp[0][0] + r1[1][0]*mtmp[1][0] + r1[2][0]*mtmp[2][0]; - m1[1] = r1[0][0]*mtmp[0][1] + r1[1][0]*mtmp[1][1] + r1[2][0]*mtmp[2][1]; - m1[2] = r1[0][0]*mtmp[0][2] + r1[1][0]*mtmp[1][2] + r1[2][0]*mtmp[2][2]; - - m1[3] = r1[0][1]*mtmp[0][1] + r1[1][1]*mtmp[1][1] + r1[2][1]*mtmp[2][1]; - m1[4] = r1[0][1]*mtmp[0][2] + r1[1][1]*mtmp[1][2] + r1[2][1]*mtmp[2][2]; - - m1[5] = r1[0][2]*mtmp[0][2] + r1[1][2]*mtmp[1][2] + r1[2][2]*mtmp[2][2]; - - memcpy(mm1,m1,6*sizeof(double)); +// /* Update the metric eigenvalue associated to the main metric direction +// * which is closest to our edge direction (because this is the one that is +// * the more influent on our edge length). */ +// mu[0] = lambda[0]; +// mu[1] = lambda[1]; +// mu[2] = mr1[5]; +// +// mu[ichg] += beta; +// +// mtan1[0] = mu[0]*vp[0][0]*vp[0][0] + mu[1]*vp[1][0]*vp[1][0]; +// mtan1[1] = mu[0]*vp[0][0]*vp[0][1] + mu[1]*vp[1][0]*vp[1][1]; +// mtan1[2] = mu[0]*vp[0][1]*vp[0][1] + mu[1]*vp[1][1]*vp[1][1]; +// +// /* Return in initial basis */ +// /* Because of the rotation, we know that: +// * mr.[2] = mr.[4]= 0 */ +// mtmp[0][0] = mtan1[0]*r1[0][0] + mtan1[1]*r1[1][0]; +// mtmp[0][1] = mtan1[0]*r1[0][1] + mtan1[1]*r1[1][1]; +// mtmp[0][2] = mtan1[0]*r1[0][2] + mtan1[1]*r1[1][2]; +// +// mtmp[1][0] = mtan1[1]*r1[0][0] + mtan1[2]*r1[1][0]; +// mtmp[1][1] = mtan1[1]*r1[0][1] + mtan1[2]*r1[1][1]; +// mtmp[1][2] = mtan1[1]*r1[0][2] + mtan1[2]*r1[1][2]; +// +// mtmp[2][0] = mr1[5]*r1[2][0]; +// mtmp[2][1] = mr1[5]*r1[2][1]; +// mtmp[2][2] = mr1[5]*r1[2][2]; +// +// m1[0] = r1[0][0]*mtmp[0][0] + r1[1][0]*mtmp[1][0] + r1[2][0]*mtmp[2][0]; +// m1[1] = r1[0][0]*mtmp[0][1] + r1[1][0]*mtmp[1][1] + r1[2][0]*mtmp[2][1]; +// m1[2] = r1[0][0]*mtmp[0][2] + r1[1][0]*mtmp[1][2] + r1[2][0]*mtmp[2][2]; +// +// m1[3] = r1[0][1]*mtmp[0][1] + r1[1][1]*mtmp[1][1] + r1[2][1]*mtmp[2][1]; +// m1[4] = r1[0][1]*mtmp[0][2] + r1[1][1]*mtmp[1][2] + r1[2][1]*mtmp[2][2]; +// +// m1[5] = r1[0][2]*mtmp[0][2] + r1[1][2]*mtmp[1][2] + r1[2][2]*mtmp[2][2]; +// +// memcpy(mm1,m1,6*sizeof(double)); + double eta; + eta = ps1*(1.0/ps2+mesh->info.hgrad*l); + eta = 1./(eta*eta); + for(int i = 0; i < 6; i++) mm1[i] *= eta; } return np1; } @@ -1207,39 +1211,43 @@ int MMG5_grad2metSurf(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria pt, int np1, mm2[kmin] += beta; } else{ - mu[0] = lambda[0]; - mu[1] = lambda[1]; - mu[2] = mr2[5]; - - mu[ichg] += beta; - - mtan2[0] = mu[0]*vp[0][0]*vp[0][0] + mu[1]*vp[1][0]*vp[1][0]; - mtan2[1] = mu[0]*vp[0][0]*vp[0][1] + mu[1]*vp[1][0]*vp[1][1]; - mtan2[2] = mu[0]*vp[0][1]*vp[0][1] + mu[1]*vp[1][1]*vp[1][1]; - - /* Return in initial basis */ - mtmp[0][0] = mtan2[0]*r2[0][0] + mtan2[1]*r2[1][0]; - mtmp[0][1] = mtan2[0]*r2[0][1] + mtan2[1]*r2[1][1]; - mtmp[0][2] = mtan2[0]*r2[0][2] + mtan2[1]*r2[1][2]; - - mtmp[1][0] = mtan2[1]*r2[0][0] + mtan2[2]*r2[1][0]; - mtmp[1][1] = mtan2[1]*r2[0][1] + mtan2[2]*r2[1][1]; - mtmp[1][2] = mtan2[1]*r2[0][2] + mtan2[2]*r2[1][2]; - - mtmp[2][0] = mr2[5]*r2[2][0]; - mtmp[2][1] = mr2[5]*r2[2][1]; - mtmp[2][2] = mr2[5]*r2[2][2]; - - m2[0] = r2[0][0]*mtmp[0][0] + r2[1][0]*mtmp[1][0] + r2[2][0]*mtmp[2][0]; - m2[1] = r2[0][0]*mtmp[0][1] + r2[1][0]*mtmp[1][1] + r2[2][0]*mtmp[2][1]; - m2[2] = r2[0][0]*mtmp[0][2] + r2[1][0]*mtmp[1][2] + r2[2][0]*mtmp[2][2]; - - m2[3] = r2[0][1]*mtmp[0][1] + r2[1][1]*mtmp[1][1] + r2[2][1]*mtmp[2][1]; - m2[4] = r2[0][1]*mtmp[0][2] + r2[1][1]*mtmp[1][2] + r2[2][1]*mtmp[2][2]; - - m2[5] = r2[0][2]*mtmp[0][2] + r2[1][2]*mtmp[1][2] + r2[2][2]*mtmp[2][2]; - - memcpy(mm2,m2,6*sizeof(double)); +// mu[0] = lambda[0]; +// mu[1] = lambda[1]; +// mu[2] = mr2[5]; +// +// mu[ichg] += beta; +// +// mtan2[0] = mu[0]*vp[0][0]*vp[0][0] + mu[1]*vp[1][0]*vp[1][0]; +// mtan2[1] = mu[0]*vp[0][0]*vp[0][1] + mu[1]*vp[1][0]*vp[1][1]; +// mtan2[2] = mu[0]*vp[0][1]*vp[0][1] + mu[1]*vp[1][1]*vp[1][1]; +// +// /* Return in initial basis */ +// mtmp[0][0] = mtan2[0]*r2[0][0] + mtan2[1]*r2[1][0]; +// mtmp[0][1] = mtan2[0]*r2[0][1] + mtan2[1]*r2[1][1]; +// mtmp[0][2] = mtan2[0]*r2[0][2] + mtan2[1]*r2[1][2]; +// +// mtmp[1][0] = mtan2[1]*r2[0][0] + mtan2[2]*r2[1][0]; +// mtmp[1][1] = mtan2[1]*r2[0][1] + mtan2[2]*r2[1][1]; +// mtmp[1][2] = mtan2[1]*r2[0][2] + mtan2[2]*r2[1][2]; +// +// mtmp[2][0] = mr2[5]*r2[2][0]; +// mtmp[2][1] = mr2[5]*r2[2][1]; +// mtmp[2][2] = mr2[5]*r2[2][2]; +// +// m2[0] = r2[0][0]*mtmp[0][0] + r2[1][0]*mtmp[1][0] + r2[2][0]*mtmp[2][0]; +// m2[1] = r2[0][0]*mtmp[0][1] + r2[1][0]*mtmp[1][1] + r2[2][0]*mtmp[2][1]; +// m2[2] = r2[0][0]*mtmp[0][2] + r2[1][0]*mtmp[1][2] + r2[2][0]*mtmp[2][2]; +// +// m2[3] = r2[0][1]*mtmp[0][1] + r2[1][1]*mtmp[1][1] + r2[2][1]*mtmp[2][1]; +// m2[4] = r2[0][1]*mtmp[0][2] + r2[1][1]*mtmp[1][2] + r2[2][1]*mtmp[2][2]; +// +// m2[5] = r2[0][2]*mtmp[0][2] + r2[1][2]*mtmp[1][2] + r2[2][2]*mtmp[2][2]; +// +// memcpy(mm2,m2,6*sizeof(double)); + double eta; + eta = ps2*(1.0/ps1+mesh->info.hgrad*l); + eta = 1./(eta*eta); + for(int i = 0; i < 6; i++) mm2[i] *= eta; } return np2; } diff --git a/src/mmg3d/anisosiz_3d.c b/src/mmg3d/anisosiz_3d.c index 189df9cf7..7d37fff16 100644 --- a/src/mmg3d/anisosiz_3d.c +++ b/src/mmg3d/anisosiz_3d.c @@ -1496,23 +1496,27 @@ int MMG5_grad2metVol(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTetra pt,int np1,int np mm1[kmin] += beta; } else { - /* Update the metric eigenvalue associated to the main metric direction - * which is closest to our edge direction (because this is the one that is - * the more influent on our edge length). */ - mu[0] = lambda[0]; - mu[1] = lambda[1]; - mu[2] = lambda[2]; - - mu[ichg] += beta; - - m1[0] = mu[0]*vp[0][0]*vp[0][0] + mu[1]*vp[1][0]*vp[1][0] + vp[2][0]*vp[2][0]*mu[2]; - m1[1] = mu[0]*vp[0][0]*vp[0][1] + mu[1]*vp[1][0]*vp[1][1] + vp[2][1]*vp[2][0]*mu[2]; - m1[2] = mu[0]*vp[0][0]*vp[0][2] + mu[1]*vp[1][0]*vp[1][2] + vp[2][0]*vp[2][2]*mu[2]; - m1[3] = mu[0]*vp[0][1]*vp[0][1] + mu[1]*vp[1][1]*vp[1][1] + vp[2][1]*vp[2][1]*mu[2]; - m1[4] = mu[0]*vp[0][1]*vp[0][2] + mu[1]*vp[1][1]*vp[1][2] + vp[2][1]*vp[2][2]*mu[2]; - m1[5] = mu[0]*vp[0][2]*vp[0][2] + mu[1]*vp[1][2]*vp[1][2] + vp[2][2]*vp[2][2]*mu[2]; - - memcpy(mm1,m1,6*sizeof(double)); +// /* Update the metric eigenvalue associated to the main metric direction +// * which is closest to our edge direction (because this is the one that is +// * the more influent on our edge length). */ +// mu[0] = lambda[0]; +// mu[1] = lambda[1]; +// mu[2] = lambda[2]; +// +// mu[ichg] += beta; +// +// m1[0] = mu[0]*vp[0][0]*vp[0][0] + mu[1]*vp[1][0]*vp[1][0] + vp[2][0]*vp[2][0]*mu[2]; +// m1[1] = mu[0]*vp[0][0]*vp[0][1] + mu[1]*vp[1][0]*vp[1][1] + vp[2][1]*vp[2][0]*mu[2]; +// m1[2] = mu[0]*vp[0][0]*vp[0][2] + mu[1]*vp[1][0]*vp[1][2] + vp[2][0]*vp[2][2]*mu[2]; +// m1[3] = mu[0]*vp[0][1]*vp[0][1] + mu[1]*vp[1][1]*vp[1][1] + vp[2][1]*vp[2][1]*mu[2]; +// m1[4] = mu[0]*vp[0][1]*vp[0][2] + mu[1]*vp[1][1]*vp[1][2] + vp[2][1]*vp[2][2]*mu[2]; +// m1[5] = mu[0]*vp[0][2]*vp[0][2] + mu[1]*vp[1][2]*vp[1][2] + vp[2][2]*vp[2][2]*mu[2]; +// +// memcpy(mm1,m1,6*sizeof(double)); + double eta; + eta = ps1*(1.0/ps2+mesh->info.hgrad*l); + eta = 1./(eta*eta); + for(int i = 0; i < 6; i++) mm1[i] *= eta; } return np1; } @@ -1572,19 +1576,23 @@ int MMG5_grad2metVol(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTetra pt,int np1,int np mm2[kmin] += beta; } else{ - mu[0] = lambda[0]; - mu[1] = lambda[1]; - mu[2] = lambda[2]; - - mu[ichg] += beta; - - m2[0] = mu[0]*vp[0][0]*vp[0][0] + mu[1]*vp[1][0]*vp[1][0] + vp[2][0]*vp[2][0]*mu[2]; - m2[1] = mu[0]*vp[0][0]*vp[0][1] + mu[1]*vp[1][0]*vp[1][1] + vp[2][1]*vp[2][0]*mu[2]; - m2[2] = mu[0]*vp[0][0]*vp[0][2] + mu[1]*vp[1][0]*vp[1][2] + vp[2][0]*vp[2][2]*mu[2]; - m2[3] = mu[0]*vp[0][1]*vp[0][1] + mu[1]*vp[1][1]*vp[1][1] + vp[2][1]*vp[2][1]*mu[2]; - m2[4] = mu[0]*vp[0][1]*vp[0][2] + mu[1]*vp[1][1]*vp[1][2] + vp[2][1]*vp[2][2]*mu[2]; - m2[5] = mu[0]*vp[0][2]*vp[0][2] + mu[1]*vp[1][2]*vp[1][2] + vp[2][2]*vp[2][2]*mu[2]; - memcpy(mm2,m2,6*sizeof(double)); +// mu[0] = lambda[0]; +// mu[1] = lambda[1]; +// mu[2] = lambda[2]; +// +// mu[ichg] += beta; +// +// m2[0] = mu[0]*vp[0][0]*vp[0][0] + mu[1]*vp[1][0]*vp[1][0] + vp[2][0]*vp[2][0]*mu[2]; +// m2[1] = mu[0]*vp[0][0]*vp[0][1] + mu[1]*vp[1][0]*vp[1][1] + vp[2][1]*vp[2][0]*mu[2]; +// m2[2] = mu[0]*vp[0][0]*vp[0][2] + mu[1]*vp[1][0]*vp[1][2] + vp[2][0]*vp[2][2]*mu[2]; +// m2[3] = mu[0]*vp[0][1]*vp[0][1] + mu[1]*vp[1][1]*vp[1][1] + vp[2][1]*vp[2][1]*mu[2]; +// m2[4] = mu[0]*vp[0][1]*vp[0][2] + mu[1]*vp[1][1]*vp[1][2] + vp[2][1]*vp[2][2]*mu[2]; +// m2[5] = mu[0]*vp[0][2]*vp[0][2] + mu[1]*vp[1][2]*vp[1][2] + vp[2][2]*vp[2][2]*mu[2]; +// memcpy(mm2,m2,6*sizeof(double)); + double eta; + eta = ps2*(1.0/ps1+mesh->info.hgrad*l); + eta = 1./(eta*eta); + for(int i = 0; i < 6; i++) mm2[i] *= eta; } return np2; } From cbdaee8a196b93d6affc66572d45200593338f41 Mon Sep 17 00:00:00 2001 From: luca Date: Tue, 22 Dec 2020 11:07:44 +0100 Subject: [PATCH 002/838] Test transformation. --- src/common/anisosiz.c | 68 +++++++++++++++++++++++++++++++++++------ src/mmg3d/anisosiz_3d.c | 60 ++++++++++++++++++++++++++++++------ 2 files changed, 108 insertions(+), 20 deletions(-) diff --git a/src/common/anisosiz.c b/src/common/anisosiz.c index 1cb13251a..d82423cce 100644 --- a/src/common/anisosiz.c +++ b/src/common/anisosiz.c @@ -926,6 +926,14 @@ int MMG5_grad2metSurf(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria pt, int np1, uy = p2->c[1] - p1->c[1]; uz = p2->c[2] - p1->c[2]; + double t[3]; + l = sqrt(ux*ux+uy*uy+uz*uz); + + t[0] = ux/l; + t[1] = uy/l; + t[2] = uz/l; + + mm1 = &met->m[6*np1]; mm2 = &met->m[6*np2]; @@ -1148,11 +1156,31 @@ int MMG5_grad2metSurf(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria pt, int np1, // // m1[5] = r1[0][2]*mtmp[0][2] + r1[1][2]*mtmp[1][2] + r1[2][2]*mtmp[2][2]; // -// memcpy(mm1,m1,6*sizeof(double)); - double eta; - eta = ps1*(1.0/ps2+mesh->info.hgrad*l); - eta = 1./(eta*eta); - for(int i = 0; i < 6; i++) mm1[i] *= eta; + double r[3][3]; + MMG5_rotmatrix(t,r); + assert( fabs(r[0][0]*t[0]+r[0][1]*t[1]+r[0][2]*t[2]) < 1.e-3 ); + assert( fabs(r[1][0]*t[0]+r[1][1]*t[1]+r[1][2]*t[2]) < 1.e-3 ); + assert( fabs(r[2][0]*t[0]+r[2][1]*t[1]+r[2][2]*t[2]-1.0) < 1.e-3 ); + MMG5_rmtr(r,m1,mm1); + double ieta; + /* eta = ps1*(1.0/ps2+mesh->info.hgrad*l); */ + ieta = 1.0/(ps1*(1.0/ps2+mesh->info.hgrad*l)); + m1[0] = mm1[0]; + m1[1] = mm1[1]; + m1[2] = mm1[2]*ieta; + m1[3] = mm1[3]; + m1[4] = mm1[4]*ieta; + m1[5] = mm1[5]*ieta*ieta; + double tmp; + for( int i = 0; i < 2; i++ ) { + for( int k = i+1; k < 3; k++ ) { + tmp = r[i][k]; + r[i][k] = r[k][i]; + r[k][i] = tmp; + } + } + MMG5_rmtr(r,m1,mm1); + memcpy(mm1,m1,6*sizeof(double)); } return np1; } @@ -1243,11 +1271,31 @@ int MMG5_grad2metSurf(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria pt, int np1, // // m2[5] = r2[0][2]*mtmp[0][2] + r2[1][2]*mtmp[1][2] + r2[2][2]*mtmp[2][2]; // -// memcpy(mm2,m2,6*sizeof(double)); - double eta; - eta = ps2*(1.0/ps1+mesh->info.hgrad*l); - eta = 1./(eta*eta); - for(int i = 0; i < 6; i++) mm2[i] *= eta; + double r[3][3]; + MMG5_rotmatrix(t,r); + assert( fabs(r[0][0]*t[0]+r[0][1]*t[1]+r[0][2]*t[2]) < 1.e-3 ); + assert( fabs(r[1][0]*t[0]+r[1][1]*t[1]+r[1][2]*t[2]) < 1.e-3 ); + assert( fabs(r[2][0]*t[0]+r[2][1]*t[1]+r[2][2]*t[2]-1.0) < 1.e-3 ); + MMG5_rmtr(r,m2,mm2); + double ieta; + /* eta = ps2*(1.0/ps1+mesh->info.hgrad*l); */ + ieta = 1.0/(ps2*(1.0/ps1+mesh->info.hgrad*l)); + m2[0] = mm2[0]; + m2[1] = mm2[1]; + m2[2] = mm2[2]*ieta; + m2[3] = mm2[3]; + m2[4] = mm2[4]*ieta; + m2[5] = mm2[5]*ieta*ieta; + double tmp; + for( int i = 0; i < 2; i++ ) { + for( int k = i+1; k < 3; k++ ) { + tmp = r[i][k]; + r[i][k] = r[k][i]; + r[k][i] = tmp; + } + } + MMG5_rmtr(r,m2,mm2); + memcpy(mm2,m2,6*sizeof(double)); } return np2; } diff --git a/src/mmg3d/anisosiz_3d.c b/src/mmg3d/anisosiz_3d.c index 7d37fff16..90f31b4c3 100644 --- a/src/mmg3d/anisosiz_3d.c +++ b/src/mmg3d/anisosiz_3d.c @@ -1512,11 +1512,31 @@ int MMG5_grad2metVol(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTetra pt,int np1,int np // m1[4] = mu[0]*vp[0][1]*vp[0][2] + mu[1]*vp[1][1]*vp[1][2] + vp[2][1]*vp[2][2]*mu[2]; // m1[5] = mu[0]*vp[0][2]*vp[0][2] + mu[1]*vp[1][2]*vp[1][2] + vp[2][2]*vp[2][2]*mu[2]; // -// memcpy(mm1,m1,6*sizeof(double)); - double eta; - eta = ps1*(1.0/ps2+mesh->info.hgrad*l); - eta = 1./(eta*eta); - for(int i = 0; i < 6; i++) mm1[i] *= eta; + double r[3][3]; + MMG5_rotmatrix(t,r); + assert( fabs(r[0][0]*t[0]+r[0][1]*t[1]+r[0][2]*t[2]) < 1.e-3 ); + assert( fabs(r[1][0]*t[0]+r[1][1]*t[1]+r[1][2]*t[2]) < 1.e-3 ); + assert( fabs(r[2][0]*t[0]+r[2][1]*t[1]+r[2][2]*t[2]-1.0) < 1.e-3 ); + MMG5_rmtr(r,m1,mm1); + double ieta; + /* eta = ps1*(1.0/ps2+mesh->info.hgrad*l); */ + ieta = 1.0/(ps1*(1.0/ps2+mesh->info.hgrad*l)); + m1[0] = mm1[0]; + m1[1] = mm1[1]; + m1[2] = mm1[2]*ieta; + m1[3] = mm1[3]; + m1[4] = mm1[4]*ieta; + m1[5] = mm1[5]*ieta*ieta; + double tmp; + for( int i = 0; i < 2; i++ ) { + for( int k = i+1; k < 3; k++ ) { + tmp = r[i][k]; + r[i][k] = r[k][i]; + r[k][i] = tmp; + } + } + MMG5_rmtr(r,m1,mm1); + memcpy(mm1,m1,6*sizeof(double)); } return np1; } @@ -1588,11 +1608,31 @@ int MMG5_grad2metVol(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTetra pt,int np1,int np // m2[3] = mu[0]*vp[0][1]*vp[0][1] + mu[1]*vp[1][1]*vp[1][1] + vp[2][1]*vp[2][1]*mu[2]; // m2[4] = mu[0]*vp[0][1]*vp[0][2] + mu[1]*vp[1][1]*vp[1][2] + vp[2][1]*vp[2][2]*mu[2]; // m2[5] = mu[0]*vp[0][2]*vp[0][2] + mu[1]*vp[1][2]*vp[1][2] + vp[2][2]*vp[2][2]*mu[2]; -// memcpy(mm2,m2,6*sizeof(double)); - double eta; - eta = ps2*(1.0/ps1+mesh->info.hgrad*l); - eta = 1./(eta*eta); - for(int i = 0; i < 6; i++) mm2[i] *= eta; + double r[3][3]; + MMG5_rotmatrix(t,r); + assert( fabs(r[0][0]*t[0]+r[0][1]*t[1]+r[0][2]*t[2]) < 1.e-3 ); + assert( fabs(r[1][0]*t[0]+r[1][1]*t[1]+r[1][2]*t[2]) < 1.e-3 ); + assert( fabs(r[2][0]*t[0]+r[2][1]*t[1]+r[2][2]*t[2]-1.0) < 1.e-3 ); + MMG5_rmtr(r,m2,mm2); + double ieta; + /* eta = ps2*(1.0/ps1+mesh->info.hgrad*l); */ + ieta = 1.0/(ps2*(1.0/ps1+mesh->info.hgrad*l)); + m2[0] = mm2[0]; + m2[1] = mm2[1]; + m2[2] = mm2[2]*ieta; + m2[3] = mm2[3]; + m2[4] = mm2[4]*ieta; + m2[5] = mm2[5]*ieta*ieta; + double tmp; + for( int i = 0; i < 2; i++ ) { + for( int k = i+1; k < 3; k++ ) { + tmp = r[i][k]; + r[i][k] = r[k][i]; + r[k][i] = tmp; + } + } + MMG5_rmtr(r,m2,mm2); + memcpy(mm2,m2,6*sizeof(double)); } return np2; } From 158985871cde1f6829d24e027920e25e7b9682c8 Mon Sep 17 00:00:00 2001 From: luca Date: Tue, 22 Dec 2020 15:11:40 +0100 Subject: [PATCH 003/838] Fix matrices. --- src/common/anisosiz.c | 4 ++-- src/mmg3d/anisosiz_3d.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/anisosiz.c b/src/common/anisosiz.c index d82423cce..dc01cc65b 100644 --- a/src/common/anisosiz.c +++ b/src/common/anisosiz.c @@ -1180,7 +1180,7 @@ int MMG5_grad2metSurf(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria pt, int np1, } } MMG5_rmtr(r,m1,mm1); - memcpy(mm1,m1,6*sizeof(double)); +// memcpy(mm1,m1,6*sizeof(double)); } return np1; } @@ -1295,7 +1295,7 @@ int MMG5_grad2metSurf(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria pt, int np1, } } MMG5_rmtr(r,m2,mm2); - memcpy(mm2,m2,6*sizeof(double)); +// memcpy(mm2,m2,6*sizeof(double)); } return np2; } diff --git a/src/mmg3d/anisosiz_3d.c b/src/mmg3d/anisosiz_3d.c index 90f31b4c3..0120da646 100644 --- a/src/mmg3d/anisosiz_3d.c +++ b/src/mmg3d/anisosiz_3d.c @@ -1536,7 +1536,7 @@ int MMG5_grad2metVol(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTetra pt,int np1,int np } } MMG5_rmtr(r,m1,mm1); - memcpy(mm1,m1,6*sizeof(double)); +// memcpy(mm1,m1,6*sizeof(double)); } return np1; } @@ -1632,7 +1632,7 @@ int MMG5_grad2metVol(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTetra pt,int np1,int np } } MMG5_rmtr(r,m2,mm2); - memcpy(mm2,m2,6*sizeof(double)); +// memcpy(mm2,m2,6*sizeof(double)); } return np2; } From 2ac37b4f906dc26c3c28d8b0c4d037c096d8f0c1 Mon Sep 17 00:00:00 2001 From: luca Date: Sun, 2 May 2021 15:03:42 +0200 Subject: [PATCH 004/838] Test simred 3d. --- src/mmg3d/anisosiz_3d.c | 537 ++++++++++++++++++---------------------- 1 file changed, 236 insertions(+), 301 deletions(-) diff --git a/src/mmg3d/anisosiz_3d.c b/src/mmg3d/anisosiz_3d.c index 0120da646..c213e2c1d 100644 --- a/src/mmg3d/anisosiz_3d.c +++ b/src/mmg3d/anisosiz_3d.c @@ -1360,285 +1360,6 @@ int MMG3D_defsiz_ani(MMG5_pMesh mesh,MMG5_pSol met) { return 1; } -/** - * \param mesh pointer toward the mesh. - * \param met pointer toward the metric structure. - * \param pt pointer toward a tetra. - * \param np1 global index of the first edge extremity. - * \param np2 global index of the second edge extremity. - * - * \return -1 if no gradation is needed, else index of graded point. - * - * Enforces gradation of metric in one extremity of edge \a ia in tetra \a pt - * with respect to the other. - * - */ -static inline -int MMG5_grad2metVol(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTetra pt,int np1,int np2) { - MMG5_pPoint p1,p2; - double *mm1,*mm2,m1[6],m2[6],ps1,ps2,ux,uy,uz; - double c[5],l,val,t[3],rbasis1[3][3],rbasis2[3][3]; - double lambda[3],vp[3][3],alpha,beta,mu[3]; - int kmin,i; - int8_t ichg; - static int8_t mmgWarn = 0; - - p1 = &mesh->point[np1]; - p2 = &mesh->point[np2]; - - mm1 = &met->m[6*np1]; - mm2 = &met->m[6*np2]; - - ux = p2->c[0] - p1->c[0]; - uy = p2->c[1] - p1->c[1]; - uz = p2->c[2] - p1->c[2]; - - if ( (!( MG_SIN(p1->tag) || (p1->tag & MG_NOM) )) && p1->tag & MG_GEO ) { - /* Recover normal and metric associated to p1 */ - /* Note that rbasis1/2 are not used in this function */ - if( !MMG5_buildridmet(mesh,met,np1,ux,uy,uz,m1,rbasis1) ) - return -1; - } - else - memcpy(m1,mm1,6*sizeof(double)); - - if ( (!( MG_SIN(p2->tag) || (p2->tag & MG_NOM) )) && p2->tag & MG_GEO ) { - /* Recover normal and metric associated to p2 */ - if( !MMG5_buildridmet(mesh,met,np2,ux,uy,uz,m2,rbasis2) ) - return -1; - } - else - memcpy(m2,mm2,6*sizeof(double)); - - l = sqrt(ux*ux+uy*uy+uz*uz); - - t[0] = ux/l; - t[1] = uy/l; - t[2] = uz/l; - - // edge length in metric m1: sqrt(t^u * m1 * u). - ps1 = m1[0]*t[0]*t[0] + 2.0*m1[1]*t[0]*t[1] + m1[3]*t[1]*t[1] - + 2.0*m1[2]*t[0]*t[2] + 2.0*m1[4]*t[1]*t[2] + m1[5]*t[2]*t[2]; - ps1 = sqrt(ps1); - - // edge length in metric m2: sqrt(t^u * m2 * u). - ps2 = m2[0]*t[0]*t[0] + 2.0*m2[1]*t[0]*t[1] + m2[3]*t[1]*t[1] - + 2.0*m2[2]*t[0]*t[2] + 2.0*m2[4]*t[1]*t[2] + m2[5]*t[2]*t[2]; - ps2 = sqrt(ps2); - - /* Metric in p1 has to be changed */ - if ( ps2 > ps1 ){ - /* compute alpha = h2 + hgrad*l */ - alpha = ps2 /(1.0+mesh->info.hgrad*l*ps2); - if( ps1 >= alpha -MMG5_EPS ) - return -1; - - if ( !MMG5_eigenv(1,m1,lambda,vp) ) { - if ( !mmgWarn ) { - fprintf(stderr,"\n ## Warning: %s: Unable to diagonalize at least" - " 1 metric.\n",__func__); - mmgWarn = 1; - } - return -1; - } - - /* Project the vector t1 along the main directions of the metric */ - c[0] = t[0]*vp[0][0] + t[1]*vp[0][1] + t[2]*vp[0][2]; - c[1] = t[0]*vp[1][0] + t[1]*vp[1][1] + t[2]*vp[1][2]; - c[2] = t[0]*vp[2][0] + t[1]*vp[2][1] + t[2]*vp[2][2]; - - /* Find index of the maximum value of c: this allow to detect which of the - * main directions of the metric is closest to our edge direction. We want - * that our new metric respect the gradation related to the size associated - * to this main direction (the ichg direction). */ - ichg = 0; - val = fabs(c[ichg]); - for (i = 1; i<3; ++i) { - if ( fabs(c[i]) > val ) { - val = fabs(c[i]); - ichg = i; - } - } - assert(c[ichg]*c[ichg] > MMG5_EPS ); - /* Compute beta coef such as lambda_1 = beta*lambda_1 => h1 = h2 + hgrad*l - * (see p317 of Charles Dapogny Thesis). */ - beta = (alpha*alpha - ps1*ps1)/(c[ichg]*c[ichg]); - - /* Metric update */ - if( MG_SIN(p1->tag) || (p1->tag & MG_NOM) ){ - /* lambda_new = 0.5 lambda_1 + 0.5 beta lambda_1: here we choose to not - * respect the gradation in order to restric the influence of the singular - * points. */ - mm1[0] += 0.5*beta; - mm1[3] += 0.5*beta; - mm1[5] += 0.5*beta; - } - else if( p1->tag & MG_GEO ) { - /* lambda[ichg] is the metric eigenvalue associated to the main metric - * direction closest to our edge direction. Find were is stored this - * eigenvalue in our special storage of ridge metric (mm-lambda = 0) and - * update it. */ - c[0] = fabs(mm1[0]-lambda[ichg]); - c[1] = fabs(mm1[1]-lambda[ichg]); - c[2] = fabs(mm1[2]-lambda[ichg]); - c[3] = fabs(mm1[3]-lambda[ichg]); - c[4] = fabs(mm1[4]-lambda[ichg]); - - // Find index af the minimum value of c - kmin = 0; - val = fabs(c[kmin]); - for (i = 1; i<5; ++i) { - if ( fabs(c[i]) < val ) { - val = fabs(c[i]); - kmin = i; - } - } - mm1[kmin] += beta; - } - else { -// /* Update the metric eigenvalue associated to the main metric direction -// * which is closest to our edge direction (because this is the one that is -// * the more influent on our edge length). */ -// mu[0] = lambda[0]; -// mu[1] = lambda[1]; -// mu[2] = lambda[2]; -// -// mu[ichg] += beta; -// -// m1[0] = mu[0]*vp[0][0]*vp[0][0] + mu[1]*vp[1][0]*vp[1][0] + vp[2][0]*vp[2][0]*mu[2]; -// m1[1] = mu[0]*vp[0][0]*vp[0][1] + mu[1]*vp[1][0]*vp[1][1] + vp[2][1]*vp[2][0]*mu[2]; -// m1[2] = mu[0]*vp[0][0]*vp[0][2] + mu[1]*vp[1][0]*vp[1][2] + vp[2][0]*vp[2][2]*mu[2]; -// m1[3] = mu[0]*vp[0][1]*vp[0][1] + mu[1]*vp[1][1]*vp[1][1] + vp[2][1]*vp[2][1]*mu[2]; -// m1[4] = mu[0]*vp[0][1]*vp[0][2] + mu[1]*vp[1][1]*vp[1][2] + vp[2][1]*vp[2][2]*mu[2]; -// m1[5] = mu[0]*vp[0][2]*vp[0][2] + mu[1]*vp[1][2]*vp[1][2] + vp[2][2]*vp[2][2]*mu[2]; -// - double r[3][3]; - MMG5_rotmatrix(t,r); - assert( fabs(r[0][0]*t[0]+r[0][1]*t[1]+r[0][2]*t[2]) < 1.e-3 ); - assert( fabs(r[1][0]*t[0]+r[1][1]*t[1]+r[1][2]*t[2]) < 1.e-3 ); - assert( fabs(r[2][0]*t[0]+r[2][1]*t[1]+r[2][2]*t[2]-1.0) < 1.e-3 ); - MMG5_rmtr(r,m1,mm1); - double ieta; - /* eta = ps1*(1.0/ps2+mesh->info.hgrad*l); */ - ieta = 1.0/(ps1*(1.0/ps2+mesh->info.hgrad*l)); - m1[0] = mm1[0]; - m1[1] = mm1[1]; - m1[2] = mm1[2]*ieta; - m1[3] = mm1[3]; - m1[4] = mm1[4]*ieta; - m1[5] = mm1[5]*ieta*ieta; - double tmp; - for( int i = 0; i < 2; i++ ) { - for( int k = i+1; k < 3; k++ ) { - tmp = r[i][k]; - r[i][k] = r[k][i]; - r[k][i] = tmp; - } - } - MMG5_rmtr(r,m1,mm1); -// memcpy(mm1,m1,6*sizeof(double)); - } - return np1; - } - /* Metric in p2 has to be changed */ - else{ - alpha = ps1 /(1.0+mesh->info.hgrad*l*ps1); - if( ps2 >= alpha - MMG5_EPS) - return -1; - - MMG5_eigenv(1,m2,lambda,vp); - - c[0] = t[0]*vp[0][0] + t[1]*vp[0][1] + t[2]*vp[0][2]; - c[1] = t[0]*vp[1][0] + t[1]*vp[1][1] + t[2]*vp[1][2]; - c[2] = t[0]*vp[2][0] + t[1]*vp[2][1] + t[2]*vp[2][2]; - - /* Detect which of the main directions of the metric is closest to our edge - * direction. */ - ichg = 0; - val = fabs(c[ichg]); - for (i = 1; i<3; ++i) { - if ( fabs(c[i]) > val ) { - val = fabs(c[i]); - ichg = i; - } - } - assert(c[ichg]*c[ichg] > MMG5_EPS ); - /* Compute beta coef such as lambda_1 = beta*lambda_1 => h1 = h2 + hgrad*l - * (see p317 of Charles Dapogny Thesis). */ - beta = (alpha*alpha - ps2*ps2)/(c[ichg]*c[ichg]); - - /* Metric update: update the metric eigenvalue associated to the main metric - * direction which is closest to our edge direction (because this is the - * one that is the more influent on our edge length). */ - if( MG_SIN(p2->tag) || (p2->tag & MG_NOM) ){ - /* lambda_new = 0.5 lambda_1 + 0.5 beta lambda_1: here we choose to not - * respect the gradation in order to restric the influence of the singular - * points. */ - mm2[0] += 0.5*beta; - mm2[3] += 0.5*beta; - mm2[5] += 0.5*beta; - } - else if( p2->tag & MG_GEO ){ - c[0] = fabs(mm2[0]-lambda[ichg]); - c[1] = fabs(mm2[1]-lambda[ichg]); - c[2] = fabs(mm2[2]-lambda[ichg]); - c[3] = fabs(mm2[3]-lambda[ichg]); - c[4] = fabs(mm2[4]-lambda[ichg]); - - kmin = 0; - val = fabs(c[kmin]); - for (i = 1; i<5; ++i) { - if ( c[i] < fabs(val) ) { - val = fabs(c[i]); - kmin = i; - } - } - mm2[kmin] += beta; - } - else{ -// mu[0] = lambda[0]; -// mu[1] = lambda[1]; -// mu[2] = lambda[2]; -// -// mu[ichg] += beta; -// -// m2[0] = mu[0]*vp[0][0]*vp[0][0] + mu[1]*vp[1][0]*vp[1][0] + vp[2][0]*vp[2][0]*mu[2]; -// m2[1] = mu[0]*vp[0][0]*vp[0][1] + mu[1]*vp[1][0]*vp[1][1] + vp[2][1]*vp[2][0]*mu[2]; -// m2[2] = mu[0]*vp[0][0]*vp[0][2] + mu[1]*vp[1][0]*vp[1][2] + vp[2][0]*vp[2][2]*mu[2]; -// m2[3] = mu[0]*vp[0][1]*vp[0][1] + mu[1]*vp[1][1]*vp[1][1] + vp[2][1]*vp[2][1]*mu[2]; -// m2[4] = mu[0]*vp[0][1]*vp[0][2] + mu[1]*vp[1][1]*vp[1][2] + vp[2][1]*vp[2][2]*mu[2]; -// m2[5] = mu[0]*vp[0][2]*vp[0][2] + mu[1]*vp[1][2]*vp[1][2] + vp[2][2]*vp[2][2]*mu[2]; - double r[3][3]; - MMG5_rotmatrix(t,r); - assert( fabs(r[0][0]*t[0]+r[0][1]*t[1]+r[0][2]*t[2]) < 1.e-3 ); - assert( fabs(r[1][0]*t[0]+r[1][1]*t[1]+r[1][2]*t[2]) < 1.e-3 ); - assert( fabs(r[2][0]*t[0]+r[2][1]*t[1]+r[2][2]*t[2]-1.0) < 1.e-3 ); - MMG5_rmtr(r,m2,mm2); - double ieta; - /* eta = ps2*(1.0/ps1+mesh->info.hgrad*l); */ - ieta = 1.0/(ps2*(1.0/ps1+mesh->info.hgrad*l)); - m2[0] = mm2[0]; - m2[1] = mm2[1]; - m2[2] = mm2[2]*ieta; - m2[3] = mm2[3]; - m2[4] = mm2[4]*ieta; - m2[5] = mm2[5]*ieta*ieta; - double tmp; - for( int i = 0; i < 2; i++ ) { - for( int k = i+1; k < 3; k++ ) { - tmp = r[i][k]; - r[i][k] = r[k][i]; - r[k][i] = tmp; - } - } - MMG5_rmtr(r,m2,mm2); -// memcpy(mm2,m2,6*sizeof(double)); - } - return np2; - } -} - - /** * \param mesh pointer toward the mesh * \param m first matrix @@ -1740,6 +1461,170 @@ int MMG3D_simred(MMG5_pMesh mesh,double *m,double *n,double dm[3], return 1; } +/** + * \param m first matrix + * \param mext second (extended) matrix + * \param iloc index of the point on the edge (1 or 2) + * \param ier flag of the modified eigenvalue: (ier & 1) if dm is altered, and (ier & 2) if dn is altered. + * + * Gradation of sizes = 1/sqrt(eigenv of the tensors) in the \a idir direction. + * + */ +static inline +void MMG3D_gradEigenv(MMG5_pMesh mesh,double m[6],double mext[6],int8_t iloc,int *ier) { + double dm[3],dmext[3],vp[3][3],ivp[3][3]; + + if( !MMG3D_simred(mesh,m,mext,dm,dmext,vp) ) { + *ier = -1; + return; + } + + /* Gradation of sizes */ + for( int i = 0; i< 3; i++ ) { + if( dmext[i] > dm[i] ) { + dm[i] = dmext[i]; + (*ier) = (*ier) | iloc; + } + } + + if( (*ier) & iloc ) { + /* Simultaneous reduction basis is non-orthogonal, so invert it for the + * inverse transformation */ + if( !MMG5_invmat33(vp,ivp) ) { + *ier = -1; + return; + } + + int ij = 0; + for( int i = 0; i < 3; i++ ) { + for( int j = i; j < 3; j++ ) { + m[ij] = 0.; + for( int k = 0; k < 3; k++ ) { + m[ij] += dm[k]*ivp[k][i]*ivp[k][j]; + } + ++ij; + } + } + } +} + +/** + * \param mesh pointer toward the mesh. + * \param met pointer toward the metric structure. + * \param pt pointer toward a tetra. + * \param np1 global index of the first edge extremity. + * \param np2 global index of the second edge extremity. + * + * \return -1 if no gradation is needed, else index of graded point. + * + * Enforces gradation of metric in one extremity of edge \a ia in tetra \a pt + * with respect to the other. + * + */ +static inline +int MMG5_grad2metVol(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTetra pt,int np1,int np2) { + MMG5_pPoint p1,p2; + double *mm1,*mm2,m1[6],m2[6],ps1,ps2,ux,uy,uz; + double c[5],l,val,t[3],rbasis1[3][3],rbasis2[3][3]; + double lambda[3],vp[3][3],alpha,beta,mu[3]; + int kmin,i; + int ier = 0; + int8_t ichg; + static int8_t mmgWarn = 0; + + p1 = &mesh->point[np1]; + p2 = &mesh->point[np2]; + + mm1 = &met->m[6*np1]; + mm2 = &met->m[6*np2]; + + ux = p2->c[0] - p1->c[0]; + uy = p2->c[1] - p1->c[1]; + uz = p2->c[2] - p1->c[2]; + + if ( (!( MG_SIN(p1->tag) || (p1->tag & MG_NOM) )) && p1->tag & MG_GEO ) { + /* Recover normal and metric associated to p1 */ + /* Note that rbasis1/2 are not used in this function */ +// if( !MMG5_buildridmet(mesh,met,np1,ux,uy,uz,m1,rbasis1) ) + return -1; + } + else + memcpy(m1,mm1,6*sizeof(double)); + + if ( (!( MG_SIN(p2->tag) || (p2->tag & MG_NOM) )) && p2->tag & MG_GEO ) { + /* Recover normal and metric associated to p2 */ +// if( !MMG5_buildridmet(mesh,met,np2,ux,uy,uz,m2,rbasis2) ) + return -1; + } + else + memcpy(m2,mm2,6*sizeof(double)); + + l = sqrt(ux*ux+uy*uy+uz*uz); + + t[0] = ux/l; + t[1] = uy/l; + t[2] = uz/l; + + double l1[3],l2[3],ieta,vv[9],ivv[9],tmp[9],tmpa[9]; + double R[3][3]; + + MMG5_eigenv(1,m1,lambda,R); + for( int i = 0; i < 3; i++ ) { + lambda[i] = 1./pow( 1./sqrt(lambda[i]) + mesh->info.hgrad*l + MMG5_EPSOK, 2.0); + } + +// m1[0] = lambda[0]*R[0][0]*R[0][0]+lambda[1]*R[1][0]*R[1][0]+lambda[2]*R[2][0]*R[2][0]; +// m1[1] = lambda[0]*R[0][0]*R[0][1]+lambda[1]*R[1][0]*R[1][1]+lambda[2]*R[2][0]*R[2][1]; +// m1[2] = lambda[0]*R[0][0]*R[0][2]+lambda[1]*R[1][0]*R[1][2]+lambda[2]*R[2][0]*R[2][2]; +// m1[3] = lambda[0]*R[0][1]*R[0][1]+lambda[1]*R[1][1]*R[1][1]+lambda[2]*R[2][1]*R[2][1]; +// m1[4] = lambda[0]*R[0][1]*R[0][2]+lambda[1]*R[1][1]*R[1][2]+lambda[2]*R[2][1]*R[2][2]; +// m1[5] = lambda[0]*R[0][2]*R[0][2]+lambda[1]*R[1][2]*R[1][2]+lambda[2]*R[2][2]*R[2][2]; + + int ij = 0; + for( int i = 0; i < 3; i++ ) { + for( int j = i; j < 3; j++ ) { + m1[ij] = 0.; + for( int k = 0; k < 3; k++ ) { + m1[ij] += lambda[k]*R[k][i]*R[k][j]; + } + ++ij; + } + } + + MMG5_eigenv(1,m2,lambda,R); + for( int i = 0; i < 3; i++ ) { + lambda[i] = 1./pow( 1./sqrt(lambda[i]) + mesh->info.hgrad*l + MMG5_EPSOK, 2.0); + } + +// m2[0] = lambda[0]*R[0][0]*R[0][0]+lambda[1]*R[1][0]*R[1][0]+lambda[2]*R[2][0]*R[2][0]; +// m2[1] = lambda[0]*R[0][0]*R[0][1]+lambda[1]*R[1][0]*R[1][1]+lambda[2]*R[2][0]*R[2][1]; +// m2[2] = lambda[0]*R[0][0]*R[0][2]+lambda[1]*R[1][0]*R[1][2]+lambda[2]*R[2][0]*R[2][2]; +// m2[3] = lambda[0]*R[0][1]*R[0][1]+lambda[1]*R[1][1]*R[1][1]+lambda[2]*R[2][1]*R[2][1]; +// m2[4] = lambda[0]*R[0][1]*R[0][2]+lambda[1]*R[1][1]*R[1][2]+lambda[2]*R[2][1]*R[2][2]; +// m2[5] = lambda[0]*R[0][2]*R[0][2]+lambda[1]*R[1][2]*R[1][2]+lambda[2]*R[2][2]*R[2][2]; + + ij = 0; + for( int i = 0; i < 3; i++ ) { + for( int j = i; j < 3; j++ ) { + m2[ij] = 0.; + for( int k = 0; k < 3; k++ ) { + m2[ij] += lambda[k]*R[k][i]*R[k][j]; + } + ++ij; + } + } + + MMG3D_gradEigenv(mesh,mm2,m1,2,&ier); + if( ier == -1 ) return ier; + + MMG3D_gradEigenv(mesh,mm1,m2,1,&ier); + if( ier == -1 ) return ier; + + return ier; + +} + + /** * \param n matrix to update * \param dn eigenvalues of n in the coreduction basis @@ -1932,6 +1817,8 @@ int MMG5_grad2metVolreq(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTetra pt,int npmaste * */ int MMG3D_gradsiz_ani(MMG5_pMesh mesh,MMG5_pSol met) { + MMG5_Hash edgeTable; + MMG5_hedge *pht; MMG5_pTetra pt; MMG5_pxTetra pxt; MMG5_Tria ptt; @@ -1939,6 +1826,7 @@ int MMG3D_gradsiz_ani(MMG5_pMesh mesh,MMG5_pSol met) { double *m,mv; int k,it,itv,nup,nu,nupv,maxit; int i,j,np0,np1,ier; + static int8_t mmgWarn = 0; if ( abs(mesh->info.imprim) > 5 || mesh->info.ddebug ) fprintf(stdout," ** Anisotropic mesh gradation\n"); @@ -1993,7 +1881,8 @@ int MMG3D_gradsiz_ani(MMG5_pMesh mesh,MMG5_pSol met) { if ( p0->s || p1->s ) continue; /* gradation along the tangent plane */ - ier = MMG5_grad2metSurf(mesh,met,&ptt,np0,np1); + ier = 0; +// ier = MMG5_grad2metSurf(mesh,met,&ptt,np0,np1); if ( ier == np0 ) { p0->flag = mesh->base; nu++; @@ -2012,43 +1901,89 @@ int MMG3D_gradsiz_ani(MMG5_pMesh mesh,MMG5_pSol met) { } while( ++it < maxit && nu > 0 ); + /////////////////////7 + + /* alloc hashtable */ + if ( !MMG5_hashNew(mesh,&edgeTable,mesh->nemax,3*mesh->nemax) ) { + fprintf(stderr,"\n ## Error: %s: unable to allocate hash table.\n",__func__); + return 0; + } + + /* build edge table */ + for(k=1 ; k<=mesh->ne ; k++) { + pt = &mesh->tetra[k]; + if ( !MG_EOK(pt) ) { + continue; + } + for(i=0 ; i<6 ; i++) { + np0 = pt->v[MMG5_iare[i][0]]; + np1 = pt->v[MMG5_iare[i][1]]; + + /* Skip edges with a required vertex */ + if ( mesh->point[np0].s || mesh->point[np1].s ) { + continue; + } + ier = MMG5_hashEdge(mesh,&edgeTable,np0,np1,k); + if ( !ier ) { + if ( !mmgWarn ) { + mmgWarn = 1; + fprintf(stderr,"\n ## Warning: %s: unable to hash at least one edge" + " (tria %d, edge %d).\n",__func__,MMG3D_indElt(mesh,k),i); + } + } + } + } + for (k=1; k<=mesh->np; k++) mesh->point[k].flag = mesh->base; nupv = itv = 0; maxit = 500; + /* analyze mesh edges via hash table */ do { - mesh->base++; + ++mesh->base; nu = 0; - for (k=1; k<=mesh->ne; k++) { - pt = &mesh->tetra[k]; - if ( !MG_EOK(pt) ) continue; - for (i=0; i<4; i++) { - /* Gradation along a volume edge */ - np0 = pt->v[MMG5_iare[i][0]]; - np1 = pt->v[MMG5_iare[i][1]]; - p0 = &mesh->point[np0]; - p1 = &mesh->point[np1]; - if ( p0->flag < mesh->base-1 && p1->flag < mesh->base-1 ) continue; + for (k=0; ka ) break; + np0 = pht->a; + np1 = pht->b; + p0 = &mesh->point[np0]; + p1 = &mesh->point[np1]; + + if ( (p0->flag < mesh->base-1) && (p1->flag < mesh->base-1) ) { + pht = pht->nxt ? &edgeTable.item[pht->nxt] : 0; + continue; + } /* Skip points belonging to a required edge */ - if ( p0->s || p1->s ) continue; + if ( p0->s || p1->s ) { + pht = pht->nxt ? &edgeTable.item[pht->nxt] : 0; + continue; + } ier = MMG5_grad2metVol(mesh,met,pt,np0,np1); - if ( ier == np0 ) { - p0->flag = mesh->base; - nu++; - } - else if ( ier == np1 ) { - p1->flag = mesh->base; - nu++; + if( ier != -1 ) { // skip ridges (now commented) + if ( ier & 1 ) { + p0->flag = mesh->base; + nu++; + } + if ( ier & 2 ) { + p1->flag = mesh->base; + nu++; + } } + + /* next edge */ + pht = pht->nxt ? &edgeTable.item[pht->nxt] : 0; } } nupv += nu; - } - while( ++itv < maxit && nu > 0 ); + } while ( ++itv < maxit && nu > 0 ); + MMG5_SAFE_FREE(edgeTable.item); if ( abs(mesh->info.imprim) > 3 ) { if ( abs(mesh->info.imprim) < 5 && !mesh->info.ddebug ) { From 7efaedfe0446f553638ba93c781767155fba36fe Mon Sep 17 00:00:00 2001 From: luca Date: Sun, 2 May 2021 15:04:15 +0200 Subject: [PATCH 005/838] Fix accuracy check for eigenvalue computations. --- src/common/eigenv.c | 6 +++--- src/mmg3d/anisosiz_3d.c | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/common/eigenv.c b/src/common/eigenv.c index 09ae92382..8553aed83 100644 --- a/src/common/eigenv.c +++ b/src/common/eigenv.c @@ -319,9 +319,9 @@ int MMG5_check_accuracy(double mat[6],double lambda[3], double v[3][3], k = 0; for (i=0; i<3; i++) { for (j=i; j<3; j++) { - m[k++] = lambda[0]*v[i][0]*v[j][0] - + lambda[1]*v[i][1]*v[j][1] - + lambda[2]*v[i][2]*v[j][2]; + m[k++] = lambda[0]*v[0][i]*v[0][j] + + lambda[1]*v[1][i]*v[1][j] + + lambda[2]*v[2][i]*v[2][j]; } } err = fabs(mat[0]-m[0]); diff --git a/src/mmg3d/anisosiz_3d.c b/src/mmg3d/anisosiz_3d.c index c213e2c1d..334ee88a6 100644 --- a/src/mmg3d/anisosiz_3d.c +++ b/src/mmg3d/anisosiz_3d.c @@ -1437,18 +1437,18 @@ int MMG3D_simred(MMG5_pMesh mesh,double *m,double *n,double dm[3], coreduction basis */ /* Compute diagonal values in simultaneous reduction basis */ dm[0] = m[0]*vp[0][0]*vp[0][0] + 2.0*m[1]*vp[0][0]*vp[0][1] + 2.0*m[2]*vp[0][0]*vp[0][2] - + m[3]*vp[0][1]*vp[0][1] + 2.0*m[4]*vp[0][1]*vp[0][2] + m[5]*vp[0][2]*vp[0][2]; + + m[3]*vp[0][1]*vp[0][1] + 2.0*m[4]*vp[0][1]*vp[0][2] + m[5]*vp[0][2]*vp[0][2]; dm[1] = m[0]*vp[1][0]*vp[1][0] + 2.0*m[1]*vp[1][0]*vp[1][1] + 2.0*m[2]*vp[1][0]*vp[1][2] - + m[3]*vp[1][1]*vp[1][1] + 2.0*m[4]*vp[1][1]*vp[1][2] + m[5]*vp[1][2]*vp[1][2]; + + m[3]*vp[1][1]*vp[1][1] + 2.0*m[4]*vp[1][1]*vp[1][2] + m[5]*vp[1][2]*vp[1][2]; dm[2] = m[0]*vp[2][0]*vp[2][0] + 2.0*m[1]*vp[2][0]*vp[2][1] + 2.0*m[2]*vp[2][0]*vp[2][2] - + m[3]*vp[2][1]*vp[2][1] + 2.0*m[4]*vp[2][1]*vp[2][2] + m[5]*vp[2][2]*vp[2][2]; + + m[3]*vp[2][1]*vp[2][1] + 2.0*m[4]*vp[2][1]*vp[2][2] + m[5]*vp[2][2]*vp[2][2]; dn[0] = n[0]*vp[0][0]*vp[0][0] + 2.0*n[1]*vp[0][0]*vp[0][1] + 2.0*n[2]*vp[0][0]*vp[0][2] - + n[3]*vp[0][1]*vp[0][1] + 2.0*n[4]*vp[0][1]*vp[0][2] + n[5]*vp[0][2]*vp[0][2]; + + n[3]*vp[0][1]*vp[0][1] + 2.0*n[4]*vp[0][1]*vp[0][2] + n[5]*vp[0][2]*vp[0][2]; dn[1] = n[0]*vp[1][0]*vp[1][0] + 2.0*n[1]*vp[1][0]*vp[1][1] + 2.0*n[2]*vp[1][0]*vp[1][2] - + n[3]*vp[1][1]*vp[1][1] + 2.0*n[4]*vp[1][1]*vp[1][2] + n[5]*vp[1][2]*vp[1][2]; + + n[3]*vp[1][1]*vp[1][1] + 2.0*n[4]*vp[1][1]*vp[1][2] + n[5]*vp[1][2]*vp[1][2]; dn[2] = n[0]*vp[2][0]*vp[2][0] + 2.0*n[1]*vp[2][0]*vp[2][1] + 2.0*n[2]*vp[2][0]*vp[2][2] - + n[3]*vp[2][1]*vp[2][1] + 2.0*n[4]*vp[2][1]*vp[2][2] + n[5]*vp[2][2]*vp[2][2]; + + n[3]*vp[2][1]*vp[2][1] + 2.0*n[4]*vp[2][1]*vp[2][2] + n[5]*vp[2][2]*vp[2][2]; } assert ( dm[0] >= MMG5_EPSD2 && dm[1] >= MMG5_EPSD2 && dm[2] >= MMG5_EPSD2 && "positive eigenvalue" ); From 243bb80627e9cd9004e5ffcacf4d605f48f90a9d Mon Sep 17 00:00:00 2001 From: luca Date: Tue, 13 Jul 2021 22:19:03 +0200 Subject: [PATCH 006/838] Avoid double metric update. --- src/mmg3d/anisosiz_3d.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/mmg3d/anisosiz_3d.c b/src/mmg3d/anisosiz_3d.c index 334ee88a6..463ce1aa4 100644 --- a/src/mmg3d/anisosiz_3d.c +++ b/src/mmg3d/anisosiz_3d.c @@ -1614,11 +1614,16 @@ int MMG5_grad2metVol(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTetra pt,int np1,int np } } - MMG3D_gradEigenv(mesh,mm2,m1,2,&ier); - if( ier == -1 ) return ier; - MMG3D_gradEigenv(mesh,mm1,m2,1,&ier); - if( ier == -1 ) return ier; + if( mesh->point[np1].flag >= mesh->base-1 ) { + MMG3D_gradEigenv(mesh,mm2,m1,2,&ier); + if( ier == -1 ) return ier; + } + + if( mesh->point[np2].flag >= mesh->base-1 ) { + MMG3D_gradEigenv(mesh,mm1,m2,1,&ier); + if( ier == -1 ) return ier; + } return ier; From 41850dc3aa0a78a2d2272c453e6de06b389a82c4 Mon Sep 17 00:00:00 2001 From: luca Date: Tue, 13 Jul 2021 22:32:08 +0200 Subject: [PATCH 007/838] TEST matrix scaling. --- src/mmg3d/anisosiz_3d.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mmg3d/anisosiz_3d.c b/src/mmg3d/anisosiz_3d.c index 463ce1aa4..86eb85e13 100644 --- a/src/mmg3d/anisosiz_3d.c +++ b/src/mmg3d/anisosiz_3d.c @@ -1480,13 +1480,20 @@ void MMG3D_gradEigenv(MMG5_pMesh mesh,double m[6],double mext[6],int8_t iloc,int } /* Gradation of sizes */ + double ratio = 1.0; for( int i = 0; i< 3; i++ ) { if( dmext[i] > dm[i] ) { - dm[i] = dmext[i]; + if( dmext[i]/dm[i] > ratio ) + ratio = dmext[i]/dm[i]; +// dm[i] = dmext[i]; (*ier) = (*ier) | iloc; } } + for( int i = 0; i < 6; i++ ) + m[i] *= ratio; + return; + if( (*ier) & iloc ) { /* Simultaneous reduction basis is non-orthogonal, so invert it for the * inverse transformation */ From a80c49e0945282e649316d79e25d8754ed2fc46b Mon Sep 17 00:00:00 2001 From: luca Date: Tue, 13 Jul 2021 22:45:26 +0200 Subject: [PATCH 008/838] TEST cobasis eigs scaling. --- src/mmg3d/anisosiz_3d.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mmg3d/anisosiz_3d.c b/src/mmg3d/anisosiz_3d.c index 86eb85e13..4bd6d4dbc 100644 --- a/src/mmg3d/anisosiz_3d.c +++ b/src/mmg3d/anisosiz_3d.c @@ -1490,9 +1490,12 @@ void MMG3D_gradEigenv(MMG5_pMesh mesh,double m[6],double mext[6],int8_t iloc,int } } - for( int i = 0; i < 6; i++ ) - m[i] *= ratio; - return; +// for( int i = 0; i < 6; i++ ) +// m[i] *= ratio; +// return; + + for( int i = 0; i < 3; i++ ) + dm[i] *= ratio; if( (*ier) & iloc ) { /* Simultaneous reduction basis is non-orthogonal, so invert it for the From b664364940cfa1a31bc9362fdcede65de94fa154 Mon Sep 17 00:00:00 2001 From: luca Date: Thu, 15 Jul 2021 11:26:05 +0200 Subject: [PATCH 009/838] Function to recompose decomposed matrix. --- src/mmg3d/anisosiz_3d.c | 31 +++++++++++++++++++++++++++++++ src/mmg3d/mmg3d.h | 3 +++ 2 files changed, 34 insertions(+) diff --git a/src/mmg3d/anisosiz_3d.c b/src/mmg3d/anisosiz_3d.c index 4bd6d4dbc..7c508fa57 100644 --- a/src/mmg3d/anisosiz_3d.c +++ b/src/mmg3d/anisosiz_3d.c @@ -36,6 +36,37 @@ #include "inlined_functions_3d.h" #include "mmg3dexterns.h" +int MMG3D_recomposeMat(int symmat,double dm[3],double vp[3][3],double *m) { + double ivp[3][3]; + int i,j,k,ij; + + if( symmat ) { + ij = 0; + for( i = 0; i < 3; i++ ) { + for( j = i; j < 3; j++ ) { + m[ij] = 0.; + for( k = 0; k < 3; k++ ) { + m[ij] += dm[k]*vp[k][i]*vp[k][j]; + } + ++ij; + } + } + } else { + if( !MMG5_invmat33(vp,ivp) ) + return 0; + for( i = 0; i < 3; i++ ) { + for( j = 0; j < 3; j++ ) { + m[3*i+j] = 0.; + for( k = 0; k < 3; k++ ) { + m[3*i+j] += dm[k]*vp[k][i]*ivp[j][k]; + } + } + } + } + + return 1; +} + int MMG3D_chk4ridVertices(MMG5_pMesh mesh, MMG5_pTetra pt) { MMG5_pPoint ppt; int i; diff --git a/src/mmg3d/mmg3d.h b/src/mmg3d/mmg3d.h index 1370a981f..b183aaec3 100644 --- a/src/mmg3d/mmg3d.h +++ b/src/mmg3d/mmg3d.h @@ -442,6 +442,9 @@ int MMG3D_pack_points(MMG5_pMesh mesh); void MMG3D_unset_reqBoundaries(MMG5_pMesh mesh); int MMG3D_packMesh(MMG5_pMesh,MMG5_pSol,MMG5_pSol); int MMG3D_bdryBuild(MMG5_pMesh); +int MMG3D_simred(MMG5_pMesh mesh,double *m,double *n,double dm[3], + double dn[3],double vp[3][3] ); +int MMG3D_recomposeMat(int symmat,double dm[3],double vp[3][3],double *m); /* rmc option */ double MMG3D_vfrac(MMG5_pMesh ,MMG5_pSol ,int ,int ); From 850ab145e4d1168a2577711207644a031699420f Mon Sep 17 00:00:00 2001 From: luca Date: Thu, 15 Jul 2021 14:40:02 +0200 Subject: [PATCH 010/838] Function to recompose decomposed matrix from coreduction. --- src/mmg3d/anisosiz_3d.c | 33 ++++++++++++++++++++++----------- src/mmg3d/mmg3d.h | 1 + 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/mmg3d/anisosiz_3d.c b/src/mmg3d/anisosiz_3d.c index 7c508fa57..80cd3410e 100644 --- a/src/mmg3d/anisosiz_3d.c +++ b/src/mmg3d/anisosiz_3d.c @@ -36,6 +36,26 @@ #include "inlined_functions_3d.h" #include "mmg3dexterns.h" +int MMG3D_recomposeMat_simred(double dm[3],double vp[3][3],double *m) { + double ivp[3][3]; + int i,j,k,ij; + + if( !MMG5_invmat33(vp,ivp) ) + return 0; + ij = 0; + for( i = 0; i < 3; i++ ) { + for( j = i; j < 3; j++ ) { + m[ij] = 0.; + for( k = 0; k < 3; k++ ) { + m[ij] += dm[k]*ivp[i][k]*ivp[j][k]; + } + ij++; + } + } + + return 1; +} + int MMG3D_recomposeMat(int symmat,double dm[3],double vp[3][3],double *m) { double ivp[3][3]; int i,j,k,ij; @@ -1531,24 +1551,15 @@ void MMG3D_gradEigenv(MMG5_pMesh mesh,double m[6],double mext[6],int8_t iloc,int if( (*ier) & iloc ) { /* Simultaneous reduction basis is non-orthogonal, so invert it for the * inverse transformation */ - if( !MMG5_invmat33(vp,ivp) ) { + if( !MMG3D_recomposeMat_simred(dm,vp,m) ) { *ier = -1; return; } - int ij = 0; - for( int i = 0; i < 3; i++ ) { - for( int j = i; j < 3; j++ ) { - m[ij] = 0.; - for( int k = 0; k < 3; k++ ) { - m[ij] += dm[k]*ivp[k][i]*ivp[k][j]; - } - ++ij; - } - } } } + /** * \param mesh pointer toward the mesh. * \param met pointer toward the metric structure. diff --git a/src/mmg3d/mmg3d.h b/src/mmg3d/mmg3d.h index b183aaec3..7b145fd98 100644 --- a/src/mmg3d/mmg3d.h +++ b/src/mmg3d/mmg3d.h @@ -445,6 +445,7 @@ int MMG3D_bdryBuild(MMG5_pMesh); int MMG3D_simred(MMG5_pMesh mesh,double *m,double *n,double dm[3], double dn[3],double vp[3][3] ); int MMG3D_recomposeMat(int symmat,double dm[3],double vp[3][3],double *m); +int MMG3D_recomposeMat_simred(double dm[3],double vp[3][3],double *m); /* rmc option */ double MMG3D_vfrac(MMG5_pMesh ,MMG5_pSol ,int ,int ); From c981297d9a340c8e1d627b15036ff226fd474d4b Mon Sep 17 00:00:00 2001 From: luca Date: Fri, 16 Jul 2021 10:50:13 +0200 Subject: [PATCH 011/838] Functions to print matrix errors. --- src/mmg3d/anisosiz_3d.c | 77 ++++++++++++++++++++++++++++++++++++++++- src/mmg3d/mmg3d.h | 3 +- 2 files changed, 78 insertions(+), 2 deletions(-) diff --git a/src/mmg3d/anisosiz_3d.c b/src/mmg3d/anisosiz_3d.c index 80cd3410e..77bd5b98b 100644 --- a/src/mmg3d/anisosiz_3d.c +++ b/src/mmg3d/anisosiz_3d.c @@ -36,6 +36,70 @@ #include "inlined_functions_3d.h" #include "mmg3dexterns.h" +/** + * \param symmat flag for symmetric(1) or non-symmetric(0) matrix.. + * \param m matrix (1x6 or 1x9 array). + * \return 1 if success, 0 if fail. + * + * Print matrix entries. + */ +int MMG3D_printMat(int8_t symmat,double *m) { + int i; + + if( symmat ) { + printf("%e %e %e\n",m[0],m[1],m[2]); + printf("%e %e %e\n",m[1],m[3],m[4]); + printf("%e %e %e\n",m[2],m[4],m[5]); + } else { + printf("%e %e %e\n",m[0],m[1],m[2]); + printf("%e %e %e\n",m[3],m[4],m[5]); + printf("%e %e %e\n",m[6],m[7],m[8]); + } + + return 1; +} + +/** + * \param symmat flag for symmetric(1) or non-symmetric(0) matrix.. + * \param m first matrix (1x6 or 1x9 array). + * \param mr second matrix (1x6 or 1x9 array). + * \return 1 if success, 0 if fail. + * + * Print relative error between two matrices, for each matrix entry. + */ +int MMG3D_printErrorMat(int8_t symmat,double *m,double *mr) { + double dm[9],dd; + int i,dim; + + if( symmat ) + dim = 6; + else + dim = 9; + + dd = 0.0; + for( i = 0; i < dim; i++ ) + if( fabs(m[i]) > dd ) + dd = fabs(m[i]); + dd = 1.0 / dd; + + for( i = 0; i < dim; i++ ) + dm[i] = (m[i]-mr[i])*dd; + + if( !MMG3D_printMat(symmat,dm) ) return 0; + + return 1; +} + +/** + * \param dm matrix diagonalization (1x3 array). + * \param vp basis vectors (3x3 array, eigenvectors stored by lines). + * \param m recomposed matrix (1x6 array). + * \return 1 if success, 0 if fail. + * + * Recompose a matrix given its decomposition on a coreduction basis V: + * M = transpose(inv(V)) * diag(mu) * inv(V) + * + */ int MMG3D_recomposeMat_simred(double dm[3],double vp[3][3],double *m) { double ivp[3][3]; int i,j,k,ij; @@ -56,7 +120,18 @@ int MMG3D_recomposeMat_simred(double dm[3],double vp[3][3],double *m) { return 1; } -int MMG3D_recomposeMat(int symmat,double dm[3],double vp[3][3],double *m) { +/** + * \param symmat flag for symmetric(1) or non-symmetric(0) matrix.. + * \param dm matrix eigenvalues (1x3 array). + * \param vp eigenvectors matrix (3x3 array, eigenvectors stored by lines). + * \param m recomposed matrix (1x6 or 1x9 array). + * \return 1 if success, 0 if fail. + * + * Recompose a matrix given its eigendecomposition: + * M = V * diag(lambda) * inv(V) + * + */ +int MMG3D_recomposeMat(int8_t symmat,double dm[3],double vp[3][3],double *m) { double ivp[3][3]; int i,j,k,ij; diff --git a/src/mmg3d/mmg3d.h b/src/mmg3d/mmg3d.h index 7b145fd98..34d1dcbcb 100644 --- a/src/mmg3d/mmg3d.h +++ b/src/mmg3d/mmg3d.h @@ -444,8 +444,9 @@ int MMG3D_packMesh(MMG5_pMesh,MMG5_pSol,MMG5_pSol); int MMG3D_bdryBuild(MMG5_pMesh); int MMG3D_simred(MMG5_pMesh mesh,double *m,double *n,double dm[3], double dn[3],double vp[3][3] ); -int MMG3D_recomposeMat(int symmat,double dm[3],double vp[3][3],double *m); +int MMG3D_recomposeMat(int8_t symmat,double dm[3],double vp[3][3],double *m); int MMG3D_recomposeMat_simred(double dm[3],double vp[3][3],double *m); +int MMG3D_printErrorMat(int8_t symmat,double *m,double *mr); /* rmc option */ double MMG3D_vfrac(MMG5_pMesh ,MMG5_pSol ,int ,int ); From 7c662038111cf02892a1a86bb7c3b133e9701230 Mon Sep 17 00:00:00 2001 From: luca Date: Fri, 16 Jul 2021 11:07:32 +0200 Subject: [PATCH 012/838] Functions to print matrix eigendecomposition. --- src/mmg3d/anisosiz_3d.c | 20 ++++++++++++++++++++ src/mmg3d/mmg3d.h | 1 + 2 files changed, 21 insertions(+) diff --git a/src/mmg3d/anisosiz_3d.c b/src/mmg3d/anisosiz_3d.c index 77bd5b98b..c879dd8a8 100644 --- a/src/mmg3d/anisosiz_3d.c +++ b/src/mmg3d/anisosiz_3d.c @@ -36,6 +36,26 @@ #include "inlined_functions_3d.h" #include "mmg3dexterns.h" +/** + * \param dm matrix eigenvalues (1x3 array). + * \param vp eigenvectors matrix (3x3 array, eigenvectors stored by lines). + * \return 1 if success, 0 if fail. + * + * Print eigendecomposition. + */ +int MMG3D_printEigenv(double dm[3],double vp[3][3]) { + int i; + + printf("--- Eigenvalues:\n"); + printf("%e %e %e\n",dm[0],dm[1],dm[2]); + printf("---Eigenvectors (visualization by columns):\n"); + printf("%e %e %e\n",vp[0][0],vp[1][0],vp[2][0]); + printf("%e %e %e\n",vp[0][1],vp[1][1],vp[2][1]); + printf("%e %e %e\n",vp[0][2],vp[1][2],vp[2][2]); + + return 1; +} + /** * \param symmat flag for symmetric(1) or non-symmetric(0) matrix.. * \param m matrix (1x6 or 1x9 array). diff --git a/src/mmg3d/mmg3d.h b/src/mmg3d/mmg3d.h index 34d1dcbcb..63304241f 100644 --- a/src/mmg3d/mmg3d.h +++ b/src/mmg3d/mmg3d.h @@ -447,6 +447,7 @@ int MMG3D_simred(MMG5_pMesh mesh,double *m,double *n,double dm[3], int MMG3D_recomposeMat(int8_t symmat,double dm[3],double vp[3][3],double *m); int MMG3D_recomposeMat_simred(double dm[3],double vp[3][3],double *m); int MMG3D_printErrorMat(int8_t symmat,double *m,double *mr); +int MMG3D_printEigenv(double dm[3],double vp[3][3]); /* rmc option */ double MMG3D_vfrac(MMG5_pMesh ,MMG5_pSol ,int ,int ); From 2a2b04ee580eb42db30e8ffdeeae5fc61a022f41 Mon Sep 17 00:00:00 2001 From: luca Date: Fri, 16 Jul 2021 11:09:45 +0200 Subject: [PATCH 013/838] Make simred function non-static. --- src/mmg3d/anisosiz_3d.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mmg3d/anisosiz_3d.c b/src/mmg3d/anisosiz_3d.c index c879dd8a8..157c117b0 100644 --- a/src/mmg3d/anisosiz_3d.c +++ b/src/mmg3d/anisosiz_3d.c @@ -1519,7 +1519,6 @@ int MMG3D_defsiz_ani(MMG5_pMesh mesh,MMG5_pSol met) { * Perform simultaneous reduction of matrices \a m and \a n. * */ -static inline int MMG3D_simred(MMG5_pMesh mesh,double *m,double *n,double dm[3], double dn[3],double vp[3][3] ) { From c192a5f848537b0b3e719820501a04b5c12bfb0f Mon Sep 17 00:00:00 2001 From: luca Date: Fri, 16 Jul 2021 11:13:10 +0200 Subject: [PATCH 014/838] Compute eigenvectors of non-symmetric matrix as orthogonal to columns of (A-lambda*I). --- src/common/eigenv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/eigenv.c b/src/common/eigenv.c index 8553aed83..ea467786d 100644 --- a/src/common/eigenv.c +++ b/src/common/eigenv.c @@ -519,9 +519,9 @@ int MMG5_eigenv(int symmat,double *mat,double lambda[3],double v[3][3]) { v[1][1] = 1.0; v[1][0] = v[1][2] = 0.0; v[2][2] = 1.0; v[2][0] = v[2][1] = 0.0; - w1[1] = a12; w1[2] = a13; - w2[0] = a21; w2[2] = a23; - w3[0] = a31; w3[1] = a32; + w1[1] = a21; w1[2] = a31; + w2[0] = a12; w2[2] = a32; + w3[0] = a13; w3[1] = a23; if ( n == 1 ) { /* vk = crsprd(wi,wj) */ From 5de70e81dac3a9087b513946b47f48fcf88a1918 Mon Sep 17 00:00:00 2001 From: Algiane Date: Thu, 22 Jul 2021 15:20:34 +0200 Subject: [PATCH 015/838] Call the new split1_cfg function in split1b. --- src/mmg3d/split_3d.c | 172 ++++++++++++------------------------------- 1 file changed, 46 insertions(+), 126 deletions(-) diff --git a/src/mmg3d/split_3d.c b/src/mmg3d/split_3d.c index c1de97248..4d2567004 100755 --- a/src/mmg3d/split_3d.c +++ b/src/mmg3d/split_3d.c @@ -37,6 +37,38 @@ extern int8_t ddb; +static inline +void MMG3D_split1_cfg(int flag,uint8_t *tau,const uint8_t **taued) { + + /* default is case 1 */ + tau[0] = 0 ; tau[1] = 1 ; tau[2] = 2 ; tau[3] = 3; + *taued = &MMG5_permedge[0][0]; + switch(flag) { + case 2: + tau[0] = 2 ; tau[1] = 0 ; tau[2] = 1 ; tau[3] = 3; + *taued = &MMG5_permedge[6][0]; + break; + case 4: + tau[0] = 0 ; tau[1] = 3 ; tau[2] = 1 ; tau[3] = 2; + *taued = &MMG5_permedge[2][0]; + break; + case 8: + tau[0] = 1 ; tau[1] = 2 ; tau[2] = 0 ; tau[3] = 3; + *taued = &MMG5_permedge[4][0]; + break; + case 16: + tau[0] = 3 ; tau[1] = 1 ; tau[2] = 0 ; tau[3] = 2; + *taued = &MMG5_permedge[10][0]; + break; + case 32: + tau[0] = 3 ; tau[1] = 2 ; tau[2] = 1 ; tau[3] = 0; + *taued = &MMG5_permedge[11][0]; + break; + } + + return; +} + /** * \param mesh pointer toward the mesh structure. * \param met pointer toward the metric structure. @@ -61,31 +93,7 @@ int MMG3D_split1_sim(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6]) { pt0 = &mesh->tetra[0]; - /* default is case 1 */ - tau[0] = 0 ; tau[1] = 1 ; tau[2] = 2 ; tau[3] = 3; - taued = &MMG5_permedge[0][0]; - switch(pt->flag) { - case 2: - tau[0] = 2 ; tau[1] = 0 ; tau[2] = 1 ; tau[3] = 3; - taued = &MMG5_permedge[6][0]; - break; - case 4: - tau[0] = 0 ; tau[1] = 3 ; tau[2] = 1 ; tau[3] = 2; - taued = &MMG5_permedge[2][0]; - break; - case 8: - tau[0] = 1 ; tau[1] = 2 ; tau[2] = 0 ; tau[3] = 3; - taued = &MMG5_permedge[4][0]; - break; - case 16: - tau[0] = 3 ; tau[1] = 1 ; tau[2] = 0 ; tau[3] = 2; - taued = &MMG5_permedge[10][0]; - break; - case 32: - tau[0] = 3 ; tau[1] = 2 ; tau[2] = 1 ; tau[3] = 0; - taued = &MMG5_permedge[11][0]; - break; - } + MMG3D_split1_cfg(pt->flag,tau,&taued); /* Test volume of the two created tets */ memcpy(pt0,pt,sizeof(MMG5_Tetra)); @@ -148,31 +156,7 @@ int MMG5_split1(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp) memset(&xt1,0,sizeof(MMG5_xTetra)); } - /* default is case 1 */ - tau[0] = 0; tau[1] = 1; tau[2] = 2; tau[3] = 3; - taued = &MMG5_permedge[0][0]; - switch(pt->flag) { - case 2: - tau[0] = 2; tau[1] = 0; tau[2] = 1; tau[3] = 3; - taued = &MMG5_permedge[6][0]; - break; - case 4: - tau[0] = 0; tau[1] = 3; tau[2] = 1; tau[3] = 2; - taued = &MMG5_permedge[2][0]; - break; - case 8: - tau[0] = 1; tau[1] = 2; tau[2] = 0; tau[3] = 3; - taued = &MMG5_permedge[4][0]; - break; - case 16: - tau[0] = 3; tau[1] = 1; tau[2] = 0; tau[3] = 2; - taued = &MMG5_permedge[10][0]; - break; - case 32: - tau[0] = 3; tau[1] = 2; tau[2] = 1; tau[3] = 0; - taued = &MMG5_permedge[11][0]; - break; - } + MMG3D_split1_cfg(pt->flag,tau,&taued); /* Generic formulation of split of 1 edge */ pt->v[tau[1]] = pt1->v[tau[0]] = vx[taued[0]]; @@ -517,7 +501,8 @@ int MMG5_split1b(MMG5_pMesh mesh, MMG5_pSol met,int *list, int ret, int ip, double lmin,lmax,len; int ilist,k,open,iel,jel,*newtet,nump,*adja,j; int *adjan,nei2,nei3,mel; - int8_t ie,tau[4],isxt,isxt1,i,voy; + int8_t ie,isxt,isxt1,i,voy; + uint8_t tau[4]; const uint8_t *taued; ilist = ret / 2; @@ -555,31 +540,10 @@ int MMG5_split1b(MMG5_pMesh mesh, MMG5_pSol met,int *list, int ret, int ip, ie = list[j] % 6; pt0 = &mesh->tetra[0]; memcpy(pt0,pt,sizeof(MMG5_Tetra)); - /* tau = sigma^-1 = permutation that sends the ref config (edge 01 split) to current */ - tau[0] = 0; tau[1] = 1; tau[2] = 2; tau[3] = 3; - taued = &MMG5_permedge[0][0]; - switch(ie){ - case 1: - tau[0] = 2; tau[1] = 0; tau[2] = 1; tau[3] = 3; - taued = &MMG5_permedge[6][0]; - break; - case 2: - tau[0] = 0; tau[1] = 3; tau[2] = 1; tau[3] = 2; - taued = &MMG5_permedge[2][0]; - break; - case 3: - tau[0] = 1; tau[1] = 2; tau[2] = 0; tau[3] = 3; - taued = &MMG5_permedge[4][0]; - break; - case 4: - tau[0] = 3; tau[1] = 1; tau[2] = 0; tau[3] = 2; - taued = &MMG5_permedge[10][0]; - break; - case 5: - tau[0] = 3; tau[1] = 2; tau[2] = 1; tau[3] = 0; - taued = &MMG5_permedge[11][0]; - break; - } + + int flag = 0; + MG_SET(flag,ie); + MMG3D_split1_cfg(flag,tau,&taued); pt0->v[MMG5_isar[ie][1]] = ip; if ( chkRidTet ) { @@ -685,31 +649,9 @@ int MMG5_split1b(MMG5_pMesh mesh, MMG5_pSol met,int *list, int ret, int ip, memset(&xt1,0, sizeof(MMG5_xTetra)); } - /* tau = sigma^-1 = permutation that sends the reference config (edge 01 split) to current */ - tau[0] = 0; tau[1] = 1; tau[2] = 2; tau[3] = 3; - taued = &MMG5_permedge[0][0]; - switch(ie){ - case 1: - tau[0] = 2; tau[1] = 0; tau[2] = 1; tau[3] = 3; - taued = &MMG5_permedge[6][0]; - break; - case 2: - tau[0] = 0; tau[1] = 3; tau[2] = 1; tau[3] = 2; - taued = &MMG5_permedge[2][0]; - break; - case 3: - tau[0] = 1; tau[1] = 2; tau[2] = 0; tau[3] = 3; - taued = &MMG5_permedge[4][0]; - break; - case 4: - tau[0] = 3; tau[1] = 1; tau[2] = 0; tau[3] = 2; - taued = &MMG5_permedge[10][0]; - break; - case 5: - tau[0] = 3; tau[1] = 2; tau[2] = 1; tau[3] = 0; - taued = &MMG5_permedge[11][0]; - break; - } + int flag = 0; + MG_SET(flag,ie); + MMG3D_split1_cfg(flag,tau,&taued); /* Generic formulation of split of 1 edge */ pt->v[tau[1]] = pt1->v[tau[0]] = ip; @@ -821,31 +763,9 @@ int MMG5_split1b(MMG5_pMesh mesh, MMG5_pSol met,int *list, int ret, int ip, memset(&xt1,0, sizeof(MMG5_xTetra)); } - /* tau = sigma^-1 = permutation that sends the reference config (edge 01 split) to current */ - tau[0] = 0; tau[1] = 1; tau[2] = 2; tau[3] = 3; - taued = &MMG5_permedge[0][0]; - switch(ie){ - case 1: - tau[0] = 2; tau[1] = 0; tau[2] = 1; tau[3] = 3; - taued = &MMG5_permedge[6][0]; - break; - case 2: - tau[0] = 0; tau[1] = 3; tau[2] = 1; tau[3] = 2; - taued = &MMG5_permedge[2][0]; - break; - case 3: - tau[0] = 1; tau[1] = 2; tau[2] = 0; tau[3] = 3; - taued = &MMG5_permedge[4][0]; - break; - case 4: - tau[0] = 3; tau[1] = 1; tau[2] = 0; tau[3] = 2; - taued = &MMG5_permedge[10][0]; - break; - case 5: - tau[0] = 3; tau[1] = 2; tau[2] = 1; tau[3] = 0; - taued = &MMG5_permedge[11][0]; - break; - } + int flag = 0; + MG_SET(flag,ie); + MMG3D_split1_cfg(flag,tau,&taued); /* Generic formulation of split of 1 edge */ pt->v[tau[1]] = pt1->v[tau[0]] = ip; From a252cb377468c8e07fb8a6745a96c88fa1a9fbe6 Mon Sep 17 00:00:00 2001 From: Algiane Date: Thu, 22 Jul 2021 15:51:32 +0200 Subject: [PATCH 016/838] Factorization of the update of the new tetra and xtetra during the split of one edge. --- src/mmg3d/split_3d.c | 291 +++++++++++++++++++------------------------ 1 file changed, 125 insertions(+), 166 deletions(-) diff --git a/src/mmg3d/split_3d.c b/src/mmg3d/split_3d.c index 4d2567004..c54f0990e 100755 --- a/src/mmg3d/split_3d.c +++ b/src/mmg3d/split_3d.c @@ -37,6 +37,16 @@ extern int8_t ddb; +/** + * \param flag flag to detect the splitting configuration + * \param tau vertices permutation + * \param taued edges permutation + * + * Compute vertices and edges permutation for the split of 1 edge depending of + * the edge that is splitted (i^th bit of flag is 1 if the i^th edge is + * splitted). + * + */ static inline void MMG3D_split1_cfg(int flag,uint8_t *tau,const uint8_t **taued) { @@ -474,7 +484,105 @@ int MMG3D_normalAdjaTri(MMG5_pMesh mesh , int start, int8_t iface, int ia, return 1; } +/** + * \param mesh pointer toward the mesh structure. + * \param ip index of new point. + * \param k position of the tetra to split in the shell of edge. + * \param list pointer toward the shell of edge. + * \param newtet list of indices of created tetra + * \param tau vertices permutation + * + * \return 1 if success, 0 if fail. + * + * Update and fill the tetra and xtetra data when splitting one edge of a tetra. + * + */ +static inline +int MMG5_split1b_eltspl(MMG5_pMesh mesh,int ip,int k,int *list,int *newtet,uint8_t tau[4]) { + MMG5_pTetra pt,pt1; + MMG5_xTetra xt,xt1; + MMG5_pxTetra pxt0; + int iel,jel; + int8_t ie,isxt,isxt1,i; + const uint8_t *taued; + + iel = list[k] / 6; + ie = list[k] % 6; + pt = &mesh->tetra[iel]; + jel = abs(newtet[k]); + pt1 = &mesh->tetra[jel]; + + pxt0 = 0; + if ( pt->xt ) { + pxt0 = &mesh->xtetra[pt->xt]; + memcpy(&xt,pxt0,sizeof(MMG5_xTetra)); + memcpy(&xt1,pxt0,sizeof(MMG5_xTetra)); + } + else { + memset(&xt,0, sizeof(MMG5_xTetra)); + memset(&xt1,0, sizeof(MMG5_xTetra)); + } + + int flag = 0; + MG_SET(flag,ie); + MMG3D_split1_cfg(flag,tau,&taued); + + /* Generic formulation of split of 1 edge */ + pt->v[tau[1]] = pt1->v[tau[0]] = ip; + if ( pt->xt ) { + /* Reset edge tag */ + xt.tag [taued[3]] = 0; xt.tag [taued[4]] = 0; + xt1.tag[taued[1]] = 0; xt1.tag[taued[2]] = 0; + xt.edg [taued[3]] = 0; xt.edg [taued[4]] = 0; + xt1.edg[taued[1]] = 0; xt1.edg[taued[2]] = 0; + xt.ref [ tau[0]] = 0; xt.ftag [ tau[0]] = 0; MG_SET( xt.ori, tau[0]); + xt1.ref[ tau[1]] = 0; xt1.ftag[ tau[1]] = 0; MG_SET(xt1.ori, tau[1]); + } + + pt->flag = pt1->flag = 0; + isxt = 0 ; + isxt1 = 0; + + for (i=0; i<4; i++) { + if ( xt.ref[i] || xt.ftag[i] ) isxt = 1; + if ( xt1.ref[i] || xt1.ftag[i] ) isxt1 = 1; + } + + if ( pt->xt ) { + if ( (isxt)&&(!isxt1) ) { + pt1->xt = 0; + pxt0 = &mesh->xtetra[pt->xt]; + memcpy(pxt0,&xt,sizeof(MMG5_xTetra)); + } + else if ((!isxt)&&(isxt1) ) { + pt1->xt = pt->xt; + pt->xt = 0; + pxt0 = &mesh->xtetra[pt1->xt]; + memcpy(pxt0,&xt1,sizeof(MMG5_xTetra)); + } + else if (isxt && isxt1 ) { + mesh->xt++; + if ( mesh->xt > mesh->xtmax ) { + /* realloc of xtetras table */ + MMG5_TAB_RECALLOC(mesh,mesh->xtetra,mesh->xtmax,MMG5_GAP,MMG5_xTetra, + "larger xtetra table", + mesh->xt--; + return 0); + } + pt1->xt = mesh->xt; + pxt0 = &mesh->xtetra[pt->xt]; + memcpy(pxt0,&xt,sizeof(MMG5_xTetra)); + pxt0 = &mesh->xtetra[pt1->xt]; + memcpy(pxt0,&xt1,sizeof(MMG5_xTetra)); + } + else { + pt->xt = 0; + pt1->xt = 0; + } + } + return 1; +} /** * \param mesh pointer toward the mesh structure. @@ -496,12 +604,10 @@ int MMG3D_normalAdjaTri(MMG5_pMesh mesh , int start, int8_t iface, int ia, int MMG5_split1b(MMG5_pMesh mesh, MMG5_pSol met,int *list, int ret, int ip, int cas,int8_t metRidTyp,int8_t chkRidTet){ MMG5_pTetra pt,pt1,pt0; - MMG5_xTetra xt,xt1; - MMG5_pxTetra pxt0; double lmin,lmax,len; int ilist,k,open,iel,jel,*newtet,nump,*adja,j; int *adjan,nei2,nei3,mel; - int8_t ie,isxt,isxt1,i,voy; + int8_t ie,i,voy; uint8_t tau[4]; const uint8_t *taued; @@ -588,25 +694,11 @@ int MMG5_split1b(MMG5_pMesh mesh, MMG5_pSol met,int *list, int ret, int ip, iel = list[k] / 6; ie = list[k] % 6; pt = &mesh->tetra[iel]; - /* identity : case 0 */ - tau[0] = 0 ; tau[1] = 1 ; tau[2] = 2 ; tau[3] = 3; - switch(ie) { - case 1: - tau[0] = 2; tau[1] = 0; tau[2] = 1; tau[3] = 3; - break; - case 2: - tau[0] = 0; tau[1] = 3; tau[2] = 1; tau[3] = 2; - break; - case 3: - tau[0] = 1; tau[1] = 2; tau[2] = 0; tau[3] = 3; - break; - case 4: - tau[0] = 3; tau[1] = 1; tau[2] = 0; tau[3] = 2; - break; - case 5: - tau[0] = 3; tau[1] = 2; tau[2] = 1; tau[3] = 0; - break; - } + + int flag = 0; + MG_SET(flag,ie); + MMG3D_split1_cfg(flag,tau,&taued); + jel = MMG3D_newElt(mesh); if ( !jel ) { MMG3D_TETRA_REALLOC(mesh,jel,mesh->gap, @@ -632,83 +724,17 @@ int MMG5_split1b(MMG5_pMesh mesh, MMG5_pSol met,int *list, int ret, int ip, /* Special case : only one element in the shell */ if ( ilist == 1 ) { assert(open); + + if ( !MMG5_split1b_eltspl(mesh,ip,0,list,newtet,tau) ) { + return -1; + } + + /* Update of adjacency relations */ iel = list[0] / 6; - ie = list[0] % 6; pt = &mesh->tetra[iel]; jel = abs(newtet[0]); pt1 = &mesh->tetra[jel]; - pxt0 = 0; - if ( pt->xt ) { - pxt0 = &mesh->xtetra[pt->xt]; - memcpy(&xt,pxt0,sizeof(MMG5_xTetra)); - memcpy(&xt1,pxt0,sizeof(MMG5_xTetra)); - } - else { - memset(&xt,0, sizeof(MMG5_xTetra)); - memset(&xt1,0, sizeof(MMG5_xTetra)); - } - - int flag = 0; - MG_SET(flag,ie); - MMG3D_split1_cfg(flag,tau,&taued); - - /* Generic formulation of split of 1 edge */ - pt->v[tau[1]] = pt1->v[tau[0]] = ip; - if ( pt->xt ) { - /* Reset edge tag */ - xt.tag [taued[3]] = 0; xt.tag [taued[4]] = 0; - xt1.tag[taued[1]] = 0; xt1.tag[taued[2]] = 0; - xt.edg [taued[3]] = 0; xt.edg [taued[4]] = 0; - xt1.edg[taued[1]] = 0; xt1.edg[taued[2]] = 0; - xt.ref [ tau[0]] = 0; xt.ftag [ tau[0]] = 0; MG_SET( xt.ori, tau[0]); - xt1.ref[ tau[1]] = 0; xt1.ftag[ tau[1]] = 0; MG_SET(xt1.ori, tau[1]); - } - - pt->flag = pt1->flag = 0; - - isxt = 0 ; - isxt1 = 0; - - for (i=0; i<4; i++) { - if ( xt.ref[i] || xt.ftag[i] ) isxt = 1; - if ( xt1.ref[i] || xt1.ftag[i]) isxt1 = 1; - } - - if ( pt->xt ) { - if ( (isxt) && (!isxt1) ) { - pt1->xt = 0; - pxt0 = &mesh->xtetra[pt->xt]; - memcpy(pxt0,&xt,sizeof(MMG5_xTetra)); - } - else if ( (!isxt) && (isxt1) ) { - pt1->xt = pt->xt; - pt->xt = 0; - pxt0 = &mesh->xtetra[pt1->xt]; - memcpy(pxt0,&xt1,sizeof(MMG5_xTetra)); - } - else if ( isxt && isxt1 ) { - mesh->xt++; - if ( mesh->xt > mesh->xtmax ) { - /* realloc of xtetras table */ - MMG5_TAB_RECALLOC(mesh,mesh->xtetra,mesh->xtmax,MMG5_GAP,MMG5_xTetra, - "larger xtetra table", - mesh->xt--; - return -1); - } - pt1->xt = mesh->xt; - pxt0 = &mesh->xtetra[pt->xt]; - memcpy(pxt0,&xt,sizeof(MMG5_xTetra)); - pxt0 = &mesh->xtetra[pt1->xt]; - memcpy(pxt0,&xt1,sizeof(MMG5_xTetra)); - } - else { - pt->xt = 0; - pt1->xt = 0; - } - } - - /* Update of adjacency relations */ adja = &mesh->adja[4*(iel-1)+1]; adjan = &mesh->adja[4*(jel-1)+1]; @@ -746,83 +772,16 @@ int MMG5_split1b(MMG5_pMesh mesh, MMG5_pSol met,int *list, int ret, int ip, /* General case : update each element of the shell */ for (k=0; ktetra[iel]; jel = abs(newtet[k]); pt1 = &mesh->tetra[jel]; - pxt0 = 0; - if ( pt->xt ) { - pxt0 = &mesh->xtetra[pt->xt]; - memcpy(&xt,pxt0,sizeof(MMG5_xTetra)); - memcpy(&xt1,pxt0,sizeof(MMG5_xTetra)); - } - else { - memset(&xt,0, sizeof(MMG5_xTetra)); - memset(&xt1,0, sizeof(MMG5_xTetra)); - } - - int flag = 0; - MG_SET(flag,ie); - MMG3D_split1_cfg(flag,tau,&taued); - - /* Generic formulation of split of 1 edge */ - pt->v[tau[1]] = pt1->v[tau[0]] = ip; - if ( pt->xt ) { - /* Reset edge tag */ - xt.tag [taued[3]] = 0; xt.tag [taued[4]] = 0; - xt1.tag[taued[1]] = 0; xt1.tag[taued[2]] = 0; - xt.edg [taued[3]] = 0; xt.edg [taued[4]] = 0; - xt1.edg[taued[1]] = 0; xt1.edg[taued[2]] = 0; - xt.ref [ tau[0]] = 0; xt.ftag [ tau[0]] = 0; MG_SET( xt.ori, tau[0]); - xt1.ref[ tau[1]] = 0; xt1.ftag[ tau[1]] = 0; MG_SET(xt1.ori, tau[1]); - } - - pt->flag = pt1->flag = 0; - - isxt = 0 ; - isxt1 = 0; - - for (i=0; i<4; i++) { - if ( xt.ref[i] || xt.ftag[i] ) isxt = 1; - if ( xt1.ref[i] || xt1.ftag[i] ) isxt1 = 1; - } - - if ( pt->xt ) { - if ( (isxt)&&(!isxt1) ) { - pt1->xt = 0; - pxt0 = &mesh->xtetra[pt->xt]; - memcpy(pxt0,&xt,sizeof(MMG5_xTetra)); - } - else if ((!isxt)&&(isxt1) ) { - pt1->xt = pt->xt; - pt->xt = 0; - pxt0 = &mesh->xtetra[pt1->xt]; - memcpy(pxt0,&xt1,sizeof(MMG5_xTetra)); - } - else if (isxt && isxt1 ) { - mesh->xt++; - if ( mesh->xt > mesh->xtmax ) { - /* realloc of xtetras table */ - MMG5_TAB_RECALLOC(mesh,mesh->xtetra,mesh->xtmax,MMG5_GAP,MMG5_xTetra, - "larger xtetra table", - mesh->xt--; - return -1); - } - pt1->xt = mesh->xt; - pxt0 = &mesh->xtetra[pt->xt]; - memcpy(pxt0,&xt,sizeof(MMG5_xTetra)); - pxt0 = &mesh->xtetra[pt1->xt]; - memcpy(pxt0,&xt1,sizeof(MMG5_xTetra)); - } - else { - pt->xt = 0; - pt1->xt = 0; - } - } - - /* Update of adjacency relations */ adja = &mesh->adja[4*(iel-1)+1]; adjan = &mesh->adja[4*(jel-1)+1]; From 0965077be5944b9c8fc0babf65e46e0034b64983 Mon Sep 17 00:00:00 2001 From: Algiane Date: Thu, 22 Jul 2021 16:14:50 +0200 Subject: [PATCH 017/838] Factorisation of split2sf configuration computation. --- src/mmg3d/split_3d.c | 142 ++++++++++++++++++------------------------- 1 file changed, 58 insertions(+), 84 deletions(-) diff --git a/src/mmg3d/split_3d.c b/src/mmg3d/split_3d.c index c54f0990e..53c453c82 100755 --- a/src/mmg3d/split_3d.c +++ b/src/mmg3d/split_3d.c @@ -981,81 +981,103 @@ int MMG5_split1b(MMG5_pMesh mesh, MMG5_pSol met,int *list, int ret, int ip, } /** - * \param mesh pointer toward the mesh structure. - * \param met pointer toward the metric structure. - * \param k index of element to split. - * \param vx \f$vx[i]\f$ is the index of the point to add on the edge \a i. - * - * \return 0 if the split fail, 1 otherwise + * \param flag flag to detect the splitting configuration + * \param tau vertices permutation + * \param taued edges permutation + * \param pt tetra in which the splitting is performed * - * Simulate split of two edges that belong to a common face + * Compute vertices and edges permutation for the split of 2 edge along the same + * face. The configuration flag is computed such as the i^th bit of flag is 1 if + * the i^th edge is splitted). * */ -int MMG3D_split2sf_sim(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6]){ - MMG5_pTetra pt,pt0; - double vold,vnew; - uint8_t tau[4],imin; - const uint8_t *taued; - - pt = &mesh->tetra[k]; - pt0 = &mesh->tetra[0]; - vold = MMG5_orvol(mesh->point,pt->v); - - if ( vold < MMG5_EPSOK ) return 0; +static inline +uint8_t MMG3D_split2sf_cfg(int flag,uint8_t *tau,const uint8_t **taued,MMG5_pTetra pt) { + uint8_t imin; /* identity is case 48 */ tau[0] = 0 ; tau[1] = 1 ; tau[2] = 2 ; tau[3] = 3; - taued = &MMG5_permedge[0][0]; - switch(pt->flag){ + *taued = &MMG5_permedge[0][0]; + switch(flag){ case 24 : tau[0] = 0 ; tau[1] = 2 ; tau[2] = 3 ; tau[3] = 1; - taued = &MMG5_permedge[1][0]; + *taued = &MMG5_permedge[1][0]; break; case 40 : tau[0] = 0 ; tau[1] = 3 ; tau[2] = 1 ; tau[3] = 2; - taued = &MMG5_permedge[2][0]; + *taued = &MMG5_permedge[2][0]; break; case 6 : tau[0] = 1 ; tau[1] = 3 ; tau[2] = 2 ; tau[3] = 0; - taued = &MMG5_permedge[5][0]; + *taued = &MMG5_permedge[5][0]; break; case 34 : tau[0] = 1 ; tau[1] = 0 ; tau[2] = 3 ; tau[3] = 2; - taued = &MMG5_permedge[3][0]; + *taued = &MMG5_permedge[3][0]; break; case 36 : tau[0] = 1 ; tau[1] = 2 ; tau[2] = 0 ; tau[3] = 3; - taued = &MMG5_permedge[4][0]; + *taued = &MMG5_permedge[4][0]; break; case 20 : tau[0] = 2 ; tau[1] = 0 ; tau[2] = 1 ; tau[3] = 3; - taued = &MMG5_permedge[6][0]; + *taued = &MMG5_permedge[6][0]; break; case 5 : tau[0] = 2 ; tau[1] = 1 ; tau[2] = 3 ; tau[3] = 0; - taued = &MMG5_permedge[7][0]; + *taued = &MMG5_permedge[7][0]; break; case 17 : tau[0] = 2 ; tau[1] = 3 ; tau[2] = 0 ; tau[3] = 1; - taued = &MMG5_permedge[8][0]; + *taued = &MMG5_permedge[8][0]; break; case 9 : tau[0] = 3 ; tau[1] = 0 ; tau[2] = 2 ; tau[3] = 1; - taued = &MMG5_permedge[9][0]; + *taued = &MMG5_permedge[9][0]; break; case 3 : tau[0] = 3 ; tau[1] = 2 ; tau[2] = 1 ; tau[3] = 0; - taued = &MMG5_permedge[11][0]; + *taued = &MMG5_permedge[11][0]; break; case 10 : tau[0] = 3 ; tau[1] = 1 ; tau[2] = 0 ; tau[3] = 2; - taued = &MMG5_permedge[10][0]; + *taued = &MMG5_permedge[10][0]; break; } - /* Test orientation of the three tets to be created */ imin = (pt->v[tau[1]] < pt->v[tau[2]]) ? tau[1] : tau[2] ; + return imin; +} + + +/** + * \param mesh pointer toward the mesh structure. + * \param met pointer toward the metric structure. + * \param k index of element to split. + * \param vx \f$vx[i]\f$ is the index of the point to add on the edge \a i. + * + * \return 0 if the split fail, 1 otherwise + * + * Simulate split of two edges that belong to a common face + * + */ +int MMG3D_split2sf_sim(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6]){ + MMG5_pTetra pt,pt0; + double vold,vnew; + uint8_t tau[4],imin; + const uint8_t *taued; + + pt = &mesh->tetra[k]; + pt0 = &mesh->tetra[0]; + vold = MMG5_orvol(mesh->point,pt->v); + + if ( vold < MMG5_EPSOK ) return 0; + + imin = MMG3D_split2sf_cfg(pt->flag,tau,&taued,pt); + + /* Test orientation of the three tets to be created */ + memcpy(pt0,pt,sizeof(MMG5_Tetra)); pt0->v[tau[1]] = vx[taued[4]]; pt0->v[tau[2]] = vx[taued[5]]; @@ -1105,9 +1127,9 @@ int MMG5_split2sf(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp MMG5_pTetra pt[3]; MMG5_xTetra xt[3]; MMG5_pxTetra pxt0; - int iel,i; + int iel,i,flg; int newtet[3]; - int8_t flg,imin,firstxt,isxt[3]; + int8_t imin,firstxt,isxt[3]; uint8_t tau[4]; const uint8_t *taued; @@ -1157,58 +1179,10 @@ int MMG5_split2sf(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp memset(&xt[1],0,sizeof(MMG5_xTetra)); memset(&xt[2],0,sizeof(MMG5_xTetra)); } - /* identity is case 48 */ - tau[0] = 0 ; tau[1] = 1 ; tau[2] = 2 ; tau[3] = 3; - taued = &MMG5_permedge[0][0]; - switch(flg){ - case 24 : - tau[0] = 0 ; tau[1] = 2 ; tau[2] = 3 ; tau[3] = 1; - taued = &MMG5_permedge[1][0]; - break; - case 40 : - tau[0] = 0 ; tau[1] = 3 ; tau[2] = 1 ; tau[3] = 2; - taued = &MMG5_permedge[2][0]; - break; - case 6 : - tau[0] = 1 ; tau[1] = 3 ; tau[2] = 2 ; tau[3] = 0; - taued = &MMG5_permedge[5][0]; - break; - case 34 : - tau[0] = 1 ; tau[1] = 0 ; tau[2] = 3 ; tau[3] = 2; - taued = &MMG5_permedge[3][0]; - break; - case 36 : - tau[0] = 1 ; tau[1] = 2 ; tau[2] = 0 ; tau[3] = 3; - taued = &MMG5_permedge[4][0]; - break; - case 20 : - tau[0] = 2 ; tau[1] = 0 ; tau[2] = 1 ; tau[3] = 3; - taued = &MMG5_permedge[6][0]; - break; - case 5 : - tau[0] = 2 ; tau[1] = 1 ; tau[2] = 3 ; tau[3] = 0; - taued = &MMG5_permedge[7][0]; - break; - case 17 : - tau[0] = 2 ; tau[1] = 3 ; tau[2] = 0 ; tau[3] = 1; - taued = &MMG5_permedge[8][0]; - break; - case 9 : - tau[0] = 3 ; tau[1] = 0 ; tau[2] = 2 ; tau[3] = 1; - taued = &MMG5_permedge[9][0]; - break; - case 3 : - tau[0] = 3 ; tau[1] = 2 ; tau[2] = 1 ; tau[3] = 0; - taued = &MMG5_permedge[11][0]; - break; - case 10 : - tau[0] = 3 ; tau[1] = 1 ; tau[2] = 0 ; tau[3] = 2; - taued = &MMG5_permedge[10][0]; - break; - } + + imin = MMG3D_split2sf_cfg(flg,tau,&taued,pt[0]); /* Generic formulation for the split of 2 edges belonging to a common face */ - imin = (pt[0]->v[tau[1]] < pt[0]->v[tau[2]]) ? tau[1] : tau[2] ; pt[0]->v[tau[1]] = vx[taued[4]] ; pt[0]->v[tau[2]] = vx[taued[5]]; xt[0].tag[taued[0]] = 0; xt[0].tag[taued[1]] = 0; xt[0].tag[taued[3]] = 0; xt[0].edg[taued[0]] = 0; From 410a69eb927f61fed10b0225abb28bc1b2817e8c Mon Sep 17 00:00:00 2001 From: Algiane Date: Thu, 22 Jul 2021 16:44:42 +0200 Subject: [PATCH 018/838] Add a test case with all kind of edges and a curve surface. --- cmake/testing/mmg3d_tests.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmake/testing/mmg3d_tests.cmake b/cmake/testing/mmg3d_tests.cmake index 15a507584..9fe6f1fb7 100644 --- a/cmake/testing/mmg3d_tests.cmake +++ b/cmake/testing/mmg3d_tests.cmake @@ -30,12 +30,15 @@ GET_FILENAME_COMPONENT ( SHRT_EXECUT_MMG3D ${EXECUT_MMG3D} NAME ) SET ( test_names # Simple test: must already pass - mmg3d_SimpleCube + mmg3d_SimpleCube_fast # MultiDomain mmg3d_MultiDom_Ellipse_fast # Non-manifold test case mmg3d_NM_Cube_fast mmg3d_NM_Complex_fast + # test case with non-manifold, ridges, ref edges and a curve surface + mmg3d_NM_cone_fast + # mmg3d_NM_cone_ani_fast #Fail because at second run a tetra we have a tet with 4 ridge vertices ) SET ( input_files @@ -45,6 +48,8 @@ SET ( input_files ### non-manifold ${MMG3D_CI_TESTS}/NM_Cube/nm ${MMG3D_CI_TESTS}/NM_Complex/nm4 + ${MMG3D_CI_TESTS}/cone-nm.mesh + #${MMG3D_CI_TESTS}/cone-nm.mesh ) SET ( args @@ -54,6 +59,8 @@ SET ( args ### non-manifold "-v 5 -hmax 0.1" "-v 5" + "-v 5" + #"-v 5 -A" ) IF ( LONG_TESTS ) From 606a638874983dbd1bd1944bd2ae1ca0c31bb40e Mon Sep 17 00:00:00 2001 From: Algiane Date: Thu, 22 Jul 2021 17:48:04 +0200 Subject: [PATCH 019/838] Remove dynamic alloc of newtet. --- src/mmg3d/split_3d.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/mmg3d/split_3d.c b/src/mmg3d/split_3d.c index 53c453c82..0828b3977 100755 --- a/src/mmg3d/split_3d.c +++ b/src/mmg3d/split_3d.c @@ -605,7 +605,7 @@ int MMG5_split1b(MMG5_pMesh mesh, MMG5_pSol met,int *list, int ret, int ip, int cas,int8_t metRidTyp,int8_t chkRidTet){ MMG5_pTetra pt,pt1,pt0; double lmin,lmax,len; - int ilist,k,open,iel,jel,*newtet,nump,*adja,j; + int ilist,k,open,iel,jel,newtet[MMG3D_LMAX+2],nump,*adja,j; int *adjan,nei2,nei3,mel; int8_t ie,i,voy; uint8_t tau[4]; @@ -680,8 +680,6 @@ int MMG5_split1b(MMG5_pMesh mesh, MMG5_pSol met,int *list, int ret, int ip, if ( j < ilist ) return 0; } - MMG5_SAFE_CALLOC(newtet,ilist,int,return -1); - iel = list[0] / 6; ie = list[0] % 6; pt = &mesh->tetra[iel]; @@ -765,8 +763,6 @@ int MMG5_split1b(MMG5_pMesh mesh, MMG5_pSol met,int *list, int ret, int ip, pt->mark = mesh->mark; pt1->mark = mesh->mark; - - MMG5_SAFE_FREE(newtet); return 1; } @@ -976,7 +972,6 @@ int MMG5_split1b(MMG5_pMesh mesh, MMG5_pSol met,int *list, int ret, int ip, pt1->mark = mesh->mark; } - MMG5_SAFE_FREE(newtet); return 1; } From e9d28ff462e26a21e800e6b7bed1d776c7c73bb5 Mon Sep 17 00:00:00 2001 From: Algiane Date: Thu, 22 Jul 2021 20:11:55 +0200 Subject: [PATCH 020/838] split2sf refactoring. --- src/mmg3d/split_3d.c | 94 ++++++++++++++++++++++---------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/src/mmg3d/split_3d.c b/src/mmg3d/split_3d.c index 0828b3977..3a628aa2e 100755 --- a/src/mmg3d/split_3d.c +++ b/src/mmg3d/split_3d.c @@ -1106,6 +1106,43 @@ int MMG3D_split2sf_sim(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6]){ return 1; } +static inline +int MMG3D_crea_newTetra(MMG5_pMesh mesh,const int nnew,int *newtet, + MMG5_pTetra *pt,MMG5_xTetra *xt,MMG5_pxTetra *pxt0) { + int iel,i,j; + + for ( i=1; igap, + fprintf(stderr,"\n ## Error: %s: unable to allocate" + " a new element.\n",__func__); + MMG5_INCREASE_MEM_MESSAGE(); + fprintf(stderr," Exit program.\n"); + return 0); + /* update pointer list */ + for ( j=0; jtetra[newtet[j]]; + } + } + pt[i] = &mesh->tetra[iel]; + memcpy(pt[i],pt[0],sizeof(MMG5_Tetra)); + newtet[i]=iel; + } + + if ( pt[0]->xt ) { + *pxt0 = &mesh->xtetra[(pt[0])->xt]; + for ( i=0; itetra[k]; flg = pt[0]->flag; pt[0]->flag = 0; newtet[0]=k; - iel = MMG3D_newElt(mesh); - if ( !iel ) { - MMG3D_TETRA_REALLOC(mesh,iel,mesh->gap, - fprintf(stderr,"\n ## Error: %s: unable to allocate" - " a new element.\n",__func__); - MMG5_INCREASE_MEM_MESSAGE(); - fprintf(stderr," Exit program.\n"); - return 0); - pt[0] = &mesh->tetra[newtet[0]]; - } - pt[1] = &mesh->tetra[iel]; - memcpy(pt[1],pt[0],sizeof(MMG5_Tetra)); - newtet[1]=iel; - - iel = MMG3D_newElt(mesh); - if ( !iel ) { - MMG3D_TETRA_REALLOC(mesh,iel,mesh->gap, - fprintf(stderr,"\n ## Error: %s: unable to allocate" - " a new element.\n",__func__); - MMG5_INCREASE_MEM_MESSAGE(); - fprintf(stderr," Exit program.\n"); - return 0); - pt[0] = &mesh->tetra[newtet[0]]; - pt[1] = &mesh->tetra[newtet[1]]; - } - pt[2] = &mesh->tetra[iel]; - memcpy(pt[2],pt[0],sizeof(MMG5_Tetra)); - newtet[2]=iel; - - if ( pt[0]->xt ) { - pxt0 = &mesh->xtetra[(pt[0])->xt]; - memcpy(&xt[0],pxt0,sizeof(MMG5_xTetra)); - memcpy(&xt[1],pxt0,sizeof(MMG5_xTetra)); - memcpy(&xt[2],pxt0,sizeof(MMG5_xTetra)); - } - else { - pxt0 = 0; - memset(&xt[0],0,sizeof(MMG5_xTetra)); - memset(&xt[1],0,sizeof(MMG5_xTetra)); - memset(&xt[2],0,sizeof(MMG5_xTetra)); + if ( !MMG3D_crea_newTetra(mesh,nnew,newtet,pt,xt,&pxt0) ) { + return 0; } imin = MMG3D_split2sf_cfg(flg,tau,&taued,pt[0]); @@ -1278,15 +1278,15 @@ int MMG5_split2sf(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp } /* Quality update */ if ( (!metRidTyp) && met->m && met->size>1 ) { - pt[0]->qual=MMG5_caltet33_ani(mesh,met,pt[0]); - pt[1]->qual=MMG5_caltet33_ani(mesh,met,pt[1]); - pt[2]->qual=MMG5_caltet33_ani(mesh,met,pt[2]); + for (i=0; iqual=MMG5_caltet33_ani(mesh,met,pt[i]); + } } else { - pt[0]->qual=MMG5_orcal(mesh,met,newtet[0]); - pt[1]->qual=MMG5_orcal(mesh,met,newtet[1]); - pt[2]->qual=MMG5_orcal(mesh,met,newtet[2]); + for (i=0; iqual=MMG5_orcal(mesh,met,newtet[i]); + } } return 1; } From 6050060398e40eddffa9327cda32af2a557f5cdc Mon Sep 17 00:00:00 2001 From: Algiane Date: Thu, 22 Jul 2021 20:24:39 +0200 Subject: [PATCH 021/838] Add a new function that update the quality of a list of tetra and call it in split2sf. --- src/mmg3d/split_3d.c | 60 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 49 insertions(+), 11 deletions(-) diff --git a/src/mmg3d/split_3d.c b/src/mmg3d/split_3d.c index 3a628aa2e..90ec7b799 100755 --- a/src/mmg3d/split_3d.c +++ b/src/mmg3d/split_3d.c @@ -1106,6 +1106,19 @@ int MMG3D_split2sf_sim(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6]){ return 1; } +/** + * \param mesh pointer toward the mesh structure. + * \param newtet list of indices of the new tetra. + * \param nnew number of tetra in the list. + * \param pt list of tetra. + * \param xt list of xtetra. + * \param pxt0 xtetra associated to the first tetra of the list + * + * \return 0 if fail, 1 otherwise + * + * Create a list of new tetra whose indices are passed in \a newtet. + * + */ static inline int MMG3D_crea_newTetra(MMG5_pMesh mesh,const int nnew,int *newtet, MMG5_pTetra *pt,MMG5_xTetra *xt,MMG5_pxTetra *pxt0) { @@ -1143,6 +1156,39 @@ int MMG3D_crea_newTetra(MMG5_pMesh mesh,const int nnew,int *newtet, return 1; } +/** + * \param mesh pointer toward the mesh structure. + * \param met pointer toward the metric structure. + * \param nnew number of tetra in the list + * \param newtet list of tetra indices + * \param pt list of tetra + * \param metRidTyp metric storage (classic or special) + * + * \return 0 if fail, 1 otherwise + * + * Compute the quality of the \a nnew tetra of the list \a pt. + * + */ +static inline +void MMG3D_update_qual(MMG5_pMesh mesh,MMG5_pSol met,const int nnew, + int *newtet,MMG5_pTetra *pt,int8_t metRidTyp) { + int i; + + if ( (!metRidTyp) && met->m && met->size>1 ) { + for (i=0; iqual=MMG5_caltet33_ani(mesh,met,pt[i]); + } + } + else + { + for (i=0; iqual=MMG5_orcal(mesh,met,newtet[i]); + } + } + + return; +} + /** * \param mesh pointer toward the mesh structure. * \param met pointer toward the metric structure. @@ -1276,18 +1322,10 @@ int MMG5_split2sf(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp pt[0]->xt = 0; } } + /* Quality update */ - if ( (!metRidTyp) && met->m && met->size>1 ) { - for (i=0; iqual=MMG5_caltet33_ani(mesh,met,pt[i]); - } - } - else - { - for (i=0; iqual=MMG5_orcal(mesh,met,newtet[i]); - } - } + MMG3D_update_qual(mesh,met,nnew,newtet,pt,metRidTyp); + return 1; } From 1a6b24f2bc5db90a10f80bcdc88b070a2e1c8493 Mon Sep 17 00:00:00 2001 From: Algiane Date: Thu, 22 Jul 2021 20:25:37 +0200 Subject: [PATCH 022/838] Begin to factorize split2. --- src/mmg3d/split_3d.c | 70 +++++--------------------------------------- 1 file changed, 8 insertions(+), 62 deletions(-) diff --git a/src/mmg3d/split_3d.c b/src/mmg3d/split_3d.c index 90ec7b799..83aed03f0 100755 --- a/src/mmg3d/split_3d.c +++ b/src/mmg3d/split_3d.c @@ -1406,76 +1406,22 @@ int MMG5_split2(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp) MMG5_pTetra pt[4]; MMG5_xTetra xt[4]; MMG5_pxTetra pxt0; - int i,iel; + int i; int newtet[4]; int8_t flg,firstxt,isxt[4]; uint8_t tau[4]; const uint8_t *taued; + const int nnew=4; pt[0] = &mesh->tetra[k]; flg = pt[0]->flag; pt[0]->flag = 0; newtet[0]=k; - iel = MMG3D_newElt(mesh); - if ( !iel ) { - MMG3D_TETRA_REALLOC(mesh,iel,mesh->gap, - fprintf(stderr,"\n ## Error: %s: unable to allocate" - " a new element.\n",__func__); - MMG5_INCREASE_MEM_MESSAGE(); - fprintf(stderr," Exit program.\n"); - return 0); - pt[0] = &mesh->tetra[newtet[0]]; - } - pt[1] = &mesh->tetra[iel]; - memcpy(pt[1],pt[0],sizeof(MMG5_Tetra)); - newtet[1]=iel; - - iel = MMG3D_newElt(mesh); - if ( !iel ) { - MMG3D_TETRA_REALLOC(mesh,iel,mesh->gap, - fprintf(stderr,"\n ## Error: %s: unable to allocate" - " a new element.\n",__func__); - MMG5_INCREASE_MEM_MESSAGE(); - fprintf(stderr," Exit program.\n"); - return 0); - pt[0] = &mesh->tetra[newtet[0]]; - pt[1] = &mesh->tetra[newtet[1]]; - } - pt[2] = &mesh->tetra[iel]; - memcpy(pt[2],pt[0],sizeof(MMG5_Tetra)); - newtet[2]=iel; - - iel = MMG3D_newElt(mesh); - if ( !iel ) { - MMG3D_TETRA_REALLOC(mesh,iel,mesh->gap, - fprintf(stderr,"\n ## Error: %s: unable to allocate" - " a new element.\n",__func__); - MMG5_INCREASE_MEM_MESSAGE(); - fprintf(stderr," Exit program.\n"); - return 0); - pt[0] = &mesh->tetra[newtet[0]]; - pt[1] = &mesh->tetra[newtet[1]]; - pt[2] = &mesh->tetra[newtet[2]]; + if ( !MMG3D_crea_newTetra(mesh,nnew,newtet,pt,xt,&pxt0) ) { + return 0; } - pt[3] = &mesh->tetra[iel]; - memcpy(pt[3],pt[0],sizeof(MMG5_Tetra)); - newtet[3]=iel; - pxt0 = 0; - if ( pt[0]->xt) { - pxt0 = &mesh->xtetra[(pt[0])->xt]; - memcpy(&xt[0],pxt0,sizeof(MMG5_xTetra)); - memcpy(&xt[1],pxt0,sizeof(MMG5_xTetra)); - memcpy(&xt[2],pxt0,sizeof(MMG5_xTetra)); - memcpy(&xt[3],pxt0,sizeof(MMG5_xTetra)); - } - else { - memset(&xt[0],0,sizeof(MMG5_xTetra)); - memset(&xt[1],0,sizeof(MMG5_xTetra)); - memset(&xt[2],0,sizeof(MMG5_xTetra)); - memset(&xt[3],0,sizeof(MMG5_xTetra)); - } /* identity : case 33 */ tau[0] = 0; tau[1] = 1; tau[2] = 2; tau[3] = 3; taued = &MMG5_permedge[0][0]; @@ -1527,10 +1473,10 @@ int MMG5_split2(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp) /* Assignation of the xt fields to the appropriate tets */ memset(isxt,0,4*sizeof(int8_t)); for (i=0; i<4; i++) { - if ( xt[0].ref[i] || xt[0].ftag[i] ) isxt[0] = 1; - if ( xt[1].ref[i] || xt[1].ftag[i] ) isxt[1] = 1; - if ( xt[2].ref[i] || xt[2].ftag[i] ) isxt[2] = 1; - if ( xt[3].ref[i] || xt[3].ftag[i] ) isxt[3] = 1; + int j; + for (j=0; jxt) { From e9fb973f0829ef66663980bc3410564c41cf5f5a Mon Sep 17 00:00:00 2001 From: Algiane Date: Thu, 22 Jul 2021 20:26:08 +0200 Subject: [PATCH 023/838] split2 refactoring. --- src/mmg3d/split_3d.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/mmg3d/split_3d.c b/src/mmg3d/split_3d.c index 83aed03f0..e133bd03e 100755 --- a/src/mmg3d/split_3d.c +++ b/src/mmg3d/split_3d.c @@ -1534,19 +1534,10 @@ int MMG5_split2(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp) pt[0]->xt = 0; } } + /* Quality update */ - if ( (!metRidTyp) && met->m && met->size>1 ) { - pt[0]->qual=MMG5_caltet33_ani(mesh,met,pt[0]); - pt[1]->qual=MMG5_caltet33_ani(mesh,met,pt[1]); - pt[2]->qual=MMG5_caltet33_ani(mesh,met,pt[2]); - pt[3]->qual=MMG5_caltet33_ani(mesh,met,pt[3]); - } - else { - pt[0]->qual=MMG5_orcal(mesh,met,newtet[0]); - pt[1]->qual=MMG5_orcal(mesh,met,newtet[1]); - pt[2]->qual=MMG5_orcal(mesh,met,newtet[2]); - pt[3]->qual=MMG5_orcal(mesh,met,newtet[3]); - } + MMG3D_update_qual(mesh,met,nnew,newtet,pt,metRidTyp); + return 1; } From e4c75c972c0fe85dfecb3bfe86bfe35e9b8a7a58 Mon Sep 17 00:00:00 2001 From: Algiane Date: Thu, 22 Jul 2021 20:31:14 +0200 Subject: [PATCH 024/838] Split3 refactoring. --- src/mmg3d/split_3d.c | 86 ++++++-------------------------------------- 1 file changed, 11 insertions(+), 75 deletions(-) diff --git a/src/mmg3d/split_3d.c b/src/mmg3d/split_3d.c index e133bd03e..ce1e4a38e 100755 --- a/src/mmg3d/split_3d.c +++ b/src/mmg3d/split_3d.c @@ -1617,11 +1617,12 @@ int MMG5_split3(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp) MMG5_pTetra pt[4]; MMG5_xTetra xt[4]; MMG5_pxTetra pxt0; - int iel,i; + int i; int newtet[4]; int8_t flg,firstxt,isxt[4]; uint8_t tau[4]; const uint8_t *taued; + const int nnew=4; pt[0] = &mesh->tetra[k]; flg = pt[0]->flag; @@ -1629,64 +1630,8 @@ int MMG5_split3(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp) newtet[0]=k; /* create 3 new tetras */ - iel = MMG3D_newElt(mesh); - if ( !iel ) { - MMG3D_TETRA_REALLOC(mesh,iel,mesh->gap, - fprintf(stderr,"\n ## Error: %s: unable to allocate" - " a new element.\n",__func__); - MMG5_INCREASE_MEM_MESSAGE(); - fprintf(stderr," Exit program.\n"); - return 0); - pt[0] = &mesh->tetra[newtet[0]]; - } - pt[1] = &mesh->tetra[iel]; - pt[1] = memcpy(pt[1],pt[0],sizeof(MMG5_Tetra)); - newtet[1]=iel; - - iel = MMG3D_newElt(mesh); - if ( !iel ) { - MMG3D_TETRA_REALLOC(mesh,iel,mesh->gap, - fprintf(stderr,"\n ## Error: %s: unable to allocate a" - " new element.\n",__func__); - MMG5_INCREASE_MEM_MESSAGE(); - fprintf(stderr," Exit program.\n"); - return 0); - pt[0] = &mesh->tetra[newtet[0]]; - pt[1] = &mesh->tetra[newtet[1]]; - } - pt[2] = &mesh->tetra[iel]; - pt[2] = memcpy(pt[2],pt[0],sizeof(MMG5_Tetra)); - newtet[2]=iel; - - iel = MMG3D_newElt(mesh); - if ( !iel ) { - MMG3D_TETRA_REALLOC(mesh,iel,mesh->gap, - fprintf(stderr,"\n ## Error: %s: unable to allocate" - " a new element.\n",__func__); - MMG5_INCREASE_MEM_MESSAGE(); - fprintf(stderr," Exit program.\n"); - return 0); - pt[0] = &mesh->tetra[newtet[0]]; - pt[1] = &mesh->tetra[newtet[1]]; - pt[2] = &mesh->tetra[newtet[2]]; - } - pt[3] = &mesh->tetra[iel]; - pt[3] = memcpy(pt[3],pt[0],sizeof(MMG5_Tetra)); - newtet[3]=iel; - - pxt0 = 0; - if ( pt[0]->xt ) { - pxt0 = &mesh->xtetra[(pt[0])->xt]; - memcpy(&xt[0],pxt0, sizeof(MMG5_xTetra)); - memcpy(&xt[1],pxt0, sizeof(MMG5_xTetra)); - memcpy(&xt[2],pxt0, sizeof(MMG5_xTetra)); - memcpy(&xt[3],pxt0, sizeof(MMG5_xTetra)); - } - else { - memset(&xt[0],0, sizeof(MMG5_xTetra)); - memset(&xt[1],0, sizeof(MMG5_xTetra)); - memset(&xt[2],0, sizeof(MMG5_xTetra)); - memset(&xt[3],0, sizeof(MMG5_xTetra)); + if ( !MMG3D_crea_newTetra(mesh,nnew,newtet,pt,xt,&pxt0) ) { + return 0; } /* update vertices, case 11 is default */ @@ -1741,10 +1686,10 @@ int MMG5_split3(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp) /* Assignation of the xt fields to the appropriate tets */ memset(isxt,0,4*sizeof(int8_t)); for (i=0; i<4; i++) { - if ( xt[0].ref[i] || xt[0].ftag[i] ) isxt[0] = 1; - if ( xt[1].ref[i] || xt[1].ftag[i] ) isxt[1] = 1; - if ( xt[2].ref[i] || xt[2].ftag[i] ) isxt[2] = 1; - if ( xt[3].ref[i] || xt[3].ftag[i] ) isxt[3] = 1; + int j; + for (j=0; jxt ) { @@ -1798,19 +1743,10 @@ int MMG5_split3(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp) pt[0]->xt = 0; } } + /* Quality update */ - if ( (!metRidTyp) && met->m && met->size>1 ) { - pt[0]->qual=MMG5_caltet33_ani(mesh,met,pt[0]); - pt[1]->qual=MMG5_caltet33_ani(mesh,met,pt[1]); - pt[2]->qual=MMG5_caltet33_ani(mesh,met,pt[2]); - pt[3]->qual=MMG5_caltet33_ani(mesh,met,pt[3]); - } - else { - pt[0]->qual=MMG5_orcal(mesh,met,newtet[0]); - pt[1]->qual=MMG5_orcal(mesh,met,newtet[1]); - pt[2]->qual=MMG5_orcal(mesh,met,newtet[2]); - pt[3]->qual=MMG5_orcal(mesh,met,newtet[3]); - } + MMG3D_update_qual(mesh,met,nnew,newtet,pt,metRidTyp); + return 1; } From 1373d5f7cb5b3545e53f845fa3378a5ead862dc6 Mon Sep 17 00:00:00 2001 From: Algiane Date: Thu, 22 Jul 2021 20:33:48 +0200 Subject: [PATCH 025/838] Split3cone refactoring. --- src/mmg3d/split_3d.c | 87 ++++++-------------------------------------- 1 file changed, 12 insertions(+), 75 deletions(-) diff --git a/src/mmg3d/split_3d.c b/src/mmg3d/split_3d.c index ce1e4a38e..f0188912a 100755 --- a/src/mmg3d/split_3d.c +++ b/src/mmg3d/split_3d.c @@ -1629,7 +1629,7 @@ int MMG5_split3(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp) pt[0]->flag = 0; newtet[0]=k; - /* create 3 new tetras */ + /* create 4 new tetras */ if ( !MMG3D_crea_newTetra(mesh,nnew,newtet,pt,xt,&pxt0) ) { return 0; } @@ -1951,6 +1951,7 @@ int MMG5_split3cone(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidT int8_t flg,firstxt,isxt[4],ia,ib; uint8_t tau[4]; const uint8_t *taued; + const int nnew=4; pt[0] = &mesh->tetra[k]; flg = pt[0]->flag; @@ -1958,64 +1959,8 @@ int MMG5_split3cone(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidT newtet[0]=k; /* create 3 new tetras */ - iel = MMG3D_newElt(mesh); - if ( !iel ) { - MMG3D_TETRA_REALLOC(mesh,iel,mesh->gap, - fprintf(stderr,"\n ## Error: %s: unable to allocate" - " a new element.\n",__func__); - MMG5_INCREASE_MEM_MESSAGE(); - fprintf(stderr," Exit program.\n"); - return 0); - pt[0] = &mesh->tetra[newtet[0]]; - } - pt[1] = &mesh->tetra[iel]; - memcpy(pt[1],pt[0],sizeof(MMG5_Tetra)); - newtet[1]=iel; - - iel = MMG3D_newElt(mesh); - if ( !iel ) { - MMG3D_TETRA_REALLOC(mesh,iel,mesh->gap, - fprintf(stderr,"\n ## Error: %s: unable to allocate" - " a new element.\n",__func__); - MMG5_INCREASE_MEM_MESSAGE(); - fprintf(stderr," Exit program.\n"); - return 0); - pt[0] = &mesh->tetra[newtet[0]]; - pt[1] = &mesh->tetra[newtet[1]]; - } - pt[2] = &mesh->tetra[iel]; - memcpy(pt[2],pt[0],sizeof(MMG5_Tetra)); - newtet[2]=iel; - - iel = MMG3D_newElt(mesh); - if ( !iel ) { - MMG3D_TETRA_REALLOC(mesh,iel,mesh->gap, - fprintf(stderr,"\n ## Error: %s: unable to allocate a" - " new element.\n",__func__); - MMG5_INCREASE_MEM_MESSAGE(); - fprintf(stderr," Exit program.\n"); - return 0); - pt[0] = &mesh->tetra[newtet[0]]; - pt[1] = &mesh->tetra[newtet[1]]; - pt[2] = &mesh->tetra[newtet[2]]; - } - pt[3] = &mesh->tetra[iel]; - memcpy(pt[3],pt[0],sizeof(MMG5_Tetra)); - newtet[3]=iel; - - if ( pt[0]->xt ) { - pxt0 = &mesh->xtetra[(pt[0])->xt]; - memcpy(&xt[0],pxt0, sizeof(MMG5_xTetra)); - memcpy(&xt[1],pxt0, sizeof(MMG5_xTetra)); - memcpy(&xt[2],pxt0, sizeof(MMG5_xTetra)); - memcpy(&xt[3],pxt0, sizeof(MMG5_xTetra)); - } - else { - pxt0 = 0; - memset(&xt[0],0, sizeof(MMG5_xTetra)); - memset(&xt[1],0, sizeof(MMG5_xTetra)); - memset(&xt[2],0, sizeof(MMG5_xTetra)); - memset(&xt[3],0, sizeof(MMG5_xTetra)); + if ( !MMG3D_crea_newTetra(mesh,nnew,newtet,pt,xt,&pxt0) ) { + return 0; } /* Set permutation of vertices : reference configuration is 7 */ @@ -2222,10 +2167,10 @@ int MMG5_split3cone(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidT isxt[0] = isxt[1] = isxt[2] = isxt[3] = 0; for (i=0; i<4; i++) { - if ( xt[0].ref[i] || xt[0].ftag[i] ) isxt[0] = 1; - if ( xt[1].ref[i] || xt[1].ftag[i] ) isxt[1] = 1; - if ( xt[2].ref[i] || xt[2].ftag[i] ) isxt[2] = 1; - if ( xt[3].ref[i] || xt[3].ftag[i] ) isxt[3] = 1; + int j; + for (j=0; jxt ) { @@ -2279,19 +2224,11 @@ int MMG5_split3cone(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidT (pt[0])->xt = 0; } } + /* Quality update */ - if ( (!metRidTyp) && met->m && met->size>1 ) { - pt[0]->qual=MMG5_caltet33_ani(mesh,met,pt[0]); - pt[1]->qual=MMG5_caltet33_ani(mesh,met,pt[1]); - pt[2]->qual=MMG5_caltet33_ani(mesh,met,pt[2]); - pt[3]->qual=MMG5_caltet33_ani(mesh,met,pt[3]); - } - else { - pt[0]->qual=MMG5_orcal(mesh,met,newtet[0]); - pt[1]->qual=MMG5_orcal(mesh,met,newtet[1]); - pt[2]->qual=MMG5_orcal(mesh,met,newtet[2]); - pt[3]->qual=MMG5_orcal(mesh,met,newtet[3]); - } + MMG3D_update_qual(mesh,met,nnew,newtet,pt,metRidTyp); + + return 1; } From 0da9b5cc3b017d08a375d7b27ce9dfe770b757a7 Mon Sep 17 00:00:00 2001 From: Algiane Date: Thu, 22 Jul 2021 20:39:25 +0200 Subject: [PATCH 026/838] Begin to refactorize split3op. --- src/mmg3d/split_3d.c | 76 +++++--------------------------------------- 1 file changed, 8 insertions(+), 68 deletions(-) diff --git a/src/mmg3d/split_3d.c b/src/mmg3d/split_3d.c index f0188912a..c7ffd18c6 100755 --- a/src/mmg3d/split_3d.c +++ b/src/mmg3d/split_3d.c @@ -1946,7 +1946,7 @@ int MMG5_split3cone(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidT MMG5_pTetra pt[4]; MMG5_xTetra xt[4]; MMG5_pxTetra pxt0; - int iel,i; + int i; int newtet[4]; int8_t flg,firstxt,isxt[4],ia,ib; uint8_t tau[4]; @@ -1958,7 +1958,7 @@ int MMG5_split3cone(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidT pt[0]->flag = 0; newtet[0]=k; - /* create 3 new tetras */ + /* create 4 new tetras */ if ( !MMG3D_crea_newTetra(mesh,nnew,newtet,pt,xt,&pxt0) ) { return 0; } @@ -2554,79 +2554,21 @@ int MMG5_split3op(MMG5_pMesh mesh, MMG5_pSol met, int k, int vx[6],int8_t metRid uint8_t imin12,imin03,tau[4],sym[4],symed[6],ip0,ip1,ip2,ip3,ie0,ie1; uint8_t ie2,ie3,ie4,ie5,isxt[5],firstxt,i; const uint8_t *taued=NULL; + const int nnew=4; pt[0] = &mesh->tetra[k]; newtet[0]=k; - // To avoid warning about potentially uninitialized value for newtet[4] - newtet[4] = 0; - /* Set permutation /symmetry of vertices : generic case : 35 */ MMG3D_configSplit3op(pt[0],vx,tau,&taued,sym,symed,&ip0,&ip1,&ip2,&ip3, - &ie0,&ie1,&ie2,&ie3,&ie4,&ie5,&imin03,&imin12); + &ie0,&ie1,&ie2,&ie3,&ie4,&ie5,&imin03,&imin12); pt[0]->flag = 0; - /* Create new elements according to the current configuration */ - iel = MMG3D_newElt(mesh); - if ( !iel ) { - MMG3D_TETRA_REALLOC(mesh,iel,mesh->gap, - fprintf(stderr,"\n ## Error: %s: unable to allocate" - " a new element.\n",__func__); - MMG5_INCREASE_MEM_MESSAGE(); - fprintf(stderr," Exit program.\n"); - return 0); - pt[0] = &mesh->tetra[newtet[0]]; - } - - pt[1] = &mesh->tetra[iel]; - pt[1] = memcpy(pt[1],pt[0],sizeof(MMG5_Tetra)); - newtet[1]=iel; - - iel = MMG3D_newElt(mesh); - if ( !iel ) { - MMG3D_TETRA_REALLOC(mesh,iel,mesh->gap, - fprintf(stderr,"\n ## Error: %s: unable to allocate a" - " new element.\n",__func__); - MMG5_INCREASE_MEM_MESSAGE(); - fprintf(stderr," Exit program.\n"); - return 0); - pt[0] = &mesh->tetra[newtet[0]]; - pt[1] = &mesh->tetra[newtet[1]]; - } - pt[2] = &mesh->tetra[iel]; - pt[2] = memcpy(pt[2],pt[0],sizeof(MMG5_Tetra)); - newtet[2]=iel; - - iel = MMG3D_newElt(mesh); - if ( !iel ) { - MMG3D_TETRA_REALLOC(mesh,iel,mesh->gap, - fprintf(stderr,"\n ## Error: %s: unable to allocate" - " a new element.\n",__func__); - MMG5_INCREASE_MEM_MESSAGE(); - fprintf(stderr," Exit program.\n"); - return 0); - pt[0] = &mesh->tetra[newtet[0]]; - pt[1] = &mesh->tetra[newtet[1]]; - pt[2] = &mesh->tetra[newtet[2]]; - } - pt[3] = &mesh->tetra[iel]; - pt[3] = memcpy(pt[3],pt[0],sizeof(MMG5_Tetra)); - newtet[3]=iel; - - if ( (pt[0])->xt ) { - pxt0 = &mesh->xtetra[(pt[0])->xt]; - memcpy(&xt[0],pxt0, sizeof(MMG5_xTetra)); - memcpy(&xt[1],pxt0, sizeof(MMG5_xTetra)); - memcpy(&xt[2],pxt0, sizeof(MMG5_xTetra)); - memcpy(&xt[3],pxt0, sizeof(MMG5_xTetra)); - } - else { - pxt0 = 0; - memset(&xt[0],0, sizeof(MMG5_xTetra)); - memset(&xt[1],0, sizeof(MMG5_xTetra)); - memset(&xt[2],0, sizeof(MMG5_xTetra)); - memset(&xt[3],0, sizeof(MMG5_xTetra)); + /* create 4 new tetras, the fifth being created only if needed. */ + if ( !MMG3D_crea_newTetra(mesh,nnew,newtet,pt,xt,&pxt0) ) { + return 0; } + newtet[4] = 0; if ( !((imin12 == ip1) && (imin03 == ip3)) ) { iel = MMG3D_newElt(mesh); @@ -2647,12 +2589,10 @@ int MMG5_split3op(MMG5_pMesh mesh, MMG5_pSol met, int k, int vx[6],int8_t metRid newtet[4]=iel; if ( pt[0]->xt ) { - pxt0 = &mesh->xtetra[(pt[0])->xt]; memcpy(&xt[4],pxt0, sizeof(MMG5_xTetra)); } else { - pxt0 = 0; memset(&xt[4],0, sizeof(MMG5_xTetra)); } } From b4eec52ad281ac6efa988262f09c1b0588bf51c5 Mon Sep 17 00:00:00 2001 From: Algiane Date: Thu, 22 Jul 2021 20:43:19 +0200 Subject: [PATCH 027/838] split3op refactoring. --- src/mmg3d/split_3d.c | 72 +++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/src/mmg3d/split_3d.c b/src/mmg3d/split_3d.c index c7ffd18c6..a856dae1e 100755 --- a/src/mmg3d/split_3d.c +++ b/src/mmg3d/split_3d.c @@ -1109,7 +1109,7 @@ int MMG3D_split2sf_sim(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6]){ /** * \param mesh pointer toward the mesh structure. * \param newtet list of indices of the new tetra. - * \param nnew number of tetra in the list. + * \param ne number of tetra in the list. * \param pt list of tetra. * \param xt list of xtetra. * \param pxt0 xtetra associated to the first tetra of the list @@ -1120,11 +1120,12 @@ int MMG3D_split2sf_sim(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6]){ * */ static inline -int MMG3D_crea_newTetra(MMG5_pMesh mesh,const int nnew,int *newtet, +int MMG3D_crea_newTetra(MMG5_pMesh mesh,const int ne,int *newtet, MMG5_pTetra *pt,MMG5_xTetra *xt,MMG5_pxTetra *pxt0) { int iel,i,j; - for ( i=1; igap, @@ -1143,15 +1144,16 @@ int MMG3D_crea_newTetra(MMG5_pMesh mesh,const int nnew,int *newtet, newtet[i]=iel; } + /* If need copy the initial xtetra */ if ( pt[0]->xt ) { *pxt0 = &mesh->xtetra[(pt[0])->xt]; - for ( i=0; im && met->size>1 ) { - for (i=0; iqual=MMG5_caltet33_ani(mesh,met,pt[i]); } } else { - for (i=0; iqual=MMG5_orcal(mesh,met,newtet[i]); } } @@ -1210,14 +1212,14 @@ int MMG5_split2sf(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp int8_t imin,firstxt,isxt[3]; uint8_t tau[4]; const uint8_t *taued; - const int nnew=3; + const int ne=3; pt[0] = &mesh->tetra[k]; flg = pt[0]->flag; pt[0]->flag = 0; newtet[0]=k; - if ( !MMG3D_crea_newTetra(mesh,nnew,newtet,pt,xt,&pxt0) ) { + if ( !MMG3D_crea_newTetra(mesh,ne,newtet,pt,xt,&pxt0) ) { return 0; } @@ -1324,7 +1326,7 @@ int MMG5_split2sf(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp } /* Quality update */ - MMG3D_update_qual(mesh,met,nnew,newtet,pt,metRidTyp); + MMG3D_update_qual(mesh,met,ne,newtet,pt,metRidTyp); return 1; } @@ -1411,14 +1413,14 @@ int MMG5_split2(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp) int8_t flg,firstxt,isxt[4]; uint8_t tau[4]; const uint8_t *taued; - const int nnew=4; + const int ne=4; pt[0] = &mesh->tetra[k]; flg = pt[0]->flag; pt[0]->flag = 0; newtet[0]=k; - if ( !MMG3D_crea_newTetra(mesh,nnew,newtet,pt,xt,&pxt0) ) { + if ( !MMG3D_crea_newTetra(mesh,ne,newtet,pt,xt,&pxt0) ) { return 0; } @@ -1474,7 +1476,7 @@ int MMG5_split2(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp) memset(isxt,0,4*sizeof(int8_t)); for (i=0; i<4; i++) { int j; - for (j=0; jtetra[k]; flg = pt[0]->flag; @@ -1630,7 +1632,7 @@ int MMG5_split3(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp) newtet[0]=k; /* create 4 new tetras */ - if ( !MMG3D_crea_newTetra(mesh,nnew,newtet,pt,xt,&pxt0) ) { + if ( !MMG3D_crea_newTetra(mesh,ne,newtet,pt,xt,&pxt0) ) { return 0; } @@ -1687,7 +1689,7 @@ int MMG5_split3(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp) memset(isxt,0,4*sizeof(int8_t)); for (i=0; i<4; i++) { int j; - for (j=0; jtetra[k]; flg = pt[0]->flag; @@ -1959,7 +1961,7 @@ int MMG5_split3cone(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidT newtet[0]=k; /* create 4 new tetras */ - if ( !MMG3D_crea_newTetra(mesh,nnew,newtet,pt,xt,&pxt0) ) { + if ( !MMG3D_crea_newTetra(mesh,ne,newtet,pt,xt,&pxt0) ) { return 0; } @@ -2168,7 +2170,7 @@ int MMG5_split3cone(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidT for (i=0; i<4; i++) { int j; - for (j=0; jtetra[k]; newtet[0]=k; @@ -2565,7 +2567,7 @@ int MMG5_split3op(MMG5_pMesh mesh, MMG5_pSol met, int k, int vx[6],int8_t metRid pt[0]->flag = 0; /* create 4 new tetras, the fifth being created only if needed. */ - if ( !MMG3D_crea_newTetra(mesh,nnew,newtet,pt,xt,&pxt0) ) { + if ( !MMG3D_crea_newTetra(mesh,ne,newtet,pt,xt,&pxt0) ) { return 0; } newtet[4] = 0; @@ -2774,10 +2776,10 @@ int MMG5_split3op(MMG5_pMesh mesh, MMG5_pSol met, int k, int vx[6],int8_t metRid isxt[0] = isxt[1] = isxt[2] = isxt[3] = 0; for (i=0; i<4; i++) { - if ( (xt[0]).ref[i] || xt[0].ftag[i] ) isxt[0] = 1; - if ( (xt[1]).ref[i] || xt[1].ftag[i] ) isxt[1] = 1; - if ( (xt[2]).ref[i] || xt[2].ftag[i] ) isxt[2] = 1; - if ( (xt[3]).ref[i] || xt[3].ftag[i] ) isxt[3] = 1; + int j; + for (j=0; jxt ) { @@ -2839,11 +2841,10 @@ int MMG5_split3op(MMG5_pMesh mesh, MMG5_pSol met, int k, int vx[6],int8_t metRid isxt[0] = isxt[1] = isxt[2] = isxt[3] = isxt[4] = 0; for (i=0; i<4; i++) { - if ( (xt[0]).ref[i] || xt[0].ftag[i] ) isxt[0] = 1; - if ( (xt[1]).ref[i] || xt[1].ftag[i] ) isxt[1] = 1; - if ( (xt[2]).ref[i] || xt[2].ftag[i] ) isxt[2] = 1; - if ( (xt[3]).ref[i] || xt[3].ftag[i] ) isxt[3] = 1; - if ( (xt[4]).ref[i] || xt[4].ftag[i] ) isxt[4] = 1; + int j; + for (j=0; j<=ne; j++) { + if ( xt[j].ref[i] || xt[j].ftag[i] ) isxt[j] = 1; + } } if ( pt[0]->xt ) { @@ -2900,6 +2901,7 @@ int MMG5_split3op(MMG5_pMesh mesh, MMG5_pSol met, int k, int vx[6],int8_t metRid } } } + /* Quality update */ if ( (!metRidTyp) && met->m && met->size>1 ) { pt[0]->qual=MMG5_caltet33_ani(mesh,met,pt[0]); From 70842193ec04010beb736b943779f4bd29230a70 Mon Sep 17 00:00:00 2001 From: Algiane Date: Fri, 23 Jul 2021 10:28:41 +0200 Subject: [PATCH 028/838] Update comments --- src/mmg3d/split_3d.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mmg3d/split_3d.c b/src/mmg3d/split_3d.c index a856dae1e..e691d9c7c 100755 --- a/src/mmg3d/split_3d.c +++ b/src/mmg3d/split_3d.c @@ -1219,6 +1219,7 @@ int MMG5_split2sf(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp pt[0]->flag = 0; newtet[0]=k; + /* Create 2 new tetra */ if ( !MMG3D_crea_newTetra(mesh,ne,newtet,pt,xt,&pxt0) ) { return 0; } @@ -1420,6 +1421,7 @@ int MMG5_split2(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp) pt[0]->flag = 0; newtet[0]=k; + /* Create 3 new tetra */ if ( !MMG3D_crea_newTetra(mesh,ne,newtet,pt,xt,&pxt0) ) { return 0; } @@ -1631,7 +1633,7 @@ int MMG5_split3(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp) pt[0]->flag = 0; newtet[0]=k; - /* create 4 new tetras */ + /* create 3 new tetras */ if ( !MMG3D_crea_newTetra(mesh,ne,newtet,pt,xt,&pxt0) ) { return 0; } @@ -1960,7 +1962,7 @@ int MMG5_split3cone(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidT pt[0]->flag = 0; newtet[0]=k; - /* create 4 new tetras */ + /* create 3 new tetras */ if ( !MMG3D_crea_newTetra(mesh,ne,newtet,pt,xt,&pxt0) ) { return 0; } @@ -2566,7 +2568,7 @@ int MMG5_split3op(MMG5_pMesh mesh, MMG5_pSol met, int k, int vx[6],int8_t metRid &ie0,&ie1,&ie2,&ie3,&ie4,&ie5,&imin03,&imin12); pt[0]->flag = 0; - /* create 4 new tetras, the fifth being created only if needed. */ + /* create 3 new tetras, the fifth being created only if needed. */ if ( !MMG3D_crea_newTetra(mesh,ne,newtet,pt,xt,&pxt0) ) { return 0; } From 0b7d64f15d6f8ed8ce254b03f69ce2bb9abee06c Mon Sep 17 00:00:00 2001 From: Algiane Date: Fri, 23 Jul 2021 10:34:57 +0200 Subject: [PATCH 029/838] Refactoring in split_3d.c. --- src/mmg3d/split_3d.c | 136 ++++++------------------------------------- 1 file changed, 17 insertions(+), 119 deletions(-) diff --git a/src/mmg3d/split_3d.c b/src/mmg3d/split_3d.c index e691d9c7c..31635a6da 100755 --- a/src/mmg3d/split_3d.c +++ b/src/mmg3d/split_3d.c @@ -2945,9 +2945,10 @@ int MMG5_split4bar(MMG5_pMesh mesh, MMG5_pSol met, int k,int8_t metRidTyp) { MMG5_xTetra xt[4]; MMG5_pxTetra pxt0; double o[3],cb[4]; - int i,ib,iel,iadr,*adja,adj1,adj2,adj3; + int i,ib,iadr,*adja,adj1,adj2,adj3; int src,newtet[4]; uint8_t isxt[4],firstxt; + const int ne=4; pt[0] = &mesh->tetra[k]; pt[0]->flag = 0; @@ -2988,65 +2989,8 @@ int MMG5_split4bar(MMG5_pMesh mesh, MMG5_pSol met, int k,int8_t metRidTyp) { } /* create 3 new tetras */ - iel = MMG3D_newElt(mesh); - if ( !iel ) { - MMG3D_TETRA_REALLOC(mesh,iel,mesh->gap, - fprintf(stderr,"\n ## Error: %s: unable to allocate" - " a new element.\n",__func__); - MMG5_INCREASE_MEM_MESSAGE(); - MMG3D_delPt(mesh,ib); - return 0); - pt[0] = &mesh->tetra[newtet[0]]; - } - pt[1] = &mesh->tetra[iel]; - pt[1] = memcpy(pt[1],pt[0],sizeof(MMG5_Tetra)); - newtet[1]=iel; - - iel = MMG3D_newElt(mesh); - if ( !iel ) { - MMG3D_TETRA_REALLOC(mesh,iel,mesh->gap, - fprintf(stderr,"\n ## Error: %s: unable to allocate" - " a new element.\n",__func__); - MMG5_INCREASE_MEM_MESSAGE(); - MMG3D_delPt(mesh,ib); - if ( !MMG3D_delElt(mesh,newtet[1]) ) return 0; - return 0); - pt[0] = &mesh->tetra[newtet[0]]; - pt[1] = &mesh->tetra[newtet[1]]; - } - pt[2] = &mesh->tetra[iel]; - pt[2] = memcpy(pt[2],pt[0],sizeof(MMG5_Tetra)); - newtet[2]=iel; - - iel = MMG3D_newElt(mesh); - if ( !iel ) { - MMG3D_TETRA_REALLOC(mesh,iel,mesh->gap, - fprintf(stderr,"\n ## Error: %s: unable to allocate" - " a new element.\n",__func__); - MMG5_INCREASE_MEM_MESSAGE(); - MMG3D_delPt(mesh,ib); - if ( !MMG3D_delElt(mesh,newtet[1]) ) return 0; - if ( !MMG3D_delElt(mesh,newtet[2]) ) return 0; - return 0); - pt[0] = &mesh->tetra[newtet[0]]; - pt[1] = &mesh->tetra[newtet[1]]; - pt[2] = &mesh->tetra[newtet[2]]; - } - pt[3] = &mesh->tetra[iel]; - pt[3] = memcpy(pt[3],pt[0],sizeof(MMG5_Tetra)); - newtet[3]=iel; - - memset(&xt[0],0, sizeof(MMG5_xTetra)); - memset(&xt[1],0, sizeof(MMG5_xTetra)); - memset(&xt[2],0, sizeof(MMG5_xTetra)); - memset(&xt[3],0, sizeof(MMG5_xTetra)); - pxt0 = 0; - if ( pt[0]->xt ) { - pxt0 = &mesh->xtetra[pt[0]->xt]; - memcpy(&xt[0],pxt0,sizeof(MMG5_xTetra)); - memcpy(&xt[1],pxt0,sizeof(MMG5_xTetra)); - memcpy(&xt[2],pxt0,sizeof(MMG5_xTetra)); - memcpy(&xt[3],pxt0,sizeof(MMG5_xTetra)); + if ( !MMG3D_crea_newTetra(mesh,ne,newtet,pt,xt,&pxt0) ) { + return 0; } /* Update adjacency */ @@ -3126,10 +3070,10 @@ int MMG5_split4bar(MMG5_pMesh mesh, MMG5_pSol met, int k,int8_t metRidTyp) { /* Assignation of the xt fields to the appropriate tets */ memset(isxt,0,4*sizeof(int8_t)); for (i=0; i<4; i++) { - if ( xt[0].ref[i] || xt[0].ftag[i] ) isxt[0] = 1; - if ( xt[1].ref[i] || xt[1].ftag[i] ) isxt[1] = 1; - if ( xt[2].ref[i] || xt[2].ftag[i] ) isxt[2] = 1; - if ( xt[3].ref[i] || xt[3].ftag[i] ) isxt[3] = 1; + int j; + for (j=0; jxt ) { @@ -3185,19 +3129,9 @@ int MMG5_split4bar(MMG5_pMesh mesh, MMG5_pSol met, int k,int8_t metRidTyp) { pt[0]->xt = 0; } } + /* Quality update */ - if ( (!metRidTyp) && met->m && met->size>1 ) { - pt[0]->qual=MMG5_caltet33_ani(mesh,met,pt[0]); - pt[1]->qual=MMG5_caltet33_ani(mesh,met,pt[1]); - pt[2]->qual=MMG5_caltet33_ani(mesh,met,pt[2]); - pt[3]->qual=MMG5_caltet33_ani(mesh,met,pt[3]); - } - else { - pt[0]->qual=MMG5_orcal(mesh,met,newtet[0]); - pt[1]->qual=MMG5_orcal(mesh,met,newtet[1]); - pt[2]->qual=MMG5_orcal(mesh,met,newtet[2]); - pt[3]->qual=MMG5_orcal(mesh,met,newtet[3]); - } + MMG3D_update_qual(mesh,met,ne,newtet,pt,metRidTyp); return ib; } @@ -3399,11 +3333,11 @@ int MMG5_split4sf(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp MMG5_pTetra pt[6]; MMG5_xTetra xt[6]; MMG5_pxTetra pxt0; - int iel; int newtet[6]; int8_t firstxt,isxt[6],j,i; uint8_t tau[4],imin23,imin12; const uint8_t *taued = NULL; + const int ne=6; pt[0] = &mesh->tetra[k]; newtet[0]=k; @@ -3413,34 +3347,8 @@ int MMG5_split4sf(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp pt[0]->flag = 0; /* create 5 new tetras */ - for (j=1; j<6; j++) { - iel = MMG3D_newElt(mesh); - if ( !iel ) { - MMG3D_TETRA_REALLOC(mesh,iel,mesh->gap, - fprintf(stderr,"\n ## Error: %s: unable to allocate" - " a new element.\n",__func__); - MMG5_INCREASE_MEM_MESSAGE(); - fprintf(stderr," Exit program.\n"); - return 0); - for ( i=0; itetra[newtet[i]]; - } - pt[j] = &mesh->tetra[iel]; - pt[j] = memcpy(pt[j],pt[0],sizeof(MMG5_Tetra)); - newtet[j]=iel; - } - - if ( (pt[0])->xt ) { - pxt0 = &mesh->xtetra[(pt[0])->xt]; - for (j=0; j<6; j++) { - memcpy(&xt[j],pxt0, sizeof(MMG5_xTetra)); - } - } - else { - pxt0 = 0; - for (j=0; j<6; j++) { - memset(&xt[j],0, sizeof(MMG5_xTetra)); - } + if ( !MMG3D_crea_newTetra(mesh,ne,newtet,pt,xt,&pxt0) ) { + return 0; } /* Generic formulation of split of 4 edges (with 3 on same face) */ @@ -3544,10 +3452,7 @@ int MMG5_split4sf(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp } /* Assignation of the xt fields to the appropriate tets */ - for (j=0; j<6;j++) { - isxt[j] = 0; - } - + memset(isxt,0,6*sizeof(int8_t)); for (i=0; i<4; i++) { for (j=0; j<6; j++) { if ( (xt[j]).ref[i] || xt[j].ftag[i] ) isxt[j] = 1; @@ -3608,16 +3513,9 @@ int MMG5_split4sf(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp } } - if ( (!metRidTyp) && met->m && met->size>1 ) { - for (i=0; i<6; i++) { - pt[i]->qual=MMG5_caltet33_ani(mesh,met,pt[i]); - } - } - else { - for (i=0; i<6; i++) { - pt[i]->qual=MMG5_orcal(mesh,met,newtet[i]); - } - } + /* Quality update */ + MMG3D_update_qual(mesh,met,ne,newtet,pt,metRidTyp); + return 1; } From 02ba1ce4c15227803a78a81214002691b1a1d618 Mon Sep 17 00:00:00 2001 From: Algiane Date: Fri, 23 Jul 2021 10:41:13 +0200 Subject: [PATCH 030/838] Refactoring in split_3d.c (2). --- src/mmg3d/split_3d.c | 113 +++++++++---------------------------------- 1 file changed, 23 insertions(+), 90 deletions(-) diff --git a/src/mmg3d/split_3d.c b/src/mmg3d/split_3d.c index 31635a6da..0c3104c7e 100755 --- a/src/mmg3d/split_3d.c +++ b/src/mmg3d/split_3d.c @@ -3068,8 +3068,8 @@ int MMG5_split4bar(MMG5_pMesh mesh, MMG5_pSol met, int k,int8_t metRidTyp) { MG_SET(xt[3].ori, 0); MG_SET(xt[3].ori, 1); MG_SET(xt[3].ori, 2); /* Assignation of the xt fields to the appropriate tets */ - memset(isxt,0,4*sizeof(int8_t)); - for (i=0; i<4; i++) { + memset(isxt,0,ne*sizeof(int8_t)); + for (i=0; itetra[k]; flg = pt[0]->flag; @@ -3686,34 +3686,8 @@ int MMG5_split4op(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp imin23 = ((pt[0])->v[tau[2]] < (pt[0])->v[tau[3]]) ? tau[2] : tau[3]; /* create 5 new tetras */ - for (j=1; j<6; j++) { - iel = MMG3D_newElt(mesh); - if ( !iel ) { - MMG3D_TETRA_REALLOC(mesh,iel,mesh->gap, - fprintf(stderr,"\n ## Error: %s: unable to allocate" - " a new element.\n",__func__); - MMG5_INCREASE_MEM_MESSAGE(); - fprintf(stderr," Exit program.\n"); - return 0); - for ( i=0; itetra[newtet[i]]; - } - pt[j] = &mesh->tetra[iel]; - pt[j] = memcpy(pt[j],pt[0],sizeof(MMG5_Tetra)); - newtet[j]=iel; - } - - if ( (pt[0])->xt ) { - pxt0 = &mesh->xtetra[(pt[0])->xt]; - for (j=0; j<6; j++) { - memcpy(&xt[j],pxt0, sizeof(MMG5_xTetra)); - } - } - else { - pxt0 = 0; - for (j=0; j<6; j++) { - memset(&xt[j],0, sizeof(MMG5_xTetra)); - } + if ( !MMG3D_crea_newTetra(mesh,ne,newtet,pt,xt,&pxt0) ) { + return 0; } /* Generic formulation for split of 4 edges, with no 3 edges lying on the same face */ @@ -3832,12 +3806,10 @@ int MMG5_split4op(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp } /* Assignation of the xt fields to the appropriate tets */ - for (j=0; j<6; j++) { - isxt[j] = 0; - } + memset(isxt,0,ne*sizeof(int8_t)); for (i=0; i<4; i++) { - for(j=0;j<6;j++ ) { + for(j=0;jm && met->size>1 ) { - for (i=0; i<6; i++) { - pt[i]->qual=MMG5_caltet33_ani(mesh,met,pt[i]); - } - } - else { - for (i=0; i<6; i++) { - pt[i]->qual=MMG5_orcal(mesh,met,newtet[i]); - } - } + + /* Quality update */ + MMG3D_update_qual(mesh,met,ne,newtet,pt,metRidTyp); + return 1; } @@ -4066,11 +4032,12 @@ int MMG5_split5(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp) MMG5_pTetra pt[7]; MMG5_xTetra xt[7]; MMG5_pxTetra pxt0; - int iel,i,j; + int i,j; int newtet[7]; int8_t firstxt,isxt[7]; uint8_t tau[4],imin; const uint8_t *taued=NULL; + const int ne=7; pt[0] = &mesh->tetra[k]; newtet[0]=k; @@ -4080,34 +4047,8 @@ int MMG5_split5(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp) pt[0]->flag = 0; /* create 6 new tetras */ - for (i=1; i<7; i++) { - iel = MMG3D_newElt(mesh); - if ( !iel ) { - MMG3D_TETRA_REALLOC(mesh,iel,mesh->gap, - fprintf(stderr,"\n ## Error: %s: unable to allocate" - " a new element.\n",__func__); - MMG5_INCREASE_MEM_MESSAGE(); - fprintf(stderr," Exit program.\n"); - return 0); - for ( j=0; jtetra[newtet[j]]; - } - pt[i] = &mesh->tetra[iel]; - pt[i] = memcpy(pt[i],pt[0],sizeof(MMG5_Tetra)); - newtet[i]=iel; - } - - if ( pt[0]->xt ) { - pxt0 = &mesh->xtetra[(pt[0])->xt]; - for (i=0; i<7; i++) { - memcpy(&xt[i],pxt0, sizeof(MMG5_xTetra)); - } - } - else { - pxt0 = 0; - for (i=0; i<7; i++) { - memset(&xt[i],0, sizeof(MMG5_xTetra)); - } + if ( !MMG3D_crea_newTetra(mesh,ne,newtet,pt,xt,&pxt0) ) { + return 0; } /* Generic formulation of split of 5 edges */ @@ -4212,12 +4153,10 @@ int MMG5_split5(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp) } /* Assignation of the xt fields to the appropriate tets */ - for (j=0; j<7; j++) { - isxt[j] = 0; - } + memset(isxt,0,ne*sizeof(int8_t)); for (i=0; i<4; i++) { - for (j=0; j<7; j++) { + for (j=0; jm && met->size>1 ) { - for (i=0; i<7; i++) { - pt[i]->qual=MMG5_caltet33_ani(mesh,met,pt[i]); - } - } - else { - for (i=0; i<7; i++) { - pt[i]->qual=MMG5_orcal(mesh,met,newtet[i]); - } - } + + /* Quality update */ + MMG3D_update_qual(mesh,met,ne,newtet,pt,metRidTyp); + return 1; } From b9bdab660b893b4b7616dcde1651578ab8639e63 Mon Sep 17 00:00:00 2001 From: Algiane Date: Fri, 23 Jul 2021 10:49:32 +0200 Subject: [PATCH 031/838] End of refactoring of split_3d.c --- src/mmg3d/split_3d.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/mmg3d/split_3d.c b/src/mmg3d/split_3d.c index 0c3104c7e..ecbd96665 100755 --- a/src/mmg3d/split_3d.c +++ b/src/mmg3d/split_3d.c @@ -4309,6 +4309,7 @@ int MMG5_split6(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp) int i,j,iel,nxt0; int newtet[8]; int8_t isxt0,isxt; + const int8_t ne=8; pt[0] = &mesh->tetra[k]; pt[0]->flag = 0; @@ -4319,7 +4320,7 @@ int MMG5_split6(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp) memcpy(&xt0,pxt,sizeof(MMG5_xTetra)); /* create 7 new tetras */ - for (i=1; i<8; i++) { + for (i=1; igap, @@ -4653,16 +4654,10 @@ int MMG5_split6(MMG5_pMesh mesh,MMG5_pSol met,int k,int vx[6],int8_t metRidTyp) } } } - if ( (!metRidTyp) && met->m && met->size>1 ) { - for (i=0; i<8; i++) { - pt[i]->qual=MMG5_caltet33_ani(mesh,met,pt[i]); - } - } - else { - for (i=0; i<8; i++) { - pt[i]->qual=MMG5_orcal(mesh,met,newtet[i]); - } - } + + /* Quality update */ + MMG3D_update_qual(mesh,met,ne,newtet,pt,metRidTyp); + return 1; } From 213a50a92de648935812027e9f9416cb120ea082 Mon Sep 17 00:00:00 2001 From: Algiane Date: Wed, 25 Aug 2021 18:27:24 +0200 Subject: [PATCH 032/838] Check that we don't pinch the surface during collapse. --- src/mmg3d/colver_3d.c | 308 ++++++++++++++++++++++++------------------ src/mmg3d/mmg3d2.c | 2 +- 2 files changed, 176 insertions(+), 134 deletions(-) diff --git a/src/mmg3d/colver_3d.c b/src/mmg3d/colver_3d.c index e64349c21..85f3ed084 100644 --- a/src/mmg3d/colver_3d.c +++ b/src/mmg3d/colver_3d.c @@ -338,6 +338,134 @@ MMG5_topchkcol_bdy(MMG5_pMesh mesh,int k,int iface,int8_t iedg,int *lists, return 1; } +/** + * \param mesh pointer toward the mesh + * \param start tetra from which we start to travel + * \param na edge vertex + * \param nb edge vertex + * \param tag new edge tag + * \param ref new edge ref + * \param piv global index of the pivot to set the sense of travel + * \param adj index of adjacent tetra for the travel + * \param filled 1 if an xtetra has been found (so tag and ref are filled) + * + * \return -1 if fail, \a start if shell has been completely travelled without + * founding an xtetra, adj if an xtetra has been found, 0 otherwise + * + * Get tag and ref of the edge \a na \a nb from tetra \a start by traveling its + * shell in one direction (given by the pivot \a piv). Stop when meeting the + * first xtetra with a non 0 tag (it is sufficient if tags and refs are + * consistent through the edge shell except for edges with null tags); + * + */ +static inline +int MMG3D_get_shellEdgeTag_oneDir(MMG5_pMesh mesh,int start, int na, int nb, + int16_t *tag,int *ref, int piv,int adj, + int8_t *filled) { + MMG5_pTetra pt; + MMG5_pxTetra pxt; + int *adja; + int8_t i; + + *filled = 0; + while ( adj && (adj != start) ) { + pt = &mesh->tetra[adj]; + + /* identification of edge number in tetra adj */ + if ( !MMG3D_findEdge(mesh,pt,adj,na,nb,1,NULL,&i) ) return -1; + + /* update edge ref and tag */ + if ( pt->xt ) { + pxt = &mesh->xtetra[pt->xt]; + *ref = pxt->edg[i]; + if ( pxt->tag[i] & MG_BDY ) { + *tag |= pxt->tag[i]; + *filled = 1; + return adj; + } + } + + /* set new triangle for travel */ + adja = &mesh->adja[4*(adj-1)+1]; + if ( pt->v[ MMG5_ifar[i][0] ] == piv ) { + adj = adja[ MMG5_ifar[i][0] ] / 4; + piv = pt->v[ MMG5_ifar[i][1] ]; + } + else { + adj = adja[ MMG5_ifar[i][1] ] /4; + piv = pt->v[ MMG5_ifar[i][0] ]; + } + } + + return adj; +} + +/** + * \param mesh pointer toward the mesh + * \param start tetra from which we start to travel + * \param ia local index of edge that must be updated + * \param tag new edge tag + * \param ref new edge ref + * \return 1 if success, 0 if fail. + * + * Get tag and ref of the edge \ia of tetra \a start by traveling its shell. + * Stop when meeting the first xtetra (it is sufficient if tags and refs are + * consistent through the edge shell); + * + */ +static inline +int MMG3D_get_shellEdgeTag(MMG5_pMesh mesh,int start, int8_t ia,int16_t *tag,int *ref) { + MMG5_pTetra pt; + MMG5_pxTetra pxt; + int piv,na,nb,adj,*adja; + int8_t filled; + + pt = &mesh->tetra[start]; + + assert( start >= 1 && MG_EOK(pt) ); + + pxt = NULL; + na = pt->v[MMG5_iare[ia][0]]; + nb = pt->v[MMG5_iare[ia][1]]; + + if ( pt->xt ) { + pxt = &mesh->xtetra[pt->xt]; + if ( pxt->tag[ia] & MG_BDY ) { + *tag |= pxt->tag[ia]; + *ref = pxt->edg[ia]; + return 1; + } + } + + /* Travel in one direction */ + adja = &mesh->adja[4*(start-1)+1]; + adj = adja[MMG5_ifar[ia][0]] / 4; + piv = pt->v[MMG5_ifar[ia][1]]; + + adj = MMG3D_get_shellEdgeTag_oneDir(mesh,start,na,nb,tag,ref,piv,adj,&filled); + + /* If an xtetra has been found or if all shell has been travelled, stop, else, + * travel it the other sense */ + if ( adj > 0 ) { + assert ( (adj == start) || filled ); + return 1; + } + else if ( adj < 0 ) return 0; + + assert(!adj); + + pt = &mesh->tetra[start]; + adja = &mesh->adja[4*(start-1)+1]; + adj = adja[MMG5_ifar[ia][1]] / 4; + piv = pt->v[MMG5_ifar[ia][0]]; + + adj = MMG3D_get_shellEdgeTag_oneDir(mesh,start,na,nb,tag,ref,piv,adj,&filled); + + if ( adj < 0 ) return 0; + + return 1; +} + /** * \param mesh pointer toward the mesh structure. * \param met pointer toward the metric structure. @@ -439,16 +567,21 @@ int MMG5_chkcol_bdy(MMG5_pMesh mesh,MMG5_pSol met,int k,int8_t iface, if ( iq < 4 ) { nbbdy = 0; - if ( pt->xt ) pxt = &mesh->xtetra[pt->xt]; + if ( pt->xt ) { + pxt = &mesh->xtetra[pt->xt]; + } + for (i=0; i<4; i++) { if ( pt->xt && (pxt->ftag[i] & MG_BDY) ) nbbdy++; } - /* Topological problem triggered when one of the two faces of collapsed edge is the only - internal one : closing a part of the domain */ - if ( nbbdy == 4 ) + if ( nbbdy == 4 ) { + /* Only one element in the domain: we don't want to delete it */ return 0; + } else if ( nbbdy == 3 ) { + /* Topological problem triggered when one of the two faces of collapsed + edge is the only internal one : closing a part of the domain */ /* Identification of edge number in tetra iel */ if ( !MMG3D_findEdge(mesh,pt,iel,numq,nump,1,NULL,&ia) ) return -1; @@ -463,6 +596,42 @@ int MMG5_chkcol_bdy(MMG5_pMesh mesh,MMG5_pSol met,int k,int8_t iface, if ( pt->xt && (pxt->ftag[ipp] & MG_BDY) && (pxt->ftag[iq] & MG_BDY) ) return 0; + if ( pt->xt ) { + for (i=0; i<4; i++) { + if ( i==ipp || i==iq ) { + continue; + } + + /* Avoid surface crimping: check that the collapse doesn't merge 3 + * bdy edge along a non bdy face: we have to check the edge of each + * shell because some MG_BDY tags may be missings due to the creation + * of an xtetra during a previous collapse */ + if ( !(pxt->ftag[i] & MG_BDY) ) { + int16_t tag0,tag1,tag2; + int ref0,ref1,ref2; + + tag0 = tag1 = tag2 = 0; + ref0 = ref1 = ref2 = 0; + + if ( !MMG3D_get_shellEdgeTag(mesh,iel,MMG5_iarf[i][0],&tag0,&ref0) ) { + fprintf(stderr,"\n ## Error: %s: 0. unable to get edge info.\n",__func__); + return 0; + } + if ( !MMG3D_get_shellEdgeTag(mesh,iel,MMG5_iarf[i][1],&tag1,&ref1) ) { + fprintf(stderr,"\n ## Error: %s: 1. unable to get edge info.\n",__func__); + return 0; + } + if ( !MMG3D_get_shellEdgeTag(mesh,iel,MMG5_iarf[i][2],&tag2,&ref2) ) { + fprintf(stderr,"\n ## Error: %s: 2. unable to get edge info.\n",__func__); + return 0; + } + if ( (tag0 & MG_BDY) && (tag1 & MG_BDY) && (tag2 & MG_BDY ) ) { + return 0; + } + } + } + } + continue; } @@ -921,134 +1090,6 @@ int MMG3D_update_shellEdgeTag(MMG5_pMesh mesh,int start, int8_t ia,int16_t tag, return 1; } -/** - * \param mesh pointer toward the mesh - * \param start tetra from which we start to travel - * \param na edge vertex - * \param nb edge vertex - * \param tag new edge tag - * \param ref new edge ref - * \param piv global index of the pivot to set the sense of travel - * \param adj index of adjacent tetra for the travel - * \param filled 1 if an xtetra has been found (so tag and ref are filled) - * - * \return -1 if fail, \a start if shell has been completely travelled without - * founding an xtetra, adj if an xtetra has been found, 0 otherwise - * - * Get tag and ref of the edge \a na \a nb from tetra \a start by traveling its - * shell in one direction (given by the pivot \a piv). Stop when meeting the - * first xtetra with a non 0 tag (it is sufficient if tags and refs are - * consistent through the edge shell except for edges with null tags); - * - */ -static inline -int MMG3D_get_shellEdgeTag_oneDir(MMG5_pMesh mesh,int start, int na, int nb, - int16_t *tag,int *ref, int piv,int adj, - int8_t *filled) { - MMG5_pTetra pt; - MMG5_pxTetra pxt; - int *adja; - int8_t i; - - *filled = 0; - while ( adj && (adj != start) ) { - pt = &mesh->tetra[adj]; - - /* identification of edge number in tetra adj */ - if ( !MMG3D_findEdge(mesh,pt,adj,na,nb,1,NULL,&i) ) return -1; - - /* update edge ref and tag */ - if ( pt->xt ) { - pxt = &mesh->xtetra[pt->xt]; - *ref = pxt->edg[i]; - if ( pxt->tag[i] & MG_BDY ) { - *tag |= pxt->tag[i]; - *filled = 1; - return adj; - } - } - - /* set new triangle for travel */ - adja = &mesh->adja[4*(adj-1)+1]; - if ( pt->v[ MMG5_ifar[i][0] ] == piv ) { - adj = adja[ MMG5_ifar[i][0] ] / 4; - piv = pt->v[ MMG5_ifar[i][1] ]; - } - else { - adj = adja[ MMG5_ifar[i][1] ] /4; - piv = pt->v[ MMG5_ifar[i][0] ]; - } - } - - return adj; -} - -/** - * \param mesh pointer toward the mesh - * \param start tetra from which we start to travel - * \param ia local index of edge that must be updated - * \param tag new edge tag - * \param ref new edge ref - * \return 1 if success, 0 if fail. - * - * Get tag and ref of the edge \ia of tetra \a start by traveling its shell. - * Stop when meeting the first xtetra (it is sufficient if tags and refs are - * consistent through the edge shell); - * - */ -static inline -int MMG3D_get_shellEdgeTag(MMG5_pMesh mesh,int start, int8_t ia,int16_t *tag,int *ref) { - MMG5_pTetra pt; - MMG5_pxTetra pxt; - int piv,na,nb,adj,*adja; - int8_t filled; - - pt = &mesh->tetra[start]; - - assert( start >= 1 && MG_EOK(pt) ); - - pxt = NULL; - na = pt->v[MMG5_iare[ia][0]]; - nb = pt->v[MMG5_iare[ia][1]]; - - if ( pt->xt ) { - pxt = &mesh->xtetra[pt->xt]; - if ( pxt->tag[ia] & MG_BDY ) { - *tag |= pxt->tag[ia]; - *ref = pxt->edg[ia]; - return 1; - } - } - - /* Travel in one direction */ - adja = &mesh->adja[4*(start-1)+1]; - adj = adja[MMG5_ifar[ia][0]] / 4; - piv = pt->v[MMG5_ifar[ia][1]]; - - adj = MMG3D_get_shellEdgeTag_oneDir(mesh,start,na,nb,tag,ref,piv,adj,&filled); - - /* If an xtetra has been found or if all shell has been travelled, stop, else, - * travel it the other sense */ - if ( adj > 0 ) { - assert ( (adj == start) || filled ); - return 1; - } - else if ( adj < 0 ) return 0; - - assert(!adj); - - pt = &mesh->tetra[start]; - adja = &mesh->adja[4*(start-1)+1]; - adj = adja[MMG5_ifar[ia][1]] / 4; - piv = pt->v[MMG5_ifar[ia][0]]; - - adj = MMG3D_get_shellEdgeTag_oneDir(mesh,start,na,nb,tag,ref,piv,adj,&filled); - - if ( adj < 0 ) return 0; - - return 1; -} - /** * \param mesh pointer toward the mesh * \param met pointer toward the metric @@ -1325,7 +1366,8 @@ int MMG5_colver(MMG5_pMesh mesh,MMG5_pSol met,int *list,int ilist,int8_t indq,in /* Recover the already used place by pxt: now pel has a xtetra but the * edges coming from voyp (not directly involved in the collapse) will * have the tag 0 that may be non consistent with other tags in their - * respective shells. */ + * respective shells: update is not possible because collapse is in + * progress */ pt1->xt = pt->xt; memcpy(pxt,pxt1,sizeof(MMG5_xTetra)); } diff --git a/src/mmg3d/mmg3d2.c b/src/mmg3d/mmg3d2.c index a639b025f..998577a27 100755 --- a/src/mmg3d/mmg3d2.c +++ b/src/mmg3d/mmg3d2.c @@ -1498,7 +1498,7 @@ int MMG5_chkmaniball(MMG5_pMesh mesh, int start, int8_t ip){ fprintf(stderr," *** Topological problem:"); fprintf(stderr," non manifold surface at point %d %d\n",nump, MMG3D_indPt(mesh,nump)); fprintf(stderr," non manifold surface at tet %d (ip %d)\n", MMG3D_indElt(mesh,start),ip); - fprintf(stderr,"nref (color %d) %d\n",nref,ref); + fprintf(stderr," nref (color %d) %d\n",nref,ref); return 0; } } From 8200266e8b6b36a019a2ce952a765776fd7054e1 Mon Sep 17 00:00:00 2001 From: Algiane Date: Thu, 2 Sep 2021 11:43:43 +0200 Subject: [PATCH 033/838] Test that we don't swap an edge belonging to a domain with only 1 element in adaptation mode (it was only done in ls mode). --- src/mmg3d/swap_3d.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/mmg3d/swap_3d.c b/src/mmg3d/swap_3d.c index 2f4f496f3..4bd0f7c72 100644 --- a/src/mmg3d/swap_3d.c +++ b/src/mmg3d/swap_3d.c @@ -61,7 +61,7 @@ int MMG5_chkswpbdy(MMG5_pMesh mesh, MMG5_pSol met, int *list,int ilist, MMG5_pPar par; double b0[3],b1[3],n[3],v[3],c[3],ux,uy,uz,ps,disnat,dischg; double cal1,cal2,calnat,calchg,calold,calnew,caltmp,hausd; - int iel,iel1,iel2,np,nq,na1,na2,k,nminus,nplus,isloc,l,info; + int iel,iel1,iel2,np,nq,na1,na2,k,nminus,nplus,isloc,l,info,refm; int8_t ifa1,ifa2,ia,ip,iq,ia1,ia2,j,isshell,ier; iel = list[0] / 6; @@ -81,20 +81,23 @@ int MMG5_chkswpbdy(MMG5_pMesh mesh, MMG5_pSol met, int *list,int ilist, (pxt->tag[ia] & MG_NOM) ) return 0; } - /* No swap when either internal or external component has only 1 element */ - //Algiane: warning, to check in multi-dom... - if ( mesh->info.iso ) { - nminus = nplus = 0; - for (k=0; ktetra[iel]; - if ( pt->ref == MG_MINUS ) - nminus++; - else - nplus++; + /* No swap when either internal or external component has only 1 element (as + * we can't swap geometric edges here we know that the edge shares at most 2 + * domains).*/ + nminus = nplus = 0; + refm = pt->ref; + for (k=0; ktetra[iel]; + if ( pt->ref == refm ) { + nminus++; + } + else { + nplus++; } - if ( nplus == 1 || nminus == 1 ) return 0; } + if ( nplus == 1 || nminus == 1 ) return 0; + iel1 = it1 / 4; ifa1 = it1 % 4; From 1d4eeb547f7d5bfed3e7f4439acf8dab73e74806 Mon Sep 17 00:00:00 2001 From: Algiane Date: Thu, 4 Nov 2021 11:27:22 +0100 Subject: [PATCH 034/838] Add generic API function to load/save mesh depending on its extension. Add 3d test cases that also show how to get the tetra adjacency. Adds the possibility to init a mesh without a solution structure. Note: to test with fortran and for 2d and surface meshes. --- cmake/modules/mmg3d.cmake | 21 ++ cmake/testing/libmmg3d_tests.cmake | 2 + src/common/inout.c | 471 +++++++++++++++-------------- src/common/vtkparser.cpp | 434 +++++++++++++------------- src/mmg2d/API_functionsf_2d.c | 38 +++ src/mmg2d/inout_2d.c | 157 +++++++++- src/mmg2d/inoutcpp_2d.cpp | 36 ++- src/mmg2d/libmmg2d.h | 36 +++ src/mmg2d/variadic_2d.c | 10 - src/mmg3d/API_functionsf_3d.c | 37 +++ src/mmg3d/inout_3d.c | 147 ++++++++- src/mmg3d/inoutcpp_3d.cpp | 12 +- src/mmg3d/libmmg3d.h | 37 +++ src/mmg3d/variadic_3d.c | 10 - src/mmgs/API_functionsf_s.c | 39 +++ src/mmgs/inout_s.c | 154 +++++++++- src/mmgs/inoutcpp_s.cpp | 18 +- src/mmgs/libmmgs.h | 37 +++ src/mmgs/variadic_s.c | 11 - 19 files changed, 1192 insertions(+), 515 deletions(-) diff --git a/cmake/modules/mmg3d.cmake b/cmake/modules/mmg3d.cmake index 6c8cb09af..53368f586 100644 --- a/cmake/modules/mmg3d.cmake +++ b/cmake/modules/mmg3d.cmake @@ -203,6 +203,7 @@ IF ( BUILD_TESTING ) SET(LIBMMG3D_EXEC4 ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_example4) SET(LIBMMG3D_EXEC5 ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_example5) SET(LIBMMG3D_EXEC6 ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_example6_io) + SET(LIBMMG3D_GENERICIO ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_generic_io) SET(LIBMMG3D_LSONLY ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_lsOnly ) SET(LIBMMG3D_LSANDMETRIC ${EXECUTABLE_OUTPUT_PATH}/libmmg3d_lsAndMetric ) SET(TEST_API3D_EXEC0 ${EXECUTABLE_OUTPUT_PATH}/test_api3d_0) @@ -262,11 +263,31 @@ IF ( BUILD_TESTING ) "${MMG3D_CI_TESTS}/API_tests/cellsAndNode-data.vtk" "${CTEST_OUTPUT_DIR}/test_API3d-vtk2mesh.o" ) + ADD_TEST(NAME libmmg3d_generic_io_msh COMMAND ${LIBMMG3D_GENERICIO} + "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/io_generic_and_get_adja/cube.msh" + "${CTEST_OUTPUT_DIR}/cube.o.msh" + ) + ADD_TEST(NAME libmmg3d_generic_io_mesh COMMAND ${LIBMMG3D_GENERICIO} + "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/io_generic_and_get_adja/cube.mesh" + "${CTEST_OUTPUT_DIR}/cube.o.mesh" + ) + ADD_TEST(NAME libmmg3d_generic_io_vtk COMMAND ${LIBMMG3D_GENERICIO} + "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/io_generic_and_get_adja/cube.vtk" + "${CTEST_OUTPUT_DIR}/cube.o.vtk" + ) + ADD_TEST(NAME libmmg3d_generic_io_vtu COMMAND ${LIBMMG3D_GENERICIO} + "${PROJECT_SOURCE_DIR}/libexamples/mmg3d/io_generic_and_get_adja/cube.vtu" + "${CTEST_OUTPUT_DIR}/cube.o.vtu" + ) IF ( NOT VTK_FOUND ) SET(expr "VTK library not founded") SET_PROPERTY(TEST test_api3d_vtk2mesh PROPERTY PASS_REGULAR_EXPRESSION "${expr}") + SET_PROPERTY(TEST libmmg3d_generic_io_vtk + PROPERTY PASS_REGULAR_EXPRESSION "${expr}") + SET_PROPERTY(TEST libmmg3d_generic_io_vtu + PROPERTY PASS_REGULAR_EXPRESSION "${expr}") ENDIF ( ) IF ( CMAKE_Fortran_COMPILER) diff --git a/cmake/testing/libmmg3d_tests.cmake b/cmake/testing/libmmg3d_tests.cmake index 03fdcbe73..380ff9f6b 100644 --- a/cmake/testing/libmmg3d_tests.cmake +++ b/cmake/testing/libmmg3d_tests.cmake @@ -35,6 +35,7 @@ SET ( MMG3D_LIB_TESTS libmmg3d_example6_io libmmg3d_lsOnly libmmg3d_lsAndMetric + libmmg3d_generic_io test_api3d_0 test_api3d_domain-selection test_api3d_vtk2mesh @@ -48,6 +49,7 @@ SET ( MMG3D_LIB_TESTS_MAIN_PATH ${PROJECT_SOURCE_DIR}/libexamples/mmg3d/io_multisols_example6/main.c ${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsOnly/main.c ${PROJECT_SOURCE_DIR}/libexamples/mmg3d/IsosurfDiscretization_lsAndMetric/main.c + ${PROJECT_SOURCE_DIR}/libexamples/mmg3d/io_generic_and_get_adja/genericIO.c ${MMG3D_CI_TESTS}/API_tests/3d.c ${MMG3D_CI_TESTS}/API_tests/domain-selection.c ${MMG3D_CI_TESTS}/API_tests/vtk2mesh.c diff --git a/src/common/inout.c b/src/common/inout.c index c11e58f91..6af5930fc 100644 --- a/src/common/inout.c +++ b/src/common/inout.c @@ -1160,306 +1160,307 @@ int MMG5_loadMshMesh_part2(MMG5_pMesh mesh,MMG5_pSol *sol,FILE **inm, ier = MMG5_check_readedMesh(mesh,nref); if ( ier < 1 ) return ier; - /** Read the solution at nodes */ - /* Init (*sol)[0] for the case where nsols=0 */ - psl = *sol; - psl->ver = mesh->ver; - psl->dim = mesh->dim; - psl->type = 1; - - for ( isol=0; isol < nsols; ++isol ) { - assert ( posNodeData[isol] ); - - rewind((*inm)); - fseek((*inm),posNodeData[isol],SEEK_SET); - - psl = *sol + isol; - + if ( sol && *sol ) { + /** Read the solution at nodes */ + /* Init (*sol)[0] for the case where nsols=0 */ + psl = *sol; psl->ver = mesh->ver; psl->dim = mesh->dim; psl->type = 1; - /* String tags: The first one stores the solution name */ - MMG_FSCANF((*inm),"%d ",&tagNum); - if ( 1 != fscanf(*inm,"\"%127s\"\n",&chaine[0]) ) { - MMG_FSCANF(*inm,"%127s\n",&chaine[0]); - } + for ( isol=0; isol < nsols; ++isol ) { + assert ( posNodeData[isol] ); - ptr = NULL; - ptr = strstr(chaine,":metric"); + rewind((*inm)); + fseek((*inm),posNodeData[isol],SEEK_SET); - metricData = 0; - if ( ptr ) { - *ptr = '\0'; - metricData = 1; - } + psl = *sol + isol; + psl->ver = mesh->ver; + psl->dim = mesh->dim; + psl->type = 1; - if ( !MMG5_Set_inputSolName(mesh,psl,chaine) ) { - if ( !mmgWarn1 ) { - mmgWarn1 = 1; - fprintf(stderr,"\n ## Warning: %s: unable to set solution name for" - " at least 1 solution.\n",__func__); + /* String tags: The first one stores the solution name */ + MMG_FSCANF((*inm),"%d ",&tagNum); + if ( 1 != fscanf(*inm,"\"%127s\"\n",&chaine[0]) ) { + MMG_FSCANF(*inm,"%127s\n",&chaine[0]); } - } - for ( k=1; knp); - for ( k=3; knp != psl->np ) { - fprintf(stderr," ** MISMATCHES DATA: THE NUMBER OF VERTICES IN " - "THE MESH (%d) DIFFERS FROM THE NUMBER OF VERTICES IN " - "THE SOLUTION (%d) \n",mesh->np,psl->np); - fclose(*inm); - return -1; - } + for ( k=1; ksize = 1; - psl->type = 1; - } - else if ( typ == 3 ) { - psl->size = psl->dim; - psl->type = 2; - } - else if ( typ == 9 ) { - if ( metricData ) { - psl->size = (psl->dim*(psl->dim+1))/2; - psl->type = 3; + /* Real tags ignored */ + if ( fscanf((*inm),"%d",&tagNum) ) { + for ( k=0; ksize = psl->dim*psl->dim; - psl->type = 4; + + /* Integer tags : allow to recover the number of sols and their types */ + MMG_FSCANF((*inm),"%d ",&tagNum); + if ( tagNum < 3 ) { + fprintf(stderr," Error: %s: node data: Expected at least 3 tags (%d given).\n", + __func__,tagNum); + fclose(*inm); + return -1; } - } - else { - fprintf(stderr," ** DATA TYPE IGNORED %d \n",typ); - fclose(*inm); - return -1; - } - /* mem alloc */ - if ( psl->m ) MMG5_DEL_MEM(mesh,psl->m); - psl->npmax = mesh->npmax; + MMG_FSCANF((*inm),"%d ",&i); //time step; + MMG_FSCANF((*inm),"%d ",&typ); //type of solution: 1=scalar, 3=vector, 9=tensor ; + MMG_FSCANF((*inm),"%d ",&psl->np); - MMG5_ADD_MEM(mesh,(psl->size*(psl->npmax+1))*sizeof(double),"initial solution", - fprintf(stderr," Exit program.\n"); - fclose(*inm); - return 0); - MMG5_SAFE_CALLOC(psl->m,psl->size*(psl->npmax+1),double,return 0); + for ( k=3; ksize == 1 ) { - if ( psl->ver == 1 ) { - for (k=1; k<=psl->np; k++) { - if(!bin){ - MMG_FSCANF((*inm),"%d ",&idx); - MMG_FSCANF((*inm),"%f ",&fbuf[0]); - } else { - MMG_FREAD(&idx,MMG5_SW,1, (*inm)); - if(iswp) idx = MMG5_swapbin(idx); - MMG_FREAD(&fbuf[0],MMG5_SW,1,(*inm)); - if(iswp) fbuf[0]=MMG5_swapf(fbuf[0]); - } - psl->m[idx] = fbuf[0]; + if ( mesh->np != psl->np ) { + fprintf(stderr," ** MISMATCHES DATA: THE NUMBER OF VERTICES IN " + "THE MESH (%d) DIFFERS FROM THE NUMBER OF VERTICES IN " + "THE SOLUTION (%d) \n",mesh->np,psl->np); + fclose(*inm); + return -1; + } + + if ( typ == 1 ) { + psl->size = 1; + psl->type = 1; + } + else if ( typ == 3 ) { + psl->size = psl->dim; + psl->type = 2; + } + else if ( typ == 9 ) { + if ( metricData ) { + psl->size = (psl->dim*(psl->dim+1))/2; + psl->type = 3; + } + else { + psl->size = psl->dim*psl->dim; + psl->type = 4; } } else { - for (k=1; k<=psl->np; k++) { - if(!bin){ - MMG_FSCANF((*inm),"%d ",&idx); - MMG_FSCANF((*inm),"%lf ",&dbuf[0]); - } else { - MMG_FREAD(&idx,MMG5_SW,1, (*inm)); - if(iswp) idx = MMG5_swapbin(idx); - MMG_FREAD(&dbuf[0],MMG5_SD,1,(*inm)); - if(iswp) dbuf[0]=MMG5_swapd(dbuf[0]); - } - psl->m[idx] = dbuf[0]; - } + fprintf(stderr," ** DATA TYPE IGNORED %d \n",typ); + fclose(*inm); + return -1; } - } - /* vector displacement only */ - else if ( psl->size == psl->dim ) { - if ( psl->ver == 1 ) { - for (k=1; k<=psl->np; k++) { - if(!bin){ - MMG_FSCANF((*inm),"%d ",&idx); - for (i=0; idim; i++) { + + /* mem alloc */ + if ( psl->m ) MMG5_DEL_MEM(mesh,psl->m); + psl->npmax = mesh->npmax; + + MMG5_ADD_MEM(mesh,(psl->size*(psl->npmax+1))*sizeof(double),"initial solution", + fprintf(stderr," Exit program.\n"); + fclose(*inm); + return 0); + MMG5_SAFE_CALLOC(psl->m,psl->size*(psl->npmax+1),double,return 0); + + /* isotropic solution */ + if ( psl->size == 1 ) { + if ( psl->ver == 1 ) { + for (k=1; k<=psl->np; k++) { + if(!bin){ + MMG_FSCANF((*inm),"%d ",&idx); MMG_FSCANF((*inm),"%f ",&fbuf[0]); - psl->m[psl->dim*idx+i] = fbuf[0]; - } - } else { - MMG_FREAD(&idx,MMG5_SW,1, (*inm)); - if(iswp) idx = MMG5_swapbin(idx); - for (i=0; idim; i++) { + } else { + MMG_FREAD(&idx,MMG5_SW,1, (*inm)); + if(iswp) idx = MMG5_swapbin(idx); MMG_FREAD(&fbuf[0],MMG5_SW,1,(*inm)); if(iswp) fbuf[0]=MMG5_swapf(fbuf[0]); - psl->m[psl->dim*idx+i] = fbuf[0]; } + psl->m[idx] = fbuf[0]; } } - } - else { - for (k=1; k<=psl->np; k++) { - if(!bin){ - MMG_FSCANF((*inm),"%d ",&idx); - - for (i=0; idim; i++) { + else { + for (k=1; k<=psl->np; k++) { + if(!bin){ + MMG_FSCANF((*inm),"%d ",&idx); MMG_FSCANF((*inm),"%lf ",&dbuf[0]); - psl->m[psl->dim*idx+i] = dbuf[0]; - } - - } else { - MMG_FREAD(&idx,MMG5_SW,1, (*inm)); - if(iswp) idx = MMG5_swapbin(idx); - - for (i=0; idim; i++) { + } else { + MMG_FREAD(&idx,MMG5_SW,1, (*inm)); + if(iswp) idx = MMG5_swapbin(idx); MMG_FREAD(&dbuf[0],MMG5_SD,1,(*inm)); if(iswp) dbuf[0]=MMG5_swapd(dbuf[0]); - psl->m[psl->dim*idx+i] = dbuf[0]; } - + psl->m[idx] = dbuf[0]; } } } - } - /* anisotropic sol */ - else { - if ( psl->ver == 1 ) { - /* Solution at simple precision */ - for (k=1; k<=psl->np; k++) { - - if(!bin){ - MMG_FSCANF((*inm),"%d ",&idx); - for(i=0 ; i<9 ; i++) - MMG_FSCANF((*inm),"%f ",&fbuf[i]); - } else { - MMG_FREAD(&idx,MMG5_SW,1, (*inm)); - if(iswp) idx = MMG5_swapbin(idx); - for(i=0 ; i<9 ; i++) { - MMG_FREAD(&fbuf[i],MMG5_SW,1,(*inm)); - if(iswp) fbuf[i]=MMG5_swapf(fbuf[i]); + /* vector displacement only */ + else if ( psl->size == psl->dim ) { + if ( psl->ver == 1 ) { + for (k=1; k<=psl->np; k++) { + if(!bin){ + MMG_FSCANF((*inm),"%d ",&idx); + for (i=0; idim; i++) { + MMG_FSCANF((*inm),"%f ",&fbuf[0]); + psl->m[psl->dim*idx+i] = fbuf[0]; + } + } else { + MMG_FREAD(&idx,MMG5_SW,1, (*inm)); + if(iswp) idx = MMG5_swapbin(idx); + for (i=0; idim; i++) { + MMG_FREAD(&fbuf[0],MMG5_SW,1,(*inm)); + if(iswp) fbuf[0]=MMG5_swapf(fbuf[0]); + psl->m[psl->dim*idx+i] = fbuf[0]; + } } } + } + else { + for (k=1; k<=psl->np; k++) { + if(!bin){ + MMG_FSCANF((*inm),"%d ",&idx); - iadr = psl->size*idx; + for (i=0; idim; i++) { + MMG_FSCANF((*inm),"%lf ",&dbuf[0]); + psl->m[psl->dim*idx+i] = dbuf[0]; + } - if ( !metricData ) { - if ( psl->dim ==2 ) { - psl->m[iadr] = fbuf[0]; - psl->m[iadr+1] = fbuf[1]; - psl->m[iadr+2] = fbuf[3]; - psl->m[iadr+3] = fbuf[4]; - } - else { - for(i=0 ; i<9 ; i++) { - psl->m[iadr+i] = fbuf[i]; + } else { + MMG_FREAD(&idx,MMG5_SW,1, (*inm)); + if(iswp) idx = MMG5_swapbin(idx); + + for (i=0; idim; i++) { + MMG_FREAD(&dbuf[0],MMG5_SD,1,(*inm)); + if(iswp) dbuf[0]=MMG5_swapd(dbuf[0]); + psl->m[psl->dim*idx+i] = dbuf[0]; } - } - } - else { - if ( psl->dim ==2 ) { - assert ( fbuf[1] == fbuf[3] ); - psl->m[iadr] = fbuf[0]; - psl->m[iadr+1] = fbuf[1]; - psl->m[iadr+2] = fbuf[4]; - } - else { - assert ( fbuf[1]==fbuf[3] && fbuf[2]==fbuf[6] && fbuf[5]==fbuf[7] ); - - psl->m[iadr+0] = fbuf[0]; - psl->m[iadr+1] = fbuf[1]; - psl->m[iadr+2] = fbuf[2]; - psl->m[iadr+3] = fbuf[4]; - psl->m[iadr+4] = fbuf[5]; - psl->m[iadr+5] = fbuf[8]; } } } } + /* anisotropic sol */ else { - for (k=1; k<=psl->np; k++) { - /* Solution at double precision */ - if(!bin){ - MMG_FSCANF((*inm),"%d ",&idx); - for(i=0 ; i<9 ; i++) - MMG_FSCANF((*inm),"%lf ",&dbuf[i]); - } else { - MMG_FREAD(&idx,MMG5_SW,1, (*inm)); - if(iswp) idx = MMG5_swapbin(idx); - for(i=0 ; i<9 ; i++) { - MMG_FREAD(&dbuf[i],MMG5_SD,1,(*inm)); - if(iswp) dbuf[i]=MMG5_swapd(dbuf[i]); + if ( psl->ver == 1 ) { + /* Solution at simple precision */ + for (k=1; k<=psl->np; k++) { + + if(!bin){ + MMG_FSCANF((*inm),"%d ",&idx); + for(i=0 ; i<9 ; i++) + MMG_FSCANF((*inm),"%f ",&fbuf[i]); + } else { + MMG_FREAD(&idx,MMG5_SW,1, (*inm)); + if(iswp) idx = MMG5_swapbin(idx); + for(i=0 ; i<9 ; i++) { + MMG_FREAD(&fbuf[i],MMG5_SW,1,(*inm)); + if(iswp) fbuf[i]=MMG5_swapf(fbuf[i]); + } } - } - iadr = psl->size*idx; + iadr = psl->size*idx; - if ( !metricData ) { - if ( psl->dim ==2 ) { - psl->m[iadr ] = dbuf[0]; - psl->m[iadr+1] = dbuf[1]; - psl->m[iadr+2] = dbuf[3]; - psl->m[iadr+3] = dbuf[4]; + if ( !metricData ) { + if ( psl->dim ==2 ) { + psl->m[iadr] = fbuf[0]; + psl->m[iadr+1] = fbuf[1]; + psl->m[iadr+2] = fbuf[3]; + psl->m[iadr+3] = fbuf[4]; + } + else { + for(i=0 ; i<9 ; i++) { + psl->m[iadr+i] = fbuf[i]; + } + } } else { - for(i=0 ; i<9 ; i++) { - psl->m[iadr+i] = dbuf[i]; + if ( psl->dim ==2 ) { + assert ( fbuf[1] == fbuf[3] ); + + psl->m[iadr] = fbuf[0]; + psl->m[iadr+1] = fbuf[1]; + psl->m[iadr+2] = fbuf[4]; + } + else { + assert ( fbuf[1]==fbuf[3] && fbuf[2]==fbuf[6] && fbuf[5]==fbuf[7] ); + + psl->m[iadr+0] = fbuf[0]; + psl->m[iadr+1] = fbuf[1]; + psl->m[iadr+2] = fbuf[2]; + psl->m[iadr+3] = fbuf[4]; + psl->m[iadr+4] = fbuf[5]; + psl->m[iadr+5] = fbuf[8]; } } } - else { - if ( psl->dim ==2 ) { - assert ( dbuf[1] == dbuf[3] ); + } + else { + for (k=1; k<=psl->np; k++) { + /* Solution at double precision */ + if(!bin){ + MMG_FSCANF((*inm),"%d ",&idx); + for(i=0 ; i<9 ; i++) + MMG_FSCANF((*inm),"%lf ",&dbuf[i]); + } else { + MMG_FREAD(&idx,MMG5_SW,1, (*inm)); + if(iswp) idx = MMG5_swapbin(idx); + for(i=0 ; i<9 ; i++) { + MMG_FREAD(&dbuf[i],MMG5_SD,1,(*inm)); + if(iswp) dbuf[i]=MMG5_swapd(dbuf[i]); + } + } - psl->m[iadr ] = dbuf[0]; - psl->m[iadr+1] = dbuf[1]; - psl->m[iadr+2] = dbuf[4]; + iadr = psl->size*idx; + + if ( !metricData ) { + if ( psl->dim ==2 ) { + psl->m[iadr ] = dbuf[0]; + psl->m[iadr+1] = dbuf[1]; + psl->m[iadr+2] = dbuf[3]; + psl->m[iadr+3] = dbuf[4]; + } + else { + for(i=0 ; i<9 ; i++) { + psl->m[iadr+i] = dbuf[i]; + } + } } else { - assert ( dbuf[1]==dbuf[3] || dbuf[2]==dbuf[6] || dbuf[5]==dbuf[7] ); - - psl->m[iadr+0] = dbuf[0]; - psl->m[iadr+1] = dbuf[1]; - psl->m[iadr+2] = dbuf[2]; - psl->m[iadr+3] = dbuf[4]; - psl->m[iadr+4] = dbuf[5]; - psl->m[iadr+5] = dbuf[8]; + if ( psl->dim ==2 ) { + assert ( dbuf[1] == dbuf[3] ); + + psl->m[iadr ] = dbuf[0]; + psl->m[iadr+1] = dbuf[1]; + psl->m[iadr+2] = dbuf[4]; + } + else { + assert ( dbuf[1]==dbuf[3] || dbuf[2]==dbuf[6] || dbuf[5]==dbuf[7] ); + + psl->m[iadr+0] = dbuf[0]; + psl->m[iadr+1] = dbuf[1]; + psl->m[iadr+2] = dbuf[2]; + psl->m[iadr+3] = dbuf[4]; + psl->m[iadr+4] = dbuf[5]; + psl->m[iadr+5] = dbuf[8]; + } } } } } - } - - psl->npi = psl->np; + psl->npi = psl->np; + } } fclose((*inm)); diff --git a/src/common/vtkparser.cpp b/src/common/vtkparser.cpp index d7d74ddd4..7a92aa19e 100644 --- a/src/common/vtkparser.cpp +++ b/src/common/vtkparser.cpp @@ -514,8 +514,8 @@ int MMG5_loadVtkMesh_part2(MMG5_pMesh mesh,MMG5_pSol *sol,vtkDataSet **dataset, pq->v[i] = (*dataset)->GetCell(k)->GetPointId(i)+1; } if ( pq->ref < 0 ) { - pq->ref = -pq->ref; - ++nref; + pq->ref = -pq->ref; + ++nref; } break; @@ -575,10 +575,10 @@ int MMG5_loadVtkMesh_part2(MMG5_pMesh mesh,MMG5_pSol *sol,vtkDataSet **dataset, else if ( nt < mesh->nt ) { MMG5_ADD_MEM(mesh,(nt-mesh->nt)*sizeof(MMG5_Tria),"triangles", - fprintf(stderr," Exit program.\n"); - return 0); + fprintf(stderr," Exit program.\n"); + return 0); MMG5_SAFE_RECALLOC(mesh->tria,mesh->nt+1,(nt+1),MMG5_Tria,"triangles", - return 0); + return 0); } mesh->nt = nt; } @@ -587,10 +587,10 @@ int MMG5_loadVtkMesh_part2(MMG5_pMesh mesh,MMG5_pSol *sol,vtkDataSet **dataset, MMG5_DEL_MEM(mesh,mesh->edge); else if ( na < mesh->na ) { MMG5_ADD_MEM(mesh,(na-mesh->na)*sizeof(MMG5_Edge),"edges", - fprintf(stderr," Exit program.\n"); - return 0); + fprintf(stderr," Exit program.\n"); + return 0); MMG5_SAFE_RECALLOC(mesh->edge,mesh->na+1,(na+1),MMG5_Edge,"edges", - return 0); + return 0); } mesh->na = na; } @@ -599,258 +599,260 @@ int MMG5_loadVtkMesh_part2(MMG5_pMesh mesh,MMG5_pSol *sol,vtkDataSet **dataset, ier = MMG5_check_readedMesh(mesh,nref); if ( ier < 1 ) return ier; - // Read the solution at nodes - // Init (*sol)[0] for the case where nsols=0 - MMG5_pSol psl = *sol; - psl->ver = mesh->ver; - psl->dim = mesh->dim; - psl->type = 1; + if ( sol && *sol ) { + // Read the solution at nodes + // Init (*sol)[0] for the case where nsols=0 + MMG5_pSol psl = *sol; + psl->ver = mesh->ver; + psl->dim = mesh->dim; + psl->type = 1; - int isol = 0; - if ( nsols ) { - auto *pd = (*dataset)->GetPointData(); + int isol = 0; + if ( nsols ) { + auto *pd = (*dataset)->GetPointData(); - auto *cd = (*dataset)->GetCellData(); + auto *cd = (*dataset)->GetCellData(); - if ( pd ) { - int npointData = pd->GetNumberOfArrays(); + if ( pd ) { + int npointData = pd->GetNumberOfArrays(); - for (int j = 0; j < npointData; j++) { - char *ptr = NULL; - bool metricData = 0; - char chaine[MMG5_FILESTR_LGTH]; - strcpy(chaine,pd->GetArrayName(j)); + for (int j = 0; j < npointData; j++) { + char *ptr = NULL; + bool metricData = 0; + char chaine[MMG5_FILESTR_LGTH]; + strcpy(chaine,pd->GetArrayName(j)); - if ( strstr(chaine,"medit:ref" ) ) { - continue; - } - else if ( (ptr = strstr(chaine,":metric")) ) { - *ptr = '\0'; - metricData = 1; - } + if ( strstr(chaine,"medit:ref" ) ) { + continue; + } + else if ( (ptr = strstr(chaine,":metric")) ) { + *ptr = '\0'; + metricData = 1; + } + + psl = *sol + isol; + psl->ver = mesh->ver; + psl->dim = mesh->dim; + psl->type = 1; + psl->entities = MMG5_Vertex; - psl = *sol + isol; - psl->ver = mesh->ver; - psl->dim = mesh->dim; - psl->type = 1; - psl->entities = MMG5_Vertex; - - if ( !MMG5_Set_inputSolName(mesh,psl,chaine) ) { - if ( !mmgWarn1 ) { - mmgWarn1 = 1; - fprintf(stderr,"\n ## Warning: %s: unable to set solution name for" - " at least 1 solution.\n",__func__); + if ( !MMG5_Set_inputSolName(mesh,psl,chaine) ) { + if ( !mmgWarn1 ) { + mmgWarn1 = 1; + fprintf(stderr,"\n ## Warning: %s: unable to set solution name for" + " at least 1 solution.\n",__func__); + } } - } - auto ar = pd->GetArray(j); + auto ar = pd->GetArray(j); - psl->np = ar->GetNumberOfTuples(); - if ( mesh->np != psl->np ) { - fprintf(stderr," ** MISMATCHES DATA: THE NUMBER OF VERTICES IN " - "THE MESH (%d) DIFFERS FROM THE NUMBER OF VERTICES IN " - "THE SOLUTION (%d) \n",mesh->np,psl->np); - return -1; - } + psl->np = ar->GetNumberOfTuples(); + if ( mesh->np != psl->np ) { + fprintf(stderr," ** MISMATCHES DATA: THE NUMBER OF VERTICES IN " + "THE MESH (%d) DIFFERS FROM THE NUMBER OF VERTICES IN " + "THE SOLUTION (%d) \n",mesh->np,psl->np); + return -1; + } - int ncp = ar->GetNumberOfComponents(); + int ncp = ar->GetNumberOfComponents(); - if ( ncp == 1 ) { - psl->size = 1; - psl->type = 1; - } - else if ( ncp == 2 || ncp == 3 ) { - assert ( ncp == mesh->dim ); - psl->size = ncp; - psl->type = 2; - } - else if ( ncp == (mesh->dim * mesh->dim) ) { - if ( metricData ) { - psl->size = (psl->dim*(psl->dim+1))/2; - psl->type = 3; + if ( ncp == 1 ) { + psl->size = 1; + psl->type = 1; } - else { + else if ( ncp == 2 || ncp == 3 ) { + assert ( ncp == mesh->dim ); psl->size = ncp; - psl->type = 4; + psl->type = 2; } - } - else { - fprintf(stderr," ** UNEXPECTED NUMBER OF COMPONENTS (%d). IGNORED \n",ncp); - return -1; - } - - // mem alloc - if ( psl->m ) MMG5_DEL_MEM(mesh,psl->m); - psl->npmax = mesh->npmax; - - MMG5_ADD_MEM(mesh,(psl->size*(psl->npmax+1))*sizeof(double),"initial solution", - fprintf(stderr," Exit program.\n"); - return -1); - MMG5_SAFE_CALLOC(psl->m,psl->size*(psl->npmax+1),double,return 0); - - switch ( psl->type ) { - case ( 1 ): case ( 2 ): - for (int k=1; k<=psl->np; k++) { - int iadr = k*psl->size; - ar->GetTuple ( k-1, &psl->m[iadr] ); + else if ( ncp == (mesh->dim * mesh->dim) ) { + if ( metricData ) { + psl->size = (psl->dim*(psl->dim+1))/2; + psl->type = 3; + } + else { + psl->size = ncp; + psl->type = 4; + } + } + else { + fprintf(stderr," ** UNEXPECTED NUMBER OF COMPONENTS (%d). IGNORED \n",ncp); + return -1; } - break; - case ( 3 ): - // anisotropic sol - double dbuf[9]; + // mem alloc + if ( psl->m ) MMG5_DEL_MEM(mesh,psl->m); + psl->npmax = mesh->npmax; - for (int k=1; k<=psl->np; k++) { - ar->GetTuple ( k-1, dbuf ); - int iadr = psl->size*k; + MMG5_ADD_MEM(mesh,(psl->size*(psl->npmax+1))*sizeof(double),"initial solution", + fprintf(stderr," Exit program.\n"); + return -1); + MMG5_SAFE_CALLOC(psl->m,psl->size*(psl->npmax+1),double,return 0); - if ( !metricData ) { - // Non symmetric tensor - if ( psl->dim ==2 ) { - psl->m[iadr] = dbuf[0]; - psl->m[iadr+1] = dbuf[1]; - psl->m[iadr+2] = dbuf[3]; - psl->m[iadr+3] = dbuf[4]; - } - else { - for ( int i=0 ; i<9 ; i++ ) { - psl->m[iadr+i] = dbuf[i]; - } - } + switch ( psl->type ) { + case ( 1 ): case ( 2 ): + for (int k=1; k<=psl->np; k++) { + int iadr = k*psl->size; + ar->GetTuple ( k-1, &psl->m[iadr] ); } - else { - // Symmetric tensor - if ( psl->dim ==2 ) { - assert ( dbuf[1] == dbuf[2] ); - - psl->m[iadr] = dbuf[0]; - psl->m[iadr+1] = dbuf[1]; - psl->m[iadr+2] = dbuf[3]; + break; + + case ( 3 ): + // anisotropic sol + double dbuf[9]; + + for (int k=1; k<=psl->np; k++) { + ar->GetTuple ( k-1, dbuf ); + int iadr = psl->size*k; + + if ( !metricData ) { + // Non symmetric tensor + if ( psl->dim ==2 ) { + psl->m[iadr] = dbuf[0]; + psl->m[iadr+1] = dbuf[1]; + psl->m[iadr+2] = dbuf[3]; + psl->m[iadr+3] = dbuf[4]; + } + else { + for ( int i=0 ; i<9 ; i++ ) { + psl->m[iadr+i] = dbuf[i]; + } + } } else { - assert ( dbuf[1]==dbuf[3] || dbuf[2]==dbuf[6] || dbuf[5]==dbuf[7] ); + // Symmetric tensor + if ( psl->dim ==2 ) { + assert ( dbuf[1] == dbuf[2] ); - psl->m[iadr+0] = dbuf[0]; - psl->m[iadr+1] = dbuf[1]; - psl->m[iadr+2] = dbuf[2]; - psl->m[iadr+3] = dbuf[4]; - psl->m[iadr+4] = dbuf[5]; - psl->m[iadr+5] = dbuf[8]; + psl->m[iadr] = dbuf[0]; + psl->m[iadr+1] = dbuf[1]; + psl->m[iadr+2] = dbuf[3]; + } + else { + assert ( dbuf[1]==dbuf[3] || dbuf[2]==dbuf[6] || dbuf[5]==dbuf[7] ); + + psl->m[iadr+0] = dbuf[0]; + psl->m[iadr+1] = dbuf[1]; + psl->m[iadr+2] = dbuf[2]; + psl->m[iadr+3] = dbuf[4]; + psl->m[iadr+4] = dbuf[5]; + psl->m[iadr+5] = dbuf[8]; + } } } - } - break; - default: - fprintf(stderr," ** UNEXPECTED METRIC TYPE (%d). EXIT PROGRAM \n",psl->type); - return -1; + break; + default: + fprintf(stderr," ** UNEXPECTED METRIC TYPE (%d). EXIT PROGRAM \n",psl->type); + return -1; + } + ++isol; } - ++isol; } - } - - if ( cd ) { - int ncellData = cd->GetNumberOfArrays(); - for (int j = 0; j < ncellData; j++) { - char *ptr = NULL; - char chaine[MMG5_FILESTR_LGTH]; - strcpy(chaine,cd->GetArrayName(j)); + if ( cd ) { + int ncellData = cd->GetNumberOfArrays(); - if ( strstr(chaine,"medit:ref" ) ) { - continue; - } + for (int j = 0; j < ncellData; j++) { + char *ptr = NULL; + char chaine[MMG5_FILESTR_LGTH]; + strcpy(chaine,cd->GetArrayName(j)); - psl = *sol + isol; - psl->ver = mesh->ver; - psl->dim = mesh->dim; - psl->type = 1; - psl->entities = MMG5_Tetrahedron; - - if ( !MMG5_Set_inputSolName(mesh,psl,chaine) ) { - if ( !mmgWarn1 ) { - mmgWarn1 = 1; - fprintf(stderr,"\n ## Warning: %s: unable to set solution name for" - " at least 1 solution.\n",__func__); + if ( strstr(chaine,"medit:ref" ) ) { + continue; } - } - auto ar = cd->GetArray(j); + psl = *sol + isol; + psl->ver = mesh->ver; + psl->dim = mesh->dim; + psl->type = 1; + psl->entities = MMG5_Tetrahedron; - psl->np = ar->GetNumberOfTuples(); - if ( mesh->ne != psl->np ) { - fprintf(stderr," ** MISMATCHES DATA: THE NUMBER OF ELEMENTS IN " - "THE MESH (%d) DIFFERS FROM THE NUMBER OF CELLS DATA IN " - "THE SOLUTION (%d) \n",mesh->ne,psl->np); - return -1; - } + if ( !MMG5_Set_inputSolName(mesh,psl,chaine) ) { + if ( !mmgWarn1 ) { + mmgWarn1 = 1; + fprintf(stderr,"\n ## Warning: %s: unable to set solution name for" + " at least 1 solution.\n",__func__); + } + } - int ncp = ar->GetNumberOfComponents(); + auto ar = cd->GetArray(j); - if ( ncp == 1 ) { - psl->size = 1; - psl->type = 1; - } - else if ( ncp == 2 || ncp == 3 ) { - assert ( ncp == mesh->dim ); - psl->size = ncp; - psl->type = 2; - } - else if ( ncp == (mesh->dim * mesh->dim) ) { - psl->size = ncp; - psl->type = 3; - } - else { - fprintf(stderr," ** UNEXPECTED NUMBER OF COMPONENTS (%d). IGNORED \n",ncp); - return -1; - } + psl->np = ar->GetNumberOfTuples(); + if ( mesh->ne != psl->np ) { + fprintf(stderr," ** MISMATCHES DATA: THE NUMBER OF ELEMENTS IN " + "THE MESH (%d) DIFFERS FROM THE NUMBER OF CELLS DATA IN " + "THE SOLUTION (%d) \n",mesh->ne,psl->np); + return -1; + } - // mem alloc - if ( psl->m ) MMG5_DEL_MEM(mesh,psl->m); - psl->npmax = mesh->nemax; + int ncp = ar->GetNumberOfComponents(); - MMG5_ADD_MEM(mesh,(psl->size*(psl->npmax+1))*sizeof(double),"initial solution", - fprintf(stderr," Exit program.\n"); - return -1); - MMG5_SAFE_CALLOC(psl->m,psl->size*(psl->npmax+1),double,return 0); - - switch ( psl->type ) { - case ( 1 ): case ( 2 ): - for (int k=1; k<=psl->np; k++) { - int iadr = k*psl->size; - ar->GetTuple ( k-1, &psl->m[iadr] ); + if ( ncp == 1 ) { + psl->size = 1; + psl->type = 1; } - break; - - case ( 3 ): - // anisotropic sol - double dbuf[9]; - - for (int k=1; k<=psl->np; k++) { - ar->GetTuple ( k-1, dbuf ); - int iadr = psl->size*k; - - // Non symmetric tensor - if ( psl->dim ==2 ) { - psl->m[iadr] = dbuf[0]; - psl->m[iadr+1] = dbuf[1]; - psl->m[iadr+2] = dbuf[3]; - psl->m[iadr+3] = dbuf[4]; + else if ( ncp == 2 || ncp == 3 ) { + assert ( ncp == mesh->dim ); + psl->size = ncp; + psl->type = 2; + } + else if ( ncp == (mesh->dim * mesh->dim) ) { + psl->size = ncp; + psl->type = 3; + } + else { + fprintf(stderr," ** UNEXPECTED NUMBER OF COMPONENTS (%d). IGNORED \n",ncp); + return -1; + } + + // mem alloc + if ( psl->m ) MMG5_DEL_MEM(mesh,psl->m); + psl->npmax = mesh->nemax; + + MMG5_ADD_MEM(mesh,(psl->size*(psl->npmax+1))*sizeof(double),"initial solution", + fprintf(stderr," Exit program.\n"); + return -1); + MMG5_SAFE_CALLOC(psl->m,psl->size*(psl->npmax+1),double,return 0); + + switch ( psl->type ) { + case ( 1 ): case ( 2 ): + for (int k=1; k<=psl->np; k++) { + int iadr = k*psl->size; + ar->GetTuple ( k-1, &psl->m[iadr] ); } - else { - for ( int i=0 ; i<9 ; i++ ) { - psl->m[iadr+i] = dbuf[i]; + break; + + case ( 3 ): + // anisotropic sol + double dbuf[9]; + + for (int k=1; k<=psl->np; k++) { + ar->GetTuple ( k-1, dbuf ); + int iadr = psl->size*k; + + // Non symmetric tensor + if ( psl->dim ==2 ) { + psl->m[iadr] = dbuf[0]; + psl->m[iadr+1] = dbuf[1]; + psl->m[iadr+2] = dbuf[3]; + psl->m[iadr+3] = dbuf[4]; + } + else { + for ( int i=0 ; i<9 ; i++ ) { + psl->m[iadr+i] = dbuf[i]; + } } } + + break; + default: + fprintf(stderr," ** UNEXPECTED METRIC TYPE (%d). EXIT PROGRAM \n",psl->type); + return -1; } - break; - default: - fprintf(stderr," ** UNEXPECTED METRIC TYPE (%d). EXIT PROGRAM \n",psl->type); - return -1; + ++isol; } - - ++isol; } } } diff --git a/src/mmg2d/API_functionsf_2d.c b/src/mmg2d/API_functionsf_2d.c index be8282241..d518571b9 100644 --- a/src/mmg2d/API_functionsf_2d.c +++ b/src/mmg2d/API_functionsf_2d.c @@ -904,6 +904,25 @@ FORTRAN_NAME(MMG2D_LOADMSHMESH,mmg2d_loadmshmesh, return; } +/** + * See \ref MMG2D_loadGenericMesh function in \ref mmg2d/libmmg2d.h file. + */ +FORTRAN_NAME(MMG2D_LOADGENERICMESH,mmg2d_loadgenericmesh, + (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, int *strlen0,int* retval), + (mesh,sol,filename,strlen0, retval)){ + char *tmp = NULL; + + MMG5_SAFE_MALLOC(tmp,*strlen0+1,char,return); + strncpy(tmp,filename,*strlen0); + tmp[*strlen0] = '\0'; + + *retval = MMG2D_loadGenericMesh(*mesh,*sol,tmp); + + MMG5_SAFE_FREE(tmp); + + return; +} + /** * See \ref MMG2D_loadMshMesh_and_allData function in \ref mmg2d/libmmg2d.h file. */ @@ -1111,6 +1130,25 @@ FORTRAN_NAME(MMG2D_SAVETETGENMESH,mmg2d_savetetgenmesh,(MMG5_pMesh *mesh,char *m return; } +/** + * See \ref MMG2D_saveGenericMesh function in \ref mmg2d/libmmg2d.h file. + */ +FORTRAN_NAME(MMG2D_SAVEGENERICMESH,mmg2d_savegenericmesh, + (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, int *strlen0,int* retval), + (mesh,sol,filename,strlen0, retval)){ + char *tmp = NULL; + + MMG5_SAFE_MALLOC(tmp,*strlen0+1,char,return); + strncpy(tmp,filename,*strlen0); + tmp[*strlen0] = '\0'; + + *retval = MMG2D_saveGenericMesh(*mesh,*sol,tmp); + + MMG5_SAFE_FREE(tmp); + + return; +} + /** * See \ref MMG2D_loadSol function in \ref mmg2d/libmmg2d.h file. */ diff --git a/src/mmg2d/inout_2d.c b/src/mmg2d/inout_2d.c index 1ce7e74eb..1407931d0 100644 --- a/src/mmg2d/inout_2d.c +++ b/src/mmg2d/inout_2d.c @@ -584,6 +584,80 @@ int MMG2D_loadMesh(MMG5_pMesh mesh,const char *filename) { return 1; } +int MMG2D_loadGenericMesh(MMG5_pMesh mesh, MMG5_pSol sol, const char *filename) { + int ier=0; + const char *filenameptr,*solnameptr; + char *tmp,*soltmp; + + if ( filename && strlen(filename) ) { + filenameptr = filename; + solnameptr = filename; + } + else if (mesh->namein && strlen(mesh->namein) ) { + filenameptr = mesh->namein; + if ( sol && strlen(sol->namein) ) { + solnameptr = sol->namein; + } + else { + solnameptr = mesh->namein; + } + } + else { + fprintf(stderr," ## Error: %s: please provide input file name" + " (either in the mesh structure or as function argument).\n", + __func__); + return 0; + } + + MMG5_SAFE_MALLOC(tmp,strlen(filenameptr)+1,char,return 0); + strcpy(tmp,filenameptr); + + /* read mesh/sol files */ + char *ptr = MMG5_Get_filenameExt(tmp); + int fmtin = MMG5_Get_format(ptr,MMG5_FMT_MeditASCII); + + switch ( fmtin ) { + + case ( MMG5_FMT_GmshASCII ): case ( MMG5_FMT_GmshBinary ): + ier = MMG2D_loadMshMesh(mesh,sol,tmp); + break; + + case ( MMG5_FMT_VtkVtu ): + ier = MMG2D_loadVtuMesh(mesh,sol,tmp); + break; + + case ( MMG5_FMT_VtkVtk ): + ier = MMG2D_loadVtkMesh(mesh,sol,tmp); + break; + + case ( MMG5_FMT_MeditASCII ): case ( MMG5_FMT_MeditBinary ): + ier = MMG2D_loadMesh(mesh,tmp); + if ( ier < 1 ) { break; } + + /* Facultative metric */ + if ( sol ) { + MMG5_SAFE_MALLOC(soltmp,strlen(solnameptr)+1,char,return 0); + strcpy(soltmp,solnameptr); + + if ( MMG2D_loadSol(mesh,sol,tmp) == -1) { + fprintf(stderr,"\n ## ERROR: WRONG DATA TYPE OR WRONG SOLUTION NUMBER.\n"); + ier = 0; + } + MMG5_SAFE_FREE(soltmp); + } + break; + + default: + fprintf(stderr," ** I/O AT FORMAT %s NOT IMPLEMENTED.\n",MMG5_Get_formatName(fmtin) ); + ier= 0; + } + + MMG5_SAFE_FREE(tmp); + + return ier; +} + + /** * \param mesh pointer toward the mesh structure. * \return 0 if failed, 1 otherwise. @@ -666,11 +740,13 @@ int MMG2D_loadMshMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { MMG5_SAFE_FREE(posNodeData); if ( ier < 1 ) return ier; - /* Check the metric type */ - ier = MMG5_chkMetricType(mesh,&sol->type,inm); - if ( ier <1 ) { - fprintf(stderr," ** ERROR WHEN PARSING THE INPUT FILE\n"); - return ier; + if ( sol ) { + /* Check the metric type */ + ier = MMG5_chkMetricType(mesh,&sol->type,inm); + if ( ier <1 ) { + fprintf(stderr," ** ERROR WHEN PARSING THE INPUT FILE\n"); + return ier; + } } /* Mark all points as used in case of mesh generation and check the @@ -2135,3 +2211,74 @@ int MMG2D_saveTetgenMesh(MMG5_pMesh mesh,const char *filename) { return 1; } + +int MMG2D_saveGenericMesh(MMG5_pMesh mesh, MMG5_pSol sol, const char *filename) { + int ier=0; + const char *filenameptr,*solnameptr; + char *tmp,*soltmp; + + if ( filename && strlen(filename) ) { + filenameptr = filename; + solnameptr = filename; + } + else if (mesh->namein && strlen(mesh->namein) ) { + filenameptr = mesh->namein; + if ( sol && strlen(sol->namein) ) { + solnameptr = sol->namein; + } + else { + solnameptr = mesh->namein; + } + } + else { + fprintf(stderr," ## Error: %s: please provide input file name" + " (either in the mesh structure or as function argument).\n", + __func__); + return 0; + } + + MMG5_SAFE_MALLOC(tmp,strlen(filenameptr)+1,char,return 0); + strcpy(tmp,filenameptr); + + /* read mesh/sol files */ + char *ptr = MMG5_Get_filenameExt(tmp); + int fmt = MMG5_Get_format(ptr,MMG5_FMT_MeditASCII); + + int8_t savesolFile = 0; + + switch ( fmt ) { + case ( MMG5_FMT_GmshASCII ): case ( MMG5_FMT_GmshBinary ): + ier = MMG2D_saveMshMesh(mesh,sol,tmp); + break; + case ( MMG5_FMT_VtkVtu ): + ier = MMG2D_saveVtuMesh(mesh,sol,tmp); + break; + case ( MMG5_FMT_VtkVtk ): + ier = MMG2D_saveVtkMesh(mesh,sol,tmp); + break; + case ( MMG5_FMT_Tetgen ): + ier = MMG2D_saveTetgenMesh(mesh,tmp); + savesolFile = 1; + break; + default: + ier = MMG2D_saveMesh(mesh,tmp); + savesolFile = 1; + break; + } + + if ( ier && savesolFile ) { + /* Medit or tetgen output: save the solution in a .sol file */ + if ( sol && sol->np ) { + MMG5_SAFE_MALLOC(soltmp,strlen(solnameptr)+1,char,return 0); + strcpy(soltmp,solnameptr); + + if ( MMG2D_saveSol(mesh,sol,soltmp) == -1) { + fprintf(stderr,"\n ## ERROR: WRONG DATA TYPE OR WRONG SOLUTION NUMBER.\n"); + ier = 0; + } + MMG5_SAFE_FREE(soltmp); + } + } + + return ier; +} diff --git a/src/mmg2d/inoutcpp_2d.cpp b/src/mmg2d/inoutcpp_2d.cpp index ff1df2059..a59a5659f 100644 --- a/src/mmg2d/inoutcpp_2d.cpp +++ b/src/mmg2d/inoutcpp_2d.cpp @@ -107,11 +107,13 @@ int MMG2D_loadVtpMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { return ier; } - /* Check the metric type */ - ier = MMG5_chkMetricType(mesh,&sol->type,NULL); - if ( ier <1 ) { - fprintf(stderr," ** UNEXPECTED METRIC TYPE\n"); - return ier; + if ( sol ) { + /* Check the metric type */ + ier = MMG5_chkMetricType(mesh,&sol->type,NULL); + if ( ier <1 ) { + fprintf(stderr," ** UNEXPECTED METRIC TYPE\n"); + return ier; + } } return ier; @@ -178,11 +180,13 @@ int MMG2D_loadVtkMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { return ier; } - /* Check the metric type */ - ier = MMG5_chkMetricType(mesh,&sol->type,NULL); - if ( ier <1 ) { - fprintf(stderr," ** UNEXPECTED METRIC TYPE\n"); - return ier; + if ( sol ) { + /* Check the metric type */ + ier = MMG5_chkMetricType(mesh,&sol->type,NULL); + if ( ier <1 ) { + fprintf(stderr," ** UNEXPECTED METRIC TYPE\n"); + return ier; + } } return ier; @@ -249,11 +253,13 @@ int MMG2D_loadVtuMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { return ier; } - /* Check the metric type */ - ier = MMG5_chkMetricType(mesh,&sol->type,NULL); - if ( ier <1 ) { - fprintf(stderr," ** UNEXPECTED METRIC TYPE\n"); - return ier; + if ( sol ) { + /* Check the metric type */ + ier = MMG5_chkMetricType(mesh,&sol->type,NULL); + if ( ier <1 ) { + fprintf(stderr," ** UNEXPECTED METRIC TYPE\n"); + return ier; + } } return ier; diff --git a/src/mmg2d/libmmg2d.h b/src/mmg2d/libmmg2d.h index 5a6b9d338..019977f0a 100644 --- a/src/mmg2d/libmmg2d.h +++ b/src/mmg2d/libmmg2d.h @@ -1636,6 +1636,25 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * */ int MMG2D_loadSol(MMG5_pMesh mesh,MMG5_pSol sol,const char * filename); + +/** + * \param mesh pointer toward the mesh structure. + * \param filename name of file. + * \return 0 if failed, 1 otherwise. + * + * Read mesh data. + * + * \remark Fortran interface: + * > SUBROUTINE MMG2D_LOADGENERICMESH(mesh,sol,filename,strlen0,retval)\n + * > MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol\n + * > CHARACTER(LEN=*), INTENT(IN) :: filename\n + * > INTEGER, INTENT(IN) :: strlen0\n + * > INTEGER, INTENT(OUT) :: retval\n + * > END SUBROUTINE\n + * + */ + int MMG2D_loadGenericMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); + /** * \param mesh pointer toward the mesh structure. * \param sol pointer toward the solutions array @@ -1839,6 +1858,23 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil */ int MMG2D_saveTetgenMesh(MMG5_pMesh ,const char *); +/** + * \param mesh pointer toward the mesh structure. + * \param filename name of file. + * \return 0 if failed, 1 otherwise. + * + * Save mesh data in a file whose format depends on the filename extension. + * + * \remark Fortran interface: + * > SUBROUTINE MMG2D_SAVEGENERICMESH(mesh,sol,filename,strlen0,retval)\n + * > MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol\n + * > CHARACTER(LEN=*), INTENT(IN) :: filename\n + * > INTEGER, INTENT(IN) :: strlen0\n + * > INTEGER, INTENT(OUT) :: retval\n + * > END SUBROUTINE\n + * + */ + int MMG2D_saveGenericMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); /** * \param mesh pointer toward the mesh structure. diff --git a/src/mmg2d/variadic_2d.c b/src/mmg2d/variadic_2d.c index 51957173f..0651380b1 100644 --- a/src/mmg2d/variadic_2d.c +++ b/src/mmg2d/variadic_2d.c @@ -217,16 +217,6 @@ int MMG2D_Init_mesh_var( va_list argptr ) { return 0; } - if ( !(sol || ls || disp) ) { - fprintf(stderr,"\n ## Error: %s: MMG2D_Init_mesh:\n" - " you need to initialize a solution structure" - " (of type MMG5_pSol and indentified by the MMG5_ARG_ppMet, " - " MMG5_ARG_ppLs or MMG5_ARG_ppDisp preprocessor variable)" - " that will contain the output mesh metric, level-set or" - " displacement.\n",__func__); - return 0; - } - /* allocations */ if ( !MMG2D_Alloc_mesh(mesh,sol,ls,disp) ) return 0; diff --git a/src/mmg3d/API_functionsf_3d.c b/src/mmg3d/API_functionsf_3d.c index c92bb0f20..a8722eafd 100644 --- a/src/mmg3d/API_functionsf_3d.c +++ b/src/mmg3d/API_functionsf_3d.c @@ -1119,6 +1119,25 @@ FORTRAN_NAME(MMG3D_LOADMSHMESH,mmg3d_loadmshmesh, return; } +/** + * See \ref MMG3D_loadGenericMesh function in \ref mmg3d/libmmg3d.h file. + */ +FORTRAN_NAME(MMG3D_LOADGENERICMESH,mmg3d_loadgenericmesh, + (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, int *strlen0,int* retval), + (mesh,sol,filename,strlen0, retval)){ + char *tmp = NULL; + + MMG5_SAFE_MALLOC(tmp,*strlen0+1,char,return); + strncpy(tmp,filename,*strlen0); + tmp[*strlen0] = '\0'; + + *retval = MMG3D_loadGenericMesh(*mesh,*sol,tmp); + + MMG5_SAFE_FREE(tmp); + + return; +} + /** * See \ref MMG3D_loadMshMesh_and_allData function in \ref mmg3d/libmmg3d.h file. */ @@ -1291,6 +1310,24 @@ FORTRAN_NAME(MMG3D_SAVETETGENMESH,mmg3d_savetetgenmesh,(MMG5_pMesh *mesh,char *m return; } +/** + * See \ref MMG3D_saveGenericMesh function in \ref mmg3d/libmmg3d.h file. + */ +FORTRAN_NAME(MMG3D_SAVEGENERICMESH,mmg3d_savegenericmesh, + (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, int *strlen0,int* retval), + (mesh,sol,filename,strlen0, retval)){ + char *tmp = NULL; + + MMG5_SAFE_MALLOC(tmp,*strlen0+1,char,return); + strncpy(tmp,filename,*strlen0); + tmp[*strlen0] = '\0'; + + *retval = MMG3D_saveGenericMesh(*mesh,*sol,tmp); + + MMG5_SAFE_FREE(tmp); + + return; +} /** * See \ref MMG3D_loadSol function in \ref mmg3d/libmmg3d.h file. diff --git a/src/mmg3d/inout_3d.c b/src/mmg3d/inout_3d.c index f644be5a3..15298365b 100644 --- a/src/mmg3d/inout_3d.c +++ b/src/mmg3d/inout_3d.c @@ -1249,7 +1249,9 @@ int MMG3D_loadMshMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { } /* Check the metric type */ - ier = MMG5_chkMetricType(mesh,&sol->type,inm); + if ( sol ) { + ier = MMG5_chkMetricType(mesh,&sol->type,inm); + } return ier; } @@ -1310,6 +1312,78 @@ int MMG3D_loadMshMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil return ier; } +int MMG3D_loadGenericMesh(MMG5_pMesh mesh, MMG5_pSol sol, const char *filename) { + int ier=0; + const char *filenameptr,*solnameptr; + char *tmp,*soltmp; + + if ( filename && strlen(filename) ) { + filenameptr = filename; + solnameptr = filename; + } + else if (mesh->namein && strlen(mesh->namein) ) { + filenameptr = mesh->namein; + if ( sol && strlen(sol->namein) ) { + solnameptr = sol->namein; + } + else { + solnameptr = mesh->namein; + } + } + else { + fprintf(stderr," ## Error: %s: please provide input file name" + " (either in the mesh structure or as function argument).\n", + __func__); + return 0; + } + + MMG5_SAFE_MALLOC(tmp,strlen(filenameptr)+1,char,return 0); + strcpy(tmp,filenameptr); + + /* read mesh/sol files */ + char *ptr = MMG5_Get_filenameExt(tmp); + int fmt = MMG5_Get_format(ptr,MMG5_FMT_MeditASCII); + + switch ( fmt ) { + + case ( MMG5_FMT_GmshASCII ): case ( MMG5_FMT_GmshBinary ): + ier = MMG3D_loadMshMesh(mesh,sol,tmp); + break; + + case ( MMG5_FMT_VtkVtu ): + ier = MMG3D_loadVtuMesh(mesh,sol,tmp); + break; + + case ( MMG5_FMT_VtkVtk ): + ier = MMG3D_loadVtkMesh(mesh,sol,tmp); + break; + + case ( MMG5_FMT_MeditASCII ): case ( MMG5_FMT_MeditBinary ): + ier = MMG3D_loadMesh(mesh,tmp); + if ( ier < 1 ) { break; } + + /* Facultative metric */ + if ( sol ) { + MMG5_SAFE_MALLOC(soltmp,strlen(solnameptr)+1,char,return 0); + strcpy(soltmp,solnameptr); + + if ( MMG3D_loadSol(mesh,sol,soltmp) == -1) { + fprintf(stderr,"\n ## ERROR: WRONG DATA TYPE OR WRONG SOLUTION NUMBER.\n"); + ier = 0; + } + MMG5_SAFE_FREE(soltmp); + } + break; + + default: + fprintf(stderr," ** I/O AT FORMAT %s NOT IMPLEMENTED.\n",MMG5_Get_formatName(fmt) ); + ier= 0; + } + + MMG5_SAFE_FREE(tmp); + + return ier; +} /** * \param mesh pointer toward the mesh structure. @@ -2091,6 +2165,77 @@ int MMG3D_saveMesh(MMG5_pMesh mesh, const char *filename) { return 1; } +int MMG3D_saveGenericMesh(MMG5_pMesh mesh, MMG5_pSol sol, const char *filename) { + int ier=0; + const char *filenameptr,*solnameptr; + char *tmp,*soltmp; + + if ( filename && strlen(filename) ) { + filenameptr = filename; + solnameptr = filename; + } + else if (mesh->namein && strlen(mesh->namein) ) { + filenameptr = mesh->namein; + if ( sol && strlen(sol->namein) ) { + solnameptr = sol->namein; + } + else { + solnameptr = mesh->namein; + } + } + else { + fprintf(stderr," ## Error: %s: please provide input file name" + " (either in the mesh structure or as function argument).\n", + __func__); + return 0; + } + + MMG5_SAFE_MALLOC(tmp,strlen(filenameptr)+1,char,return 0); + strcpy(tmp,filenameptr); + + /* read mesh/sol files */ + char *ptr = MMG5_Get_filenameExt(tmp); + int fmt = MMG5_Get_format(ptr,MMG5_FMT_MeditASCII); + + int8_t savesolFile = 0; + + switch ( fmt ) { + case ( MMG5_FMT_GmshASCII ): case ( MMG5_FMT_GmshBinary ): + ier = MMG3D_saveMshMesh(mesh,sol,tmp); + break; + case ( MMG5_FMT_VtkVtu ): + ier = MMG3D_saveVtuMesh(mesh,sol,tmp); + break; + case ( MMG5_FMT_VtkVtk ): + ier = MMG3D_saveVtkMesh(mesh,sol,tmp); + break; + case ( MMG5_FMT_Tetgen ): + ier = MMG3D_saveTetgenMesh(mesh,tmp); + savesolFile = 1; + break; + default: + ier = MMG3D_saveMesh(mesh,tmp); + savesolFile = 1; + break; + } + + if ( ier && savesolFile ) { + /* Medit or tetgen output: save the solution in a .sol file */ + if ( sol && sol->np ) { + MMG5_SAFE_MALLOC(soltmp,strlen(solnameptr)+1,char,return 0); + strcpy(soltmp,solnameptr); + + if ( MMG3D_saveSol(mesh,sol,soltmp) == -1) { + fprintf(stderr,"\n ## ERROR: WRONG DATA TYPE OR WRONG SOLUTION NUMBER.\n"); + ier = 0; + } + MMG5_SAFE_FREE(soltmp); + } + } + + return ier; +} + int MMG3D_saveMshMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { return MMG5_saveMshMesh(mesh,&sol,filename,1); diff --git a/src/mmg3d/inoutcpp_3d.cpp b/src/mmg3d/inoutcpp_3d.cpp index 1e7e31135..524e344de 100644 --- a/src/mmg3d/inoutcpp_3d.cpp +++ b/src/mmg3d/inoutcpp_3d.cpp @@ -99,8 +99,10 @@ int MMG3D_loadVtuMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { return ier; } - /* Check the metric type */ - ier = MMG5_chkMetricType(mesh,&sol->type,NULL); + if ( sol ) { + /* Check the metric type */ + ier = MMG5_chkMetricType(mesh,&sol->type,NULL); + } return ier; #endif @@ -168,8 +170,10 @@ int MMG3D_loadVtkMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { return ier; } - /* Check the metric type */ - ier = MMG5_chkMetricType(mesh,&sol->type,NULL); + if ( sol ) { + /* Check the metric type */ + ier = MMG5_chkMetricType(mesh,&sol->type,NULL); + } return ier; #endif diff --git a/src/mmg3d/libmmg3d.h b/src/mmg3d/libmmg3d.h index dae692c87..c61e47b59 100644 --- a/src/mmg3d/libmmg3d.h +++ b/src/mmg3d/libmmg3d.h @@ -2046,6 +2046,25 @@ int MMG3D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * */ int MMG3D_loadMshMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename); + +/** + * \param mesh pointer toward the mesh structure. + * \param filename name of file. + * \return 0 if failed, 1 otherwise. + * + * Read mesh data in a file whose format depends on the filename extension. + * + * \remark Fortran interface: + * > SUBROUTINE MMG3D_LOADGENERICMESH(mesh,sol,filename,strlen0,retval)\n + * > MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol\n + * > CHARACTER(LEN=*), INTENT(IN) :: filename\n + * > INTEGER, INTENT(IN) :: strlen0\n + * > INTEGER, INTENT(OUT) :: retval\n + * > END SUBROUTINE\n + * + */ + int MMG3D_loadGenericMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); + /** * \param mesh pointer toward the mesh structure. * \param filename pointer toward the name of file. @@ -2196,6 +2215,24 @@ int MMG3D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil */ int MMG3D_saveTetgenMesh(MMG5_pMesh ,const char *); +/** + * \param mesh pointer toward the mesh structure. + * \param filename name of file. + * \return 0 if failed, 1 otherwise. + * + * Save mesh data in a file whose format depends on the filename extension. + * + * \remark Fortran interface: + * > SUBROUTINE MMG3D_SAVEGENERICMESH(mesh,sol,filename,strlen0,retval)\n + * > MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol\n + * > CHARACTER(LEN=*), INTENT(IN) :: filename\n + * > INTEGER, INTENT(IN) :: strlen0\n + * > INTEGER, INTENT(OUT) :: retval\n + * > END SUBROUTINE\n + * + */ + int MMG3D_saveGenericMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); + /** * \param mesh pointer toward the mesh structure. * \param met pointer toward the sol structure. diff --git a/src/mmg3d/variadic_3d.c b/src/mmg3d/variadic_3d.c index 122f9fc92..cf7f4e177 100644 --- a/src/mmg3d/variadic_3d.c +++ b/src/mmg3d/variadic_3d.c @@ -220,16 +220,6 @@ int MMG3D_Init_mesh_var( va_list argptr ) { return 0; } - if ( !(sol || ls || disp) ) { - fprintf(stderr,"\n ## Error: %s: MMG3D_Init_mesh:\n" - " you need to initialize a solution structure" - " (of type MMG5_pSol and indentified by the MMG5_ARG_ppMet, " - " MMG5_ARG_ppLs or MMG5_ARG_ppDisp preprocessor variable)" - " that will contain the output mesh metric, level-set or" - " displacement.\n",__func__); - return 0; - } - /* allocations */ if ( !MMG3D_Alloc_mesh(mesh,sol,ls,disp) ) return 0; diff --git a/src/mmgs/API_functionsf_s.c b/src/mmgs/API_functionsf_s.c index f32f21220..33c91d666 100644 --- a/src/mmgs/API_functionsf_s.c +++ b/src/mmgs/API_functionsf_s.c @@ -891,6 +891,25 @@ FORTRAN_NAME(MMGS_LOADMSHMESH,mmgs_loadmshmesh, return; } +/** + * See \ref MMGS_loadGenericMesh function in \ref mmgs/libmmgs.h file. + */ +FORTRAN_NAME(MMGS_LOADGENERICMESH,mmgs_loadgenericmesh, + (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, int *strlen0,int* retval), + (mesh,sol,filename,strlen0, retval)){ + char *tmp = NULL; + + MMG5_SAFE_MALLOC(tmp,*strlen0+1,char,return); + strncpy(tmp,filename,*strlen0); + tmp[*strlen0] = '\0'; + + *retval = MMGS_loadGenericMesh(*mesh,*sol,tmp); + + MMG5_SAFE_FREE(tmp); + + return; +} + /** * See \ref MMGS_loadMshMesh_and_allData function in \ref mmgs/libmmgs.h file. */ @@ -1104,6 +1123,26 @@ FORTRAN_NAME(MMGS_SAVEMSHMESH,mmgs_savemshmesh, return; } +/** + * See \ref MMGS_saveGenericMesh function in \ref mmgs/libmmgs.h file. + */ +FORTRAN_NAME(MMGS_SAVEGENERICMESH,mmgs_savegenericmesh, + (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, int *strlen0,int* retval), + (mesh,sol,filename,strlen0, retval)){ + char *tmp = NULL; + + MMG5_SAFE_MALLOC(tmp,*strlen0+1,char,return); + strncpy(tmp,filename,*strlen0); + tmp[*strlen0] = '\0'; + + *retval = MMGS_saveGenericMesh(*mesh,*sol,tmp); + + MMG5_SAFE_FREE(tmp); + + return; +} + + /** * See \ref MMGS_saveSol function in \ref mmgs/libmmgs.h file. */ diff --git a/src/mmgs/inout_s.c b/src/mmgs/inout_s.c index 5b2dc782a..e0b3d482a 100644 --- a/src/mmgs/inout_s.c +++ b/src/mmgs/inout_s.c @@ -752,8 +752,10 @@ int MMGS_loadMshMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { return ier; } - /* Check the metric type */ - ier = MMG5_chkMetricType(mesh,&sol->type,inm); + if ( sol ) { + /* Check the metric type */ + ier = MMG5_chkMetricType(mesh,&sol->type,inm); + } return ier; } @@ -815,6 +817,84 @@ int MMGS_loadMshMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *file return ier; } +int MMGS_loadGenericMesh(MMG5_pMesh mesh, MMG5_pSol sol, const char *filename) { + int ier=0; + const char *filenameptr,*solnameptr; + char *tmp,*soltmp; + + if ( filename && strlen(filename) ) { + filenameptr = filename; + solnameptr = filename; + } + else if (mesh->namein && strlen(mesh->namein) ) { + filenameptr = mesh->namein; + if ( sol && strlen(sol->namein) ) { + solnameptr = sol->namein; + } + else { + solnameptr = mesh->namein; + } + } + else { + fprintf(stderr," ## Error: %s: please provide input file name" + " (either in the mesh structure or as function argument).\n", + __func__); + return 0; + } + + MMG5_SAFE_MALLOC(tmp,strlen(filenameptr)+1,char,return 0); + strcpy(tmp,filenameptr); + + /* read mesh/sol files */ + char *ptr = MMG5_Get_filenameExt(tmp); + int fmtin = MMG5_Get_format(ptr,MMG5_FMT_MeditASCII); + + switch ( fmtin ) { + + case ( MMG5_FMT_GmshASCII ): case ( MMG5_FMT_GmshBinary ): + ier = MMGS_loadMshMesh(mesh,sol,tmp); + break; + + case ( MMG5_FMT_VtkVtp ): + ier = MMGS_loadVtpMesh(mesh,sol,tmp); + break; + + case ( MMG5_FMT_VtkVtu ): + ier = MMGS_loadVtuMesh(mesh,sol,tmp); + break; + + case ( MMG5_FMT_VtkVtk ): + ier = MMGS_loadVtkMesh(mesh,sol,tmp); + break; + + case ( MMG5_FMT_MeditASCII ): case ( MMG5_FMT_MeditBinary ): + ier = MMGS_loadMesh(mesh,tmp); + if ( ier < 1 ) { break; } + + /* Facultative metric */ + if ( sol ) { + MMG5_SAFE_MALLOC(soltmp,strlen(solnameptr)+1,char,return 0); + strcpy(soltmp,solnameptr); + + if ( MMGS_loadSol(mesh,sol,tmp) == -1) { + fprintf(stderr,"\n ## ERROR: WRONG DATA TYPE OR WRONG SOLUTION NUMBER.\n"); + ier = 0; + } + MMG5_SAFE_FREE(soltmp); + } + break; + + default: + fprintf(stderr," ** I/O AT FORMAT %s NOT IMPLEMENTED.\n",MMG5_Get_formatName(fmtin) ); + ier= 0; + } + + MMG5_SAFE_FREE(tmp); + + return ier; +} + + int MMGS_saveMesh(MMG5_pMesh mesh, const char* filename) { FILE *inm; MMG5_pPoint ppt; @@ -1576,3 +1656,73 @@ int MMGS_saveAllSols(MMG5_pMesh mesh,MMG5_pSol *sol, const char *filename) { fclose(inm); return 1; } + +int MMGS_saveGenericMesh(MMG5_pMesh mesh, MMG5_pSol sol, const char *filename) { + int ier=0; + const char *filenameptr,*solnameptr; + char *tmp,*soltmp; + + if ( filename && strlen(filename) ) { + filenameptr = filename; + solnameptr = filename; + } + else if (mesh->namein && strlen(mesh->namein) ) { + filenameptr = mesh->namein; + if ( sol && strlen(sol->namein) ) { + solnameptr = sol->namein; + } + else { + solnameptr = mesh->namein; + } + } + else { + fprintf(stderr," ## Error: %s: please provide input file name" + " (either in the mesh structure or as function argument).\n", + __func__); + return 0; + } + + MMG5_SAFE_MALLOC(tmp,strlen(filenameptr)+1,char,return 0); + strcpy(tmp,filenameptr); + + /* read mesh/sol files */ + char *ptr = MMG5_Get_filenameExt(tmp); + int fmt = MMG5_Get_format(ptr,MMG5_FMT_MeditASCII); + + int8_t savesolFile = 0; + + switch ( fmt ) { + case ( MMG5_FMT_GmshASCII ): case ( MMG5_FMT_GmshBinary ): + ier = MMGS_saveMshMesh(mesh,sol,tmp); + break; + case ( MMG5_FMT_VtkVtp ): + ier = MMGS_saveVtpMesh(mesh,sol,tmp); + break; + case ( MMG5_FMT_VtkVtu ): + ier = MMGS_saveVtuMesh(mesh,sol,tmp); + break; + case ( MMG5_FMT_VtkVtk ): + ier = MMGS_saveVtkMesh(mesh,sol,tmp); + break; + default: + ier = MMGS_saveMesh(mesh,tmp); + savesolFile = 1; + break; + } + + if ( ier && savesolFile ) { + /* Medit or tetgen output: save the solution in a .sol file */ + if ( sol && sol->np ) { + MMG5_SAFE_MALLOC(soltmp,strlen(solnameptr)+1,char,return 0); + strcpy(soltmp,solnameptr); + + if ( MMGS_saveSol(mesh,sol,soltmp) == -1) { + fprintf(stderr,"\n ## ERROR: WRONG DATA TYPE OR WRONG SOLUTION NUMBER.\n"); + ier = 0; + } + MMG5_SAFE_FREE(soltmp); + } + } + + return ier; +} diff --git a/src/mmgs/inoutcpp_s.cpp b/src/mmgs/inoutcpp_s.cpp index 95aa40c1c..f36ddff83 100644 --- a/src/mmgs/inoutcpp_s.cpp +++ b/src/mmgs/inoutcpp_s.cpp @@ -100,8 +100,10 @@ int MMGS_loadVtpMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { return ier; } - /* Check the metric type */ - ier = MMG5_chkMetricType(mesh,&sol->type,NULL); + if ( sol ) { + /* Check the metric type */ + ier = MMG5_chkMetricType(mesh,&sol->type,NULL); + } return ier; #endif @@ -168,8 +170,10 @@ int MMGS_loadVtkMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { return ier; } - /* Check the metric type */ - ier = MMG5_chkMetricType(mesh,&sol->type,NULL); + if ( sol ) { + /* Check the metric type */ + ier = MMG5_chkMetricType(mesh,&sol->type,NULL); + } return ier; #endif @@ -236,8 +240,10 @@ int MMGS_loadVtuMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { return ier; } - /* Check the metric type */ - ier = MMG5_chkMetricType(mesh,&sol->type,NULL); + if ( sol ) { + /* Check the metric type */ + ier = MMG5_chkMetricType(mesh,&sol->type,NULL); + } return ier; #endif diff --git a/src/mmgs/libmmgs.h b/src/mmgs/libmmgs.h index 39274287b..27f83558d 100644 --- a/src/mmgs/libmmgs.h +++ b/src/mmgs/libmmgs.h @@ -1453,6 +1453,24 @@ int MMGS_loadMshMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); * */ int MMGS_loadMshMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename); +/** + * \param mesh pointer toward the mesh structure. + * \param filename name of file. + * \return 0 if failed, 1 otherwise. + * + * Read mesh data. + * + * \remark Fortran interface: + * > SUBROUTINE MMGS_LOADGENERICMESH(mesh,sol,filename,strlen0,retval)\n + * > MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol\n + * > CHARACTER(LEN=*), INTENT(IN) :: filename\n + * > INTEGER, INTENT(IN) :: strlen0\n + * > INTEGER, INTENT(OUT) :: retval\n + * > END SUBROUTINE\n + * + */ + int MMGS_loadGenericMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); + /** * \param mesh pointer toward the mesh structure. * \param filename name of file. @@ -1618,6 +1636,25 @@ int MMGS_saveMshMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *file * */ int MMGS_saveVtpMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename); + +/** + * \param mesh pointer toward the mesh structure. + * \param filename name of file. + * \return 0 if failed, 1 otherwise. + * + * Save mesh data in a file whose format depends on the filename extension. + * + * \remark Fortran interface: + * > SUBROUTINE MMGS_SAVEGENERICMESH(mesh,sol,filename,strlen0,retval)\n + * > MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol\n + * > CHARACTER(LEN=*), INTENT(IN) :: filename\n + * > INTEGER, INTENT(IN) :: strlen0\n + * > INTEGER, INTENT(OUT) :: retval\n + * > END SUBROUTINE\n + * + */ + int MMGS_saveGenericMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); + /** * \param mesh pointer toward the mesh structure. * \param met pointer toward the sol structure. diff --git a/src/mmgs/variadic_s.c b/src/mmgs/variadic_s.c index 1fa4a68f3..4cfd89592 100644 --- a/src/mmgs/variadic_s.c +++ b/src/mmgs/variadic_s.c @@ -187,17 +187,6 @@ int MMGS_Init_mesh_var( va_list argptr ) { return 0; } - if ( !(sol || ls) ) { - fprintf(stderr,"\n ## Error: %s: MMGS_Init_mesh:\n" - " you need to initialize a solution structure" - " (of type MMG5_pSol and indentified by the MMG5_ARG_ppMet or " - " MMG5_ARG_ppLs preprocessor variable)" - " that will contain the output mesh metric or the level-set.\n", - __func__); - return 0; - } - - /* allocations */ if ( !MMGS_Alloc_mesh(mesh,sol,ls) ) return 0; From b8aebe1568b1bb2c5e8254b727a6db044735d254 Mon Sep 17 00:00:00 2001 From: Algiane Date: Thu, 4 Nov 2021 11:34:40 +0100 Subject: [PATCH 035/838] Add library example. --- .../mmg3d/io_generic_and_get_adja/cube.mesh | 1288 +++++++++++++ .../mmg3d/io_generic_and_get_adja/cube.msh | 1046 +++++++++++ .../mmg3d/io_generic_and_get_adja/cube.vtk | 1649 +++++++++++++++++ .../mmg3d/io_generic_and_get_adja/cube.vtu | 25 + .../mmg3d/io_generic_and_get_adja/genericIO.c | 226 +++ 5 files changed, 4234 insertions(+) create mode 100644 libexamples/mmg3d/io_generic_and_get_adja/cube.mesh create mode 100644 libexamples/mmg3d/io_generic_and_get_adja/cube.msh create mode 100644 libexamples/mmg3d/io_generic_and_get_adja/cube.vtk create mode 100644 libexamples/mmg3d/io_generic_and_get_adja/cube.vtu create mode 100644 libexamples/mmg3d/io_generic_and_get_adja/genericIO.c diff --git a/libexamples/mmg3d/io_generic_and_get_adja/cube.mesh b/libexamples/mmg3d/io_generic_and_get_adja/cube.mesh new file mode 100644 index 000000000..ea7f5c355 --- /dev/null +++ b/libexamples/mmg3d/io_generic_and_get_adja/cube.mesh @@ -0,0 +1,1288 @@ +MeshVersionFormatted 2 + + +Dimension 3 + + +Vertices +152 +0 0 0 0 +0.200000002980232 0 0 0 +0.400000005960464 0 0 0 +0.600000023841858 0 0 0 +0.800000011920929 0 0 0 +1 0 0 0 +0 0.200000002980232 0 0 +0.200000002980232 0.200000002980232 0 0 +0.400000005960464 0.200000002980232 0 0 +0.600000023841858 0.200000002980232 0 0 +0.800000011920929 0.200000002980232 0 0 +1 0.200000002980232 0 0 +0 0.400000005960464 0 0 +0.200000002980232 0.400000005960464 0 0 +0.400000005960464 0.400000005960464 0 0 +0.600000023841858 0.400000005960464 0 0 +0.800000011920929 0.400000005960464 0 0 +1 0.400000005960464 0 0 +0 0.600000023841858 0 0 +0.200000002980232 0.600000023841858 0 0 +0.400000005960464 0.600000023841858 0 0 +0.600000023841858 0.600000023841858 0 0 +0.800000011920929 0.600000023841858 0 0 +1 0.600000023841858 0 0 +0 0.800000011920929 0 0 +0.200000002980232 0.800000011920929 0 0 +0.400000005960464 0.800000011920929 0 0 +0.600000023841858 0.800000011920929 0 0 +0.800000011920929 0.800000011920929 0 0 +1 0.800000011920929 0 0 +0 1 0 0 +0.200000002980232 1 0 0 +0.400000005960464 1 0 0 +0.600000023841858 1 0 0 +0.800000011920929 1 0 0 +1 1 0 0 +0 0 0.200000002980232 0 +0.200000002980232 0 0.200000002980232 0 +0.400000005960464 0 0.200000002980232 0 +0.600000023841858 0 0.200000002980232 0 +0.800000011920929 0 0.200000002980232 0 +1 0 0.200000002980232 0 +0 0.200000002980232 0.200000002980232 0 +1 0.200000002980232 0.200000002980232 0 +0 0.400000005960464 0.200000002980232 0 +1 0.400000005960464 0.200000002980232 0 +0 0.600000023841858 0.200000002980232 0 +1 0.600000023841858 0.200000002980232 0 +0 0.800000011920929 0.200000002980232 0 +1 0.800000011920929 0.200000002980232 0 +0 1 0.200000002980232 0 +0.200000002980232 1 0.200000002980232 0 +0.400000005960464 1 0.200000002980232 0 +0.600000023841858 1 0.200000002980232 0 +0.800000011920929 1 0.200000002980232 0 +1 1 0.200000002980232 0 +0 0 0.400000005960464 0 +0.200000002980232 0 0.400000005960464 0 +0.400000005960464 0 0.400000005960464 0 +0.600000023841858 0 0.400000005960464 0 +0.800000011920929 0 0.400000005960464 0 +1 0 0.400000005960464 0 +0 0.200000002980232 0.400000005960464 0 +1 0.200000002980232 0.400000005960464 0 +0 0.400000005960464 0.400000005960464 0 +1 0.400000005960464 0.400000005960464 0 +0 0.600000023841858 0.400000005960464 0 +1 0.600000023841858 0.400000005960464 0 +0 0.800000011920929 0.400000005960464 0 +1 0.800000011920929 0.400000005960464 0 +0 1 0.400000005960464 0 +0.200000002980232 1 0.400000005960464 0 +0.400000005960464 1 0.400000005960464 0 +0.600000023841858 1 0.400000005960464 0 +0.800000011920929 1 0.400000005960464 0 +1 1 0.400000005960464 0 +0 0 0.600000023841858 0 +0.200000002980232 0 0.600000023841858 0 +0.400000005960464 0 0.600000023841858 0 +0.600000023841858 0 0.600000023841858 0 +0.800000011920929 0 0.600000023841858 0 +1 0 0.600000023841858 0 +0 0.200000002980232 0.600000023841858 0 +1 0.200000002980232 0.600000023841858 0 +0 0.400000005960464 0.600000023841858 0 +1 0.400000005960464 0.600000023841858 0 +0 0.600000023841858 0.600000023841858 0 +1 0.600000023841858 0.600000023841858 0 +0 0.800000011920929 0.600000023841858 0 +1 0.800000011920929 0.600000023841858 0 +0 1 0.600000023841858 0 +0.200000002980232 1 0.600000023841858 0 +0.400000005960464 1 0.600000023841858 0 +0.600000023841858 1 0.600000023841858 0 +0.800000011920929 1 0.600000023841858 0 +1 1 0.600000023841858 0 +0 0 0.800000011920929 0 +0.200000002980232 0 0.800000011920929 0 +0.400000005960464 0 0.800000011920929 0 +0.600000023841858 0 0.800000011920929 0 +0.800000011920929 0 0.800000011920929 0 +1 0 0.800000011920929 0 +0 0.200000002980232 0.800000011920929 0 +1 0.200000002980232 0.800000011920929 0 +0 0.400000005960464 0.800000011920929 0 +1 0.400000005960464 0.800000011920929 0 +0 0.600000023841858 0.800000011920929 0 +1 0.600000023841858 0.800000011920929 0 +0 0.800000011920929 0.800000011920929 0 +1 0.800000011920929 0.800000011920929 0 +0 1 0.800000011920929 0 +0.200000002980232 1 0.800000011920929 0 +0.400000005960464 1 0.800000011920929 0 +0.600000023841858 1 0.800000011920929 0 +0.800000011920929 1 0.800000011920929 0 +1 1 0.800000011920929 0 +0 0 1 0 +0.200000002980232 0 1 0 +0.400000005960464 0 1 0 +0.600000023841858 0 1 0 +0.800000011920929 0 1 0 +1 0 1 0 +0 0.200000002980232 1 0 +0.200000002980232 0.200000002980232 1 0 +0.400000005960464 0.200000002980232 1 0 +0.600000023841858 0.200000002980232 1 0 +0.800000011920929 0.200000002980232 1 0 +1 0.200000002980232 1 0 +0 0.400000005960464 1 0 +0.200000002980232 0.400000005960464 1 0 +0.400000005960464 0.400000005960464 1 0 +0.600000023841858 0.400000005960464 1 0 +0.800000011920929 0.400000005960464 1 0 +1 0.400000005960464 1 0 +0 0.600000023841858 1 0 +0.200000002980232 0.600000023841858 1 0 +0.400000005960464 0.600000023841858 1 0 +0.600000023841858 0.600000023841858 1 0 +0.800000011920929 0.600000023841858 1 0 +1 0.600000023841858 1 0 +0 0.800000011920929 1 0 +0.200000002980232 0.800000011920929 1 0 +0.400000005960464 0.800000011920929 1 0 +0.600000023841858 0.800000011920929 1 0 +0.800000011920929 0.800000011920929 1 0 +1 0.800000011920929 1 0 +0 1 1 0 +0.200000002980232 1 1 0 +0.400000005960464 1 1 0 +0.600000023841858 1 1 0 +0.800000011920929 1 1 0 +1 1 1 0 + + +Corners +8 +1 +6 +31 +36 +117 +122 +147 +152 + + +Tetrahedra +373 +88 139 86 108 0 +88 90 139 108 0 +85 131 87 130 0 +85 79 124 83 0 +81 84 101 82 0 +81 84 82 61 0 +58 59 38 63 0 +58 63 78 59 0 +70 54 55 50 0 +70 68 54 50 0 +70 90 74 68 0 +70 55 76 50 0 +131 65 87 73 0 +67 21 73 65 0 +67 73 21 47 0 +67 87 73 72 0 +67 73 47 72 0 +54 22 28 29 0 +54 28 34 29 0 +54 28 22 53 0 +28 34 27 53 0 +54 74 53 22 0 +54 55 29 34 0 +70 74 54 68 0 +44 46 12 11 0 +115 146 145 110 0 +151 144 150 114 0 +152 151 116 146 0 +92 89 93 112 0 +135 130 105 107 0 +109 142 112 147 0 +142 112 147 148 0 +144 110 90 114 0 +139 140 108 146 0 +115 116 151 146 0 +146 139 145 110 0 +88 94 90 68 0 +113 137 93 144 0 +143 149 144 113 0 +151 114 145 144 0 +150 144 149 114 0 +147 142 141 109 0 +143 113 142 149 0 +109 141 135 142 0 +142 136 112 113 0 +132 79 59 66 0 +114 145 144 110 0 +139 110 90 144 0 +90 138 139 144 0 +139 106 108 134 0 +133 127 106 134 0 +106 126 127 132 0 +133 132 106 127 0 +139 106 133 132 0 +140 139 108 134 0 +93 138 94 144 0 +110 145 144 139 0 +85 87 131 65 0 +137 136 113 93 0 +138 93 86 132 0 +85 130 87 105 0 +73 66 93 131 0 +131 132 125 79 0 +135 142 136 109 0 +136 107 135 109 0 +108 146 110 139 0 +127 126 101 120 0 +127 122 101 102 0 +127 104 122 102 0 +106 127 104 134 0 +142 113 137 136 0 +138 88 86 93 0 +137 131 87 93 0 +132 66 86 80 0 +106 104 126 86 0 +127 101 126 104 0 +136 130 135 107 0 +131 130 79 125 0 +105 129 123 130 0 +59 66 16 131 0 +137 93 132 131 0 +103 98 97 78 0 +103 105 124 83 0 +80 59 66 60 0 +103 124 78 83 0 +127 122 104 128 0 +134 128 127 104 0 +127 101 122 121 0 +101 84 104 82 0 +101 104 84 80 0 +127 121 120 101 0 +126 101 120 100 0 +126 100 104 101 0 +119 120 99 125 0 +40 3 39 10 0 +119 125 99 118 0 +126 104 80 84 0 +137 131 130 87 0 +106 132 86 126 0 +103 123 98 124 0 +132 80 126 125 0 +123 130 124 105 0 +124 123 98 118 0 +142 136 109 112 0 +125 118 124 99 0 +120 100 99 125 0 +124 98 99 118 0 +123 117 97 118 0 +103 78 124 98 0 +103 98 123 97 0 +116 90 95 96 0 +144 114 90 94 0 +131 132 79 59 0 +88 138 139 90 0 +116 95 90 115 0 +114 90 94 95 0 +93 66 73 68 0 +93 144 114 113 0 +131 59 79 65 0 +90 95 76 75 0 +90 115 110 116 0 +115 146 151 145 0 +111 91 112 109 0 +109 87 136 107 0 +94 144 114 93 0 +85 131 79 65 0 +87 137 136 130 0 +126 104 100 80 0 +127 102 101 104 0 +126 80 100 125 0 +136 107 87 130 0 +125 124 79 99 0 +103 123 124 105 0 +115 151 114 145 0 +68 94 93 88 0 +90 68 94 74 0 +139 110 108 90 0 +92 89 91 72 0 +93 68 74 94 0 +93 72 87 89 0 +66 93 131 132 0 +71 91 69 72 0 +71 51 72 69 0 +136 112 113 93 0 +44 46 11 40 0 +93 73 87 72 0 +87 69 89 72 0 +66 86 93 132 0 +93 89 87 112 0 +123 98 118 97 0 +85 131 130 79 0 +85 79 83 65 0 +126 104 84 86 0 +81 80 101 84 0 +84 80 86 61 0 +84 64 61 86 0 +44 64 40 61 0 +64 66 40 61 0 +44 61 42 64 0 +84 61 64 82 0 +126 86 84 80 0 +81 61 80 84 0 +86 80 66 61 0 +137 93 87 136 0 +3 8 2 38 0 +68 86 93 66 0 +131 73 15 65 0 +79 63 59 78 0 +25 20 47 19 0 +78 83 63 57 0 +130 87 105 107 0 +16 40 46 66 0 +79 83 65 63 0 +139 134 133 106 0 +76 55 56 50 0 +56 29 36 50 0 +73 65 21 15 0 +56 36 29 55 0 +54 68 48 50 0 +54 68 22 48 0 +54 74 22 68 0 +54 22 55 50 0 +144 137 93 138 0 +21 53 47 73 0 +74 68 73 22 0 +72 49 52 47 0 +91 89 69 72 0 +49 69 72 51 0 +51 49 25 52 0 +49 52 26 25 0 +49 52 47 26 0 +132 80 79 66 0 +66 60 40 61 0 +41 61 44 40 0 +64 42 62 61 0 +64 61 86 66 0 +21 20 15 47 0 +67 72 69 87 0 +135 105 130 129 0 +124 83 79 78 0 +106 104 127 126 0 +138 94 90 88 0 +132 80 125 79 0 +138 86 106 132 0 +88 94 93 138 0 +41 5 11 42 0 +142 149 113 112 0 +64 40 66 46 0 +144 94 90 138 0 +138 139 132 106 0 +38 15 39 9 0 +65 87 73 67 0 +36 35 29 55 0 +65 47 14 45 0 +56 50 55 29 0 +70 75 76 55 0 +35 55 34 29 0 +54 29 55 22 0 +28 53 27 22 0 +70 55 54 74 0 +52 53 26 32 0 +109 89 91 112 0 +92 72 93 89 0 +51 32 52 25 0 +16 15 73 22 0 +15 43 38 65 0 +72 47 52 53 0 +53 32 33 27 0 +52 26 53 47 0 +30 29 24 50 0 +93 88 86 68 0 +73 16 68 66 0 +55 29 50 22 0 +23 48 22 17 0 +50 22 23 48 0 +50 23 22 29 0 +54 50 48 22 0 +50 24 23 29 0 +53 32 27 26 0 +53 27 22 21 0 +53 47 26 20 0 +125 99 79 80 0 +48 24 46 17 0 +9 3 38 8 0 +68 46 16 48 0 +50 23 24 48 0 +44 40 64 46 0 +64 82 61 62 0 +36 29 30 50 0 +60 59 16 40 0 +131 66 16 73 0 +48 22 17 16 0 +70 74 75 55 0 +90 74 94 95 0 +73 53 22 21 0 +24 18 46 17 0 +40 39 59 16 0 +138 139 106 86 0 +53 27 21 20 0 +34 53 33 27 0 +90 95 75 74 0 +49 25 26 47 0 +47 69 72 49 0 +20 15 47 14 0 +73 53 47 72 0 +90 95 96 76 0 +21 47 15 65 0 +47 20 14 13 0 +26 25 20 47 0 +20 19 13 47 0 +53 20 26 27 0 +66 16 68 46 0 +47 15 65 14 0 +131 65 15 59 0 +65 14 43 45 0 +58 57 78 63 0 +41 11 44 42 0 +22 16 68 73 0 +15 8 9 38 0 +43 13 45 14 0 +8 1 38 43 0 +2 8 1 38 0 +37 38 1 43 0 +63 38 57 43 0 +43 7 13 8 0 +38 15 65 59 0 +65 38 63 43 0 +43 14 15 8 0 +73 22 15 21 0 +11 5 12 42 0 +92 112 91 89 0 +58 63 38 57 0 +12 6 42 5 0 +11 5 40 10 0 +11 46 10 40 0 +4 40 5 10 0 +17 10 46 16 0 +48 46 16 17 0 +15 10 16 39 0 +68 22 48 16 0 +79 78 83 63 0 +47 45 13 14 0 +8 43 38 15 0 +66 60 59 16 0 +57 43 38 37 0 +43 7 8 1 0 +10 39 9 3 0 +70 74 90 75 0 +16 39 59 15 0 +11 17 10 46 0 +67 65 47 21 0 +144 114 113 149 0 +112 109 87 136 0 +83 85 105 124 0 +124 99 78 79 0 +39 10 9 15 0 +80 60 66 61 0 +80 79 66 59 0 +143 142 113 137 0 +79 59 63 65 0 +148 142 112 149 0 +65 14 15 43 0 +125 124 130 79 0 +143 113 144 137 0 +114 115 110 90 0 +125 100 99 80 0 +126 100 120 125 0 +66 40 60 16 0 +78 77 83 57 0 +124 85 105 130 0 +54 53 34 28 0 +20 21 53 47 0 +16 131 15 59 0 +136 93 87 112 0 +138 137 93 132 0 +132 86 126 80 0 +101 104 80 100 0 +74 73 53 22 0 +103 78 97 83 0 +52 32 26 25 0 +46 17 18 12 0 +23 17 24 48 0 +46 10 40 16 0 +41 44 61 42 0 +70 75 90 76 0 +101 104 102 82 0 +46 17 12 11 0 +25 31 51 32 0 +43 14 8 13 0 +65 59 63 38 0 +44 42 11 12 0 +51 49 52 72 0 +73 68 74 93 0 +41 44 11 40 0 +138 88 139 86 0 +131 132 59 66 0 +130 79 124 85 0 +131 93 73 87 0 +139 108 106 86 0 +39 10 16 40 0 +115 114 110 145 0 +67 72 47 69 0 +59 38 15 39 0 +97 78 77 83 0 +112 109 89 87 0 +147 111 112 109 0 +4 10 3 40 0 +115 110 116 146 0 +115 95 90 114 0 +39 9 3 38 0 +124 98 78 99 0 +73 131 15 16 0 +41 40 11 5 0 + + +Normals +96 +0 0 -1 +0 0 -1 +0 0 -1 +0 0 -1 +0 0 -1 +0 0 -1 +0 0 -1 +0 0 -1 +0 0 -1 +0 0 -1 +0 0 -1 +0 0 -1 +0 0 -1 +0 0 -1 +0 0 -1 +0 0 -1 +0 -1 0 +0 -1 0 +0 -1 0 +0 -1 0 +-1 0 0 +1 0 0 +-1 0 0 +1 0 0 +-1 0 0 +1 0 0 +-1 0 0 +1 0 0 +0 1 0 +0 1 0 +0 1 0 +0 1 0 +0 -1 0 +0 -1 0 +0 -1 0 +0 -1 0 +-1 0 0 +1 0 0 +-1 0 0 +1 0 0 +-1 0 0 +1 0 0 +-1 0 0 +1 0 0 +0 1 0 +0 1 0 +0 1 0 +0 1 0 +0 -1 0 +0 -1 0 +0 -1 0 +0 -1 0 +-1 0 0 +1 0 0 +-1 0 0 +1 0 0 +-1 0 0 +1 0 0 +-1 0 0 +1 0 0 +0 1 0 +0 1 0 +0 1 0 +0 1 0 +0 -1 0 +0 -1 0 +0 -1 0 +0 -1 0 +-1 0 0 +1 0 0 +-1 0 0 +1 0 0 +-1 0 0 +1 0 0 +-1 0 0 +1 0 0 +0 1 0 +0 1 0 +0 1 0 +0 1 0 +0 0 1 +0 0 1 +0 0 1 +0 0 1 +0 0 1 +0 0 1 +0 0 1 +0 0 1 +0 0 1 +0 0 1 +0 0 1 +0 0 1 +0 0 1 +0 0 1 +0 0 1 +0 0 1 + + +NormalAtVertices +96 +8 1 +9 2 +10 3 +11 4 +14 5 +15 6 +16 7 +17 8 +20 9 +21 10 +22 11 +23 12 +26 13 +27 14 +28 15 +29 16 +38 17 +39 18 +40 19 +41 20 +43 21 +44 22 +45 23 +46 24 +47 25 +48 26 +49 27 +50 28 +52 29 +53 30 +54 31 +55 32 +58 33 +59 34 +60 35 +61 36 +63 37 +64 38 +65 39 +66 40 +67 41 +68 42 +69 43 +70 44 +72 45 +73 46 +74 47 +75 48 +78 49 +79 50 +80 51 +81 52 +83 53 +84 54 +85 55 +86 56 +87 57 +88 58 +89 59 +90 60 +92 61 +93 62 +94 63 +95 64 +98 65 +99 66 +100 67 +101 68 +103 69 +104 70 +105 71 +106 72 +107 73 +108 74 +109 75 +110 76 +112 77 +113 78 +114 79 +115 80 +124 81 +125 82 +126 83 +127 84 +130 85 +131 86 +132 87 +133 88 +136 89 +137 90 +138 91 +139 92 +142 93 +143 94 +144 95 +145 96 + + +Tangents +48 +1 0 0 +1 0 0 +1 0 0 +1 0 0 +0 1 0 +-0 1 0 +0 1 0 +-0 1 0 +0 1 0 +-0 1 0 +0 1 0 +-0 1 0 +1 -0 0 +1 -0 0 +1 -0 0 +1 -0 0 +0 0 1 +-0 0 1 +0 -0 1 +0 0 1 +0 0 1 +-0 0 1 +0 -0 1 +0 0 1 +0 0 1 +-0 0 1 +0 -0 1 +0 0 1 +0 0 1 +-0 0 1 +0 -0 1 +0 0 1 +1 0 -0 +1 0 -0 +1 0 -0 +1 0 -0 +0 1 -0 +0 1 0 +0 1 -0 +0 1 0 +0 1 -0 +0 1 0 +0 1 -0 +0 1 0 +1 0 0 +1 0 0 +1 0 0 +1 0 0 + + +TangentAtVertices +48 +2 1 +3 2 +4 3 +5 4 +7 5 +12 6 +13 7 +18 8 +19 9 +24 10 +25 11 +30 12 +32 13 +33 14 +34 15 +35 16 +37 17 +42 18 +51 19 +56 20 +57 21 +62 22 +71 23 +76 24 +77 25 +82 26 +91 27 +96 28 +97 29 +102 30 +111 31 +116 32 +118 33 +119 34 +120 35 +121 36 +123 37 +128 38 +129 39 +134 40 +135 41 +140 42 +141 43 +146 44 +148 45 +149 46 +150 47 +151 48 + + +Triangles +300 +88 108 86 0 +88 90 108 0 +81 82 101 0 +81 61 82 0 +58 38 59 0 +58 59 78 0 +70 68 50 0 +70 90 68 0 +70 50 76 0 +22 28 29 0 +28 34 29 0 +28 27 34 0 +54 53 74 0 +54 55 34 0 +44 12 46 0 +151 114 150 0 +151 150 144 0 +152 146 116 0 +152 151 146 0 +152 116 151 0 +92 112 93 0 +135 107 105 0 +112 147 148 0 +142 148 147 0 +140 108 146 0 +139 140 146 0 +115 151 116 0 +146 145 139 0 +88 68 90 0 +143 144 149 0 +151 144 145 0 +150 114 149 0 +150 149 144 0 +147 109 141 0 +147 141 142 0 +143 149 142 0 +141 135 142 0 +109 135 141 0 +138 139 144 0 +106 108 134 0 +133 127 134 0 +126 127 132 0 +133 132 127 0 +139 132 133 0 +140 134 108 0 +140 139 134 0 +145 144 139 0 +85 87 65 0 +85 105 87 0 +131 125 132 0 +135 136 142 0 +107 135 109 0 +108 110 146 0 +127 126 120 0 +122 101 102 0 +104 122 102 0 +106 134 104 0 +142 136 137 0 +106 104 86 0 +136 135 130 0 +131 130 125 0 +129 123 130 0 +105 123 129 0 +137 131 132 0 +98 97 78 0 +103 105 83 0 +80 59 60 0 +122 104 128 0 +127 122 128 0 +134 128 104 0 +134 127 128 0 +101 122 121 0 +127 121 122 0 +84 104 82 0 +121 120 101 0 +127 120 121 0 +101 120 100 0 +119 120 125 0 +119 99 120 0 +40 39 3 0 +119 118 99 0 +119 125 118 0 +137 130 131 0 +132 125 126 0 +123 124 130 0 +124 123 118 0 +125 124 118 0 +120 99 100 0 +98 99 118 0 +117 97 118 0 +123 117 118 0 +123 97 117 0 +103 97 123 0 +116 96 95 0 +116 90 96 0 +116 95 115 0 +114 95 94 0 +93 113 114 0 +95 76 75 0 +90 116 110 0 +146 151 145 0 +111 91 109 0 +111 112 91 0 +109 87 107 0 +94 93 114 0 +137 136 130 0 +103 123 105 0 +115 114 151 0 +110 108 90 0 +92 72 91 0 +93 94 74 0 +71 91 72 0 +71 69 91 0 +71 51 69 0 +71 72 51 0 +112 113 93 0 +93 73 72 0 +87 89 69 0 +98 118 97 0 +85 65 83 0 +104 84 86 0 +81 101 80 0 +84 64 86 0 +44 64 42 0 +84 82 64 0 +81 80 61 0 +3 38 2 0 +3 2 8 0 +68 86 66 0 +79 78 59 0 +25 19 47 0 +25 20 19 0 +83 63 57 0 +87 105 107 0 +83 65 63 0 +139 133 134 0 +76 50 56 0 +76 56 55 0 +56 50 36 0 +56 36 55 0 +68 48 50 0 +144 137 138 0 +91 69 89 0 +49 69 51 0 +51 25 49 0 +60 40 61 0 +41 61 40 0 +42 62 61 0 +64 62 42 0 +64 66 86 0 +21 15 20 0 +67 87 69 0 +135 129 130 0 +135 105 129 0 +41 5 42 0 +149 113 112 0 +64 46 66 0 +138 132 139 0 +65 87 67 0 +36 35 55 0 +36 29 35 0 +65 47 45 0 +75 76 55 0 +35 29 34 0 +35 34 55 0 +28 22 27 0 +55 54 74 0 +52 53 32 0 +109 91 89 0 +92 93 72 0 +51 52 32 0 +16 15 22 0 +72 53 52 0 +32 33 27 0 +53 33 32 0 +30 50 24 0 +30 24 29 0 +88 86 68 0 +23 17 22 0 +23 22 29 0 +24 23 29 0 +32 27 26 0 +27 22 21 0 +99 79 80 0 +48 46 24 0 +9 3 8 0 +68 46 48 0 +50 48 24 0 +44 46 64 0 +82 61 62 0 +64 82 62 0 +36 50 30 0 +36 30 29 0 +60 59 40 0 +22 17 16 0 +74 75 55 0 +74 94 95 0 +24 18 17 0 +24 46 18 0 +40 59 39 0 +27 21 20 0 +34 27 33 0 +34 33 53 0 +95 75 74 0 +49 25 47 0 +47 69 49 0 +20 15 14 0 +73 53 72 0 +95 96 76 0 +90 76 96 0 +20 14 13 0 +26 20 25 0 +19 13 47 0 +20 13 19 0 +20 26 27 0 +66 46 68 0 +65 45 43 0 +58 78 57 0 +15 9 8 0 +43 45 13 0 +2 38 1 0 +2 1 8 0 +37 43 1 0 +37 1 38 0 +63 43 57 0 +7 13 8 0 +43 13 7 0 +65 43 63 0 +14 15 8 0 +22 15 21 0 +11 12 5 0 +92 91 112 0 +58 57 38 0 +6 42 5 0 +12 6 5 0 +12 42 6 0 +11 5 10 0 +4 10 5 0 +4 5 40 0 +17 10 16 0 +15 16 10 0 +47 13 45 0 +57 37 38 0 +57 43 37 0 +7 8 1 0 +43 7 1 0 +10 3 9 0 +11 10 17 0 +67 47 65 0 +114 113 149 0 +83 105 85 0 +99 78 79 0 +10 9 15 0 +80 60 61 0 +80 79 59 0 +143 142 137 0 +148 149 112 0 +148 142 149 0 +125 130 124 0 +143 137 144 0 +100 99 80 0 +126 125 120 0 +77 83 57 0 +78 77 57 0 +54 34 53 0 +138 137 132 0 +101 100 80 0 +74 53 73 0 +103 83 97 0 +32 26 25 0 +17 18 12 0 +46 12 18 0 +23 24 17 0 +41 42 61 0 +70 76 90 0 +104 102 82 0 +101 82 102 0 +17 12 11 0 +31 51 32 0 +25 31 32 0 +25 51 31 0 +14 8 13 0 +44 42 12 0 +51 72 52 0 +73 93 74 0 +108 106 86 0 +67 69 47 0 +59 38 39 0 +97 83 77 0 +97 77 78 0 +109 89 87 0 +147 111 109 0 +147 112 111 0 +4 40 3 0 +4 3 10 0 +110 116 146 0 +115 95 114 0 +39 38 3 0 +98 78 99 0 +41 40 5 0 + + +Edges +60 +150 151 0 +33 34 0 +30 36 0 +117 118 0 +151 152 0 +34 35 0 +56 76 0 +118 119 0 +1 2 0 +35 36 0 +57 77 0 +119 120 0 +2 3 0 +91 111 0 +120 121 0 +117 123 0 +134 140 0 +42 62 0 +116 152 0 +121 122 0 +76 96 0 +1 7 0 +135 141 0 +18 24 0 +5 6 0 +19 25 0 +1 37 0 +62 82 0 +96 116 0 +122 128 0 +97 117 0 +123 129 0 +6 12 0 +31 51 0 +140 146 0 +82 102 0 +7 13 0 +141 147 0 +24 30 0 +6 42 0 +25 31 0 +51 71 0 +147 148 0 +102 122 0 +128 134 0 +36 56 0 +148 149 0 +31 32 0 +129 135 0 +12 18 0 +37 57 0 +149 150 0 +146 152 0 +111 147 0 +71 91 0 +13 19 0 +32 33 0 +4 5 0 +77 97 0 +3 4 0 + + +Ridges +60 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 + + +End diff --git a/libexamples/mmg3d/io_generic_and_get_adja/cube.msh b/libexamples/mmg3d/io_generic_and_get_adja/cube.msh new file mode 100644 index 000000000..6f3ba1a20 --- /dev/null +++ b/libexamples/mmg3d/io_generic_and_get_adja/cube.msh @@ -0,0 +1,1046 @@ +$MeshFormat +2.2 0 8 +$EndMeshFormat +$Nodes +152 + 1 0 0 0 + 2 0.200000002980232 0 0 + 3 0.400000005960464 0 0 + 4 0.600000023841858 0 0 + 5 0.800000011920929 0 0 + 6 1 0 0 + 7 0 0.200000002980232 0 + 8 0.200000002980232 0.200000002980232 0 + 9 0.400000005960464 0.200000002980232 0 + 10 0.600000023841858 0.200000002980232 0 + 11 0.800000011920929 0.200000002980232 0 + 12 1 0.200000002980232 0 + 13 0 0.400000005960464 0 + 14 0.200000002980232 0.400000005960464 0 + 15 0.400000005960464 0.400000005960464 0 + 16 0.600000023841858 0.400000005960464 0 + 17 0.800000011920929 0.400000005960464 0 + 18 1 0.400000005960464 0 + 19 0 0.600000023841858 0 + 20 0.200000002980232 0.600000023841858 0 + 21 0.400000005960464 0.600000023841858 0 + 22 0.600000023841858 0.600000023841858 0 + 23 0.800000011920929 0.600000023841858 0 + 24 1 0.600000023841858 0 + 25 0 0.800000011920929 0 + 26 0.200000002980232 0.800000011920929 0 + 27 0.400000005960464 0.800000011920929 0 + 28 0.600000023841858 0.800000011920929 0 + 29 0.800000011920929 0.800000011920929 0 + 30 1 0.800000011920929 0 + 31 0 1 0 + 32 0.200000002980232 1 0 + 33 0.400000005960464 1 0 + 34 0.600000023841858 1 0 + 35 0.800000011920929 1 0 + 36 1 1 0 + 37 0 0 0.200000002980232 + 38 0.200000002980232 0 0.200000002980232 + 39 0.400000005960464 0 0.200000002980232 + 40 0.600000023841858 0 0.200000002980232 + 41 0.800000011920929 0 0.200000002980232 + 42 1 0 0.200000002980232 + 43 0 0.200000002980232 0.200000002980232 + 44 1 0.200000002980232 0.200000002980232 + 45 0 0.400000005960464 0.200000002980232 + 46 1 0.400000005960464 0.200000002980232 + 47 0 0.600000023841858 0.200000002980232 + 48 1 0.600000023841858 0.200000002980232 + 49 0 0.800000011920929 0.200000002980232 + 50 1 0.800000011920929 0.200000002980232 + 51 0 1 0.200000002980232 + 52 0.200000002980232 1 0.200000002980232 + 53 0.400000005960464 1 0.200000002980232 + 54 0.600000023841858 1 0.200000002980232 + 55 0.800000011920929 1 0.200000002980232 + 56 1 1 0.200000002980232 + 57 0 0 0.400000005960464 + 58 0.200000002980232 0 0.400000005960464 + 59 0.400000005960464 0 0.400000005960464 + 60 0.600000023841858 0 0.400000005960464 + 61 0.800000011920929 0 0.400000005960464 + 62 1 0 0.400000005960464 + 63 0 0.200000002980232 0.400000005960464 + 64 1 0.200000002980232 0.400000005960464 + 65 0 0.400000005960464 0.400000005960464 + 66 1 0.400000005960464 0.400000005960464 + 67 0 0.600000023841858 0.400000005960464 + 68 1 0.600000023841858 0.400000005960464 + 69 0 0.800000011920929 0.400000005960464 + 70 1 0.800000011920929 0.400000005960464 + 71 0 1 0.400000005960464 + 72 0.200000002980232 1 0.400000005960464 + 73 0.400000005960464 1 0.400000005960464 + 74 0.600000023841858 1 0.400000005960464 + 75 0.800000011920929 1 0.400000005960464 + 76 1 1 0.400000005960464 + 77 0 0 0.600000023841858 + 78 0.200000002980232 0 0.600000023841858 + 79 0.400000005960464 0 0.600000023841858 + 80 0.600000023841858 0 0.600000023841858 + 81 0.800000011920929 0 0.600000023841858 + 82 1 0 0.600000023841858 + 83 0 0.200000002980232 0.600000023841858 + 84 1 0.200000002980232 0.600000023841858 + 85 0 0.400000005960464 0.600000023841858 + 86 1 0.400000005960464 0.600000023841858 + 87 0 0.600000023841858 0.600000023841858 + 88 1 0.600000023841858 0.600000023841858 + 89 0 0.800000011920929 0.600000023841858 + 90 1 0.800000011920929 0.600000023841858 + 91 0 1 0.600000023841858 + 92 0.200000002980232 1 0.600000023841858 + 93 0.400000005960464 1 0.600000023841858 + 94 0.600000023841858 1 0.600000023841858 + 95 0.800000011920929 1 0.600000023841858 + 96 1 1 0.600000023841858 + 97 0 0 0.800000011920929 + 98 0.200000002980232 0 0.800000011920929 + 99 0.400000005960464 0 0.800000011920929 + 100 0.600000023841858 0 0.800000011920929 + 101 0.800000011920929 0 0.800000011920929 + 102 1 0 0.800000011920929 + 103 0 0.200000002980232 0.800000011920929 + 104 1 0.200000002980232 0.800000011920929 + 105 0 0.400000005960464 0.800000011920929 + 106 1 0.400000005960464 0.800000011920929 + 107 0 0.600000023841858 0.800000011920929 + 108 1 0.600000023841858 0.800000011920929 + 109 0 0.800000011920929 0.800000011920929 + 110 1 0.800000011920929 0.800000011920929 + 111 0 1 0.800000011920929 + 112 0.200000002980232 1 0.800000011920929 + 113 0.400000005960464 1 0.800000011920929 + 114 0.600000023841858 1 0.800000011920929 + 115 0.800000011920929 1 0.800000011920929 + 116 1 1 0.800000011920929 + 117 0 0 1 + 118 0.200000002980232 0 1 + 119 0.400000005960464 0 1 + 120 0.600000023841858 0 1 + 121 0.800000011920929 0 1 + 122 1 0 1 + 123 0 0.200000002980232 1 + 124 0.200000002980232 0.200000002980232 1 + 125 0.400000005960464 0.200000002980232 1 + 126 0.600000023841858 0.200000002980232 1 + 127 0.800000011920929 0.200000002980232 1 + 128 1 0.200000002980232 1 + 129 0 0.400000005960464 1 + 130 0.200000002980232 0.400000005960464 1 + 131 0.400000005960464 0.400000005960464 1 + 132 0.600000023841858 0.400000005960464 1 + 133 0.800000011920929 0.400000005960464 1 + 134 1 0.400000005960464 1 + 135 0 0.600000023841858 1 + 136 0.200000002980232 0.600000023841858 1 + 137 0.400000005960464 0.600000023841858 1 + 138 0.600000023841858 0.600000023841858 1 + 139 0.800000011920929 0.600000023841858 1 + 140 1 0.600000023841858 1 + 141 0 0.800000011920929 1 + 142 0.200000002980232 0.800000011920929 1 + 143 0.400000005960464 0.800000011920929 1 + 144 0.600000023841858 0.800000011920929 1 + 145 0.800000011920929 0.800000011920929 1 + 146 1 0.800000011920929 1 + 147 0 1 1 + 148 0.200000002980232 1 1 + 149 0.400000005960464 1 1 + 150 0.600000023841858 1 1 + 151 0.800000011920929 1 1 + 152 1 1 1 +$EndNodes +$Elements +885 +1 15 2 0 0 1 +2 15 2 0 0 2 +3 15 2 0 0 3 +4 15 2 0 0 4 +5 15 2 0 0 5 +6 15 2 0 0 6 +7 15 2 0 0 7 +8 15 2 0 0 8 +9 15 2 0 0 9 +10 15 2 0 0 10 +11 15 2 0 0 11 +12 15 2 0 0 12 +13 15 2 0 0 13 +14 15 2 0 0 14 +15 15 2 0 0 15 +16 15 2 0 0 16 +17 15 2 0 0 17 +18 15 2 0 0 18 +19 15 2 0 0 19 +20 15 2 0 0 20 +21 15 2 0 0 21 +22 15 2 0 0 22 +23 15 2 0 0 23 +24 15 2 0 0 24 +25 15 2 0 0 25 +26 15 2 0 0 26 +27 15 2 0 0 27 +28 15 2 0 0 28 +29 15 2 0 0 29 +30 15 2 0 0 30 +31 15 2 0 0 31 +32 15 2 0 0 32 +33 15 2 0 0 33 +34 15 2 0 0 34 +35 15 2 0 0 35 +36 15 2 0 0 36 +37 15 2 0 0 37 +38 15 2 0 0 38 +39 15 2 0 0 39 +40 15 2 0 0 40 +41 15 2 0 0 41 +42 15 2 0 0 42 +43 15 2 0 0 43 +44 15 2 0 0 44 +45 15 2 0 0 45 +46 15 2 0 0 46 +47 15 2 0 0 47 +48 15 2 0 0 48 +49 15 2 0 0 49 +50 15 2 0 0 50 +51 15 2 0 0 51 +52 15 2 0 0 52 +53 15 2 0 0 53 +54 15 2 0 0 54 +55 15 2 0 0 55 +56 15 2 0 0 56 +57 15 2 0 0 57 +58 15 2 0 0 58 +59 15 2 0 0 59 +60 15 2 0 0 60 +61 15 2 0 0 61 +62 15 2 0 0 62 +63 15 2 0 0 63 +64 15 2 0 0 64 +65 15 2 0 0 65 +66 15 2 0 0 66 +67 15 2 0 0 67 +68 15 2 0 0 68 +69 15 2 0 0 69 +70 15 2 0 0 70 +71 15 2 0 0 71 +72 15 2 0 0 72 +73 15 2 0 0 73 +74 15 2 0 0 74 +75 15 2 0 0 75 +76 15 2 0 0 76 +77 15 2 0 0 77 +78 15 2 0 0 78 +79 15 2 0 0 79 +80 15 2 0 0 80 +81 15 2 0 0 81 +82 15 2 0 0 82 +83 15 2 0 0 83 +84 15 2 0 0 84 +85 15 2 0 0 85 +86 15 2 0 0 86 +87 15 2 0 0 87 +88 15 2 0 0 88 +89 15 2 0 0 89 +90 15 2 0 0 90 +91 15 2 0 0 91 +92 15 2 0 0 92 +93 15 2 0 0 93 +94 15 2 0 0 94 +95 15 2 0 0 95 +96 15 2 0 0 96 +97 15 2 0 0 97 +98 15 2 0 0 98 +99 15 2 0 0 99 +100 15 2 0 0 100 +101 15 2 0 0 101 +102 15 2 0 0 102 +103 15 2 0 0 103 +104 15 2 0 0 104 +105 15 2 0 0 105 +106 15 2 0 0 106 +107 15 2 0 0 107 +108 15 2 0 0 108 +109 15 2 0 0 109 +110 15 2 0 0 110 +111 15 2 0 0 111 +112 15 2 0 0 112 +113 15 2 0 0 113 +114 15 2 0 0 114 +115 15 2 0 0 115 +116 15 2 0 0 116 +117 15 2 0 0 117 +118 15 2 0 0 118 +119 15 2 0 0 119 +120 15 2 0 0 120 +121 15 2 0 0 121 +122 15 2 0 0 122 +123 15 2 0 0 123 +124 15 2 0 0 124 +125 15 2 0 0 125 +126 15 2 0 0 126 +127 15 2 0 0 127 +128 15 2 0 0 128 +129 15 2 0 0 129 +130 15 2 0 0 130 +131 15 2 0 0 131 +132 15 2 0 0 132 +133 15 2 0 0 133 +134 15 2 0 0 134 +135 15 2 0 0 135 +136 15 2 0 0 136 +137 15 2 0 0 137 +138 15 2 0 0 138 +139 15 2 0 0 139 +140 15 2 0 0 140 +141 15 2 0 0 141 +142 15 2 0 0 142 +143 15 2 0 0 143 +144 15 2 0 0 144 +145 15 2 0 0 145 +146 15 2 0 0 146 +147 15 2 0 0 147 +148 15 2 0 0 148 +149 15 2 0 0 149 +150 15 2 0 0 150 +151 15 2 0 0 151 +152 15 2 0 0 152 +153 1 2 0 0 150 151 +154 1 2 0 0 33 34 +155 1 2 0 0 30 36 +156 1 2 0 0 117 118 +157 1 2 0 0 151 152 +158 1 2 0 0 34 35 +159 1 2 0 0 56 76 +160 1 2 0 0 118 119 +161 1 2 0 0 1 2 +162 1 2 0 0 35 36 +163 1 2 0 0 57 77 +164 1 2 0 0 119 120 +165 1 2 0 0 2 3 +166 1 2 0 0 91 111 +167 1 2 0 0 120 121 +168 1 2 0 0 117 123 +169 1 2 0 0 134 140 +170 1 2 0 0 42 62 +171 1 2 0 0 116 152 +172 1 2 0 0 121 122 +173 1 2 0 0 76 96 +174 1 2 0 0 1 7 +175 1 2 0 0 135 141 +176 1 2 0 0 18 24 +177 1 2 0 0 5 6 +178 1 2 0 0 19 25 +179 1 2 0 0 1 37 +180 1 2 0 0 62 82 +181 1 2 0 0 96 116 +182 1 2 0 0 122 128 +183 1 2 0 0 97 117 +184 1 2 0 0 123 129 +185 1 2 0 0 6 12 +186 1 2 0 0 31 51 +187 1 2 0 0 140 146 +188 1 2 0 0 82 102 +189 1 2 0 0 7 13 +190 1 2 0 0 141 147 +191 1 2 0 0 24 30 +192 1 2 0 0 6 42 +193 1 2 0 0 25 31 +194 1 2 0 0 51 71 +195 1 2 0 0 147 148 +196 1 2 0 0 102 122 +197 1 2 0 0 128 134 +198 1 2 0 0 36 56 +199 1 2 0 0 148 149 +200 1 2 0 0 31 32 +201 1 2 0 0 129 135 +202 1 2 0 0 12 18 +203 1 2 0 0 37 57 +204 1 2 0 0 149 150 +205 1 2 0 0 146 152 +206 1 2 0 0 111 147 +207 1 2 0 0 71 91 +208 1 2 0 0 13 19 +209 1 2 0 0 32 33 +210 1 2 0 0 4 5 +211 1 2 0 0 77 97 +212 1 2 0 0 3 4 +213 2 2 0 0 88 108 86 +214 2 2 0 0 88 90 108 +215 2 2 0 0 81 82 101 +216 2 2 0 0 81 61 82 +217 2 2 0 0 58 38 59 +218 2 2 0 0 58 59 78 +219 2 2 0 0 70 68 50 +220 2 2 0 0 70 90 68 +221 2 2 0 0 70 50 76 +222 2 2 0 0 22 28 29 +223 2 2 0 0 28 34 29 +224 2 2 0 0 28 27 34 +225 2 2 0 0 54 53 74 +226 2 2 0 0 54 55 34 +227 2 2 0 0 44 12 46 +228 2 2 0 0 151 114 150 +229 2 2 0 0 151 150 144 +230 2 2 0 0 152 146 116 +231 2 2 0 0 152 151 146 +232 2 2 0 0 152 116 151 +233 2 2 0 0 92 112 93 +234 2 2 0 0 135 107 105 +235 2 2 0 0 112 147 148 +236 2 2 0 0 142 148 147 +237 2 2 0 0 140 108 146 +238 2 2 0 0 139 140 146 +239 2 2 0 0 115 151 116 +240 2 2 0 0 146 145 139 +241 2 2 0 0 88 68 90 +242 2 2 0 0 143 144 149 +243 2 2 0 0 151 144 145 +244 2 2 0 0 150 114 149 +245 2 2 0 0 150 149 144 +246 2 2 0 0 147 109 141 +247 2 2 0 0 147 141 142 +248 2 2 0 0 143 149 142 +249 2 2 0 0 141 135 142 +250 2 2 0 0 109 135 141 +251 2 2 0 0 138 139 144 +252 2 2 0 0 106 108 134 +253 2 2 0 0 133 127 134 +254 2 2 0 0 126 127 132 +255 2 2 0 0 133 132 127 +256 2 2 0 0 139 132 133 +257 2 2 0 0 140 134 108 +258 2 2 0 0 140 139 134 +259 2 2 0 0 145 144 139 +260 2 2 0 0 85 87 65 +261 2 2 0 0 85 105 87 +262 2 2 0 0 131 125 132 +263 2 2 0 0 135 136 142 +264 2 2 0 0 107 135 109 +265 2 2 0 0 108 110 146 +266 2 2 0 0 127 126 120 +267 2 2 0 0 122 101 102 +268 2 2 0 0 104 122 102 +269 2 2 0 0 106 134 104 +270 2 2 0 0 142 136 137 +271 2 2 0 0 106 104 86 +272 2 2 0 0 136 135 130 +273 2 2 0 0 131 130 125 +274 2 2 0 0 129 123 130 +275 2 2 0 0 105 123 129 +276 2 2 0 0 137 131 132 +277 2 2 0 0 98 97 78 +278 2 2 0 0 103 105 83 +279 2 2 0 0 80 59 60 +280 2 2 0 0 122 104 128 +281 2 2 0 0 127 122 128 +282 2 2 0 0 134 128 104 +283 2 2 0 0 134 127 128 +284 2 2 0 0 101 122 121 +285 2 2 0 0 127 121 122 +286 2 2 0 0 84 104 82 +287 2 2 0 0 121 120 101 +288 2 2 0 0 127 120 121 +289 2 2 0 0 101 120 100 +290 2 2 0 0 119 120 125 +291 2 2 0 0 119 99 120 +292 2 2 0 0 40 39 3 +293 2 2 0 0 119 118 99 +294 2 2 0 0 119 125 118 +295 2 2 0 0 137 130 131 +296 2 2 0 0 132 125 126 +297 2 2 0 0 123 124 130 +298 2 2 0 0 124 123 118 +299 2 2 0 0 125 124 118 +300 2 2 0 0 120 99 100 +301 2 2 0 0 98 99 118 +302 2 2 0 0 117 97 118 +303 2 2 0 0 123 117 118 +304 2 2 0 0 123 97 117 +305 2 2 0 0 103 97 123 +306 2 2 0 0 116 96 95 +307 2 2 0 0 116 90 96 +308 2 2 0 0 116 95 115 +309 2 2 0 0 114 95 94 +310 2 2 0 0 93 113 114 +311 2 2 0 0 95 76 75 +312 2 2 0 0 90 116 110 +313 2 2 0 0 146 151 145 +314 2 2 0 0 111 91 109 +315 2 2 0 0 111 112 91 +316 2 2 0 0 109 87 107 +317 2 2 0 0 94 93 114 +318 2 2 0 0 137 136 130 +319 2 2 0 0 103 123 105 +320 2 2 0 0 115 114 151 +321 2 2 0 0 110 108 90 +322 2 2 0 0 92 72 91 +323 2 2 0 0 93 94 74 +324 2 2 0 0 71 91 72 +325 2 2 0 0 71 69 91 +326 2 2 0 0 71 51 69 +327 2 2 0 0 71 72 51 +328 2 2 0 0 112 113 93 +329 2 2 0 0 93 73 72 +330 2 2 0 0 87 89 69 +331 2 2 0 0 98 118 97 +332 2 2 0 0 85 65 83 +333 2 2 0 0 104 84 86 +334 2 2 0 0 81 101 80 +335 2 2 0 0 84 64 86 +336 2 2 0 0 44 64 42 +337 2 2 0 0 84 82 64 +338 2 2 0 0 81 80 61 +339 2 2 0 0 3 38 2 +340 2 2 0 0 3 2 8 +341 2 2 0 0 68 86 66 +342 2 2 0 0 79 78 59 +343 2 2 0 0 25 19 47 +344 2 2 0 0 25 20 19 +345 2 2 0 0 83 63 57 +346 2 2 0 0 87 105 107 +347 2 2 0 0 83 65 63 +348 2 2 0 0 139 133 134 +349 2 2 0 0 76 50 56 +350 2 2 0 0 76 56 55 +351 2 2 0 0 56 50 36 +352 2 2 0 0 56 36 55 +353 2 2 0 0 68 48 50 +354 2 2 0 0 144 137 138 +355 2 2 0 0 91 69 89 +356 2 2 0 0 49 69 51 +357 2 2 0 0 51 25 49 +358 2 2 0 0 60 40 61 +359 2 2 0 0 41 61 40 +360 2 2 0 0 42 62 61 +361 2 2 0 0 64 62 42 +362 2 2 0 0 64 66 86 +363 2 2 0 0 21 15 20 +364 2 2 0 0 67 87 69 +365 2 2 0 0 135 129 130 +366 2 2 0 0 135 105 129 +367 2 2 0 0 41 5 42 +368 2 2 0 0 149 113 112 +369 2 2 0 0 64 46 66 +370 2 2 0 0 138 132 139 +371 2 2 0 0 65 87 67 +372 2 2 0 0 36 35 55 +373 2 2 0 0 36 29 35 +374 2 2 0 0 65 47 45 +375 2 2 0 0 75 76 55 +376 2 2 0 0 35 29 34 +377 2 2 0 0 35 34 55 +378 2 2 0 0 28 22 27 +379 2 2 0 0 55 54 74 +380 2 2 0 0 52 53 32 +381 2 2 0 0 109 91 89 +382 2 2 0 0 92 93 72 +383 2 2 0 0 51 52 32 +384 2 2 0 0 16 15 22 +385 2 2 0 0 72 53 52 +386 2 2 0 0 32 33 27 +387 2 2 0 0 53 33 32 +388 2 2 0 0 30 50 24 +389 2 2 0 0 30 24 29 +390 2 2 0 0 88 86 68 +391 2 2 0 0 23 17 22 +392 2 2 0 0 23 22 29 +393 2 2 0 0 24 23 29 +394 2 2 0 0 32 27 26 +395 2 2 0 0 27 22 21 +396 2 2 0 0 99 79 80 +397 2 2 0 0 48 46 24 +398 2 2 0 0 9 3 8 +399 2 2 0 0 68 46 48 +400 2 2 0 0 50 48 24 +401 2 2 0 0 44 46 64 +402 2 2 0 0 82 61 62 +403 2 2 0 0 64 82 62 +404 2 2 0 0 36 50 30 +405 2 2 0 0 36 30 29 +406 2 2 0 0 60 59 40 +407 2 2 0 0 22 17 16 +408 2 2 0 0 74 75 55 +409 2 2 0 0 74 94 95 +410 2 2 0 0 24 18 17 +411 2 2 0 0 24 46 18 +412 2 2 0 0 40 59 39 +413 2 2 0 0 27 21 20 +414 2 2 0 0 34 27 33 +415 2 2 0 0 34 33 53 +416 2 2 0 0 95 75 74 +417 2 2 0 0 49 25 47 +418 2 2 0 0 47 69 49 +419 2 2 0 0 20 15 14 +420 2 2 0 0 73 53 72 +421 2 2 0 0 95 96 76 +422 2 2 0 0 90 76 96 +423 2 2 0 0 20 14 13 +424 2 2 0 0 26 20 25 +425 2 2 0 0 19 13 47 +426 2 2 0 0 20 13 19 +427 2 2 0 0 20 26 27 +428 2 2 0 0 66 46 68 +429 2 2 0 0 65 45 43 +430 2 2 0 0 58 78 57 +431 2 2 0 0 15 9 8 +432 2 2 0 0 43 45 13 +433 2 2 0 0 2 38 1 +434 2 2 0 0 2 1 8 +435 2 2 0 0 37 43 1 +436 2 2 0 0 37 1 38 +437 2 2 0 0 63 43 57 +438 2 2 0 0 7 13 8 +439 2 2 0 0 43 13 7 +440 2 2 0 0 65 43 63 +441 2 2 0 0 14 15 8 +442 2 2 0 0 22 15 21 +443 2 2 0 0 11 12 5 +444 2 2 0 0 92 91 112 +445 2 2 0 0 58 57 38 +446 2 2 0 0 6 42 5 +447 2 2 0 0 12 6 5 +448 2 2 0 0 12 42 6 +449 2 2 0 0 11 5 10 +450 2 2 0 0 4 10 5 +451 2 2 0 0 4 5 40 +452 2 2 0 0 17 10 16 +453 2 2 0 0 15 16 10 +454 2 2 0 0 47 13 45 +455 2 2 0 0 57 37 38 +456 2 2 0 0 57 43 37 +457 2 2 0 0 7 8 1 +458 2 2 0 0 43 7 1 +459 2 2 0 0 10 3 9 +460 2 2 0 0 11 10 17 +461 2 2 0 0 67 47 65 +462 2 2 0 0 114 113 149 +463 2 2 0 0 83 105 85 +464 2 2 0 0 99 78 79 +465 2 2 0 0 10 9 15 +466 2 2 0 0 80 60 61 +467 2 2 0 0 80 79 59 +468 2 2 0 0 143 142 137 +469 2 2 0 0 148 149 112 +470 2 2 0 0 148 142 149 +471 2 2 0 0 125 130 124 +472 2 2 0 0 143 137 144 +473 2 2 0 0 100 99 80 +474 2 2 0 0 126 125 120 +475 2 2 0 0 77 83 57 +476 2 2 0 0 78 77 57 +477 2 2 0 0 54 34 53 +478 2 2 0 0 138 137 132 +479 2 2 0 0 101 100 80 +480 2 2 0 0 74 53 73 +481 2 2 0 0 103 83 97 +482 2 2 0 0 32 26 25 +483 2 2 0 0 17 18 12 +484 2 2 0 0 46 12 18 +485 2 2 0 0 23 24 17 +486 2 2 0 0 41 42 61 +487 2 2 0 0 70 76 90 +488 2 2 0 0 104 102 82 +489 2 2 0 0 101 82 102 +490 2 2 0 0 17 12 11 +491 2 2 0 0 31 51 32 +492 2 2 0 0 25 31 32 +493 2 2 0 0 25 51 31 +494 2 2 0 0 14 8 13 +495 2 2 0 0 44 42 12 +496 2 2 0 0 51 72 52 +497 2 2 0 0 73 93 74 +498 2 2 0 0 108 106 86 +499 2 2 0 0 67 69 47 +500 2 2 0 0 59 38 39 +501 2 2 0 0 97 83 77 +502 2 2 0 0 97 77 78 +503 2 2 0 0 109 89 87 +504 2 2 0 0 147 111 109 +505 2 2 0 0 147 112 111 +506 2 2 0 0 4 40 3 +507 2 2 0 0 4 3 10 +508 2 2 0 0 110 116 146 +509 2 2 0 0 115 95 114 +510 2 2 0 0 39 38 3 +511 2 2 0 0 98 78 99 +512 2 2 0 0 41 40 5 +513 4 2 0 0 88 139 86 108 +514 4 2 0 0 88 90 139 108 +515 4 2 0 0 85 131 87 130 +516 4 2 0 0 85 79 124 83 +517 4 2 0 0 81 84 101 82 +518 4 2 0 0 81 84 82 61 +519 4 2 0 0 58 59 38 63 +520 4 2 0 0 58 63 78 59 +521 4 2 0 0 70 54 55 50 +522 4 2 0 0 70 68 54 50 +523 4 2 0 0 70 90 74 68 +524 4 2 0 0 70 55 76 50 +525 4 2 0 0 131 65 87 73 +526 4 2 0 0 67 21 73 65 +527 4 2 0 0 67 73 21 47 +528 4 2 0 0 67 87 73 72 +529 4 2 0 0 67 73 47 72 +530 4 2 0 0 54 22 28 29 +531 4 2 0 0 54 28 34 29 +532 4 2 0 0 54 28 22 53 +533 4 2 0 0 28 34 27 53 +534 4 2 0 0 54 74 53 22 +535 4 2 0 0 54 55 29 34 +536 4 2 0 0 70 74 54 68 +537 4 2 0 0 44 46 12 11 +538 4 2 0 0 115 146 145 110 +539 4 2 0 0 151 144 150 114 +540 4 2 0 0 152 151 116 146 +541 4 2 0 0 92 89 93 112 +542 4 2 0 0 135 130 105 107 +543 4 2 0 0 109 142 112 147 +544 4 2 0 0 142 112 147 148 +545 4 2 0 0 144 110 90 114 +546 4 2 0 0 139 140 108 146 +547 4 2 0 0 115 116 151 146 +548 4 2 0 0 146 139 145 110 +549 4 2 0 0 88 94 90 68 +550 4 2 0 0 113 137 93 144 +551 4 2 0 0 143 149 144 113 +552 4 2 0 0 151 114 145 144 +553 4 2 0 0 150 144 149 114 +554 4 2 0 0 147 142 141 109 +555 4 2 0 0 143 113 142 149 +556 4 2 0 0 109 141 135 142 +557 4 2 0 0 142 136 112 113 +558 4 2 0 0 132 79 59 66 +559 4 2 0 0 114 145 144 110 +560 4 2 0 0 139 110 90 144 +561 4 2 0 0 90 138 139 144 +562 4 2 0 0 139 106 108 134 +563 4 2 0 0 133 127 106 134 +564 4 2 0 0 106 126 127 132 +565 4 2 0 0 133 132 106 127 +566 4 2 0 0 139 106 133 132 +567 4 2 0 0 140 139 108 134 +568 4 2 0 0 93 138 94 144 +569 4 2 0 0 110 145 144 139 +570 4 2 0 0 85 87 131 65 +571 4 2 0 0 137 136 113 93 +572 4 2 0 0 138 93 86 132 +573 4 2 0 0 85 130 87 105 +574 4 2 0 0 73 66 93 131 +575 4 2 0 0 131 132 125 79 +576 4 2 0 0 135 142 136 109 +577 4 2 0 0 136 107 135 109 +578 4 2 0 0 108 146 110 139 +579 4 2 0 0 127 126 101 120 +580 4 2 0 0 127 122 101 102 +581 4 2 0 0 127 104 122 102 +582 4 2 0 0 106 127 104 134 +583 4 2 0 0 142 113 137 136 +584 4 2 0 0 138 88 86 93 +585 4 2 0 0 137 131 87 93 +586 4 2 0 0 132 66 86 80 +587 4 2 0 0 106 104 126 86 +588 4 2 0 0 127 101 126 104 +589 4 2 0 0 136 130 135 107 +590 4 2 0 0 131 130 79 125 +591 4 2 0 0 105 129 123 130 +592 4 2 0 0 59 66 16 131 +593 4 2 0 0 137 93 132 131 +594 4 2 0 0 103 98 97 78 +595 4 2 0 0 103 105 124 83 +596 4 2 0 0 80 59 66 60 +597 4 2 0 0 103 124 78 83 +598 4 2 0 0 127 122 104 128 +599 4 2 0 0 134 128 127 104 +600 4 2 0 0 127 101 122 121 +601 4 2 0 0 101 84 104 82 +602 4 2 0 0 101 104 84 80 +603 4 2 0 0 127 121 120 101 +604 4 2 0 0 126 101 120 100 +605 4 2 0 0 126 100 104 101 +606 4 2 0 0 119 120 99 125 +607 4 2 0 0 40 3 39 10 +608 4 2 0 0 119 125 99 118 +609 4 2 0 0 126 104 80 84 +610 4 2 0 0 137 131 130 87 +611 4 2 0 0 106 132 86 126 +612 4 2 0 0 103 123 98 124 +613 4 2 0 0 132 80 126 125 +614 4 2 0 0 123 130 124 105 +615 4 2 0 0 124 123 98 118 +616 4 2 0 0 142 136 109 112 +617 4 2 0 0 125 118 124 99 +618 4 2 0 0 120 100 99 125 +619 4 2 0 0 124 98 99 118 +620 4 2 0 0 123 117 97 118 +621 4 2 0 0 103 78 124 98 +622 4 2 0 0 103 98 123 97 +623 4 2 0 0 116 90 95 96 +624 4 2 0 0 144 114 90 94 +625 4 2 0 0 131 132 79 59 +626 4 2 0 0 88 138 139 90 +627 4 2 0 0 116 95 90 115 +628 4 2 0 0 114 90 94 95 +629 4 2 0 0 93 66 73 68 +630 4 2 0 0 93 144 114 113 +631 4 2 0 0 131 59 79 65 +632 4 2 0 0 90 95 76 75 +633 4 2 0 0 90 115 110 116 +634 4 2 0 0 115 146 151 145 +635 4 2 0 0 111 91 112 109 +636 4 2 0 0 109 87 136 107 +637 4 2 0 0 94 144 114 93 +638 4 2 0 0 85 131 79 65 +639 4 2 0 0 87 137 136 130 +640 4 2 0 0 126 104 100 80 +641 4 2 0 0 127 102 101 104 +642 4 2 0 0 126 80 100 125 +643 4 2 0 0 136 107 87 130 +644 4 2 0 0 125 124 79 99 +645 4 2 0 0 103 123 124 105 +646 4 2 0 0 115 151 114 145 +647 4 2 0 0 68 94 93 88 +648 4 2 0 0 90 68 94 74 +649 4 2 0 0 139 110 108 90 +650 4 2 0 0 92 89 91 72 +651 4 2 0 0 93 68 74 94 +652 4 2 0 0 93 72 87 89 +653 4 2 0 0 66 93 131 132 +654 4 2 0 0 71 91 69 72 +655 4 2 0 0 71 51 72 69 +656 4 2 0 0 136 112 113 93 +657 4 2 0 0 44 46 11 40 +658 4 2 0 0 93 73 87 72 +659 4 2 0 0 87 69 89 72 +660 4 2 0 0 66 86 93 132 +661 4 2 0 0 93 89 87 112 +662 4 2 0 0 123 98 118 97 +663 4 2 0 0 85 131 130 79 +664 4 2 0 0 85 79 83 65 +665 4 2 0 0 126 104 84 86 +666 4 2 0 0 81 80 101 84 +667 4 2 0 0 84 80 86 61 +668 4 2 0 0 84 64 61 86 +669 4 2 0 0 44 64 40 61 +670 4 2 0 0 64 66 40 61 +671 4 2 0 0 44 61 42 64 +672 4 2 0 0 84 61 64 82 +673 4 2 0 0 126 86 84 80 +674 4 2 0 0 81 61 80 84 +675 4 2 0 0 86 80 66 61 +676 4 2 0 0 137 93 87 136 +677 4 2 0 0 3 8 2 38 +678 4 2 0 0 68 86 93 66 +679 4 2 0 0 131 73 15 65 +680 4 2 0 0 79 63 59 78 +681 4 2 0 0 25 20 47 19 +682 4 2 0 0 78 83 63 57 +683 4 2 0 0 130 87 105 107 +684 4 2 0 0 16 40 46 66 +685 4 2 0 0 79 83 65 63 +686 4 2 0 0 139 134 133 106 +687 4 2 0 0 76 55 56 50 +688 4 2 0 0 56 29 36 50 +689 4 2 0 0 73 65 21 15 +690 4 2 0 0 56 36 29 55 +691 4 2 0 0 54 68 48 50 +692 4 2 0 0 54 68 22 48 +693 4 2 0 0 54 74 22 68 +694 4 2 0 0 54 22 55 50 +695 4 2 0 0 144 137 93 138 +696 4 2 0 0 21 53 47 73 +697 4 2 0 0 74 68 73 22 +698 4 2 0 0 72 49 52 47 +699 4 2 0 0 91 89 69 72 +700 4 2 0 0 49 69 72 51 +701 4 2 0 0 51 49 25 52 +702 4 2 0 0 49 52 26 25 +703 4 2 0 0 49 52 47 26 +704 4 2 0 0 132 80 79 66 +705 4 2 0 0 66 60 40 61 +706 4 2 0 0 41 61 44 40 +707 4 2 0 0 64 42 62 61 +708 4 2 0 0 64 61 86 66 +709 4 2 0 0 21 20 15 47 +710 4 2 0 0 67 72 69 87 +711 4 2 0 0 135 105 130 129 +712 4 2 0 0 124 83 79 78 +713 4 2 0 0 106 104 127 126 +714 4 2 0 0 138 94 90 88 +715 4 2 0 0 132 80 125 79 +716 4 2 0 0 138 86 106 132 +717 4 2 0 0 88 94 93 138 +718 4 2 0 0 41 5 11 42 +719 4 2 0 0 142 149 113 112 +720 4 2 0 0 64 40 66 46 +721 4 2 0 0 144 94 90 138 +722 4 2 0 0 138 139 132 106 +723 4 2 0 0 38 15 39 9 +724 4 2 0 0 65 87 73 67 +725 4 2 0 0 36 35 29 55 +726 4 2 0 0 65 47 14 45 +727 4 2 0 0 56 50 55 29 +728 4 2 0 0 70 75 76 55 +729 4 2 0 0 35 55 34 29 +730 4 2 0 0 54 29 55 22 +731 4 2 0 0 28 53 27 22 +732 4 2 0 0 70 55 54 74 +733 4 2 0 0 52 53 26 32 +734 4 2 0 0 109 89 91 112 +735 4 2 0 0 92 72 93 89 +736 4 2 0 0 51 32 52 25 +737 4 2 0 0 16 15 73 22 +738 4 2 0 0 15 43 38 65 +739 4 2 0 0 72 47 52 53 +740 4 2 0 0 53 32 33 27 +741 4 2 0 0 52 26 53 47 +742 4 2 0 0 30 29 24 50 +743 4 2 0 0 93 88 86 68 +744 4 2 0 0 73 16 68 66 +745 4 2 0 0 55 29 50 22 +746 4 2 0 0 23 48 22 17 +747 4 2 0 0 50 22 23 48 +748 4 2 0 0 50 23 22 29 +749 4 2 0 0 54 50 48 22 +750 4 2 0 0 50 24 23 29 +751 4 2 0 0 53 32 27 26 +752 4 2 0 0 53 27 22 21 +753 4 2 0 0 53 47 26 20 +754 4 2 0 0 125 99 79 80 +755 4 2 0 0 48 24 46 17 +756 4 2 0 0 9 3 38 8 +757 4 2 0 0 68 46 16 48 +758 4 2 0 0 50 23 24 48 +759 4 2 0 0 44 40 64 46 +760 4 2 0 0 64 82 61 62 +761 4 2 0 0 36 29 30 50 +762 4 2 0 0 60 59 16 40 +763 4 2 0 0 131 66 16 73 +764 4 2 0 0 48 22 17 16 +765 4 2 0 0 70 74 75 55 +766 4 2 0 0 90 74 94 95 +767 4 2 0 0 73 53 22 21 +768 4 2 0 0 24 18 46 17 +769 4 2 0 0 40 39 59 16 +770 4 2 0 0 138 139 106 86 +771 4 2 0 0 53 27 21 20 +772 4 2 0 0 34 53 33 27 +773 4 2 0 0 90 95 75 74 +774 4 2 0 0 49 25 26 47 +775 4 2 0 0 47 69 72 49 +776 4 2 0 0 20 15 47 14 +777 4 2 0 0 73 53 47 72 +778 4 2 0 0 90 95 96 76 +779 4 2 0 0 21 47 15 65 +780 4 2 0 0 47 20 14 13 +781 4 2 0 0 26 25 20 47 +782 4 2 0 0 20 19 13 47 +783 4 2 0 0 53 20 26 27 +784 4 2 0 0 66 16 68 46 +785 4 2 0 0 47 15 65 14 +786 4 2 0 0 131 65 15 59 +787 4 2 0 0 65 14 43 45 +788 4 2 0 0 58 57 78 63 +789 4 2 0 0 41 11 44 42 +790 4 2 0 0 22 16 68 73 +791 4 2 0 0 15 8 9 38 +792 4 2 0 0 43 13 45 14 +793 4 2 0 0 8 1 38 43 +794 4 2 0 0 2 8 1 38 +795 4 2 0 0 37 38 1 43 +796 4 2 0 0 63 38 57 43 +797 4 2 0 0 43 7 13 8 +798 4 2 0 0 38 15 65 59 +799 4 2 0 0 65 38 63 43 +800 4 2 0 0 43 14 15 8 +801 4 2 0 0 73 22 15 21 +802 4 2 0 0 11 5 12 42 +803 4 2 0 0 92 112 91 89 +804 4 2 0 0 58 63 38 57 +805 4 2 0 0 12 6 42 5 +806 4 2 0 0 11 5 40 10 +807 4 2 0 0 11 46 10 40 +808 4 2 0 0 4 40 5 10 +809 4 2 0 0 17 10 46 16 +810 4 2 0 0 48 46 16 17 +811 4 2 0 0 15 10 16 39 +812 4 2 0 0 68 22 48 16 +813 4 2 0 0 79 78 83 63 +814 4 2 0 0 47 45 13 14 +815 4 2 0 0 8 43 38 15 +816 4 2 0 0 66 60 59 16 +817 4 2 0 0 57 43 38 37 +818 4 2 0 0 43 7 8 1 +819 4 2 0 0 10 39 9 3 +820 4 2 0 0 70 74 90 75 +821 4 2 0 0 16 39 59 15 +822 4 2 0 0 11 17 10 46 +823 4 2 0 0 67 65 47 21 +824 4 2 0 0 144 114 113 149 +825 4 2 0 0 112 109 87 136 +826 4 2 0 0 83 85 105 124 +827 4 2 0 0 124 99 78 79 +828 4 2 0 0 39 10 9 15 +829 4 2 0 0 80 60 66 61 +830 4 2 0 0 80 79 66 59 +831 4 2 0 0 143 142 113 137 +832 4 2 0 0 79 59 63 65 +833 4 2 0 0 148 142 112 149 +834 4 2 0 0 65 14 15 43 +835 4 2 0 0 125 124 130 79 +836 4 2 0 0 143 113 144 137 +837 4 2 0 0 114 115 110 90 +838 4 2 0 0 125 100 99 80 +839 4 2 0 0 126 100 120 125 +840 4 2 0 0 66 40 60 16 +841 4 2 0 0 78 77 83 57 +842 4 2 0 0 124 85 105 130 +843 4 2 0 0 54 53 34 28 +844 4 2 0 0 20 21 53 47 +845 4 2 0 0 16 131 15 59 +846 4 2 0 0 136 93 87 112 +847 4 2 0 0 138 137 93 132 +848 4 2 0 0 132 86 126 80 +849 4 2 0 0 101 104 80 100 +850 4 2 0 0 74 73 53 22 +851 4 2 0 0 103 78 97 83 +852 4 2 0 0 52 32 26 25 +853 4 2 0 0 46 17 18 12 +854 4 2 0 0 23 17 24 48 +855 4 2 0 0 46 10 40 16 +856 4 2 0 0 41 44 61 42 +857 4 2 0 0 70 75 90 76 +858 4 2 0 0 101 104 102 82 +859 4 2 0 0 46 17 12 11 +860 4 2 0 0 25 31 51 32 +861 4 2 0 0 43 14 8 13 +862 4 2 0 0 65 59 63 38 +863 4 2 0 0 44 42 11 12 +864 4 2 0 0 51 49 52 72 +865 4 2 0 0 73 68 74 93 +866 4 2 0 0 41 44 11 40 +867 4 2 0 0 138 88 139 86 +868 4 2 0 0 131 132 59 66 +869 4 2 0 0 130 79 124 85 +870 4 2 0 0 131 93 73 87 +871 4 2 0 0 139 108 106 86 +872 4 2 0 0 39 10 16 40 +873 4 2 0 0 115 114 110 145 +874 4 2 0 0 67 72 47 69 +875 4 2 0 0 59 38 15 39 +876 4 2 0 0 97 78 77 83 +877 4 2 0 0 112 109 89 87 +878 4 2 0 0 147 111 112 109 +879 4 2 0 0 4 10 3 40 +880 4 2 0 0 115 110 116 146 +881 4 2 0 0 115 95 90 114 +882 4 2 0 0 39 9 3 38 +883 4 2 0 0 124 98 78 99 +884 4 2 0 0 73 131 15 16 +885 4 2 0 0 41 40 11 5 +$EndElements diff --git a/libexamples/mmg3d/io_generic_and_get_adja/cube.vtk b/libexamples/mmg3d/io_generic_and_get_adja/cube.vtk new file mode 100644 index 000000000..7cfd470bb --- /dev/null +++ b/libexamples/mmg3d/io_generic_and_get_adja/cube.vtk @@ -0,0 +1,1649 @@ +# vtk DataFile Version 4.2 +vtk output +ASCII +DATASET UNSTRUCTURED_GRID +POINTS 152 float +0 0 0 0.2 0 0 0.4 0 0 +0.6 0 0 0.8 0 0 1 0 0 +0 0.2 0 0.2 0.2 0 0.4 0.2 0 +0.6 0.2 0 0.8 0.2 0 1 0.2 0 +0 0.4 0 0.2 0.4 0 0.4 0.4 0 +0.6 0.4 0 0.8 0.4 0 1 0.4 0 +0 0.6 0 0.2 0.6 0 0.4 0.6 0 +0.6 0.6 0 0.8 0.6 0 1 0.6 0 +0 0.8 0 0.2 0.8 0 0.4 0.8 0 +0.6 0.8 0 0.8 0.8 0 1 0.8 0 +0 1 0 0.2 1 0 0.4 1 0 +0.6 1 0 0.8 1 0 1 1 0 +0 0 0.2 0.2 0 0.2 0.4 0 0.2 +0.6 0 0.2 0.8 0 0.2 1 0 0.2 +0 0.2 0.2 1 0.2 0.2 0 0.4 0.2 +1 0.4 0.2 0 0.6 0.2 1 0.6 0.2 +0 0.8 0.2 1 0.8 0.2 0 1 0.2 +0.2 1 0.2 0.4 1 0.2 0.6 1 0.2 +0.8 1 0.2 1 1 0.2 0 0 0.4 +0.2 0 0.4 0.4 0 0.4 0.6 0 0.4 +0.8 0 0.4 1 0 0.4 0 0.2 0.4 +1 0.2 0.4 0 0.4 0.4 1 0.4 0.4 +0 0.6 0.4 1 0.6 0.4 0 0.8 0.4 +1 0.8 0.4 0 1 0.4 0.2 1 0.4 +0.4 1 0.4 0.6 1 0.4 0.8 1 0.4 +1 1 0.4 0 0 0.6 0.2 0 0.6 +0.4 0 0.6 0.6 0 0.6 0.8 0 0.6 +1 0 0.6 0 0.2 0.6 1 0.2 0.6 +0 0.4 0.6 1 0.4 0.6 0 0.6 0.6 +1 0.6 0.6 0 0.8 0.6 1 0.8 0.6 +0 1 0.6 0.2 1 0.6 0.4 1 0.6 +0.6 1 0.6 0.8 1 0.6 1 1 0.6 +0 0 0.8 0.2 0 0.8 0.4 0 0.8 +0.6 0 0.8 0.8 0 0.8 1 0 0.8 +0 0.2 0.8 1 0.2 0.8 0 0.4 0.8 +1 0.4 0.8 0 0.6 0.8 1 0.6 0.8 +0 0.8 0.8 1 0.8 0.8 0 1 0.8 +0.2 1 0.8 0.4 1 0.8 0.6 1 0.8 +0.8 1 0.8 1 1 0.8 0 0 1 +0.2 0 1 0.4 0 1 0.6 0 1 +0.8 0 1 1 0 1 0 0.2 1 +0.2 0.2 1 0.4 0.2 1 0.6 0.2 1 +0.8 0.2 1 1 0.2 1 0 0.4 1 +0.2 0.4 1 0.4 0.4 1 0.6 0.4 1 +0.8 0.4 1 1 0.4 1 0 0.6 1 +0.2 0.6 1 0.4 0.6 1 0.6 0.6 1 +0.8 0.6 1 1 0.6 1 0 0.8 1 +0.2 0.8 1 0.4 0.8 1 0.6 0.8 1 +0.8 0.8 1 1 0.8 1 0 1 1 +0.2 1 1 0.4 1 1 0.6 1 1 +0.8 1 1 1 1 1 +CELLS 733 3245 +2 149 150 +2 32 33 +2 29 35 +2 116 117 +2 150 151 +2 33 34 +2 55 75 +2 117 118 +2 0 1 +2 34 35 +2 56 76 +2 118 119 +2 1 2 +2 90 110 +2 119 120 +2 116 122 +2 133 139 +2 41 61 +2 115 151 +2 120 121 +2 75 95 +2 0 6 +2 134 140 +2 17 23 +2 4 5 +2 18 24 +2 0 36 +2 61 81 +2 95 115 +2 121 127 +2 96 116 +2 122 128 +2 5 11 +2 30 50 +2 139 145 +2 81 101 +2 6 12 +2 140 146 +2 23 29 +2 5 41 +2 24 30 +2 50 70 +2 146 147 +2 101 121 +2 127 133 +2 35 55 +2 147 148 +2 30 31 +2 128 134 +2 11 17 +2 36 56 +2 148 149 +2 145 151 +2 110 146 +2 70 90 +2 12 18 +2 31 32 +2 3 4 +2 76 96 +2 2 3 +3 87 107 85 +3 87 89 107 +3 80 81 100 +3 80 60 81 +3 57 37 58 +3 57 58 77 +3 69 67 49 +3 69 89 67 +3 69 49 75 +3 21 27 28 +3 27 33 28 +3 27 26 33 +3 53 52 73 +3 53 54 33 +3 43 11 45 +3 150 113 149 +3 150 149 143 +3 151 145 115 +3 151 150 145 +3 151 115 150 +3 91 111 92 +3 134 106 104 +3 111 146 147 +3 141 147 146 +3 139 107 145 +3 138 139 145 +3 114 150 115 +3 145 144 138 +3 87 67 89 +3 142 143 148 +3 150 143 144 +3 149 113 148 +3 149 148 143 +3 146 108 140 +3 146 140 141 +3 142 148 141 +3 140 134 141 +3 108 134 140 +3 137 138 143 +3 105 107 133 +3 132 126 133 +3 125 126 131 +3 132 131 126 +3 138 131 132 +3 139 133 107 +3 139 138 133 +3 144 143 138 +3 84 86 64 +3 84 104 86 +3 130 124 131 +3 134 135 141 +3 106 134 108 +3 107 109 145 +3 126 125 119 +3 121 100 101 +3 103 121 101 +3 105 133 103 +3 141 135 136 +3 105 103 85 +3 135 134 129 +3 130 129 124 +3 128 122 129 +3 104 122 128 +3 136 130 131 +3 97 96 77 +3 102 104 82 +3 79 58 59 +3 121 103 127 +3 126 121 127 +3 133 127 103 +3 133 126 127 +3 100 121 120 +3 126 120 121 +3 83 103 81 +3 120 119 100 +3 126 119 120 +3 100 119 99 +3 118 119 124 +3 118 98 119 +3 39 38 2 +3 118 117 98 +3 118 124 117 +3 136 129 130 +3 131 124 125 +3 122 123 129 +3 123 122 117 +3 124 123 117 +3 119 98 99 +3 97 98 117 +3 116 96 117 +3 122 116 117 +3 122 96 116 +3 102 96 122 +3 115 95 94 +3 115 89 95 +3 115 94 114 +3 113 94 93 +3 92 112 113 +3 94 75 74 +3 89 115 109 +3 145 150 144 +3 110 90 108 +3 110 111 90 +3 108 86 106 +3 93 92 113 +3 136 135 129 +3 102 122 104 +3 114 113 150 +3 109 107 89 +3 91 71 90 +3 92 93 73 +3 70 90 71 +3 70 68 90 +3 70 50 68 +3 70 71 50 +3 111 112 92 +3 92 72 71 +3 86 88 68 +3 97 117 96 +3 84 64 82 +3 103 83 85 +3 80 100 79 +3 83 63 85 +3 43 63 41 +3 83 81 63 +3 80 79 60 +3 2 37 1 +3 2 1 7 +3 67 85 65 +3 78 77 58 +3 24 18 46 +3 24 19 18 +3 82 62 56 +3 86 104 106 +3 82 64 62 +3 138 132 133 +3 75 49 55 +3 75 55 54 +3 55 49 35 +3 55 35 54 +3 67 47 49 +3 143 136 137 +3 90 68 88 +3 48 68 50 +3 50 24 48 +3 59 39 60 +3 40 60 39 +3 41 61 60 +3 63 61 41 +3 63 65 85 +3 20 14 19 +3 66 86 68 +3 134 128 129 +3 134 104 128 +3 40 4 41 +3 148 112 111 +3 63 45 65 +3 137 131 138 +3 64 86 66 +3 35 34 54 +3 35 28 34 +3 64 46 44 +3 74 75 54 +3 34 28 33 +3 34 33 54 +3 27 21 26 +3 54 53 73 +3 51 52 31 +3 108 90 88 +3 91 92 71 +3 50 51 31 +3 15 14 21 +3 71 52 51 +3 31 32 26 +3 52 32 31 +3 29 49 23 +3 29 23 28 +3 87 85 67 +3 22 16 21 +3 22 21 28 +3 23 22 28 +3 31 26 25 +3 26 21 20 +3 98 78 79 +3 47 45 23 +3 8 2 7 +3 67 45 47 +3 49 47 23 +3 43 45 63 +3 81 60 61 +3 63 81 61 +3 35 49 29 +3 35 29 28 +3 59 58 39 +3 21 16 15 +3 73 74 54 +3 73 93 94 +3 23 17 16 +3 23 45 17 +3 39 58 38 +3 26 20 19 +3 33 26 32 +3 33 32 52 +3 94 74 73 +3 48 24 46 +3 46 68 48 +3 19 14 13 +3 72 52 71 +3 94 95 75 +3 89 75 95 +3 19 13 12 +3 25 19 24 +3 18 12 46 +3 19 12 18 +3 19 25 26 +3 65 45 67 +3 64 44 42 +3 57 77 56 +3 14 8 7 +3 42 44 12 +3 1 37 0 +3 1 0 7 +3 36 42 0 +3 36 0 37 +3 62 42 56 +3 6 12 7 +3 42 12 6 +3 64 42 62 +3 13 14 7 +3 21 14 20 +3 10 11 4 +3 91 90 111 +3 57 56 37 +3 5 41 4 +3 11 5 4 +3 11 41 5 +3 10 4 9 +3 3 9 4 +3 3 4 39 +3 16 9 15 +3 14 15 9 +3 46 12 44 +3 56 36 37 +3 56 42 36 +3 6 7 0 +3 42 6 0 +3 9 2 8 +3 10 9 16 +3 66 46 64 +3 113 112 148 +3 82 104 84 +3 98 77 78 +3 9 8 14 +3 79 59 60 +3 79 78 58 +3 142 141 136 +3 147 148 111 +3 147 141 148 +3 124 129 123 +3 142 136 143 +3 99 98 79 +3 125 124 119 +3 76 82 56 +3 77 76 56 +3 53 33 52 +3 137 136 131 +3 100 99 79 +3 73 52 72 +3 102 82 96 +3 31 25 24 +3 16 17 11 +3 45 11 17 +3 22 23 16 +3 40 41 60 +3 69 75 89 +3 103 101 81 +3 100 81 101 +3 16 11 10 +3 30 50 31 +3 24 30 31 +3 24 50 30 +3 13 7 12 +3 43 41 11 +3 50 71 51 +3 72 92 73 +3 107 105 85 +3 66 68 46 +3 58 37 38 +3 96 82 76 +3 96 76 77 +3 108 88 86 +3 146 110 108 +3 146 111 110 +3 3 39 2 +3 3 2 9 +3 109 115 145 +3 114 94 113 +3 38 37 2 +3 97 77 98 +3 40 39 4 +4 87 138 85 107 +4 87 89 138 107 +4 84 130 86 129 +4 84 78 123 82 +4 80 83 100 81 +4 80 83 81 60 +4 57 58 37 62 +4 57 62 77 58 +4 69 53 54 49 +4 69 67 53 49 +4 69 89 73 67 +4 69 54 75 49 +4 130 64 86 72 +4 66 20 72 64 +4 66 72 20 46 +4 66 86 72 71 +4 66 72 46 71 +4 53 21 27 28 +4 53 27 33 28 +4 53 27 21 52 +4 27 33 26 52 +4 53 73 52 21 +4 53 54 28 33 +4 69 73 53 67 +4 43 45 11 10 +4 114 145 144 109 +4 150 143 149 113 +4 151 150 115 145 +4 91 88 92 111 +4 134 129 104 106 +4 108 141 111 146 +4 141 111 146 147 +4 143 109 89 113 +4 138 139 107 145 +4 114 115 150 145 +4 145 138 144 109 +4 87 93 89 67 +4 112 136 92 143 +4 142 148 143 112 +4 150 113 144 143 +4 149 143 148 113 +4 146 141 140 108 +4 142 112 141 148 +4 108 140 134 141 +4 141 135 111 112 +4 131 78 58 65 +4 113 144 143 109 +4 138 109 89 143 +4 89 137 138 143 +4 138 105 107 133 +4 132 126 105 133 +4 105 125 126 131 +4 132 131 105 126 +4 138 105 132 131 +4 139 138 107 133 +4 92 137 93 143 +4 109 144 143 138 +4 84 86 130 64 +4 136 135 112 92 +4 137 92 85 131 +4 84 129 86 104 +4 72 65 92 130 +4 130 131 124 78 +4 134 141 135 108 +4 135 106 134 108 +4 107 145 109 138 +4 126 125 100 119 +4 126 121 100 101 +4 126 103 121 101 +4 105 126 103 133 +4 141 112 136 135 +4 137 87 85 92 +4 136 130 86 92 +4 131 65 85 79 +4 105 103 125 85 +4 126 100 125 103 +4 135 129 134 106 +4 130 129 78 124 +4 104 128 122 129 +4 58 65 15 130 +4 136 92 131 130 +4 102 97 96 77 +4 102 104 123 82 +4 79 58 65 59 +4 102 123 77 82 +4 126 121 103 127 +4 133 127 126 103 +4 126 100 121 120 +4 100 83 103 81 +4 100 103 83 79 +4 126 120 119 100 +4 125 100 119 99 +4 125 99 103 100 +4 118 119 98 124 +4 39 2 38 9 +4 118 124 98 117 +4 125 103 79 83 +4 136 130 129 86 +4 105 131 85 125 +4 102 122 97 123 +4 131 79 125 124 +4 122 129 123 104 +4 123 122 97 117 +4 141 135 108 111 +4 124 117 123 98 +4 119 99 98 124 +4 123 97 98 117 +4 122 116 96 117 +4 102 77 123 97 +4 102 97 122 96 +4 115 89 94 95 +4 143 113 89 93 +4 130 131 78 58 +4 87 137 138 89 +4 115 94 89 114 +4 113 89 93 94 +4 92 65 72 67 +4 92 143 113 112 +4 130 58 78 64 +4 89 94 75 74 +4 89 114 109 115 +4 114 145 150 144 +4 110 90 111 108 +4 108 86 135 106 +4 93 143 113 92 +4 84 130 78 64 +4 86 136 135 129 +4 125 103 99 79 +4 126 101 100 103 +4 125 79 99 124 +4 135 106 86 129 +4 124 123 78 98 +4 102 122 123 104 +4 114 150 113 144 +4 67 93 92 87 +4 89 67 93 73 +4 138 109 107 89 +4 91 88 90 71 +4 92 67 73 93 +4 92 71 86 88 +4 65 92 130 131 +4 70 90 68 71 +4 70 50 71 68 +4 135 111 112 92 +4 43 45 10 39 +4 92 72 86 71 +4 86 68 88 71 +4 65 85 92 131 +4 92 88 86 111 +4 122 97 117 96 +4 84 130 129 78 +4 84 78 82 64 +4 125 103 83 85 +4 80 79 100 83 +4 83 79 85 60 +4 83 63 60 85 +4 43 63 39 60 +4 63 65 39 60 +4 43 60 41 63 +4 83 60 63 81 +4 125 85 83 79 +4 80 60 79 83 +4 85 79 65 60 +4 136 92 86 135 +4 2 7 1 37 +4 67 85 92 65 +4 130 72 14 64 +4 78 62 58 77 +4 24 19 46 18 +4 77 82 62 56 +4 129 86 104 106 +4 15 39 45 65 +4 78 82 64 62 +4 138 133 132 105 +4 75 54 55 49 +4 55 28 35 49 +4 72 64 20 14 +4 55 35 28 54 +4 53 67 47 49 +4 53 67 21 47 +4 53 73 21 67 +4 53 21 54 49 +4 143 136 92 137 +4 20 52 46 72 +4 73 67 72 21 +4 71 48 51 46 +4 90 88 68 71 +4 48 68 71 50 +4 50 48 24 51 +4 48 51 25 24 +4 48 51 46 25 +4 131 79 78 65 +4 65 59 39 60 +4 40 60 43 39 +4 63 41 61 60 +4 63 60 85 65 +4 20 19 14 46 +4 66 71 68 86 +4 134 104 129 128 +4 123 82 78 77 +4 105 103 126 125 +4 137 93 89 87 +4 131 79 124 78 +4 137 85 105 131 +4 87 93 92 137 +4 40 4 10 41 +4 141 148 112 111 +4 63 39 65 45 +4 143 93 89 137 +4 137 138 131 105 +4 37 14 38 8 +4 64 86 72 66 +4 35 34 28 54 +4 64 46 13 44 +4 55 49 54 28 +4 69 74 75 54 +4 34 54 33 28 +4 53 28 54 21 +4 27 52 26 21 +4 69 54 53 73 +4 51 52 25 31 +4 108 88 90 111 +4 91 71 92 88 +4 50 31 51 24 +4 15 14 72 21 +4 14 42 37 64 +4 71 46 51 52 +4 52 31 32 26 +4 51 25 52 46 +4 29 28 23 49 +4 92 87 85 67 +4 72 15 67 65 +4 54 28 49 21 +4 22 47 21 16 +4 49 21 22 47 +4 49 22 21 28 +4 53 49 47 21 +4 49 23 22 28 +4 52 31 26 25 +4 52 26 21 20 +4 52 46 25 19 +4 124 98 78 79 +4 47 23 45 16 +4 8 2 37 7 +4 67 45 15 47 +4 49 22 23 47 +4 43 39 63 45 +4 63 81 60 61 +4 35 28 29 49 +4 59 58 15 39 +4 130 65 15 72 +4 47 21 16 15 +4 69 73 74 54 +4 89 73 93 94 +4 72 52 21 20 +4 23 17 45 16 +4 39 38 58 15 +4 137 138 105 85 +4 52 26 20 19 +4 33 52 32 26 +4 89 94 74 73 +4 48 24 25 46 +4 46 68 71 48 +4 19 14 46 13 +4 72 52 46 71 +4 89 94 95 75 +4 20 46 14 64 +4 46 19 13 12 +4 25 24 19 46 +4 19 18 12 46 +4 52 19 25 26 +4 65 15 67 45 +4 46 14 64 13 +4 130 64 14 58 +4 64 13 42 44 +4 57 56 77 62 +4 40 10 43 41 +4 21 15 67 72 +4 14 7 8 37 +4 42 12 44 13 +4 7 0 37 42 +4 1 7 0 37 +4 36 37 0 42 +4 62 37 56 42 +4 42 6 12 7 +4 37 14 64 58 +4 64 37 62 42 +4 42 13 14 7 +4 72 21 14 20 +4 10 4 11 41 +4 91 111 90 88 +4 57 62 37 56 +4 11 5 41 4 +4 10 4 39 9 +4 10 45 9 39 +4 3 39 4 9 +4 16 9 45 15 +4 47 45 15 16 +4 14 9 15 38 +4 67 21 47 15 +4 78 77 82 62 +4 46 44 12 13 +4 7 42 37 14 +4 65 59 58 15 +4 56 42 37 36 +4 42 6 7 0 +4 9 38 8 2 +4 69 73 89 74 +4 15 38 58 14 +4 10 16 9 45 +4 66 64 46 20 +4 143 113 112 148 +4 111 108 86 135 +4 82 84 104 123 +4 123 98 77 78 +4 38 9 8 14 +4 79 59 65 60 +4 79 78 65 58 +4 142 141 112 136 +4 78 58 62 64 +4 147 141 111 148 +4 64 13 14 42 +4 124 123 129 78 +4 142 112 143 136 +4 113 114 109 89 +4 124 99 98 79 +4 125 99 119 124 +4 65 39 59 15 +4 77 76 82 56 +4 123 84 104 129 +4 53 52 33 27 +4 19 20 52 46 +4 15 130 14 58 +4 135 92 86 111 +4 137 136 92 131 +4 131 85 125 79 +4 100 103 79 99 +4 73 72 52 21 +4 102 77 96 82 +4 51 31 25 24 +4 45 16 17 11 +4 22 16 23 47 +4 45 9 39 15 +4 40 43 60 41 +4 69 74 89 75 +4 100 103 101 81 +4 45 16 11 10 +4 24 30 50 31 +4 42 13 7 12 +4 64 58 62 37 +4 43 41 10 11 +4 50 48 51 71 +4 72 67 73 92 +4 40 43 10 39 +4 137 87 138 85 +4 130 131 58 65 +4 129 78 123 84 +4 130 92 72 86 +4 138 107 105 85 +4 38 9 15 39 +4 114 113 109 144 +4 66 71 46 68 +4 58 37 14 38 +4 96 77 76 82 +4 111 108 88 86 +4 146 110 111 108 +4 3 9 2 39 +4 114 109 115 145 +4 114 94 89 113 +4 38 8 2 37 +4 123 97 77 98 +4 72 130 14 15 +4 40 39 10 4 + +CELL_TYPES 733 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 +10 + +CELL_DATA 733 +FIELD FieldData 1 +medit:ridges 1 733 int +2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 +POINT_DATA 152 +FIELD FieldData 2 +medit:corner 1 152 int +32 0 0 0 0 32 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 32 0 0 0 0 32 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 32 +0 0 0 0 32 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 32 0 0 0 0 32 +medit:requiredVertices 1 152 int +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 diff --git a/libexamples/mmg3d/io_generic_and_get_adja/cube.vtu b/libexamples/mmg3d/io_generic_and_get_adja/cube.vtu new file mode 100644 index 000000000..732d96a57 --- /dev/null +++ b/libexamples/mmg3d/io_generic_and_get_adja/cube.vtu @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + _AQAAAACAAABgAgAAHgAAAA==eJxTYMAECljEqA2w2UEPe4c7UCBSjF72AgA0bwEBAQAAAACAAABgAgAADwAAAA==eJxjYBgFo4B2AAACYAABAQAAAACAAAB0CwAAHgAAAA==eJztw7ENAAAMAiDj/0f3C5dCQpP0UQAAWDsyzwB5AQAAAACAAAAgBwAARAEAAA==eJxtlNENwjAMRFmDZfACDJU1YCazE4rc+N4lRUL1R3rxnZ/7eOj3y/dLdXb9/TwDZ0JvDNR6fz5VZ9dTB2dC9424u7t0EjoJnYROQufse+qozq7nE2dCPkfceb58tc6qL1+to4xG3OVVXkfrrLru7DOhfEfcZe15KzP6Zu9+PzUq/3Nmlec5v8rnnGX53efqd2TXy6/6HKE+Tya8P3HB2XI+njFzYi/UW353zpbfnbnl1/nz7KQrvwm/Cb/OrueunsgvGXSOyALzZmbsi9rl99yN8rvviTOhvKi1/KrPc8ecJ2XNPrhnvivknUyRC2bP/Ngj72mebZ+ddXHAjPg+eLZvge+JGGK+vNu/B9pp3zHxx9mwb98z7Yrvh9jlXOnZ+RWDzp1YIxPMy7nQbH2emiHnxqw9b2XmvtU776cG/3+tIkwfAQAAAACAAACATgAAMg0AAA==eJyN3Om3n0UNwPEKuLAoiJRN1FZALJUiZVEQ5IeABRUREbWKeFmEAhWouCCbBQQFRURb+Hd9YT4v+J4z5977JudJ8syTyWQymSS/e3LX//8+GLhn4N6BXxh46cDfD/xD3vsw73154DcGfj/v/XHXR/8+lvd875sDf5D3/pT3Thn4i4HPhO+FyP/iwDcH/mPgvoG3DHx+oPkZ588DzevXuz7694mBbw3858DPDrxg4GkDPz7w3IEXZrzLItd9+S45yfWXgVsDO+/j+e6ZA7848OBAenk/3/3NQPM8a6B5/megebIj36Nn8+x3v5tx/pvvdp7Wkd2wO++dyHe+NPD4QOtED9aJ3tmhcU4OpBf2we7IbR7skp6sMzn2DDx1ILtg91sDTwnfzwY+PfCB4A+H/qOB1vGx4G8O/caBlw+8KXjP9wy8c+DtA68J/nDod4bPfto98PMDL8nz3gX+4tCvH3jdwLuDvyH8+weyg6sG8nPHBp4M3vN7A9kD+6gf+SD0D8OH/suBzw58cCB7fWrgkfB137ybZ3T7m32Q553Q4X8X+Z4P/d95nx1ab+v/r4H0ZV99ELzx6PdY+E/m2Xvmd3Rg/ZJneiHPieDxvRX80eDxvT3Q/Mnz5EB65q/+OvDV4F8J/o3wvxH6Ows+62fcp4N/J3T6fi/0nwz86cBN8EdCf33gy5GLvv42kD6fCp1+yfvbgezMvOnJOe9c4NecF0+EDm9d3gwfucj59/DjeyB85H9t4Ot5po/jA18M/Ujw+HzfePT58MCtgfzw4xnvxwPvHchvf2sgvZiXc/XV0Hveen4i+FdDtx7GeSF8javuz7j3hc96G/fV4F8IHf7RgY0jXw7+kdCvGPiVgaeEX1z7SPAvh24dax9vhJ9ds4OX8t5LoRv/5dDhzYN89PBw8PjFi1vBvxh68VuhPx48PueG+PWh4A+H/nz4nEPHgv/VQOfkcws+ccb38j3fqb9xLvGP4jxx3dHgn13Q+Uf+rvKSk53wK9adPunR/q4+yGse/Kh5iisORU5ykEu81Dj2UPB3hA5/MHT4Q6HTl/V6MPCuvEePP8/47Jldbg10Tm0G8of8C3/Dn4uH+Y97w3dr+PcHvy/894VufOOKu/kV8Xbvt54/OVBcRY7bBv5woPOAv3ffcv84EPznQqenbw90D6J/9vdU+Dd5TxwhLnFO2Ifi/+YLPN+QZ/y9710afvq5Ou+Jb+wzcRv7ZU/s6+vBHwy8MHzOVeeG9f1qntGbd0C/Nfh9wVtv63/ewM8MtJ7fGWjdzEO8cnzga8EfCZ387qfkETfbv/YzOd2jyEvfzj32sYmc5Lau8kM3BH9J6MZh318byN+zL+N4zzjNY+0Nv/ume+rFobtf8p/XDnQPde93LrA79sY/83/1l8YzztkDrTu5vOe7fW9P5L8ueHzyN/ZP8zqe6c+9j13ah+cPPCdynp9n41wQOjy5yH1Rno1jP4hv+EV+l19gn773qYH8bv0t/voVz8bZH377wXlgn9+yoMOzc99pXtYz/fA//D4/Qy/0z27Yqf1xQ/DiAfGT+cmTnRP8VaH7PnnE0dbLOvFXe0PfE7xn9kou8pObP+afDwTeET7ft48+PVD84Xv2le+KU/mVw3lGN75x5QMvCr3nNL4D4Ws+Eb77gd+1Lux4M5B/vHKg/J74wblPL/aHfeE945BLvCKe2RW8P+PIt14Z+mV5Np74Aj85m5eunGeFbxO6ca2TeRtnd/Ds94yB8ofOSf6cn3c+0jO5zat5cuOcGXrx+0I/I3ynDzw1z6cF79m+PSf8PW/ODp2d0jO7ME/reXnwV4Zufeh9V/g+Ebzv89vs9IzQzUd8Qd7NQPco8Yz4RnwrLnKvcL7YL84Z3yMHfTl/+Ombg/c+fyk/KS8lbm1949ng3w1dfqB5BOMbV3wsT2B+5JOfMJ78gnoFPVnXe0KHFyfx6/yr+JA84kT3MXKRh7/3Pn/tvkyerYHiB36Sv2UXzq3WAVofEpc497wvTrYfra96R88J91B5ydZnWnfzHfKw79bRzLN1tuIPhs7v2Xf2sXjGvHzf+85FcaZ1EMdaJ/kI+VRxov3oXLYv7QP+QvywNdD6tl7mmf2Jt8XZ7hnqAs+ED/7Z0PlJ/rF1Oc/2vzxM6yXyNuIIfsf8zNd48hvmY1+yN/Lw3+Jw9yt6fjr0w+FD59/kKenrtdD5K/7EeshzyIPUnktvXNw6Y8/9G/PcfIf91npf65K3h29Vt7w7/OjGbT6D3jYD6c++YO/nBb8J/a7wHQi94x4KHf5A6Oa7qrdeH3zrrqUb57rgG8+j954Mvzt0+u39nP5b17U+vX/VX9p/rV/ar61Htg7Zem73t7iPv+EH+ZPWi5pP44ec463vrvDOf3KbDzsmf+u8rQPTT+vS7wcap/rjX9wfW/8XXznn6YfcrcvCe691+dYvW5c/Ef7qUR2X3n3/ufCdCN+qTtw6YvPc4prGe+5rq3nR7zt5Phw+z6u6tOed1qdbL/W803r1k+Hr98vfOnXlYy/mx86qp53WteuvW4dpfeLtPDtfyW98+7t5c37Zehvn9cDWB9lL7Y2cR/O8XX3dPq5dtc7eemrrw627o29Xfy+f9TWv+gnzov/mGx8Mf+MXdHptHt29ovX+V8JH7sdCx9/6Xft22h9gXa1z8+/tF6i/cA83bv3qG6G7H+20j6DxXfsJyOFe633vGdf7tZ/2H7TPoHZS/be/AH7VT/BY8PjMq/0J7TtY7YtHQ/f8RPjbhyCet/69X7gXuFe0z6B1/Npj65jdH/VT7J/dsHvjth7Njqy391Z5g9qz92pvHd/8Vn7POdv+C+O1v6N5jvZRrPok2g+xFTr9sPuO1/3XPor2QzTf7Dw7Fj7nYM+Pxhn8ZuOD9kM8FHz7Dfpd/PwOv+C8uz30zoO/Jz95yb/Jd7fr6yBv7+GN/7fr82BXRwPtl563jUfMz7x7v+78jLvqB+n+bl6M/3Le1t+9En7vs//Op/f/7hPy2yf1D93f7SdtvMtO2ifTvEX53AcbH6/6YNzP2t/ie8ZvPaz12falrOI6+7F9NfJe7a9pfg3f6l7he73/uvdeET77kvydT/sh0Bs3Nc7w3HwbeVd+fWtg90fjpOaf2n/S/bHq82H/jRcaD3jv5tBvDX7VF9R+kPZxlL4/z+3/uD/01o8br3Y+7ftvfNB4+LbwN76sH2z9vPXA9i/1vLDu7FP9ZDPQusv/9fcI7WuS/zo3fKs+p9W9jT8Ub1u39rms7LJ9Ub1vi7vap9L+J8/yYu0TaD6x/UHtmzJO+1hWfVSl7w5f83u7w9/8Y/Oz7dPqvdt85A2tr3k3Xwvf/hj1f3UL47Qvp/65fWHt0zkYPvZ4bfCeW49ayYWv8TV7uy1wp/1o+8PXfsZVf1r9nu+2r4PdNX/dc81+ax+a/Xh8YO+j7Xvs/b35jOaNxAXii+q3+Rfvm3fvS81/1n7bT+d8pu/mG1f9ddarfR72T+f3dmB/P2Ie/LR1c/9Uz94MXNU12rdX/+J99qDuqF+g/q51APn/7fr6+juv1i8qV+sh/Ev7y1r/2a7vz75t/1/jT+vbPu3GU63z+h7/0T6N+j94/RTWe5PvWp/Op/2MewZeHP6Lwm+89q2po1vvxvvtJzSfs4O3D2ovxm3f4dXBn7ND/muCb/9i64n9Tvsp2+dY/bbfcWWXq3OxfWbNG636I9vXRz/tk2Q/q35J67TS3wWhr86jnfZTNq5pH2v7JBvPiT+bX2V3K7vB1/pk+ytbV27+pH2HXd/2YXZ9+rulzrP+v/0Yta9Vn2b7hvE3P7Ndfyb7XPVpNu5axRWrvs3Wv1d5NedI6+29f7Qfc9XXubqH9PcW7fO8Lnyrvs76P3awkpucrXfhu2nB3z7P9i+Ku9xvxDfimvYPsefK3/sef8Lf8DPt5yRX+5f89b3+nqZ87VP01z7RVR9j+xTbj9r4ajOw+l/1u4KrPtXVed9+1VUfaX9/3vtQ+2+qh/artp+13+evTg/9quDxtQ+rfa7tW12dQ8V7j77a98qfru69+HofaZ6hv09hH7Xfxmfk6v2u/r32WLuufXYfmHfjfud9zzf+lJ+vvshHfuu7Wif3iM1A+mK/q7pB+2FXeXrr0d+xvxS46u9tPW67Pt/mz1b39lXfb+vgreewq83A9gHTx4nw1X+wi+b3m39tf0zzNdal9Rd2Yvzt+ozR+3vt5k3pmd2177h9yebV9TfP/v8Q8Y57oXN5FW+3Ht/zlR02f2qd2gfd/PqqLtt8duu/9GnfruLM1i+3BtJjf0/WeKfxaPuq+3uwxv8rv0+v4otVnrz5gf4up/pp/3Xlb//g6v8X0UfP5/ZTbwZ2//LTjZf6+5LmF62H+Lb1VuvNjqq/1ofaX9M+4taz2gdSf9H95v1VHap9X72f1P/2/tY6dfvBmn/sfaN9x82DbQ1c+ZmeP9v1nZe/v9Nx7nZ+O+0vb//n6lw33/YrtO/cetW/dX+St/He/wA9cef9AQAAAACAAADoFgAAgwQAAA==eJw12O9DHQIYhmGmETKZkMmETCYcHJMJxxyETCaTCZmQyYRMyDQOCyGERgiNwzIhFkLIhBBCLNMImUYshPz40NX75foX3ucet8HoxXBjxnIzxnEC4zmRCdyWiZzEJE5mMndhCqcwlVOZxr0Z4H4MchrTOZ0ZPJQhzmCYRzGTxzKLM5nNWczhbOZyDvN4BvM5lwU8l4WcxyLOZzEvYQkXsJRXcSEXMcLFvIm3sIp38m4uYS0f5MNcyiiXcTmfZhNX8EW+zFa+wZV8mx38gB/xE3ZzFVdzDfv4PddyHQe5nr/zT47wP47bcNTxjOXmnMCtmMDtOIk7Mpm7cgr3YBr34X48gOk8mIfycIZ5NI/l8czmSZzNU5nHMzmX57CQF3A+L2YJL+eVvJrlvI438EZW8jbewbtYw/v4AB9iPR/jE3ySjXyWz/MFtvBVvs432c53+T4/ZBc/4xf8kr38ht/xBw7wZ/7K3zjMv/kvNxw3agw34WbcgvHcmttyeyZxJ+7C3ZjKPbk392WQB3I6D2GIR/AoHsMsnsBZPJm5PI1n8CwW8DzO44Us5qVcwCtYxmt4La9nBW/mrbyd1byH9/J+1vERPsrH2cCn+AyfYzNf4it8jW18i+/wPXbyY37Kz9nDr/g1v2U/f+RP/IVD/IN/8R9usBG4MTdlHLfkRG7DRO7AydyZKdydU7kXA9yf03gQM3gYZ/BIZvI4zuSJzOEpnMPTmc+zeS7PZxEv4iW8jKW8igu5iBEu5k28hVW8k3dzCWv5IB/mUka5jMv5NJu4gi/yZbbyDa7k2+zgB/yIn7Cbq7iaa9jH77mW6zjI9fydf3KEY49zDGMZx3gmMJFJTGYKU5nGAINMZwZDDDOTWcxmDnOZx3wWsJBFLGYJS1nGckZYwUpWsZo1rGUd6xllAxvZxGa2sJVtbGcHO9nFbvawl33s5wAHOcRhjowNpvGjxDCWcYxnAhOZxGSmMJVpDDDIdGYwxDAzmcVs5jCXecxnAQtZxGKWsJRlLGeEFaxkFatZw1rWsZ5RNrCRTWxmC1vZxnZ2sJNd7GYPe9nHfg5wkEMc5gjHBnMMYxnHeCYwkUlMZgpTmcYAg0xnBkMMM5NZzGYOc5nHfBawkEUsZglLWcZyRljBSlaxmjWsZR3rGWUDG9nEZrawlW1sZwc72cVu9rCXfeznAAc5xGGOjIWSTUaJYSzjGM8EJjKJyUxhKtMYYJDpzGCIYWYyi9nMYS7zmM8CFrKIxSxhKctYzggrWMkqVrOGtaxjPaNsYCOb2MwWtrKN7exgJ7vYzR72so/9HOAghzjMEY6FshjGMo7xTGAik5jMFKYyjQEGmc4MhhhmJrOYzRzmMo/5LGAhi1jMEpayjOWMsIKVrGI1a1jLOtYzygY2sonNbGEr29jODnayi93sYS/72M8BDnKIwxwZC6SbjhLDWMYxnglMZBKTmcJUpjHAINOZwRDDzGQWs5nDXOYxnwUsZBGLWcJSlrGcEVawklWsZg1rWcd6RtnARjaxmS1sZRvb2cFO/g+9imx5AQAAAACAAADdAgAAFQAAAA==eJxjZiYfsI4CogHXKKA/AACS8xUj + + diff --git a/libexamples/mmg3d/io_generic_and_get_adja/genericIO.c b/libexamples/mmg3d/io_generic_and_get_adja/genericIO.c new file mode 100644 index 000000000..0e74e2498 --- /dev/null +++ b/libexamples/mmg3d/io_generic_and_get_adja/genericIO.c @@ -0,0 +1,226 @@ +/* ============================================================================= +** This file is part of the mmg software package for the tetrahedral +** mesh modification. +** Copyright (c) Bx INP/Inria/UBordeaux/UPMC, 2004- . +** +** mmg is free software: you can redistribute it and/or modify it +** under the terms of the GNU Lesser General Public License as published +** by the Free Software Foundation, either version 3 of the License, or +** (at your option) any later version. +** +** mmg is distributed in the hope that it will be useful, but WITHOUT +** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +** FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +** License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License and of the GNU General Public License along with mmg (in +** files COPYING.LESSER and COPYING). If not, see +** . Please read their terms carefully and +** use this copy of the mmg distribution only if you accept them. +** ============================================================================= +*/ + +/** + * Example of use of the mmg3d library to load an save files whose format is + * detected using the extension), get the mesh from Mmg to store it into user + * data structures and get the adjacency relationship between tetra. + * + * \author Charles Dapogny (LJLL, UPMC) + * \author Cécile Dobrzynski (Inria / IMB, Université de Bordeaux) + * \author Pascal Frey (LJLL, UPMC) + * \author Algiane Froehly (Inria / IMB, Université de Bordeaux) + * \version 5 + * \copyright GNU Lesser General Public License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +/** Include the mmg3d library hader file */ +// if the header file is in the "include" directory +// #include "libmmg3d.h" +// if the header file is in "include/mmg/mmg3d" +#include "mmg/mmg3d/libmmg3d.h" + +int main(int argc,char *argv[]) { + MMG5_pMesh mmgMesh; + int ier; + /* To save final mesh in a file */ + FILE* inm; + char *fileout_generic,*fileout_medit,*filein; + + + fprintf(stdout," -- TEST LOAD AND GET MESH DATA \n"); + + if ( argc != 3 ) { + printf(" Usage: %s filein fileout\n",argv[0]); + return(EXIT_FAILURE); + } + + /* Name and path of the input mesh file */ + filein = (char *) calloc(strlen(argv[1]) + 1, sizeof(char)); + if ( filein == NULL ) { + perror(" ## Memory problem: calloc"); + exit(EXIT_FAILURE); + } + strcpy(filein,argv[1]); + + fileout_generic = (char *) calloc(strlen(argv[2])+1, sizeof(char)); + if ( fileout_generic == NULL ) { + perror(" ## Memory problem: calloc"); + exit(EXIT_FAILURE); + } + strcpy(fileout_generic,argv[2]); + + fileout_medit = (char *) calloc(strlen(argv[2]) + 6, sizeof(char)); + if ( fileout_medit == NULL ) { + perror(" ## Memory problem: calloc"); + exit(EXIT_FAILURE); + } + strcpy(fileout_medit,argv[2]); + strcat(fileout_medit,".mesh"); + + /** ------------------------------ STEP I -------------------------- */ + /** 1) Initialisation of mesh structure of Mmg */ + /* args of InitMesh: + * MMG5_ARG_start: we start to give the args of a variadic func + * MMG5_ARG_ppMesh: next arg will be a pointer over a MMG5_pMesh + * &mmgMesh: pointer toward your MMG5_pMesh (that store your mesh) + * MMG5_ARG_ppMet: next arg will be a pointer over a MMG5_pSol storing a metric + * &mmgSol: pointer toward your MMG5_pSol (that store your metric) */ + mmgMesh = NULL; + + MMG3D_Init_mesh(MMG5_ARG_start, + MMG5_ARG_ppMesh,&mmgMesh, + MMG5_ARG_end); + + + /** 2) Mesh loading depending on detected extension */ + ier = MMG3D_loadGenericMesh(mmgMesh,NULL,filein); + + if ( ier<1 ) { + if ( ier==0 ) { + fprintf(stderr," ** %s NOT FOUND.\n",filein); + fprintf(stderr," ** UNABLE TO OPEN INPUT FILE.\n"); + return EXIT_FAILURE; + } + } + + /** 3) Get the mesh from Mmg data structure into local data structure */ + + /** a) get the size of the mesh: np = #vertices, ne = #tetra, npr = #prisms, + * nt = #triangles, nq = #quadrangls, na = #edges */ + int np, ne, nt, na; + if ( MMG3D_Get_meshSize(mmgMesh,&np,&ne,NULL,&nt,NULL,&na) !=1 ) { + fprintf(stderr," ERROR: Unable to get mesh size.\n"); + return EXIT_FAILURE; + } + + /** b) get point coordinates and references: i^th point coordinates are stored + * in points[3*(i-1)]@3. Reference of this point is in ref[i-1] */ + double *points=NULL; // point coordinates + int *ref=NULL; // point references (==gmsh tags, ==colors) + + points = (double *)malloc(3*np*sizeof(double)); + assert(points); + ref = (int *)malloc(np*sizeof(int)); + assert(ref); + + ier = MMG3D_Get_vertices(mmgMesh,points, ref,NULL,NULL); + if ( !ier ) { + fprintf(stderr," ERROR: Unable to get mesh vertices.\n"); + return EXIT_FAILURE; + } + + /** c) get tetra and tetra references: i^th tetra vertices are stored + * in tetra[4*(i-1)]@4. Reference of this tetra is in tetref[i-1]*/ + int *tetref=NULL, *tetra=NULL; + + tetra = (int *)malloc(4*ne*sizeof(int)); + assert(tetra); + tetref = (int *)malloc(ne*sizeof(int)); + assert(tetref); + + ier = MMG3D_Get_tetrahedra(mmgMesh,tetra, tetref,NULL); + if ( !ier ) { + fprintf(stderr," ERROR: Unable to get mesh tetra.\n"); + return EXIT_FAILURE; + } + + /** ... etc... */ + + /** 4) Mesh saving at Medit format to check it */ + int k; + + if( !(inm = fopen(fileout_medit,"w")) ) { + fprintf(stderr," ** UNABLE TO OPEN OUTPUT MESH FILE.\n"); + exit(EXIT_FAILURE); + } + /* Header */ + fprintf(inm,"MeshVersionFormatted 2\n"); + fprintf(inm,"\nDimension 3\n"); + + /* Mesh vertices */ + fprintf(inm,"\nVertices\n%d\n",np); + for(k=1; k<=np; k++) { + int address = 3*(k-1); + fprintf(inm,"%.15lg %.15lg %.15lg %d \n",points[address],points[address+1],points[address+2],ref[k-1]); + } + + /* Mesh tetra */ + fprintf(inm,"\nTetrahedra\n%d\n",ne); + for(k=1; k<=ne; k++) { + int address = 4*(k-1); + fprintf(inm,"%d %d %d %d %d \n",tetra[address],tetra[address+1], + tetra[address+2],tetra[address+3],tetref[k-1]); + } + + fprintf(inm,"\nEnd\n"); + fclose(inm); + + /* Memory release */ + free(points); free(ref); + free(tetra); free(tetref); + free(fileout_medit); + fileout_medit = NULL; + + /** 5) get and print tetra adjacencies in terminal */ + for ( k=1; k<=ne; ++k ) { + int adja[4]; + ier = MMG3D_Get_adjaTet(mmgMesh,k,adja); + if ( !ier ) { + fprintf(stderr," ERROR: Unable to get adjacents of tetra %d.\n",k); + return EXIT_FAILURE; + } + + fprintf(stdout,"Tetra %d is adjacent to tetras %d %d %d %d\n", + k,adja[0],adja[1],adja[2],adja[3]); + } + + /** 6) Save output file depending on the detected extension */ + ier = MMG3D_saveGenericMesh(mmgMesh,NULL,fileout_generic); + + if ( ier<1 ) { + if ( ier==0 ) { + fprintf(stderr," ** %s NOT FOUND.\n",fileout_generic); + fprintf(stderr," ** UNABLE TO OPEN INPUT FILE.\n"); + return EXIT_FAILURE; + } + } + free(fileout_generic); + fileout_generic = NULL; + + /** 7) Free the MMG3D5 structures */ + MMG3D_Free_all(MMG5_ARG_start, + MMG5_ARG_ppMesh,&mmgMesh, + MMG5_ARG_end); + + return(EXIT_SUCCESS); +} From 342fc618309ea9409491e30fa1f2e0d66bcb72d7 Mon Sep 17 00:00:00 2001 From: Algiane Date: Wed, 24 Nov 2021 15:05:33 +0100 Subject: [PATCH 036/838] Add man pages installation. --- cmake/modules/mmg.cmake | 5 +++++ cmake/modules/mmg2d.cmake | 3 +++ cmake/modules/mmg3d.cmake | 2 ++ cmake/modules/mmgs.cmake | 3 +++ 4 files changed, 13 insertions(+) diff --git a/cmake/modules/mmg.cmake b/cmake/modules/mmg.cmake index 470905f4f..e0ee36193 100644 --- a/cmake/modules/mmg.cmake +++ b/cmake/modules/mmg.cmake @@ -105,6 +105,11 @@ IF ( LIBMMG_STATIC OR LIBMMG_SHARED ) SET(MMG3D_INCLUDE ${PROJECT_BINARY_DIR}/include/mmg/mmg3d ) SET(MMG_INCLUDE ${PROJECT_BINARY_DIR}/include/mmg ) + # install man pages + INSTALL(FILES ${PROJECT_SOURCE_DIR}/doc/man/mmg2d.1.gz DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) + INSTALL(FILES ${PROJECT_SOURCE_DIR}/doc/man/mmg3d.1.gz DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) + INSTALL(FILES ${PROJECT_SOURCE_DIR}/doc/man/mmgs.1.gz DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) + # Install header files in /usr/local or equivalent INSTALL(FILES ${mmg2d_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mmg/mmg2d) INSTALL(FILES ${mmgs_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mmg/mmgs) diff --git a/cmake/modules/mmg2d.cmake b/cmake/modules/mmg2d.cmake index 9e89764f2..83e212dd2 100644 --- a/cmake/modules/mmg2d.cmake +++ b/cmake/modules/mmg2d.cmake @@ -113,6 +113,9 @@ IF (NOT WIN32 OR MINGW) LIST(APPEND mmg2d_headers ${COMMON_BINARY_DIR}/git_log_mmg.h ) ENDIF() +# install man pages +INSTALL(FILES ${PROJECT_SOURCE_DIR}/doc/man/mmg2d.1.gz DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) + # Install header files in /usr/local or equivalent INSTALL(FILES ${mmg2d_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mmg/mmg2d COMPONENT headers ) diff --git a/cmake/modules/mmg3d.cmake b/cmake/modules/mmg3d.cmake index 53368f586..c9bda437b 100644 --- a/cmake/modules/mmg3d.cmake +++ b/cmake/modules/mmg3d.cmake @@ -140,6 +140,8 @@ IF (NOT WIN32 OR MINGW) LIST(APPEND mmg3d_headers ${COMMON_BINARY_DIR}/git_log_mmg.h ) ENDIF() +# install man pages +INSTALL(FILES ${PROJECT_SOURCE_DIR}/doc/man/mmg3d.1.gz DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) # Install header files in /usr/local or equivalent INSTALL(FILES ${mmg3d_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mmg/mmg3d COMPONENT headers) diff --git a/cmake/modules/mmgs.cmake b/cmake/modules/mmgs.cmake index d89ce4d39..8eb21f202 100644 --- a/cmake/modules/mmgs.cmake +++ b/cmake/modules/mmgs.cmake @@ -105,6 +105,9 @@ IF (NOT WIN32 OR MINGW) LIST(APPEND mmgs_headers ${COMMON_BINARY_DIR}/git_log_mmg.h ) ENDIF() +# install man pages +INSTALL(FILES ${PROJECT_SOURCE_DIR}/doc/man/mmgs.1.gz DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) + # Install header files in /usr/local or equivalent INSTALL(FILES ${mmgs_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mmg/mmgs COMPONENT headers) From 1bf46d46c29271f7e335d6abe7b818b6a61523b9 Mon Sep 17 00:00:00 2001 From: Francesco Brarda Date: Thu, 25 Nov 2021 10:27:57 +0100 Subject: [PATCH 037/838] New branch for MMG_int --- CMakeLists.txt | 18 +- src/common/mmgcmakedefines.h.in | 2 + src/mmg2d/API_functions_2d.c | 216 ++++++++++----------- src/mmg2d/API_functionsf_2d.c | 236 +++++++++++------------ src/mmg2d/analys_2d.c | 20 +- src/mmg2d/anisomovpt_2d.c | 4 +- src/mmg2d/anisosiz_2d.c | 20 +- src/mmg2d/bezier_2d.c | 4 +- src/mmg2d/boulep_2d.c | 16 +- src/mmg2d/cenrad_2d.c | 2 +- src/mmg2d/chkmsh_2d.c | 18 +- src/mmg2d/colver_2d.c | 16 +- src/mmg2d/delone_2d.c | 18 +- src/mmg2d/enforcement_2d.c | 8 +- src/mmg2d/hash_2d.c | 42 ++--- src/mmg2d/inout_2d.c | 106 +++++------ src/mmg2d/inoutcpp_2d.cpp | 42 ++--- src/mmg2d/intmet_2d.c | 10 +- src/mmg2d/isosiz_2d.c | 12 +- src/mmg2d/length_2d.c | 8 +- src/mmg2d/libmmg2d.c | 22 +-- src/mmg2d/libmmg2d.h | 250 ++++++++++++------------- src/mmg2d/libmmg2d_tools.c | 38 ++-- src/mmg2d/libmmg2d_toolsf.c | 20 +- src/mmg2d/libmmg2df.c | 8 +- src/mmg2d/libmmg2df.h | 142 +++++++------- src/mmg2d/lissmet_2d.c | 4 +- src/mmg2d/locate_2d.c | 24 +-- src/mmg2d/mmg2d.c | 24 +-- src/mmg2d/mmg2d.h | 322 ++++++++++++++++---------------- src/mmg2d/mmg2d1.c | 38 ++-- src/mmg2d/mmg2d2.c | 38 ++-- src/mmg2d/mmg2d6.c | 46 ++--- src/mmg2d/mmg2d9.c | 40 ++-- src/mmg2d/mmg2dexterns.c | 10 +- src/mmg2d/mmg2dexterns.h | 10 +- src/mmg2d/movpt_2d.c | 8 +- src/mmg2d/quality_2d.c | 12 +- src/mmg2d/scalem_2d.c | 4 +- src/mmg2d/solmap_2d.c | 6 +- src/mmg2d/split_2d.c | 40 ++-- src/mmg2d/swapar_2d.c | 14 +- src/mmg2d/tools_2d.c | 10 +- src/mmg2d/variadic_2d.c | 36 ++-- src/mmg2d/velextls_2d.c | 26 +-- src/mmg2d/zaldy_2d.c | 38 ++-- 46 files changed, 1033 insertions(+), 1015 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6639ab253..d3a3642b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,7 +70,7 @@ SET (CMAKE_RELEASE_VERSION ##### ############################################################################### IF (NOT WIN32) - # Set preprocessor flags to say that we are posix and gnu compatible +# Set preprocessor flags to say that we are posix and gnu compatible SET (DEF_POSIX "#define MMG_POSIX") SET (DEF_GNU "#define MMG_GNU") ELSEIF(MINGW) @@ -83,6 +83,21 @@ if ( MSVC ) add_definitions(-Dstrdup=_strdup) endif() +############################################################################ +##### +##### Integer type +##### +############################################################################ + +# type of integer + +SET (MMG_INT "int32_t" CACHE STRING "Integer type") +IF (${MMG_INT} STREQUAL "int64_t") + SET ( DEF_MMG_INT "#define MMG_int int64_t") +ELSE () + SET ( DEF_MMG_INT "#define MMG_int int32_t") +ENDIF () + # Create mmgcmakedefines.h file with the architecture infos and # the definition ot the USE_POINTMAP flag. CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/src/common/mmgcmakedefines.h.in @@ -228,6 +243,7 @@ IF ( NOT (WIN32 OR MINGW) ) SET( LIBRARIES ${M_LIB} ${LIBRARIES}) ENDIF() + ############################################################################ ##### ##### Point map diff --git a/src/common/mmgcmakedefines.h.in b/src/common/mmgcmakedefines.h.in index ca0ba2c40..a37d16404 100644 --- a/src/common/mmgcmakedefines.h.in +++ b/src/common/mmgcmakedefines.h.in @@ -27,6 +27,8 @@ @DEF_POSIX@ @DEF_GNU@ +@DEF_MMG_INT@ + #cmakedefine USE_POINTMAP /*!< Flag to enable and export the pointmap used */ #endif diff --git a/src/mmg2d/API_functions_2d.c b/src/mmg2d/API_functions_2d.c index d34288a54..9ce3f7214 100644 --- a/src/mmg2d/API_functions_2d.c +++ b/src/mmg2d/API_functions_2d.c @@ -40,9 +40,9 @@ #include "mmg2d.h" -int MMG2D_Init_mesh(const int starter,...) { +MMG_int MMG2D_Init_mesh(const MMG_int starter,...) { va_list argptr; - int ier; + MMG_int ier; va_start(argptr, starter); @@ -60,21 +60,21 @@ void MMG2D_Init_fileNames(MMG5_pMesh mesh,MMG5_pSol sol return; } -int MMG2D_Set_inputMeshName(MMG5_pMesh mesh, const char* meshin) { +MMG_int MMG2D_Set_inputMeshName(MMG5_pMesh mesh, const char* meshin) { return MMG5_Set_inputMeshName(mesh,meshin); } -int MMG2D_Set_inputSolName(MMG5_pMesh mesh,MMG5_pSol sol, const char* solin) { +MMG_int MMG2D_Set_inputSolName(MMG5_pMesh mesh,MMG5_pSol sol, const char* solin) { return MMG5_Set_inputSolName(mesh,sol,solin); } -int MMG2D_Set_outputMeshName(MMG5_pMesh mesh, const char* meshout) { +MMG_int MMG2D_Set_outputMeshName(MMG5_pMesh mesh, const char* meshout) { return MMG5_Set_outputMeshName(mesh,meshout); } -int MMG2D_Set_outputSolName(MMG5_pMesh mesh,MMG5_pSol sol, const char* solout) { +MMG_int MMG2D_Set_outputSolName(MMG5_pMesh mesh,MMG5_pSol sol, const char* solout) { return MMG5_Set_outputSolName(mesh,sol,solout); } void MMG2D_Init_parameters(MMG5_pMesh mesh) { @@ -100,8 +100,8 @@ void MMG2D_Init_parameters(MMG5_pMesh mesh) { mesh->info.dhd = MMG5_ANGEDG; } -int MMG2D_Set_iparameter(MMG5_pMesh mesh, MMG5_pSol sol, int iparam, int val){ - int k; +MMG_int MMG2D_Set_iparameter(MMG5_pMesh mesh, MMG5_pSol sol, MMG_int iparam, MMG_int val){ + MMG_int k; switch ( iparam ) { /* Integer parameters */ @@ -243,7 +243,7 @@ int MMG2D_Set_iparameter(MMG5_pMesh mesh, MMG5_pSol sol, int iparam, int val){ return 1; } -int MMG2D_Set_dparameter(MMG5_pMesh mesh, MMG5_pSol sol, int dparam, double val){ +MMG_int MMG2D_Set_dparameter(MMG5_pMesh mesh, MMG5_pSol sol, MMG_int dparam, double val){ switch ( dparam ) { /* double parameters */ @@ -311,10 +311,10 @@ int MMG2D_Set_dparameter(MMG5_pMesh mesh, MMG5_pSol sol, int dparam, double val) return 1; } -int MMG2D_Set_localParameter(MMG5_pMesh mesh,MMG5_pSol sol, int typ, int ref, +MMG_int MMG2D_Set_localParameter(MMG5_pMesh mesh,MMG5_pSol sol, MMG_int typ, MMG_int ref, double hmin,double hmax,double hausd){ MMG5_pPar par; - int k; + MMG_int k; if ( !mesh->info.npar ) { fprintf(stderr,"\n ## Error: %s: You must set the number of local" @@ -384,13 +384,13 @@ int MMG2D_Set_localParameter(MMG5_pMesh mesh,MMG5_pSol sol, int typ, int ref, return 1; } -int MMG2D_Set_multiMat(MMG5_pMesh mesh,MMG5_pSol sol,int ref, - int split,int rin,int rout){ +MMG_int MMG2D_Set_multiMat(MMG5_pMesh mesh,MMG5_pSol sol,MMG_int ref, + MMG_int split,MMG_int rin,MMG_int rout){ return MMG5_Set_multiMat(mesh,sol,ref,split,rin,rout); } -int MMG2D_Set_meshSize(MMG5_pMesh mesh, int np, int nt, int nquad, int na) { +MMG_int MMG2D_Set_meshSize(MMG5_pMesh mesh, MMG_int np, MMG_int nt, MMG_int nquad, MMG_int na) { if ( ( (mesh->info.imprim > 5) || mesh->info.ddebug ) && ( mesh->point || mesh->tria || mesh->edge) ) @@ -432,7 +432,7 @@ int MMG2D_Set_meshSize(MMG5_pMesh mesh, int np, int nt, int nquad, int na) { return 1; } -int MMG2D_Set_solSize(MMG5_pMesh mesh, MMG5_pSol sol, int typEntity, int np, int typSol) { +MMG_int MMG2D_Set_solSize(MMG5_pMesh mesh, MMG5_pSol sol, MMG_int typEntity, MMG_int np, MMG_int typSol) { if ( ( (mesh->info.imprim > 5) || mesh->info.ddebug ) && sol->m ) fprintf(stderr,"\n ## Warning: %s: old solution deletion.\n",__func__); @@ -476,11 +476,11 @@ int MMG2D_Set_solSize(MMG5_pMesh mesh, MMG5_pSol sol, int typEntity, int np, int return 1; } -int MMG2D_Set_solsAtVerticesSize(MMG5_pMesh mesh, MMG5_pSol *sol,int nsols, - int np, int *typSol) { +MMG_int MMG2D_Set_solsAtVerticesSize(MMG5_pMesh mesh, MMG5_pSol *sol,MMG_int nsols, + MMG_int np, MMG_int *typSol) { MMG5_pSol psl; char data[18]; - int j; + MMG_int j; if ( ( (mesh->info.imprim > 5) || mesh->info.ddebug ) && mesh->nsols ) { if ( *sol ) { @@ -521,8 +521,8 @@ int MMG2D_Set_solsAtVerticesSize(MMG5_pMesh mesh, MMG5_pSol *sol,int nsols, return 1; } -int MMG2D_Get_solSize(MMG5_pMesh mesh, MMG5_pSol sol, int* typEntity, int* np, - int* typSol) { +MMG_int MMG2D_Get_solSize(MMG5_pMesh mesh, MMG5_pSol sol, MMG_int* typEntity, MMG_int* np, + MMG_int* typSol) { if ( typEntity != NULL ) *typEntity = MMG5_Vertex; @@ -546,10 +546,10 @@ int MMG2D_Get_solSize(MMG5_pMesh mesh, MMG5_pSol sol, int* typEntity, int* np, return 1; } -int MMG2D_Get_solsAtVerticesSize(MMG5_pMesh mesh, MMG5_pSol *sol, int *nsols, - int* np, int* typSol) { +MMG_int MMG2D_Get_solsAtVerticesSize(MMG5_pMesh mesh, MMG5_pSol *sol, MMG_int *nsols, + MMG_int* np, MMG_int* typSol) { MMG5_pSol psl; - int j; + MMG_int j; if ( !mesh ) { fprintf(stderr,"\n ## Error: %s: your mesh structure must be allocated" @@ -575,8 +575,8 @@ int MMG2D_Get_solsAtVerticesSize(MMG5_pMesh mesh, MMG5_pSol *sol, int *nsols, return 1; } -int MMG2D_Get_meshSize(MMG5_pMesh mesh, int* np, int* nt, int* nquad, int* na) { - int k; +MMG_int MMG2D_Get_meshSize(MMG5_pMesh mesh, MMG_int* np, MMG_int* nt, MMG_int* nquad, MMG_int* na) { + MMG_int k; if ( np != NULL ) *np = mesh->np; @@ -599,7 +599,7 @@ int MMG2D_Get_meshSize(MMG5_pMesh mesh, int* np, int* nt, int* nquad, int* na) { return 1; } -int MMG2D_Set_vertex(MMG5_pMesh mesh, double c0, double c1, int ref, int pos) { +MMG_int MMG2D_Set_vertex(MMG5_pMesh mesh, double c0, double c1, MMG_int ref, MMG_int pos) { if ( !mesh->np ) { fprintf(stderr,"\n ## Error: %s: you must set the number of points with the", @@ -639,33 +639,33 @@ int MMG2D_Set_vertex(MMG5_pMesh mesh, double c0, double c1, int ref, int pos) { return 1; } -int MMG2D_Set_corner(MMG5_pMesh mesh, int k) { +MMG_int MMG2D_Set_corner(MMG5_pMesh mesh, MMG_int k) { assert ( k <= mesh->np ); mesh->point[k].tag |= MG_CRN; return 1; } -int MMG2D_Unset_corner(MMG5_pMesh mesh, int k) { +MMG_int MMG2D_Unset_corner(MMG5_pMesh mesh, MMG_int k) { assert ( k <= mesh->np ); mesh->point[k].tag &= ~MG_CRN; return 1; } -int MMG2D_Set_requiredVertex(MMG5_pMesh mesh, int k) { +MMG_int MMG2D_Set_requiredVertex(MMG5_pMesh mesh, MMG_int k) { assert ( k <= mesh->np ); mesh->point[k].tag |= MG_REQ; mesh->point[k].tag &= ~MG_NUL; return 1; } -int MMG2D_Unset_requiredVertex(MMG5_pMesh mesh, int k) { +MMG_int MMG2D_Unset_requiredVertex(MMG5_pMesh mesh, MMG_int k) { assert ( k <= mesh->np ); mesh->point[k].tag &= ~MG_REQ; return 1; } -int MMG2D_Get_vertex(MMG5_pMesh mesh, double* c0, double* c1, int* ref, - int* isCorner, int* isRequired) { +MMG_int MMG2D_Get_vertex(MMG5_pMesh mesh, double* c0, double* c1, MMG_int* ref, + MMG_int* isCorner, MMG_int* isRequired) { if ( mesh->npi == mesh->np ) { mesh->npi = 0; @@ -691,8 +691,8 @@ int MMG2D_Get_vertex(MMG5_pMesh mesh, double* c0, double* c1, int* ref, return MMG2D_GetByIdx_vertex( mesh,c0,c1,ref,isCorner,isRequired,mesh->npi); } -int MMG2D_GetByIdx_vertex(MMG5_pMesh mesh, double* c0, double* c1, int* ref, - int* isCorner, int* isRequired, int idx) { +MMG_int MMG2D_GetByIdx_vertex(MMG5_pMesh mesh, double* c0, double* c1, MMG_int* ref, + MMG_int* isCorner, MMG_int* isRequired, MMG_int idx) { if ( idx < 1 || idx > mesh->np ) { fprintf(stderr,"\n ## Error: %s: unable to get point at position %d.\n", @@ -723,9 +723,9 @@ int MMG2D_GetByIdx_vertex(MMG5_pMesh mesh, double* c0, double* c1, int* ref, return 1; } -int MMG2D_Set_vertices(MMG5_pMesh mesh, double *vertices,int *refs) { +MMG_int MMG2D_Set_vertices(MMG5_pMesh mesh, double *vertices,MMG_int *refs) { MMG5_pPoint ppt; - int i,j; + MMG_int i,j; /*coordinates vertices*/ for (i=1;i<=mesh->np;i++) @@ -751,10 +751,10 @@ int MMG2D_Set_vertices(MMG5_pMesh mesh, double *vertices,int *refs) { return 1; } -int MMG2D_Get_vertices(MMG5_pMesh mesh, double* vertices, int* refs, - int* areCorners, int* areRequired) { +MMG_int MMG2D_Get_vertices(MMG5_pMesh mesh, double* vertices, MMG_int* refs, + MMG_int* areCorners, MMG_int* areRequired) { MMG5_pPoint ppt; - int i,j; + MMG_int i,j; for (i=1;i<=mesh->np;i++) { @@ -786,11 +786,11 @@ int MMG2D_Get_vertices(MMG5_pMesh mesh, double* vertices, int* refs, return 1; } -int MMG2D_Set_triangle(MMG5_pMesh mesh, int v0, int v1, int v2, int ref, int pos) { +MMG_int MMG2D_Set_triangle(MMG5_pMesh mesh, MMG_int v0, MMG_int v1, MMG_int v2, MMG_int ref, MMG_int pos) { MMG5_pPoint ppt; MMG5_pTria pt; double vol; - int i,j,ip,tmp; + MMG_int i,j,ip,tmp; if ( !mesh->nt ) { fprintf(stderr," ## Error: %s: You must set the number of elements with the", @@ -861,7 +861,7 @@ int MMG2D_Set_triangle(MMG5_pMesh mesh, int v0, int v1, int v2, int ref, int pos return 1; } -int MMG2D_Set_requiredTriangle(MMG5_pMesh mesh, int k) { +MMG_int MMG2D_Set_requiredTriangle(MMG5_pMesh mesh, MMG_int k) { MMG5_pTria pt; assert ( k <= mesh->nt ); @@ -874,7 +874,7 @@ int MMG2D_Set_requiredTriangle(MMG5_pMesh mesh, int k) { return 1; } -int MMG2D_Unset_requiredTriangle(MMG5_pMesh mesh, int k) { +MMG_int MMG2D_Unset_requiredTriangle(MMG5_pMesh mesh, MMG_int k) { MMG5_pTria pt; assert ( k <= mesh->nt ); @@ -887,8 +887,8 @@ int MMG2D_Unset_requiredTriangle(MMG5_pMesh mesh, int k) { return 1; } -int MMG2D_Get_triangle(MMG5_pMesh mesh, int* v0, int* v1, int* v2, int* ref - ,int* isRequired) { +MMG_int MMG2D_Get_triangle(MMG5_pMesh mesh, MMG_int* v0, MMG_int* v1, MMG_int* v2, MMG_int* ref + ,MMG_int* isRequired) { MMG5_pTria ptt; if ( mesh->nti == mesh->nt ) { @@ -932,11 +932,11 @@ int MMG2D_Get_triangle(MMG5_pMesh mesh, int* v0, int* v1, int* v2, int* ref return 1; } -int MMG2D_Set_triangles(MMG5_pMesh mesh, int *tria, int *refs) { +MMG_int MMG2D_Set_triangles(MMG5_pMesh mesh, MMG_int *tria, MMG_int *refs) { MMG5_pPoint ppt; MMG5_pTria ptt; double vol; - int i, j,ip,tmp; + MMG_int i, j,ip,tmp; mesh->xt = 0; for (i=1;i<=mesh->nt;i++) @@ -953,7 +953,7 @@ int MMG2D_Set_triangles(MMG5_pMesh mesh, int *tria, int *refs) { mesh->point[ptt->v[1]].tag &= ~MG_NUL; mesh->point[ptt->v[2]].tag &= ~MG_NUL; - int ii; + MMG_int ii; for( ii=0 ; ii<3 ; ii++) ptt->edg[ii] = 0; @@ -965,7 +965,7 @@ int MMG2D_Set_triangles(MMG5_pMesh mesh, int *tria, int *refs) { __func__,i); for ( ip=0; ip<3; ip++ ) { ppt = &mesh->point[ptt->v[ip]]; - int jj; + MMG_int jj; for ( jj=0; jj<3; jj++ ) { if ( fabs(ppt->c[jj])>0. ) { fprintf(stderr," Check that you don't have a sliver triangle.\n"); @@ -989,10 +989,10 @@ int MMG2D_Set_triangles(MMG5_pMesh mesh, int *tria, int *refs) { return 1; } -int MMG2D_Get_triangles(MMG5_pMesh mesh, int* tria, int* refs, - int* areRequired) { +MMG_int MMG2D_Get_triangles(MMG5_pMesh mesh, MMG_int* tria, MMG_int* refs, + MMG_int* areRequired) { MMG5_pTria ptt; - int i, j; + MMG_int i, j; for (i=1;i<=mesh->nt;i++) { @@ -1015,7 +1015,7 @@ int MMG2D_Get_triangles(MMG5_pMesh mesh, int* tria, int* refs, return 1; } -int MMG2D_Set_quadrilateral(MMG5_pMesh mesh, int v0, int v1, int v2, int v3, int ref, int pos) { +MMG_int MMG2D_Set_quadrilateral(MMG5_pMesh mesh, MMG_int v0, MMG_int v1, MMG_int v2, MMG_int v3, MMG_int ref, MMG_int pos) { MMG5_pQuad pq; if ( !mesh->nquad ) { @@ -1049,9 +1049,9 @@ int MMG2D_Set_quadrilateral(MMG5_pMesh mesh, int v0, int v1, int v2, int v3, int return 1; } -int MMG2D_Get_quadrilateral(MMG5_pMesh mesh, int* v0, int* v1, int* v2, int* v3, - int* ref, int* isRequired) { - static int nqi = 0; +MMG_int MMG2D_Get_quadrilateral(MMG5_pMesh mesh, MMG_int* v0, MMG_int* v1, MMG_int* v2, MMG_int* v3, + MMG_int* ref, MMG_int* isRequired) { + static MMG_int nqi = 0; if ( nqi == mesh->nquad ) { nqi = 0; @@ -1095,9 +1095,9 @@ int MMG2D_Get_quadrilateral(MMG5_pMesh mesh, int* v0, int* v1, int* v2, int* v3, return 1; } -int MMG2D_Set_quadrilaterals(MMG5_pMesh mesh, int *quadra, int *refs) { +MMG_int MMG2D_Set_quadrilaterals(MMG5_pMesh mesh, MMG_int *quadra, MMG_int *refs) { MMG5_pQuad pq; - int i,j; + MMG_int i,j; for (i=1;i<=mesh->nquad;i++) { @@ -1120,9 +1120,9 @@ int MMG2D_Set_quadrilaterals(MMG5_pMesh mesh, int *quadra, int *refs) { return 1; } -int MMG2D_Get_quadrilaterals(MMG5_pMesh mesh, int *quadra, int *refs, int * areRequired) { +MMG_int MMG2D_Get_quadrilaterals(MMG5_pMesh mesh, MMG_int *quadra, MMG_int *refs, MMG_int * areRequired) { MMG5_pQuad pq; - int i, j; + MMG_int i, j; for (i=1;i<=mesh->nquad;i++) { @@ -1150,7 +1150,7 @@ int MMG2D_Get_quadrilaterals(MMG5_pMesh mesh, int *quadra, int *refs, int * are } -int MMG2D_Set_edge(MMG5_pMesh mesh, int v0, int v1, int ref, int pos) { +MMG_int MMG2D_Set_edge(MMG5_pMesh mesh, MMG_int v0, MMG_int v1, MMG_int ref, MMG_int pos) { MMG5_pEdge pt; if ( !mesh->na ) { @@ -1181,7 +1181,7 @@ int MMG2D_Set_edge(MMG5_pMesh mesh, int v0, int v1, int ref, int pos) { return 1; } -int MMG2D_Set_requiredEdge(MMG5_pMesh mesh, int k) { +MMG_int MMG2D_Set_requiredEdge(MMG5_pMesh mesh, MMG_int k) { MMG5_pEdge ped; assert ( k <= mesh->na ); @@ -1193,7 +1193,7 @@ int MMG2D_Set_requiredEdge(MMG5_pMesh mesh, int k) { return 1; } -int MMG2D_Unset_requiredEdge(MMG5_pMesh mesh, int k) { +MMG_int MMG2D_Unset_requiredEdge(MMG5_pMesh mesh, MMG_int k) { MMG5_pEdge ped; assert ( k <= mesh->na ); @@ -1205,7 +1205,7 @@ int MMG2D_Unset_requiredEdge(MMG5_pMesh mesh, int k) { return 1; } -int MMG2D_Set_parallelEdge(MMG5_pMesh mesh, int k) { +MMG_int MMG2D_Set_parallelEdge(MMG5_pMesh mesh, MMG_int k) { MMG5_pPoint ppt; MMG5_pEdge ped; @@ -1223,8 +1223,8 @@ int MMG2D_Set_parallelEdge(MMG5_pMesh mesh, int k) { return 1; } -int MMG2D_Get_edge(MMG5_pMesh mesh, int* e0, int* e1, int* ref - ,int* isRidge, int* isRequired) { +MMG_int MMG2D_Get_edge(MMG5_pMesh mesh, MMG_int* e0, MMG_int* e1, MMG_int* ref + ,MMG_int* isRidge, MMG_int* isRequired) { MMG5_pEdge ped; if ( mesh->nai == mesh->na ) { @@ -1279,8 +1279,8 @@ int MMG2D_Get_edge(MMG5_pMesh mesh, int* e0, int* e1, int* ref return 1; } -int MMG2D_Set_edges(MMG5_pMesh mesh, int *edges, int *refs) { - int i,j; +MMG_int MMG2D_Set_edges(MMG5_pMesh mesh, MMG_int *edges, MMG_int *refs) { + MMG_int i,j; for (i=1;i<=mesh->na;i++) { @@ -1299,8 +1299,8 @@ int MMG2D_Set_edges(MMG5_pMesh mesh, int *edges, int *refs) { return 1; } -int MMG2D_Get_edges(MMG5_pMesh mesh, int* edges,int *refs,int* areRidges,int* areRequired) { - int i,j; +MMG_int MMG2D_Get_edges(MMG5_pMesh mesh, MMG_int* edges,MMG_int *refs,MMG_int* areRidges,MMG_int* areRequired) { + MMG_int i,j; for (i=1;i<=mesh->na;i++) { @@ -1329,7 +1329,7 @@ int MMG2D_Get_edges(MMG5_pMesh mesh, int* edges,int *refs,int* areRidges,int* ar return 1; } -double MMG2D_Get_triangleQuality(MMG5_pMesh mesh,MMG5_pSol met, int k) { +double MMG2D_Get_triangleQuality(MMG5_pMesh mesh,MMG5_pSol met, MMG_int k) { double qual = 0.; MMG5_pTria pt; @@ -1353,7 +1353,7 @@ double MMG2D_Get_triangleQuality(MMG5_pMesh mesh,MMG5_pSol met, int k) { return qual; } -int MMG2D_Set_scalarSol(MMG5_pSol met, double s, int pos) { +MMG_int MMG2D_Set_scalarSol(MMG5_pSol met, double s, MMG_int pos) { if ( !met->np ) { fprintf(stderr,"\n ## Error: %s: You must set the number of" @@ -1383,9 +1383,9 @@ int MMG2D_Set_scalarSol(MMG5_pSol met, double s, int pos) { return 1; } -int MMG2D_Get_scalarSol(MMG5_pSol met, double* s) +MMG_int MMG2D_Get_scalarSol(MMG5_pSol met, double* s) { - int ddebug = 0; + MMG_int ddebug = 0; if ( met->npi == met->np ) { met->npi = 0; @@ -1414,8 +1414,8 @@ int MMG2D_Get_scalarSol(MMG5_pSol met, double* s) return 1; } -int MMG2D_Set_scalarSols(MMG5_pSol met, double *s) { - int k; +MMG_int MMG2D_Set_scalarSols(MMG5_pSol met, double *s) { + MMG_int k; if ( !met->np ) { fprintf(stderr,"\n ## Error: %s: you must set the number of" @@ -1431,8 +1431,8 @@ int MMG2D_Set_scalarSols(MMG5_pSol met, double *s) { return 1; } -int MMG2D_Get_scalarSols(MMG5_pSol met, double* s) { - int k; +MMG_int MMG2D_Get_scalarSols(MMG5_pSol met, double* s) { + MMG_int k; for ( k=0; knp; ++k ) s[k] = met->m[k+1]; @@ -1440,8 +1440,8 @@ int MMG2D_Get_scalarSols(MMG5_pSol met, double* s) { return 1; } -int MMG2D_Set_vectorSol(MMG5_pSol met, double vx,double vy, int pos) { - int isol; +MMG_int MMG2D_Set_vectorSol(MMG5_pSol met, double vx,double vy, MMG_int pos) { + MMG_int isol; if ( !met->np ) { fprintf(stderr,"\n ## Error: %s: you must set the number of" @@ -1481,9 +1481,9 @@ int MMG2D_Set_vectorSol(MMG5_pSol met, double vx,double vy, int pos) { } -int MMG2D_Get_vectorSol(MMG5_pSol met, double* vx, double* vy) { +MMG_int MMG2D_Get_vectorSol(MMG5_pSol met, double* vx, double* vy) { - int ddebug = 0; + MMG_int ddebug = 0; if ( met->npi == met->np ) { met->npi = 0; @@ -1512,9 +1512,9 @@ int MMG2D_Get_vectorSol(MMG5_pSol met, double* vx, double* vy) { return 1; } -int MMG2D_Set_vectorSols(MMG5_pSol met, double *sols) { +MMG_int MMG2D_Set_vectorSols(MMG5_pSol met, double *sols) { double *m; - int k,j; + MMG_int k,j; if ( !met->np ) { fprintf(stderr,"\n ## Error: %s: you must set the number of" @@ -1534,9 +1534,9 @@ int MMG2D_Set_vectorSols(MMG5_pSol met, double *sols) { return 1; } -int MMG2D_Get_vectorSols(MMG5_pSol met, double* sols) { +MMG_int MMG2D_Get_vectorSols(MMG5_pSol met, double* sols) { double *m; - int k, j; + MMG_int k, j; for ( k=0; knp; ++k ) { j = 2*k; @@ -1550,9 +1550,9 @@ int MMG2D_Get_vectorSols(MMG5_pSol met, double* sols) { } -int MMG2D_Set_tensorSol(MMG5_pSol met, double m11, double m12, double m22, - int pos) { - int isol; +MMG_int MMG2D_Set_tensorSol(MMG5_pSol met, double m11, double m12, double m22, + MMG_int pos) { + MMG_int isol; if ( !met->np ) { fprintf(stderr,"\n ## Error: %s: you must set the number of" @@ -1584,10 +1584,10 @@ int MMG2D_Set_tensorSol(MMG5_pSol met, double m11, double m12, double m22, return 1; } -int MMG2D_Get_tensorSol(MMG5_pSol met, double *m11,double *m12,double *m22) +MMG_int MMG2D_Get_tensorSol(MMG5_pSol met, double *m11,double *m12,double *m22) { - int ddebug = 0; - int isol; + MMG_int ddebug = 0; + MMG_int isol; if ( met->npi == met->np ) { met->npi = 0; @@ -1618,9 +1618,9 @@ int MMG2D_Get_tensorSol(MMG5_pSol met, double *m11,double *m12,double *m22) return 1; } -int MMG2D_Set_tensorSols(MMG5_pSol met, double *sols) { +MMG_int MMG2D_Set_tensorSols(MMG5_pSol met, double *sols) { double *m; - int k,j; + MMG_int k,j; if ( !met->np ) { fprintf(stderr,"\n ## Error: %s: You must set the number" @@ -1641,9 +1641,9 @@ int MMG2D_Set_tensorSols(MMG5_pSol met, double *sols) { return 1; } -int MMG2D_Get_tensorSols(MMG5_pSol met, double *sols) { +MMG_int MMG2D_Get_tensorSols(MMG5_pSol met, double *sols) { double *m; - int k,j; + MMG_int k,j; for ( k=0; knp; ++k ) { j = 3*k; @@ -1657,7 +1657,7 @@ int MMG2D_Get_tensorSols(MMG5_pSol met, double *sols) { return 1; } -int MMG2D_Set_ithSols_inSolsAtVertices(MMG5_pSol sol,int i, double *s) { +MMG_int MMG2D_Set_ithSols_inSolsAtVertices(MMG5_pSol sol,MMG_int i, double *s) { MMG5_pSol psl; /* Warning: users give indices from 1 to nsols */ @@ -1685,7 +1685,7 @@ int MMG2D_Set_ithSols_inSolsAtVertices(MMG5_pSol sol,int i, double *s) { return 1; } -int MMG2D_Get_ithSols_inSolsAtVertices(MMG5_pSol sol,int i, double *s) { +MMG_int MMG2D_Get_ithSols_inSolsAtVertices(MMG5_pSol sol,MMG_int i, double *s) { MMG5_pSol psl; /* Warning: users give indices from 1 to nsols */ @@ -1713,7 +1713,7 @@ int MMG2D_Get_ithSols_inSolsAtVertices(MMG5_pSol sol,int i, double *s) { return 1; } -int MMG2D_Set_ithSol_inSolsAtVertices(MMG5_pSol sol,int i, double* s,int pos) { +MMG_int MMG2D_Set_ithSol_inSolsAtVertices(MMG5_pSol sol,MMG_int i, double* s,MMG_int pos) { MMG5_pSol psl; /* Warning: users give indices from 1 to nsols */ @@ -1740,7 +1740,7 @@ int MMG2D_Set_ithSol_inSolsAtVertices(MMG5_pSol sol,int i, double* s,int pos) { return 1; } -int MMG2D_Get_ithSol_inSolsAtVertices(MMG5_pSol sol,int i, double *s,int pos) { +MMG_int MMG2D_Get_ithSol_inSolsAtVertices(MMG5_pSol sol,MMG_int i, double *s,MMG_int pos) { MMG5_pSol psl; /* Warning: users give indices from 1 to nsols */ @@ -1770,7 +1770,7 @@ int MMG2D_Get_ithSol_inSolsAtVertices(MMG5_pSol sol,int i, double *s,int pos) { return 1; } -int MMG2D_Chk_meshData(MMG5_pMesh mesh,MMG5_pSol met) { +MMG_int MMG2D_Chk_meshData(MMG5_pMesh mesh,MMG5_pSol met) { if ( (mesh->npi != mesh->np) || (mesh->nti != mesh->nt) ) { fprintf(stderr,"\n ## Error: %s: if you don't use the MMG2D_loadMesh function,", @@ -1815,16 +1815,16 @@ int MMG2D_Chk_meshData(MMG5_pMesh mesh,MMG5_pSol met) { return 1; } -int MMG2D_Free_allSols(MMG5_pMesh mesh,MMG5_pSol *sol) { +MMG_int MMG2D_Free_allSols(MMG5_pMesh mesh,MMG5_pSol *sol) { return MMG5_Free_allSols(mesh,sol); } -int MMG2D_Free_all(const int starter,...) +MMG_int MMG2D_Free_all(const MMG_int starter,...) { va_list argptr; - int ier; + MMG_int ier; va_start(argptr, starter); @@ -1835,9 +1835,9 @@ int MMG2D_Free_all(const int starter,...) return ier; } -int MMG2D_Free_structures(const int starter,...) +MMG_int MMG2D_Free_structures(const MMG_int starter,...) { - int ier; + MMG_int ier; va_list argptr; @@ -1850,10 +1850,10 @@ int MMG2D_Free_structures(const int starter,...) return ier; } -int MMG2D_Free_names(const int starter,...) +MMG_int MMG2D_Free_names(const MMG_int starter,...) { va_list argptr; - int ier; + MMG_int ier; va_start(argptr, starter); diff --git a/src/mmg2d/API_functionsf_2d.c b/src/mmg2d/API_functionsf_2d.c index be8282241..257f41a6c 100644 --- a/src/mmg2d/API_functionsf_2d.c +++ b/src/mmg2d/API_functionsf_2d.c @@ -42,9 +42,9 @@ * See \ref MMG2D_Init_mesh function in common/libmmgcommon.h file. */ FORTRAN_VARIADIC ( MMG2D_INIT_MESH, mmg2d_init_mesh, - (const int starter, ... ), + (const MMG_int starter, ... ), va_list argptr; - int ier; + MMG_int ier; va_start(argptr, starter); @@ -77,7 +77,7 @@ FORTRAN_NAME(MMG2D_INIT_PARAMETERS, mmg2d_init_parameters,(MMG5_pMesh *mesh), * See \ref MMG2D_Set_inputMeshName function in \ref common/libmmgcommon.h file. */ FORTRAN_NAME(MMG2D_SET_INPUTMESHNAME, mmg2d_set_inputmeshname, - (MMG5_pMesh *mesh, char* meshin, int *strlen0, int* retval), + (MMG5_pMesh *mesh, char* meshin, MMG_int *strlen0, MMG_int* retval), (mesh,meshin,strlen0,retval)) { char *tmp = NULL; @@ -94,7 +94,7 @@ FORTRAN_NAME(MMG2D_SET_INPUTMESHNAME, mmg2d_set_inputmeshname, * See \ref MMG2D_Set_inputSolName function in \ref common/libmmgcommon.h file. */ FORTRAN_NAME(MMG2D_SET_INPUTSOLNAME, mmg2d_set_inputsolname, - (MMG5_pMesh *mesh,MMG5_pSol *sol, char* solin, int* strlen0, int* retval), + (MMG5_pMesh *mesh,MMG5_pSol *sol, char* solin, MMG_int* strlen0, MMG_int* retval), (mesh,sol,solin,strlen0,retval)) { char *tmp = NULL; @@ -113,7 +113,7 @@ FORTRAN_NAME(MMG2D_SET_INPUTSOLNAME, mmg2d_set_inputsolname, * mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SET_OUTPUTMESHNAME,mmg2d_set_outputmeshname, - (MMG5_pMesh *mesh, char* meshout, int* strlen0,int* retval), + (MMG5_pMesh *mesh, char* meshout, MMG_int* strlen0,MMG_int* retval), (mesh,meshout,strlen0,retval)){ char *tmp = NULL; @@ -130,7 +130,7 @@ FORTRAN_NAME(MMG2D_SET_OUTPUTMESHNAME,mmg2d_set_outputmeshname, * See \ref MMG2D_Set_outputSolName function in \ref common/libmmgcommon.h file. */ FORTRAN_NAME(MMG2D_SET_OUTPUTSOLNAME,mmg2d_set_outputsolname, - (MMG5_pMesh *mesh,MMG5_pSol *sol, char* solout,int* strlen0, int* retval), + (MMG5_pMesh *mesh,MMG5_pSol *sol, char* solout,MMG_int* strlen0, MMG_int* retval), (mesh,sol,solout,strlen0,retval)){ char *tmp = NULL; @@ -147,7 +147,7 @@ FORTRAN_NAME(MMG2D_SET_OUTPUTSOLNAME,mmg2d_set_outputsolname, * See \ref MMG2D_Set_iparameter function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SET_IPARAMETER,mmg2d_set_iparameter, - (MMG5_pMesh *mesh, MMG5_pSol *sol, int *iparam, int *val, int* retval), + (MMG5_pMesh *mesh, MMG5_pSol *sol, MMG_int *iparam, MMG_int *val, MMG_int* retval), (mesh,sol,iparam,val,retval)){ *retval = MMG2D_Set_iparameter(*mesh,*sol,*iparam,*val); return; @@ -156,7 +156,7 @@ FORTRAN_NAME(MMG2D_SET_IPARAMETER,mmg2d_set_iparameter, * See \ref MMG2D_Set_dparameter function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SET_DPARAMETER,mmg2d_set_dparameter, - (MMG5_pMesh *mesh, MMG5_pSol *sol, int *dparam, double *val, int* retval), + (MMG5_pMesh *mesh, MMG5_pSol *sol, MMG_int *dparam, double *val, MMG_int* retval), (mesh,sol,dparam,val,retval)){ *retval = MMG2D_Set_dparameter(*mesh,*sol,*dparam,*val); return; @@ -166,8 +166,8 @@ FORTRAN_NAME(MMG2D_SET_DPARAMETER,mmg2d_set_dparameter, * See \ref MMG2D_Set_localParameter function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SET_LOCALPARAMETER,mmg2d_set_localparameter, - (MMG5_pMesh *mesh,MMG5_pSol *sol, int *typ, int *ref, - double *hmin, double *hmax, double *hausd, int* retval), + (MMG5_pMesh *mesh,MMG5_pSol *sol, MMG_int *typ, MMG_int *ref, + double *hmin, double *hmax, double *hausd, MMG_int* retval), (mesh,sol,typ,ref,hmin, hmax, hausd,retval)){ *retval = MMG2D_Set_localParameter(*mesh,*sol,*typ,*ref,*hmin,*hmax,*hausd); return; @@ -178,8 +178,8 @@ FORTRAN_NAME(MMG2D_SET_LOCALPARAMETER,mmg2d_set_localparameter, * See \ref MMG2D_Set_multiMat function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SET_MULTIMAT,mmg2d_set_multimat, - (MMG5_pMesh *mesh,MMG5_pSol *sol, int *ref,int *split, - int* rin,int* rex, int* retval), + (MMG5_pMesh *mesh,MMG5_pSol *sol, MMG_int *ref,MMG_int *split, + MMG_int* rin,MMG_int* rex, MMG_int* retval), (mesh,sol,ref,split,rin,rex,retval)){ *retval = MMG2D_Set_multiMat(*mesh,*sol,*ref,*split,*rin,*rex); return; @@ -189,7 +189,7 @@ FORTRAN_NAME(MMG2D_SET_MULTIMAT,mmg2d_set_multimat, * See \ref MMG2D_Set_meshSize function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SET_MESHSIZE,mmg2d_set_meshsize, - (MMG5_pMesh *mesh, int *np, int *nt, int *nquad, int *na, int *retval), + (MMG5_pMesh *mesh, MMG_int *np, MMG_int *nt, MMG_int *nquad, MMG_int *na, MMG_int *retval), (mesh,np,nt,nquad,na,retval)) { *retval = MMG2D_Set_meshSize(*mesh,*np,*nt,*nquad,*na); return; @@ -198,8 +198,8 @@ FORTRAN_NAME(MMG2D_SET_MESHSIZE,mmg2d_set_meshsize, * See \ref MMG2D_Set_solSize function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SET_SOLSIZE,mmg2d_set_solsize, - (MMG5_pMesh *mesh, MMG5_pSol *sol, int* typEntity, - int* np, int* typSol, int* retval), + (MMG5_pMesh *mesh, MMG5_pSol *sol, MMG_int* typEntity, + MMG_int* np, MMG_int* typSol, MMG_int* retval), (mesh, sol, typEntity, np, typSol, retval)) { *retval = MMG2D_Set_solSize(*mesh,*sol,*typEntity,*np,*typSol); return; @@ -208,8 +208,8 @@ FORTRAN_NAME(MMG2D_SET_SOLSIZE,mmg2d_set_solsize, * See \ref MMG2D_Set_solsAtVerticesSize function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SET_SOLSATVERTICESSIZE,mmg2d_set_solsatverticessize, - (MMG5_pMesh *mesh, MMG5_pSol *sol,int* nsols, - int* nentities, int* typSol, int* retval), + (MMG5_pMesh *mesh, MMG5_pSol *sol,MMG_int* nsols, + MMG_int* nentities, MMG_int* typSol, MMG_int* retval), (mesh, sol, nsols, nentities, typSol, retval)) { *retval = MMG2D_Set_solsAtVerticesSize(*mesh,sol,*nsols,*nentities,typSol); return; @@ -219,7 +219,7 @@ FORTRAN_NAME(MMG2D_SET_SOLSATVERTICESSIZE,mmg2d_set_solsatverticessize, * See \ref MMG2D_Get_solSize function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_GET_SOLSIZE,mmg2d_get_solsize, - (MMG5_pMesh *mesh, MMG5_pSol *sol, int* typEntity, int* np, int* typSol, int* retval), + (MMG5_pMesh *mesh, MMG5_pSol *sol, MMG_int* typEntity, MMG_int* np, MMG_int* typSol, MMG_int* retval), (mesh,sol,typEntity,np,typSol,retval)) { *retval = MMG2D_Get_solSize(*mesh,*sol,typEntity,np,typSol); @@ -230,8 +230,8 @@ FORTRAN_NAME(MMG2D_GET_SOLSIZE,mmg2d_get_solsize, * See \ref MMG2D_Get_solsAtVerticesSize function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_GET_SOLSATVERTICESSIZE,mmg2d_get_solsatverticessize, - (MMG5_pMesh *mesh, MMG5_pSol *sol, int *nsols, - int* nentities, int* typSol, int* retval), + (MMG5_pMesh *mesh, MMG5_pSol *sol, MMG_int *nsols, + MMG_int* nentities, MMG_int* typSol, MMG_int* retval), (mesh,sol,nsols,nentities,typSol,retval)) { *retval = MMG2D_Get_solsAtVerticesSize(*mesh,sol,nsols,nentities,typSol); @@ -242,8 +242,8 @@ FORTRAN_NAME(MMG2D_GET_SOLSATVERTICESSIZE,mmg2d_get_solsatverticessize, * See \ref MMG2D_Set_vertex function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SET_VERTEX,mmg2d_set_vertex, - (MMG5_pMesh *mesh, double* c0, double* c1, int* ref, - int* pos, int* retval), + (MMG5_pMesh *mesh, double* c0, double* c1, MMG_int* ref, + MMG_int* pos, MMG_int* retval), (mesh,c0,c1,ref,pos,retval)) { *retval = MMG2D_Set_vertex(*mesh,*c0,*c1,*ref,*pos); @@ -252,7 +252,7 @@ FORTRAN_NAME(MMG2D_SET_VERTEX,mmg2d_set_vertex, /** * See \ref MMG2D_Set_corner function in \ref mmg2d/libmmg2d.h file. */ -FORTRAN_NAME(MMG2D_SET_CORNER,mmg2d_set_corner,(MMG5_pMesh *mesh, int *k, int* retval), +FORTRAN_NAME(MMG2D_SET_CORNER,mmg2d_set_corner,(MMG5_pMesh *mesh, MMG_int *k, MMG_int* retval), (mesh,k,retval)) { *retval = MMG2D_Set_corner(*mesh,*k); return; @@ -260,7 +260,7 @@ FORTRAN_NAME(MMG2D_SET_CORNER,mmg2d_set_corner,(MMG5_pMesh *mesh, int *k, int* r /** * See \ref MMG2D_Unset_corner function in \ref mmg2d/libmmg2d.h file. */ -FORTRAN_NAME(MMG2D_UNSET_CORNER,mmg2d_unset_corner,(MMG5_pMesh *mesh, int *k, int* retval), +FORTRAN_NAME(MMG2D_UNSET_CORNER,mmg2d_unset_corner,(MMG5_pMesh *mesh, MMG_int *k, MMG_int* retval), (mesh,k,retval)) { *retval = MMG2D_Unset_corner(*mesh,*k); return; @@ -270,7 +270,7 @@ FORTRAN_NAME(MMG2D_UNSET_CORNER,mmg2d_unset_corner,(MMG5_pMesh *mesh, int *k, in * See \ref MMG2D_Set_requiredVertex function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SET_REQUIREDVERTEX,mmg2d_set_requiredvertex, - (MMG5_pMesh *mesh, int *k, int* retval), + (MMG5_pMesh *mesh, MMG_int *k, MMG_int* retval), (mesh,k,retval)) { *retval = MMG2D_Set_requiredVertex(*mesh,*k); return; @@ -280,7 +280,7 @@ FORTRAN_NAME(MMG2D_SET_REQUIREDVERTEX,mmg2d_set_requiredvertex, * See \ref MMG2D_Unset_requiredVertex function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_UNSET_REQUIREDVERTEX,mmg2d_unset_requiredvertex, - (MMG5_pMesh *mesh, int *k, int* retval), + (MMG5_pMesh *mesh, MMG_int *k, MMG_int* retval), (mesh,k,retval)) { *retval = MMG2D_Unset_requiredVertex(*mesh,*k); return; @@ -290,8 +290,8 @@ FORTRAN_NAME(MMG2D_UNSET_REQUIREDVERTEX,mmg2d_unset_requiredvertex, * See \ref MMG2D_Get_vertex function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_GET_VERTEX,mmg2d_get_vertex, - (MMG5_pMesh *mesh,double* c0, double* c1, int* ref, - int* isCorner, int* isRequired, int* retval), + (MMG5_pMesh *mesh,double* c0, double* c1, MMG_int* ref, + MMG_int* isCorner, MMG_int* isRequired, MMG_int* retval), (mesh,c0,c1,ref,isCorner,isRequired, retval)) { *retval = MMG2D_Get_vertex(*mesh,c0,c1,ref,isCorner,isRequired); return; @@ -300,8 +300,8 @@ FORTRAN_NAME(MMG2D_GET_VERTEX,mmg2d_get_vertex, * See \ref MMG2D_GetByIdx_vertex function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_GETBYIDX_VERTEX,mmg2d_getbyidx_vertex, - (MMG5_pMesh *mesh, double* c0, double* c1, int* ref, - int* isCorner, int* isRequired, int* idx,int* retval), + (MMG5_pMesh *mesh, double* c0, double* c1, MMG_int* ref, + MMG_int* isCorner, MMG_int* isRequired, MMG_int* idx,MMG_int* retval), (mesh,c0,c1,ref,isCorner,isRequired,idx, retval)) { *retval = MMG2D_GetByIdx_vertex(*mesh,c0,c1,ref,isCorner,isRequired,*idx); return; @@ -311,7 +311,7 @@ FORTRAN_NAME(MMG2D_GETBYIDX_VERTEX,mmg2d_getbyidx_vertex, * See \ref MMG2D_Set_vertices function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SET_VERTICES,mmg2d_set_vertices, - (MMG5_pMesh *mesh, double* vertices, int* refs, int* retval), + (MMG5_pMesh *mesh, double* vertices, MMG_int* refs, MMG_int* retval), (mesh,vertices,refs,retval)) { *retval = MMG2D_Set_vertices(*mesh,vertices,refs); @@ -323,8 +323,8 @@ FORTRAN_NAME(MMG2D_SET_VERTICES,mmg2d_set_vertices, * See \ref MMG2D_Get_vertices function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_GET_VERTICES,mmg2d_get_vertices, - (MMG5_pMesh *mesh, double* vertices, int* refs, - int* areCorners, int* areRequired, int* retval), + (MMG5_pMesh *mesh, double* vertices, MMG_int* refs, + MMG_int* areCorners, MMG_int* areRequired, MMG_int* retval), (mesh,vertices,refs,areCorners,areRequired, retval)) { *retval = MMG2D_Get_vertices(*mesh,vertices,refs,areCorners,areRequired); return; @@ -335,8 +335,8 @@ FORTRAN_NAME(MMG2D_GET_VERTICES,mmg2d_get_vertices, * See \ref MMG2D_Set_triangle function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SET_TRIANGLE,mmg2d_set_triangle, - (MMG5_pMesh *mesh, int* v0, int* v1, int* v2, int* ref,int* pos, - int* retval), + (MMG5_pMesh *mesh, MMG_int* v0, MMG_int* v1, MMG_int* v2, MMG_int* ref,MMG_int* pos, + MMG_int* retval), (mesh,v0,v1,v2,ref,pos,retval)) { *retval = MMG2D_Set_triangle(*mesh, *v0, *v1, *v2, *ref, *pos); return; @@ -345,7 +345,7 @@ FORTRAN_NAME(MMG2D_SET_TRIANGLE,mmg2d_set_triangle, * See \ref MMG2D_Set_requiredTriangle function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SET_REQUIREDTRIANGLE,mmg2d_set_requiredtriangle, - (MMG5_pMesh *mesh, int *k, int* retval), + (MMG5_pMesh *mesh, MMG_int *k, MMG_int* retval), (mesh,k,retval)) { *retval = MMG2D_Set_requiredTriangle(*mesh, *k); return; @@ -354,7 +354,7 @@ FORTRAN_NAME(MMG2D_SET_REQUIREDTRIANGLE,mmg2d_set_requiredtriangle, * See \ref MMG2D_Unset_requiredTriangle function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_UNSET_REQUIREDTRIANGLE,mmg2d_unset_requiredtriangle, - (MMG5_pMesh *mesh, int *k, int* retval), + (MMG5_pMesh *mesh, MMG_int *k, MMG_int* retval), (mesh,k,retval)) { *retval = MMG2D_Unset_requiredTriangle(*mesh, *k); return; @@ -364,8 +364,8 @@ FORTRAN_NAME(MMG2D_UNSET_REQUIREDTRIANGLE,mmg2d_unset_requiredtriangle, * See \ref MMG2D_Get_triangle function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_GET_TRIANGLE,mmg2d_get_triangle, - (MMG5_pMesh *mesh, int* v0, int* v1, int* v2, int* ref - ,int* isRequired, int* retval), + (MMG5_pMesh *mesh, MMG_int* v0, MMG_int* v1, MMG_int* v2, MMG_int* ref + ,MMG_int* isRequired, MMG_int* retval), (mesh,v0,v1,v2,ref,isRequired,retval)) { *retval = MMG2D_Get_triangle(*mesh,v0,v1,v2,ref,isRequired); return; @@ -374,8 +374,8 @@ FORTRAN_NAME(MMG2D_GET_TRIANGLE,mmg2d_get_triangle, * See \ref MMG2D_Set_triangles function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SET_TRIANGLES,mmg2d_set_triangles, - (MMG5_pMesh *mesh, int* tria, int* refs, - int* retval), + (MMG5_pMesh *mesh, MMG_int* tria, MMG_int* refs, + MMG_int* retval), (mesh,tria,refs,retval)) { *retval = MMG2D_Set_triangles(*mesh, tria, refs); return; @@ -385,8 +385,8 @@ FORTRAN_NAME(MMG2D_SET_TRIANGLES,mmg2d_set_triangles, * See \ref MMG2D_Get_triangles function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_GET_TRIANGLES,mmg2d_get_triangles, - (MMG5_pMesh *mesh, int* tria, int* refs,int* areRequired, - int* retval), + (MMG5_pMesh *mesh, MMG_int* tria, MMG_int* refs,MMG_int* areRequired, + MMG_int* retval), (mesh,tria,refs,areRequired,retval)) { *retval = MMG2D_Get_triangles(*mesh,tria,refs,areRequired); return; @@ -396,8 +396,8 @@ FORTRAN_NAME(MMG2D_GET_TRIANGLES,mmg2d_get_triangles, * See \ref MMG2D_Set_quadrilateral function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SET_QUADRILATERAL,mmg2d_set_quadrilateral, - (MMG5_pMesh *mesh, int* v0, int* v1, int* v2, int *v3,int* ref,int* pos, - int* retval), + (MMG5_pMesh *mesh, MMG_int* v0, MMG_int* v1, MMG_int* v2, MMG_int *v3,MMG_int* ref,MMG_int* pos, + MMG_int* retval), (mesh,v0,v1,v2,v3,ref,pos,retval)) { *retval = MMG2D_Set_quadrilateral(*mesh, *v0, *v1, *v2, *v3, *ref, *pos); return; @@ -406,8 +406,8 @@ FORTRAN_NAME(MMG2D_SET_QUADRILATERAL,mmg2d_set_quadrilateral, * See \ref MMG2D_Get_quadrilateral function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_GET_QUADRILATERAL,mmg2d_get_quadrilateral, - (MMG5_pMesh *mesh, int* v0, int* v1, int* v2, int *v3, int* ref - ,int* isRequired, int* retval), + (MMG5_pMesh *mesh, MMG_int* v0, MMG_int* v1, MMG_int* v2, MMG_int *v3, MMG_int* ref + ,MMG_int* isRequired, MMG_int* retval), (mesh,v0,v1,v2,v3,ref,isRequired,retval)) { *retval = MMG2D_Get_quadrilateral(*mesh,v0,v1,v2,v3,ref,isRequired); return; @@ -416,8 +416,8 @@ FORTRAN_NAME(MMG2D_GET_QUADRILATERAL,mmg2d_get_quadrilateral, * See \ref MMG2D_Set_quadrilaterals function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SET_QUADRILATERALS,mmg2d_set_quadrilaterals, - (MMG5_pMesh *mesh, int* quadra, int* refs, - int* retval), + (MMG5_pMesh *mesh, MMG_int* quadra, MMG_int* refs, + MMG_int* retval), (mesh,quadra,refs,retval)) { *retval = MMG2D_Set_quadrilaterals(*mesh, quadra, refs); return; @@ -427,8 +427,8 @@ FORTRAN_NAME(MMG2D_SET_QUADRILATERALS,mmg2d_set_quadrilaterals, * See \ref MMG2D_Get_quadrilaterals function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_GET_QUADRILATERALS,mmg2d_get_quadrilaterals, - (MMG5_pMesh *mesh, int* quadra, int* refs,int* areRequired, - int* retval), + (MMG5_pMesh *mesh, MMG_int* quadra, MMG_int* refs,MMG_int* areRequired, + MMG_int* retval), (mesh,quadra,refs,areRequired,retval)) { *retval = MMG2D_Get_quadrilaterals(*mesh,quadra,refs,areRequired); return; @@ -438,7 +438,7 @@ FORTRAN_NAME(MMG2D_GET_QUADRILATERALS,mmg2d_get_quadrilaterals, * See \ref MMG2D_Set_edge function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SET_EDGE,mmg2d_set_edge, - (MMG5_pMesh *mesh, int *v0, int *v1, int *ref, int *pos, int* retval), + (MMG5_pMesh *mesh, MMG_int *v0, MMG_int *v1, MMG_int *ref, MMG_int *pos, MMG_int* retval), (mesh,v0,v1,ref,pos,retval)){ *retval = MMG2D_Set_edge(*mesh,*v0,*v1,*ref,*pos); return; @@ -447,7 +447,7 @@ FORTRAN_NAME(MMG2D_SET_EDGE,mmg2d_set_edge, * See \ref MMG2D_Set_requiredEdge function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SET_REQUIREDEDGE,mmg2d_set_requirededge, - (MMG5_pMesh *mesh, int *k, int* retval), + (MMG5_pMesh *mesh, MMG_int *k, MMG_int* retval), (mesh,k,retval)) { *retval = MMG2D_Set_requiredEdge(*mesh,*k); return; @@ -456,7 +456,7 @@ FORTRAN_NAME(MMG2D_SET_REQUIREDEDGE,mmg2d_set_requirededge, * See \ref MMG2D_Unset_requiredEdge function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_UNSET_REQUIREDEDGE,mmg2d_unset_requirededge, - (MMG5_pMesh *mesh, int *k, int* retval), + (MMG5_pMesh *mesh, MMG_int *k, MMG_int* retval), (mesh,k,retval)) { *retval = MMG2D_Unset_requiredEdge(*mesh,*k); return; @@ -465,7 +465,7 @@ FORTRAN_NAME(MMG2D_UNSET_REQUIREDEDGE,mmg2d_unset_requirededge, * See \ref MMG2D_Set_parallelEdge function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SET_PARALLELEDGE,mmg2d_set_paralleledge, - (MMG5_pMesh *mesh, int *k, int* retval), + (MMG5_pMesh *mesh, MMG_int *k, MMG_int* retval), (mesh,k,retval)) { *retval = MMG2D_Set_parallelEdge(*mesh,*k); return; @@ -474,8 +474,8 @@ FORTRAN_NAME(MMG2D_SET_PARALLELEDGE,mmg2d_set_paralleledge, /** * See \ref MMG2D_Get_edge function in \ref mmg2d/libmmg2d.h file. */ -FORTRAN_NAME(MMG2D_GET_EDGE,mmg2d_get_edge,(MMG5_pMesh *mesh, int* e0, int* e1, int* ref - ,int* isRidge, int* isRequired, int* retval), +FORTRAN_NAME(MMG2D_GET_EDGE,mmg2d_get_edge,(MMG5_pMesh *mesh, MMG_int* e0, MMG_int* e1, MMG_int* ref + ,MMG_int* isRidge, MMG_int* isRequired, MMG_int* retval), (mesh,e0,e1,ref,isRidge,isRequired,retval)) { *retval = MMG2D_Get_edge(*mesh,e0,e1,ref,isRidge,isRequired); return; @@ -484,7 +484,7 @@ FORTRAN_NAME(MMG2D_GET_EDGE,mmg2d_get_edge,(MMG5_pMesh *mesh, int* e0, int* e1, * See \ref MMG2D_Set_edges function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SET_EDGES,mmg2d_set_edges, - (MMG5_pMesh *mesh, int *edges, int *refs, int* retval), + (MMG5_pMesh *mesh, MMG_int *edges, MMG_int *refs, MMG_int* retval), (mesh,edges,refs,retval)){ *retval = MMG2D_Set_edges(*mesh,edges,refs); return; @@ -493,9 +493,9 @@ FORTRAN_NAME(MMG2D_SET_EDGES,mmg2d_set_edges, /** * See \ref MMG2D_Get_edges function in \ref mmg2d/libmmg2d.h file. */ -FORTRAN_NAME(MMG2D_GET_EDGES,mmg2d_get_edges,(MMG5_pMesh *mesh, int* edges, - int* refs,int* areRidges, - int* areRequired, int* retval), +FORTRAN_NAME(MMG2D_GET_EDGES,mmg2d_get_edges,(MMG5_pMesh *mesh, MMG_int* edges, + MMG_int* refs,MMG_int* areRidges, + MMG_int* areRequired, MMG_int* retval), (mesh,edges,refs,areRidges,areRequired,retval)) { *retval = MMG2D_Get_edges(*mesh,edges,refs,areRidges,areRequired); return; @@ -505,7 +505,7 @@ FORTRAN_NAME(MMG2D_GET_EDGES,mmg2d_get_edges,(MMG5_pMesh *mesh, int* edges, * See \ref MMG2D_Get_triangleQuality function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_GET_TRIANGLEQUALITY,mmg2d_get_trianglequality, - (MMG5_pMesh *mesh, MMG5_pSol *met, int* k, double* retval), + (MMG5_pMesh *mesh, MMG5_pSol *met, MMG_int* k, double* retval), (mesh,met,k,retval)) { *retval = MMG2D_Get_triangleQuality(*mesh,*met,*k); return; @@ -515,7 +515,7 @@ FORTRAN_NAME(MMG2D_GET_TRIANGLEQUALITY,mmg2d_get_trianglequality, * See \ref MMG2D_Get_meshSize function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_GET_MESHSIZE,mmg2d_get_meshsize, - (MMG5_pMesh *mesh, int* np, int* nt, int *nquad, int* na, int* retval), + (MMG5_pMesh *mesh, MMG_int* np, MMG_int* nt, MMG_int *nquad, MMG_int* na, MMG_int* retval), (mesh,np,nt, nquad,na,retval)) { *retval = MMG2D_Get_meshSize(*mesh,np,nt,nquad,na); @@ -525,7 +525,7 @@ FORTRAN_NAME(MMG2D_GET_MESHSIZE,mmg2d_get_meshsize, * See \ref MMG2D_Set_scalarSol function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SET_SCALARSOL,mmg2d_set_scalarsol, - (MMG5_pSol *met, double *s, int *pos, int* retval), + (MMG5_pSol *met, double *s, MMG_int *pos, MMG_int* retval), (met,s,pos,retval)) { *retval = MMG2D_Set_scalarSol(*met,*s,*pos); return; @@ -534,7 +534,7 @@ FORTRAN_NAME(MMG2D_SET_SCALARSOL,mmg2d_set_scalarsol, * See \ref MMG2D_Get_scalarSol function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_GET_SCALARSOL,mmg2d_get_scalarsol, - (MMG5_pSol *met, double* s, int* retval), + (MMG5_pSol *met, double* s, MMG_int* retval), (met,s,retval)) { *retval = MMG2D_Get_scalarSol(*met,s); return; @@ -543,7 +543,7 @@ FORTRAN_NAME(MMG2D_GET_SCALARSOL,mmg2d_get_scalarsol, * See \ref MMG2D_Set_scalarSols function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SET_SCALARSOLS,mmg2d_set_scalarsols, - (MMG5_pSol *met, double *s, int* retval), + (MMG5_pSol *met, double *s, MMG_int* retval), (met,s,retval)) { *retval = MMG2D_Set_scalarSols(*met,s); return; @@ -553,7 +553,7 @@ FORTRAN_NAME(MMG2D_SET_SCALARSOLS,mmg2d_set_scalarsols, * See \ref MMG2D_Get_scalarSols function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_GET_SCALARSOLS,mmg2d_get_scalarsols, - (MMG5_pSol *met, double* s, int* retval), + (MMG5_pSol *met, double* s, MMG_int* retval), (met,s,retval)) { *retval = MMG2D_Get_scalarSols(*met,s); return; @@ -564,7 +564,7 @@ FORTRAN_NAME(MMG2D_GET_SCALARSOLS,mmg2d_get_scalarsols, */ FORTRAN_NAME(MMG2D_SET_VECTORSOL,mmg2d_set_vectorsol, (MMG5_pSol *met, double *vx, double *vy, - int *pos, int* retval), + MMG_int *pos, MMG_int* retval), (met,vx,vy,pos,retval)) { *retval = MMG2D_Set_vectorSol(*met,*vx,*vy,*pos); return; @@ -574,7 +574,7 @@ FORTRAN_NAME(MMG2D_SET_VECTORSOL,mmg2d_set_vectorsol, * See \ref MMG2D_Get_vectorSol function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_GET_VECTORSOL,mmg2d_get_vectorsol, - (MMG5_pSol *met, double* vx,double *vy, int* retval), + (MMG5_pSol *met, double* vx,double *vy, MMG_int* retval), (met,vx,vy,retval)) { *retval = MMG2D_Get_vectorSol(*met,vx,vy); return; @@ -583,7 +583,7 @@ FORTRAN_NAME(MMG2D_GET_VECTORSOL,mmg2d_get_vectorsol, * See \ref MMG2D_Set_vectorSols function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SET_VECTORSOLS,mmg2d_set_vectorsols, - (MMG5_pSol *met, double *sols, int* retval), + (MMG5_pSol *met, double *sols, MMG_int* retval), (met,sols,retval)) { *retval = MMG2D_Set_vectorSols(*met,sols); return; @@ -593,7 +593,7 @@ FORTRAN_NAME(MMG2D_SET_VECTORSOLS,mmg2d_set_vectorsols, * See \ref MMG2D_Get_vectorSols function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_GET_VECTORSOLS,mmg2d_get_vectorsols, - (MMG5_pSol *met, double* sols, int* retval), + (MMG5_pSol *met, double* sols, MMG_int* retval), (met,sols,retval)) { *retval = MMG2D_Get_vectorSols(*met,sols); return; @@ -604,7 +604,7 @@ FORTRAN_NAME(MMG2D_GET_VECTORSOLS,mmg2d_get_vectorsols, */ FORTRAN_NAME(MMG2D_SET_TENSORSOL,mmg2d_set_tensorsol, (MMG5_pSol *met, double *m11, double *m12, double *m22, - int *pos, int* retval), + MMG_int *pos, MMG_int* retval), (met,m11,m12,m22,pos,retval)) { *retval = MMG2D_Set_tensorSol(*met,*m11,*m12,*m22,*pos); return; @@ -614,7 +614,7 @@ FORTRAN_NAME(MMG2D_SET_TENSORSOL,mmg2d_set_tensorsol, */ FORTRAN_NAME(MMG2D_GET_TENSORSOL,mmg2d_get_tensorsol, (MMG5_pSol *met, double* m11,double *m12, double *m22, - int* retval), + MMG_int* retval), (met,m11,m12,m22,retval)) { *retval = MMG2D_Get_tensorSol(*met,m11,m12,m22); return; @@ -623,7 +623,7 @@ FORTRAN_NAME(MMG2D_GET_TENSORSOL,mmg2d_get_tensorsol, * See \ref MMG2D_Set_tensorSol function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SET_TENSORSOLS,mmg2d_set_tensorsols, - (MMG5_pSol *met, double* sols,int* retval), + (MMG5_pSol *met, double* sols,MMG_int* retval), (met,sols,retval)) { *retval = MMG2D_Set_tensorSols(*met,sols); return; @@ -633,7 +633,7 @@ FORTRAN_NAME(MMG2D_SET_TENSORSOLS,mmg2d_set_tensorsols, * See \ref MMG2D_Get_tensorSol function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_GET_TENSORSOLS,mmg2d_get_tensorsols, - (MMG5_pSol *met, double* sols, int* retval), + (MMG5_pSol *met, double* sols, MMG_int* retval), (met,sols,retval)) { *retval = MMG2D_Get_tensorSols(*met,sols); return; @@ -642,7 +642,7 @@ FORTRAN_NAME(MMG2D_GET_TENSORSOLS,mmg2d_get_tensorsols, * See \ref MMG2D_Set_ithSol_solsAtVertices function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SET_ITHSOL_INSOLSATVERTICES,mmg2d_set_ithsol_insolsatvertices, - (MMG5_pSol *sol, int *i,double *s,int *pos, int* retval), + (MMG5_pSol *sol, MMG_int *i,double *s,MMG_int *pos, MMG_int* retval), (sol,i,s,pos,retval)) { *retval = MMG2D_Set_ithSol_inSolsAtVertices(*sol,*i,s,*pos); return; @@ -652,7 +652,7 @@ FORTRAN_NAME(MMG2D_SET_ITHSOL_INSOLSATVERTICES,mmg2d_set_ithsol_insolsatvertices * See \ref MMG2D_Get_ithSol_inSolsAtVertices function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_GET_ITHSOL_INSOLSATVERTICES,mmg2d_get_ithsol_insolsatvertices, - (MMG5_pSol *sol, int* i,double *s,int *pos, int* retval), + (MMG5_pSol *sol, MMG_int* i,double *s,MMG_int *pos, MMG_int* retval), (sol,i,s,pos,retval)) { *retval = MMG2D_Get_ithSol_inSolsAtVertices(*sol,*i,s,*pos); return; @@ -663,7 +663,7 @@ FORTRAN_NAME(MMG2D_GET_ITHSOL_INSOLSATVERTICES,mmg2d_get_ithsol_insolsatvertices * See \ref MMG2D_Set_ithSols_inSolsAtVertices function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SET_ITHSOLS_INSOLSATVERTICES,mmg2d_set_ithsols_insolsatvertices, - (MMG5_pSol *sol, int *i,double *s, int* retval), + (MMG5_pSol *sol, MMG_int *i,double *s, MMG_int* retval), (sol,i,s,retval)) { *retval = MMG2D_Set_ithSols_inSolsAtVertices(*sol,*i,s); return; @@ -673,7 +673,7 @@ FORTRAN_NAME(MMG2D_SET_ITHSOLS_INSOLSATVERTICES,mmg2d_set_ithsols_insolsatvertic * See \ref MMG2D_Get_ithSols_inSolsAtVertices function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_GET_ITHSOLS_INSOLSATVERTICES,mmg2d_get_ithsols_insolsatvertices, - (MMG5_pSol *sol, int* i,double *s, int* retval), + (MMG5_pSol *sol, MMG_int* i,double *s, MMG_int* retval), (sol,i,s,retval)) { *retval = MMG2D_Get_ithSols_inSolsAtVertices(*sol,*i,s); return; @@ -683,7 +683,7 @@ FORTRAN_NAME(MMG2D_GET_ITHSOLS_INSOLSATVERTICES,mmg2d_get_ithsols_insolsatvertic * See \ref MMG2D_Chk_meshData function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_CHK_MESHDATA,mmg2d_chk_meshdata, - (MMG5_pMesh *mesh,MMG5_pSol *met, int* retval), + (MMG5_pMesh *mesh,MMG5_pSol *met, MMG_int* retval), (mesh,met,retval)) { *retval = MMG2D_Chk_meshData(*mesh,*met); return; @@ -693,7 +693,7 @@ FORTRAN_NAME(MMG2D_CHK_MESHDATA,mmg2d_chk_meshdata, * See \ref MMG2D_Free_allSols function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_FREE_ALLSOLS,mmg2d_free_allsols, - (MMG5_pMesh *mesh,MMG5_pSol *sol,int* retval), + (MMG5_pMesh *mesh,MMG5_pSol *sol,MMG_int* retval), (mesh,sol,retval)){ *retval = MMG2D_Free_allSols(*mesh,sol); @@ -706,9 +706,9 @@ FORTRAN_NAME(MMG2D_FREE_ALLSOLS,mmg2d_free_allsols, * See \ref MMG2D_Free_all function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_VARIADIC(MMG2D_FREE_ALL,mmg2d_free_all, - (const int starter,...), + (const MMG_int starter,...), va_list argptr; - int ier; + MMG_int ier; va_start(argptr, starter); @@ -725,9 +725,9 @@ FORTRAN_VARIADIC(MMG2D_FREE_ALL,mmg2d_free_all, * See \ref MMG2D_Free_structures function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_VARIADIC(MMG2D_FREE_STRUCTURES,mmg2d_free_structures, - (const int starter,...), + (const MMG_int starter,...), va_list argptr; - int ier; + MMG_int ier; va_start(argptr, starter); @@ -744,9 +744,9 @@ FORTRAN_VARIADIC(MMG2D_FREE_STRUCTURES,mmg2d_free_structures, * See \ref MMG2D_Free_names function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_VARIADIC(MMG2D_FREE_NAMES,mmg2d_free_names, - (const int starter,...), + (const MMG_int starter,...), va_list argptr; - int ier; + MMG_int ier; va_start(argptr, starter); @@ -762,7 +762,7 @@ FORTRAN_VARIADIC(MMG2D_FREE_NAMES,mmg2d_free_names, /** * See \ref MMG2D_loadMesh function in \ref mmg2d/libmmg2d.h file. */ -FORTRAN_NAME(MMG2D_LOADMESH,mmg2d_loadmesh,(MMG5_pMesh *mesh,char* meshin,int* strlen0,int* retval),(mesh, meshin,strlen0,retval)){ +FORTRAN_NAME(MMG2D_LOADMESH,mmg2d_loadmesh,(MMG5_pMesh *mesh,char* meshin,MMG_int* strlen0,MMG_int* retval),(mesh, meshin,strlen0,retval)){ char *tmp = NULL; @@ -780,7 +780,7 @@ FORTRAN_NAME(MMG2D_LOADMESH,mmg2d_loadmesh,(MMG5_pMesh *mesh,char* meshin,int* s * See \ref MMG2D_loadVtkMesh function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_LOADVTKMESH,mmg2d_loadvtkmesh, - (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, int *strlen0,int* retval), + (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, MMG_int *strlen0,MMG_int* retval), (mesh,sol,filename,strlen0, retval)){ char *tmp = NULL; @@ -798,7 +798,7 @@ FORTRAN_NAME(MMG2D_LOADVTKMESH,mmg2d_loadvtkmesh, * See \ref MMG2D_loadvtkMesh_and_allData function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_LOADVTKMESH_AND_ALLDATA,mmg2d_loadvtkmesh_and_alldata, - (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, int *strlen0,int* retval), + (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, MMG_int *strlen0,MMG_int* retval), (mesh,sol,filename,strlen0, retval)){ char *tmp = NULL; @@ -816,7 +816,7 @@ FORTRAN_NAME(MMG2D_LOADVTKMESH_AND_ALLDATA,mmg2d_loadvtkmesh_and_alldata, * See \ref MMG2D_loadVtpMesh function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_LOADVTPMESH,mmg2d_loadvtpmesh, - (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, int *strlen0,int* retval), + (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, MMG_int *strlen0,MMG_int* retval), (mesh,sol,filename,strlen0, retval)){ char *tmp = NULL; @@ -834,7 +834,7 @@ FORTRAN_NAME(MMG2D_LOADVTPMESH,mmg2d_loadvtpmesh, * See \ref MMG2D_loadvtpMesh_and_allData function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_LOADVTPMESH_AND_ALLDATA,mmg2d_loadvtpmesh_and_alldata, - (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, int *strlen0,int* retval), + (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, MMG_int *strlen0,MMG_int* retval), (mesh,sol,filename,strlen0, retval)){ char *tmp = NULL; @@ -852,7 +852,7 @@ FORTRAN_NAME(MMG2D_LOADVTPMESH_AND_ALLDATA,mmg2d_loadvtpmesh_and_alldata, * See \ref MMG2D_loadVtuMesh function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_LOADVTUMESH,mmg2d_loadvtumesh, - (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, int *strlen0,int* retval), + (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, MMG_int *strlen0,MMG_int* retval), (mesh,sol,filename,strlen0, retval)){ char *tmp = NULL; @@ -870,7 +870,7 @@ FORTRAN_NAME(MMG2D_LOADVTUMESH,mmg2d_loadvtumesh, * See \ref MMG2D_loadVtuMesh_and_allData function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_LOADVTUMESH_AND_ALLDATA,mmg2d_loadvtumesh_and_alldata, - (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, int *strlen0,int* retval), + (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, MMG_int *strlen0,MMG_int* retval), (mesh,sol,filename,strlen0, retval)){ char *tmp = NULL; @@ -889,7 +889,7 @@ FORTRAN_NAME(MMG2D_LOADVTUMESH_AND_ALLDATA,mmg2d_loadvtumesh_and_alldata, * See \ref MMG2D_loadMshMesh function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_LOADMSHMESH,mmg2d_loadmshmesh, - (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, int *strlen0,int* retval), + (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, MMG_int *strlen0,MMG_int* retval), (mesh,sol,filename,strlen0, retval)){ char *tmp = NULL; @@ -908,7 +908,7 @@ FORTRAN_NAME(MMG2D_LOADMSHMESH,mmg2d_loadmshmesh, * See \ref MMG2D_loadMshMesh_and_allData function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_LOADMSHMESH_AND_ALLDATA,mmg2d_loadmshmesh_and_alldata, - (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, int *strlen0,int* retval), + (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, MMG_int *strlen0,MMG_int* retval), (mesh,sol,filename,strlen0, retval)){ char *tmp = NULL; @@ -926,7 +926,7 @@ FORTRAN_NAME(MMG2D_LOADMSHMESH_AND_ALLDATA,mmg2d_loadmshmesh_and_alldata, /** * See \ref MMG2D_saveMesh function in \ref mmg2d/libmmg2d.h file. */ -FORTRAN_NAME(MMG2D_SAVEMESH,mmg2d_savemesh,(MMG5_pMesh *mesh,char *meshin,int *strlen0, int* retval), +FORTRAN_NAME(MMG2D_SAVEMESH,mmg2d_savemesh,(MMG5_pMesh *mesh,char *meshin,MMG_int *strlen0, MMG_int* retval), (mesh,meshin,strlen0,retval)){ char *tmp = NULL; @@ -942,8 +942,8 @@ FORTRAN_NAME(MMG2D_SAVEMESH,mmg2d_savemesh,(MMG5_pMesh *mesh,char *meshin,int *s * See \ref MMG2D_saveVtkMesh function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SAVEVTKMESH,mmg2d_savevtkmesh, - (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, int *strlen0, - int* retval), + (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, MMG_int *strlen0, + MMG_int* retval), (mesh,sol,filename,strlen0,retval)){ char *tmp = NULL; @@ -961,8 +961,8 @@ FORTRAN_NAME(MMG2D_SAVEVTKMESH,mmg2d_savevtkmesh, * See \ref MMG2D_saveVtkMesh_and_allData function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SAVEVTKMESH_AND_ALLDATA,mmg2d_savevtkmesh_and_alldata, - (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, int *strlen0, - int* retval), + (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, MMG_int *strlen0, + MMG_int* retval), (mesh,sol,filename,strlen0,retval)){ char *tmp = NULL; @@ -981,8 +981,8 @@ FORTRAN_NAME(MMG2D_SAVEVTKMESH_AND_ALLDATA,mmg2d_savevtkmesh_and_alldata, * See \ref MMG2D_saveVtuMesh function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SAVEVTUMESH,mmg2d_savevtumesh, - (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, int *strlen0, - int* retval), + (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, MMG_int *strlen0, + MMG_int* retval), (mesh,sol,filename,strlen0,retval)){ char *tmp = NULL; @@ -1000,8 +1000,8 @@ FORTRAN_NAME(MMG2D_SAVEVTUMESH,mmg2d_savevtumesh, * See \ref MMG2D_saveVtuMesh_and_allData function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SAVEVTUMESH_AND_ALLDATA,mmg2d_savevtumesh_and_alldata, - (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, int *strlen0, - int* retval), + (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, MMG_int *strlen0, + MMG_int* retval), (mesh,sol,filename,strlen0,retval)){ char *tmp = NULL; @@ -1020,8 +1020,8 @@ FORTRAN_NAME(MMG2D_SAVEVTUMESH_AND_ALLDATA,mmg2d_savevtumesh_and_alldata, * See \ref MMG2D_saveVtpMesh function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SAVEVTPMESH,mmg2d_savevtpmesh, - (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, int *strlen0, - int* retval), + (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, MMG_int *strlen0, + MMG_int* retval), (mesh,sol,filename,strlen0,retval)){ char *tmp = NULL; @@ -1039,8 +1039,8 @@ FORTRAN_NAME(MMG2D_SAVEVTPMESH,mmg2d_savevtpmesh, * See \ref MMG2D_saveVtpmesh_and_allData function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SAVEVTPMESH_AND_ALLDATA,mmg2d_savevtpmesh_and_alldata, - (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, int *strlen0, - int* retval), + (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, MMG_int *strlen0, + MMG_int* retval), (mesh,sol,filename,strlen0,retval)){ char *tmp = NULL; @@ -1059,8 +1059,8 @@ FORTRAN_NAME(MMG2D_SAVEVTPMESH_AND_ALLDATA,mmg2d_savevtpmesh_and_alldata, * See \ref MMG2D_saveMshMesh function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SAVEMSHMESH,mmg2d_savemshmesh, - (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, int *strlen0, - int* retval), + (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, MMG_int *strlen0, + MMG_int* retval), (mesh,sol,filename,strlen0,retval)){ char *tmp = NULL; @@ -1079,8 +1079,8 @@ FORTRAN_NAME(MMG2D_SAVEMSHMESH,mmg2d_savemshmesh, * See \ref MMG2D_saveMshMesh function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SAVEMSHMESH_AND_ALLDATA,mmg2d_savemshmesh_and_alldata, - (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, int *strlen0, - int* retval), + (MMG5_pMesh *mesh, MMG5_pSol *sol,char* filename, MMG_int *strlen0, + MMG_int* retval), (mesh,sol,filename,strlen0,retval)){ char *tmp = NULL; @@ -1098,7 +1098,7 @@ FORTRAN_NAME(MMG2D_SAVEMSHMESH_AND_ALLDATA,mmg2d_savemshmesh_and_alldata, /** * See \ref MMG2D_saveTetgenMesh function in \ref mmg2d/libmmg2d.h file. */ -FORTRAN_NAME(MMG2D_SAVETETGENMESH,mmg2d_savetetgenmesh,(MMG5_pMesh *mesh,char *meshin,int *strlen0, int* retval), +FORTRAN_NAME(MMG2D_SAVETETGENMESH,mmg2d_savetetgenmesh,(MMG5_pMesh *mesh,char *meshin,MMG_int *strlen0, MMG_int* retval), (mesh,meshin,strlen0,retval)){ char *tmp = NULL; @@ -1115,7 +1115,7 @@ FORTRAN_NAME(MMG2D_SAVETETGENMESH,mmg2d_savetetgenmesh,(MMG5_pMesh *mesh,char *m * See \ref MMG2D_loadSol function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_LOADSOL,mmg2d_loadsol, - (MMG5_pMesh *mesh,MMG5_pSol *met,char *meshin,int* strlen0,int* retval), + (MMG5_pMesh *mesh,MMG5_pSol *met,char *meshin,MMG_int* strlen0,MMG_int* retval), (mesh,met,meshin,strlen0,retval)){ char *tmp = NULL; @@ -1133,7 +1133,7 @@ FORTRAN_NAME(MMG2D_LOADSOL,mmg2d_loadsol, * See \ref MMG2D_loadAllSols function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_LOADALLSOLS,mmg2d_loadallsols, - (MMG5_pMesh *mesh,MMG5_pSol *sol,char *meshin,int* strlen0,int* retval), + (MMG5_pMesh *mesh,MMG5_pSol *sol,char *meshin,MMG_int* strlen0,MMG_int* retval), (mesh,sol,meshin,strlen0,retval)){ char *tmp = NULL; @@ -1152,7 +1152,7 @@ FORTRAN_NAME(MMG2D_LOADALLSOLS,mmg2d_loadallsols, * See \ref MMG2D_saveSol function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SAVESOL,mmg2d_savesol,(MMG5_pMesh *mesh,MMG5_pSol *met, - char *meshin,int *strlen0,int* retval), + char *meshin,MMG_int *strlen0,MMG_int* retval), (mesh,met,meshin,strlen0,retval)){ char *tmp = NULL; @@ -1170,7 +1170,7 @@ FORTRAN_NAME(MMG2D_SAVESOL,mmg2d_savesol,(MMG5_pMesh *mesh,MMG5_pSol *met, * See \ref MMG2D_saveSol function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SAVEALLSOLS,mmg2d_saveallsols,(MMG5_pMesh *mesh,MMG5_pSol *sol, - char *meshin,int *strlen0,int* retval), + char *meshin,MMG_int *strlen0,MMG_int* retval), (mesh,sol,meshin,strlen0,retval)){ char *tmp = NULL; diff --git a/src/mmg2d/analys_2d.c b/src/mmg2d/analys_2d.c index e2f878f0f..ce81d489a 100644 --- a/src/mmg2d/analys_2d.c +++ b/src/mmg2d/analys_2d.c @@ -45,10 +45,10 @@ extern int8_t ddb; * count number of subdomains or connected components * */ -int MMG2D_setadj(MMG5_pMesh mesh) { +MMG_int MMG2D_setadj(MMG5_pMesh mesh) { MMG5_pTria pt,pt1; MMG5_pQuad pq; - int *pile,*adja,ipil,k,kk,ncc,ip1,ip2,nr,nref; + MMG_int *pile,*adja,ipil,k,kk,ncc,ip1,ip2,nr,nref; int16_t tag; int8_t i,ii,i1,i2; @@ -56,7 +56,7 @@ int MMG2D_setadj(MMG5_pMesh mesh) { fprintf(stdout," ** SETTING TOPOLOGY\n"); /** Step 1: Tags setting from triangles analysis */ - MMG5_SAFE_MALLOC(pile,mesh->nt+1,int,return 0); + MMG5_SAFE_MALLOC(pile,mesh->nt+1,MMG_int,return 0); /* Initialization of the pile */ ncc = 1; @@ -264,11 +264,11 @@ int MMG2D_setadj(MMG5_pMesh mesh) { * Identify singularities in the mesh. * */ -int MMG2D_singul(MMG5_pMesh mesh, int ref ) { +MMG_int MMG2D_singul(MMG5_pMesh mesh, MMG_int ref ) { MMG5_pTria pt; MMG5_pPoint ppt,p1,p2; double ux,uy,uz,vx,vy,vz,dd; - int list[MMG2D_LONMAX+2],listref[MMG2D_LONMAX+2],k,ns,ng,nr,nm,nre,nc; + MMG_int list[MMG2D_LONMAX+2],listref[MMG2D_LONMAX+2],k,ns,ng,nr,nm,nre,nc; int8_t i; nre = nc = nm = 0; @@ -397,10 +397,10 @@ int MMG2D_singul(MMG5_pMesh mesh, int ref ) { * Calculate normal vectors at vertices of the mesh. * */ -int MMG2D_norver(MMG5_pMesh mesh, int ref) { +MMG_int MMG2D_norver(MMG5_pMesh mesh, MMG_int ref) { MMG5_pTria pt,pt1; MMG5_pPoint ppt; - int k,kk,nn,pleft,pright; + MMG_int k,kk,nn,pleft,pright; int8_t i,ii; nn = 0; @@ -502,11 +502,11 @@ int MMG2D_norver(MMG5_pMesh mesh, int ref) { * antilaplacian smoothing * */ -int MMG2D_regnor(MMG5_pMesh mesh) { +MMG_int MMG2D_regnor(MMG5_pMesh mesh) { MMG5_pTria pt; MMG5_pPoint ppt,p1,p2; double *tmp,dd,ps,lm1,lm2,nx,ny,ux,uy,nxt,nyt,res,res0,n[2]; - int k,iel,ip1,ip2,nn,it,maxit; + MMG_int k,iel,ip1,ip2,nn,it,maxit; int8_t i,ier; it = 0; @@ -758,7 +758,7 @@ int MMG2D_regnor(MMG5_pMesh mesh) { } /** preprocessing stage: mesh analysis */ -int MMG2D_analys(MMG5_pMesh mesh) { +MMG_int MMG2D_analys(MMG5_pMesh mesh) { /* Transfer the boundary edge references to the triangles, if it has not been * already done (option 1) */ diff --git a/src/mmg2d/anisomovpt_2d.c b/src/mmg2d/anisomovpt_2d.c index adde1feb2..13d4616fd 100644 --- a/src/mmg2d/anisomovpt_2d.c +++ b/src/mmg2d/anisomovpt_2d.c @@ -34,12 +34,12 @@ #include "mmg2d.h" /* Relocate internal vertex whose ball is passed */ -int MMG2D_movintpt_ani(MMG5_pMesh mesh,MMG5_pSol met,int ilist,int *list,int8_t improve) { +MMG_int MMG2D_movintpt_ani(MMG5_pMesh mesh,MMG5_pSol met,MMG_int ilist,MMG_int *list,int8_t improve) { MMG5_pTria pt,pt0; MMG5_pPoint ppt0,p0,p1,p2; double calold,calnew,area,det,alpha,ps,ps1,ps2,step,sqdetm1,sqdetm2; double gr[2],grp[2],*m0,*m1,*m2; - int k,iel,ip0,ip1,ip2; + MMG_int k,iel,ip0,ip1,ip2; int8_t i,i1,i2; static int8_t mmgWarn0=0; diff --git a/src/mmg2d/anisosiz_2d.c b/src/mmg2d/anisosiz_2d.c index a1c667a73..7ec9ee592 100644 --- a/src/mmg2d/anisosiz_2d.c +++ b/src/mmg2d/anisosiz_2d.c @@ -47,10 +47,10 @@ * able to truncate it with the local params later. * */ -int MMG2D_defaultmet_2d(MMG5_pMesh mesh,MMG5_pSol met,int k,int8_t i) { +MMG_int MMG2D_defaultmet_2d(MMG5_pMesh mesh,MMG5_pSol met,MMG_int k,int8_t i) { MMG5_pTria pt; double *m,isqhmax; - int ip; + MMG_int ip; isqhmax = mesh->info.hmax; @@ -82,14 +82,14 @@ int MMG2D_defaultmet_2d(MMG5_pMesh mesh,MMG5_pSol met,int k,int8_t i) { * imposing the local parameters later. * */ -int MMG2D_defmetbdy_2d(MMG5_pMesh mesh,MMG5_pSol met,int k,int8_t i) { +MMG_int MMG2D_defmetbdy_2d(MMG5_pMesh mesh,MMG5_pSol met,MMG_int k,int8_t i) { MMG5_pTria pt; MMG5_pPoint p0,p1,p2; MMG5_pPar ppa; double hausd,hmin,hmax,sqhmin,sqhmax,ux,uy,ll,li,ps1,ps2,lm,ltmp,pv; double M1,M2,t1[2],t2[2],b1[2],b2[2],*n,*m; double gpp1[2],gpp2[2]; - int ilist,iel,ip,ip1,ip2,it[2],l,list[MMG2D_LONMAX+2]; + MMG_int ilist,iel,ip,ip1,ip2,it[2],l,list[MMG2D_LONMAX+2]; int8_t isloc,hausdloc; int8_t i0,i1,i2,j; static int8_t mmgWarn0=0,mmgWarn1=0,mmgWarn2=0; @@ -357,12 +357,12 @@ int MMG2D_defmetbdy_2d(MMG5_pMesh mesh,MMG5_pSol met,int k,int8_t i) { * Definition of an anisotropic metric tensor field based on the geometry of the * domain; this tensor field is intersected by a user-defined tensor field */ -int MMG2D_defsiz_ani(MMG5_pMesh mesh,MMG5_pSol met) { +MMG_int MMG2D_defsiz_ani(MMG5_pMesh mesh,MMG5_pSol met) { MMG5_pTria pt; MMG5_pPoint ppt; MMG5_pPar ppa; double mm[3],mr[3],isqhmax; - int k,l,ip; + MMG_int k,l,ip; int8_t ismet; int8_t isdef,i; @@ -528,7 +528,7 @@ void MMG2D_gradEigenv(double dm[2],double dn[2],double difsiz,int8_t dir,int8_t * */ static inline -int MMG2D_updatemet_ani(double *m,double *n,double dm[2],double dn[2], +MMG_int MMG2D_updatemet_ani(double *m,double *n,double dm[2],double dn[2], double vp[2][2],int8_t ier ) { double det,ip[4]; @@ -571,7 +571,7 @@ int MMG2D_updatemet_ani(double *m,double *n,double dm[2],double dn[2], * Ref : https://www.rocq.inria.fr/gamma/Frederic.Alauzet/cours/cea2010_V2.pdf * */ -int MMG2D_grad2met_ani(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTria pt,int np1,int np2) { +MMG_int MMG2D_grad2met_ani(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTria pt,MMG_int np1,MMG_int np2) { MMG5_pPoint p1,p2; double dm[2],dn[2]; double vp[2][2],*m,*n,ll,difsiz; @@ -634,8 +634,8 @@ int MMG2D_grad2met_ani(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTria pt,int np1,int n * Ref : https://www.rocq.inria.fr/gamma/Frederic.Alauzet/cours/cea2010_V2.pdf * */ -int MMG2D_grad2metreq_ani(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTria pt, - int npmaster,int npslave) { +MMG_int MMG2D_grad2metreq_ani(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTria pt, + MMG_int npmaster,MMG_int npslave) { MMG5_pPoint p2,p1; double ux,uy,dm[2],dn[2]; double vp[2][2],*m,*n,ll,difsiz; diff --git a/src/mmg2d/bezier_2d.c b/src/mmg2d/bezier_2d.c index 223c617f1..10b84d22b 100644 --- a/src/mmg2d/bezier_2d.c +++ b/src/mmg2d/bezier_2d.c @@ -25,7 +25,7 @@ // extern int8_t ddb; /* Check if triangle k should be split based on geometric and rough edge length considerations */ -int MMG2D_chkedg(MMG5_pMesh mesh, int k) { +MMG_int MMG2D_chkedg(MMG5_pMesh mesh, MMG_int k) { MMG5_pTria pt; MMG5_pPoint p1,p2; double hausd,hmax,ps,cosn,ux,uy,ll,li,t1[2],t2[2]; @@ -115,7 +115,7 @@ int MMG2D_chkedg(MMG5_pMesh mesh, int k) { /* Calculate coordinates o[2] and interpolated normal vector no[2] of a new point situated at parametric distance s from i1 = inxt2[i] */ -int MMG2D_bezierCurv(MMG5_pMesh mesh,int k,int8_t i,double s,double *o,double *no) { +MMG_int MMG2D_bezierCurv(MMG5_pMesh mesh,MMG_int k,int8_t i,double s,double *o,double *no) { MMG5_pTria pt; MMG5_pPoint p1,p2; double b1[2],b2[2],t1[2],t2[2],n1[2],n2[2],bn[2],ux,uy,ll,li,ps; diff --git a/src/mmg2d/boulep_2d.c b/src/mmg2d/boulep_2d.c index 3444d2a0e..52a968620 100644 --- a/src/mmg2d/boulep_2d.c +++ b/src/mmg2d/boulep_2d.c @@ -31,10 +31,10 @@ static uint8_t iprev[3] = {2,0,1}; in: ifirst : triangle containing p iploc : index of p in start out: list : list of triangles */ -int MMG2D_boulep(MMG5_pMesh mesh, int ifirst, int iploc, int * list) { +MMG_int MMG2D_boulep(MMG5_pMesh mesh, MMG_int ifirst, MMG_int iploc, MMG_int * list) { MMG5_pTria pt; MMG5_pPoint ppt; - int ip,voy,ilist,iel,*adja,i,iadr; + MMG_int ip,voy,ilist,iel,*adja,i,iadr; if ( ifirst < 1 ) return 0; pt = &mesh->tria[ifirst]; @@ -109,11 +109,11 @@ int MMG2D_boulep(MMG5_pMesh mesh, int ifirst, int iploc, int * list) { * of ip in kk. * */ -int MMG2D_boulen(MMG5_pMesh mesh, int start,int8_t ip, int *pleft, int *pright, double *nn) { +MMG_int MMG2D_boulen(MMG5_pMesh mesh, MMG_int start,int8_t ip, MMG_int *pleft, MMG_int *pright, double *nn) { MMG5_pTria pt; MMG5_pPoint p1,p2; double ux,uy,dd,n1[2],n2[2]; - int *adja,k,kk,refs; + MMG_int *adja,k,kk,refs; int8_t notedg; int8_t i,ii,i1,i2; @@ -226,8 +226,8 @@ int MMG2D_boulen(MMG5_pMesh mesh, int start,int8_t ip, int *pleft, int *pright, * crossing ridge. * */ -int MMG2D_boulet(MMG5_pMesh mesh,int start,int8_t ip,int *list) { - int *adja,k,ilist; +MMG_int MMG2D_boulet(MMG5_pMesh mesh,MMG_int start,int8_t ip,MMG_int *list) { + MMG_int *adja,k,ilist; int8_t i,i1,i2; ilist = 0; @@ -279,9 +279,9 @@ int MMG2D_boulet(MMG5_pMesh mesh,int start,int8_t ip,int *list) { * \a ip2 with their indices. * */ -int MMG2D_bouleendp(MMG5_pMesh mesh,int start,int8_t ip,int *ip1,int *ip2) { +MMG_int MMG2D_bouleendp(MMG5_pMesh mesh,MMG_int start,int8_t ip,MMG_int *ip1,MMG_int *ip2) { MMG5_pTria pt; - int *adja,k; + MMG_int *adja,k; int8_t i,i1,i2; static int8_t mmgWarn0=0; diff --git a/src/mmg2d/cenrad_2d.c b/src/mmg2d/cenrad_2d.c index 519e9926b..6ae8e2dd5 100644 --- a/src/mmg2d/cenrad_2d.c +++ b/src/mmg2d/cenrad_2d.c @@ -39,7 +39,7 @@ * Compute radius and center of circumscribing circle to the element. * */ -int MMG2D_cenrad_iso(MMG5_pMesh mesh,double *ct,double *c,double *rad) { +MMG_int MMG2D_cenrad_iso(MMG5_pMesh mesh,double *ct,double *c,double *rad) { double dd,ux,uy,n1[2],n2[2],*c1,*c2,*c3,pl1,pl2; double cc1,cc2; diff --git a/src/mmg2d/chkmsh_2d.c b/src/mmg2d/chkmsh_2d.c index dc5d08163..d427886e9 100644 --- a/src/mmg2d/chkmsh_2d.c +++ b/src/mmg2d/chkmsh_2d.c @@ -31,13 +31,13 @@ * Check the mesh validity * */ -int MMG5_mmg2dChkmsh(MMG5_pMesh mesh, int severe,int base) { +MMG_int MMG5_mmg2dChkmsh(MMG5_pMesh mesh, MMG_int severe,MMG_int base) { MMG5_pPoint ppt; MMG5_pTria pt1,pt2; MMG5_pEdge ped; - int *adja,*adja1,adj,adj1,k,i,iadr; - int kk,l,nk,j,ip,lon,len; - int *list; + MMG_int *adja,*adja1,adj,adj1,k,i,iadr; + MMG_int kk,l,nk,j,ip,lon,len; + MMG_int *list; uint8_t voy,voy1; static int8_t mmgErr0=0,mmgErr1=0,mmgErr2=0,mmgErr3=0,mmgErr4=0,mmgErr5=0; static int8_t mmgErr6=0; @@ -134,7 +134,7 @@ int MMG5_mmg2dChkmsh(MMG5_pMesh mesh, int severe,int base) { if ( !severe ) return 1; - MMG5_SAFE_CALLOC(list,MMG2D_LMAX,int,return 0); + MMG5_SAFE_CALLOC(list,MMG2D_LMAX,MMG_int,return 0); for (k=1; k<=mesh->nt; k++) { pt1 = &mesh->tria[k]; @@ -201,10 +201,10 @@ int MMG5_mmg2dChkmsh(MMG5_pMesh mesh, int severe,int base) { } /* Check of adjacency relations and edge tags */ -int MMG2D_chkmsh(MMG5_pMesh mesh) { +MMG_int MMG2D_chkmsh(MMG5_pMesh mesh) { MMG5_pTria pt,pt1; MMG5_pPoint p1,p2; - int *adja,*adjaj,k,jel; + MMG_int *adja,*adjaj,k,jel; int8_t i,i1,i2,j; static int8_t mmgErr0=0,mmgErr1=0,mmgErr2=0,mmgErr3=0,mmgErr4=0; static int8_t mmgErr6=0,mmgErr5=0; @@ -401,11 +401,11 @@ int MMG2D_chkmsh(MMG5_pMesh mesh) { } /* Check orientation of elements in the mesh */ -int MMG2D_chkor(MMG5_pMesh mesh) { +MMG_int MMG2D_chkor(MMG5_pMesh mesh) { MMG5_pTria pt; MMG5_pPoint p0,p1,p2; double det; - int k; + MMG_int k; for (k=1; k<=mesh->np; k++) { pt = &mesh->tria[k]; diff --git a/src/mmg2d/colver_2d.c b/src/mmg2d/colver_2d.c index 16b160a21..df1fa5a0e 100644 --- a/src/mmg2d/colver_2d.c +++ b/src/mmg2d/colver_2d.c @@ -38,11 +38,11 @@ extern uint8_t ddb; * preserved when collapsing edge i (p1->p2) * */ -int MMG2D_chkcol(MMG5_pMesh mesh, MMG5_pSol met,int k,int8_t i,int *list,int8_t typchk) { +MMG_int MMG2D_chkcol(MMG5_pMesh mesh, MMG5_pSol met,MMG_int k,int8_t i,MMG_int *list,int8_t typchk) { MMG5_pTria pt0,pt,pt1,pt2; MMG5_pPoint ppt,p2; double lon,len,calold,calnew,caltmp; - int ip1,ip2,ipb,l,ll,lj,jel,kel,ilist,*adja; + MMG_int ip1,ip2,ipb,l,ll,lj,jel,kel,ilist,*adja; uint8_t i1,i2,j,jj,j2,voy,open; pt0 = &mesh->tria[0]; @@ -267,9 +267,9 @@ int MMG2D_chkcol(MMG5_pMesh mesh, MMG5_pSol met,int k,int8_t i,int *list,int8_t } /* Perform effective collapse of edge i in tria k, i1->i2 */ -int MMG2D_colver(MMG5_pMesh mesh,int ilist,int *list) { +MMG_int MMG2D_colver(MMG5_pMesh mesh,MMG_int ilist,MMG_int *list) { MMG5_pTria pt,pt1,pt2; - int iel,jel,ip1,ip2,k,kel,*adja; + MMG_int iel,jel,ip1,ip2,k,kel,*adja; uint8_t i,j,jj,i1,i2,open; iel = list[0] / 3; @@ -353,9 +353,9 @@ int MMG2D_colver(MMG5_pMesh mesh,int ilist,int *list) { /* Perform effective collapse of edge i in tria k, i1->i2 in the particular case where only three elements are in the ball of i */ -int MMG2D_colver3(MMG5_pMesh mesh,int *list) { +MMG_int MMG2D_colver3(MMG5_pMesh mesh,MMG_int *list) { MMG5_pTria pt,pt1,pt2; - int iel,jel,kel,mel,ip,*adja; + MMG_int iel,jel,kel,mel,ip,*adja; uint8_t i,i1,j,j1,j2,k,m; /* Update of the new point for triangle list[0] */ @@ -415,9 +415,9 @@ int MMG2D_colver3(MMG5_pMesh mesh,int *list) { /* Perform effective collapse of edge i in tria k, i1->i2 in the particular case where only two elements are in the ball of i */ -int MMG2D_colver2(MMG5_pMesh mesh,int *list) { +MMG_int MMG2D_colver2(MMG5_pMesh mesh,MMG_int *list) { MMG5_pTria pt,pt1; - int *adja,iel,jel,kel,ip1,ip2; + MMG_int *adja,iel,jel,kel,ip1,ip2; int8_t i1,i2,jj,j2,k; /* update of new point for triangle list[0] */ diff --git a/src/mmg2d/delone_2d.c b/src/mmg2d/delone_2d.c index e70822676..e2bbe10de 100644 --- a/src/mmg2d/delone_2d.c +++ b/src/mmg2d/delone_2d.c @@ -28,11 +28,11 @@ #define KTB 11 /* Cavity correction for quality */ -static int MMG2D_correction_iso(MMG5_pMesh mesh,int ip,int *list,int ilist,int nedep) { +static MMG_int MMG2D_correction_iso(MMG5_pMesh mesh,MMG_int ip,MMG_int *list,MMG_int ilist,MMG_int nedep) { MMG5_pTria pt; MMG5_pPoint ppt,p1,p2; double dd,ux,uy,vx,vy; - int *adja,i,ipil,iel,lon,iadr,adj,ib,ic,base,ncor,nei[3]; + MMG_int *adja,i,ipil,iel,lon,iadr,adj,ib,ic,base,ncor,nei[3]; ppt = &mesh->point[ip]; if ( !MG_VOK(ppt) ) return ilist; @@ -103,9 +103,9 @@ static int MMG2D_correction_iso(MMG5_pMesh mesh,int ip,int *list,int ilist,int n * face has already been seen. * */ -static int MMG2D_hashEdgeDelone(MMG5_pMesh mesh,MMG5_Hash *hash,int iel,int i) { +static MMG_int MMG2D_hashEdgeDelone(MMG5_pMesh mesh,MMG5_Hash *hash,MMG_int iel,MMG_int i) { MMG5_pTria pt; - int *adja,iadr,jel,j,ip1,ip2; + MMG_int *adja,iadr,jel,j,ip1,ip2; int16_t i1,i2; pt = &mesh->tria[iel]; @@ -144,11 +144,11 @@ static int MMG2D_hashEdgeDelone(MMG5_pMesh mesh,MMG5_Hash *hash,int iel,int i) { /** Create the cavity point ip, starting from triangle list[0]; Return a negative value for ilist if one of the triangles of the cavity is required */ -int MMG2D_cavity(MMG5_pMesh mesh,MMG5_pSol sol,int ip,int *list) { +MMG_int MMG2D_cavity(MMG5_pMesh mesh,MMG5_pSol sol,MMG_int ip,MMG_int *list) { MMG5_pTria pt,pt1,ptc; MMG5_pPoint ppt; double c[2],crit,dd,eps,rad,ct[6]; - int *adja,*adjb,adj,adi,voy,i,j,ilist,ipil,jel,iadr,base,nei[3],l,tref; //isreq; + MMG_int *adja,*adjb,adj,adi,voy,i,j,ilist,ipil,jel,iadr,base,nei[3],l,tref; //isreq; static int8_t mmgWarn0=0; ppt = &mesh->point[ip]; @@ -244,11 +244,11 @@ int MMG2D_cavity(MMG5_pMesh mesh,MMG5_pSol sol,int ip,int *list) { * Insertion in point ip in the cavity described by list. * */ -int MMG2D_delone(MMG5_pMesh mesh,MMG5_pSol sol,int ip,int *list,int ilist) { +MMG_int MMG2D_delone(MMG5_pMesh mesh,MMG5_pSol sol,MMG_int ip,MMG_int *list,MMG_int ilist) { MMG5_pTria pt,pt1; MMG5_pPoint ppt; - int *adja,*adjb,i,j,k,iel,jel,old,iadr,base,size,nei[3],iadrold; - int tref,ielnum[3*MMG2D_LONMAX+1]; + MMG_int *adja,*adjb,i,j,k,iel,jel,old,iadr,base,size,nei[3],iadrold; + MMG_int tref,ielnum[3*MMG2D_LONMAX+1]; int8_t ier; short i1; int8_t alert; diff --git a/src/mmg2d/enforcement_2d.c b/src/mmg2d/enforcement_2d.c index 95ce0c8cb..ba4f614f0 100644 --- a/src/mmg2d/enforcement_2d.c +++ b/src/mmg2d/enforcement_2d.c @@ -31,14 +31,14 @@ * Check if all edges exist in the mesh and if not force them. * */ -int MMG2D_bdryenforcement(MMG5_pMesh mesh,MMG5_pSol sol) { +MMG_int MMG2D_bdryenforcement(MMG5_pMesh mesh,MMG5_pSol sol) { MMG5_pTria pt,pt1; MMG5_pEdge ped; MMG5_pPoint ppt; - int k,l,kk,nex,list[MMG2D_LONMAX],kdep,lon,iel,iare,ied; - int ia,ib,ilon,rnd,idep,*adja,ir,adj,list2[3]; + MMG_int k,l,kk,nex,list[MMG2D_LONMAX],kdep,lon,iel,iare,ied; + MMG_int ia,ib,ilon,rnd,idep,*adja,ir,adj,list2[3]; int8_t i,i1,i2,j; -// int iadr2,*adja2,ndel,iadr,ped0,ped1; +// MMG_int iadr2,*adja2,ndel,iadr,ped0,ped1; static int8_t mmgWarn0=0,mmgWarn1=0,mmgWarn2=0,mmgWarn3=0; static int8_t mmgWarn4=0,mmgWarn5=0,mmgWarn6=0,mmgWarn7=0; static int8_t mmgWarn8=0; diff --git a/src/mmg2d/hash_2d.c b/src/mmg2d/hash_2d.c index d03fdffda..c022b7f67 100644 --- a/src/mmg2d/hash_2d.c +++ b/src/mmg2d/hash_2d.c @@ -32,24 +32,24 @@ * Create adjacency relations between the triangles dein the mesh * */ -int MMG2D_hashTria(MMG5_pMesh mesh) { +MMG_int MMG2D_hashTria(MMG5_pMesh mesh) { MMG5_pTria pt,pt1; - int k,kk,pp,l,ll,mins,mins1,maxs,maxs1; - int *hcode,*link,inival,hsize,iadr; + MMG_int k,kk,pp,l,ll,mins,mins1,maxs,maxs1; + MMG_int *hcode,*link,inival,hsize,iadr; uint8_t i,ii,i1,i2; - unsigned int key; + unsigned MMG_int key; if ( mesh->adja ) return 1; if ( !mesh->nt ) return 0; /* memory alloc */ - MMG5_SAFE_CALLOC(hcode,mesh->nt+1,int,return 0); + MMG5_SAFE_CALLOC(hcode,mesh->nt+1,MMG_int,return 0); /* memory alloc */ - MMG5_ADD_MEM(mesh,(3*mesh->ntmax+5)*sizeof(int),"adjacency table", + MMG5_ADD_MEM(mesh,(3*mesh->ntmax+5)*sizeof(MMG_int),"adjacency table", printf(" Exit program.\n"); return 0;); - MMG5_SAFE_CALLOC(mesh->adja,3*mesh->ntmax+5,int,return 0); + MMG5_SAFE_CALLOC(mesh->adja,3*mesh->ntmax+5,MMG_int,return 0); link = mesh->adja; hsize = mesh->nt; @@ -148,14 +148,14 @@ int MMG2D_hashTria(MMG5_pMesh mesh) { * adja[4*(k1-1)+1+i1] = -(3*k2+i2) \f$. * */ -int MMG2D_hashQuad(MMG5_pMesh mesh) { +MMG_int MMG2D_hashQuad(MMG5_pMesh mesh) { MMG5_pQuad pq,pq1; MMG5_pTria pt; MMG5_Hash hash; - int k,kk,pp,l,ll,mins,mins1,maxs,maxs1,iadr; - int *hcode,*link,hsize,inival; + MMG_int k,kk,pp,l,ll,mins,mins1,maxs,maxs1,iadr; + MMG_int *hcode,*link,hsize,inival; uint8_t i,ii,i1,i2; - unsigned int key; + unsigned MMG_int key; /** Step 1: Fill adjacendies between quadrangles */ if ( !mesh->nquad ) { @@ -175,11 +175,11 @@ int MMG2D_hashQuad(MMG5_pMesh mesh) { fprintf(stdout," ** SETTING QUAD ADJACENCY\n"); /* memory alloc */ - MMG5_ADD_MEM(mesh,(4*mesh->nquad+5)*sizeof(int),"quad adjacency table", + MMG5_ADD_MEM(mesh,(4*mesh->nquad+5)*sizeof(MMG_int),"quad adjacency table", fprintf(stderr," Exit program.\n"); return 0); - MMG5_SAFE_CALLOC(mesh->adjq,4*mesh->nquad+5,int,return 0); - MMG5_SAFE_CALLOC(hcode,mesh->nquad+5,int,return 0); + MMG5_SAFE_CALLOC(mesh->adjq,4*mesh->nquad+5,MMG_int,return 0); + MMG5_SAFE_CALLOC(hcode,mesh->nquad+5,MMG_int,return 0); link = mesh->adjq; hsize = mesh->nquad; @@ -330,12 +330,12 @@ int MMG2D_hashQuad(MMG5_pMesh mesh) { * Transfer some input edge data to the corresponding triangles fields * */ -int MMG2D_assignEdge(MMG5_pMesh mesh) { +MMG_int MMG2D_assignEdge(MMG5_pMesh mesh) { MMG5_Hash hash; MMG5_pTria pt; MMG5_pQuad pq; MMG5_pEdge pa; - int k,ia; + MMG_int k,ia; int8_t ier; uint8_t i,i1,i2; @@ -430,11 +430,11 @@ int MMG2D_assignEdge(MMG5_pMesh mesh) { * \remark Call in debug mode only * */ -int MMG2D_bdryEdge(MMG5_pMesh mesh) { +MMG_int MMG2D_bdryEdge(MMG5_pMesh mesh) { MMG5_pTria pt,pt1; MMG5_pEdge pa; MMG5_pPoint p0; - int k,*adja,natmp,iel; + MMG_int k,*adja,natmp,iel; int8_t i,i1,i2; natmp = 0; @@ -511,13 +511,13 @@ int MMG2D_bdryEdge(MMG5_pMesh mesh) { * (edges). * */ -int MMG2D_pack(MMG5_pMesh mesh,MMG5_pSol sol,MMG5_pSol met) { +MMG_int MMG2D_pack(MMG5_pMesh mesh,MMG5_pSol sol,MMG5_pSol met) { MMG5_pTria pt,ptnew,pt1; MMG5_pQuad pq,pq1; MMG5_pEdge ped; MMG5_pPoint ppt,pptnew; - int np,ned,nt,k,iel,nbl,isol,isolnew,memWarn,nc; - int iadr,iadrnew,iadrv,*adjav,*adja,*adjanew,voy; + MMG_int np,ned,nt,k,iel,nbl,isol,isolnew,memWarn,nc; + MMG_int iadr,iadrnew,iadrv,*adjav,*adja,*adjanew,voy; int8_t i,i1,i2; /* Keep only one domain if asked */ diff --git a/src/mmg2d/inout_2d.c b/src/mmg2d/inout_2d.c index b9d1fc466..8e856ac67 100644 --- a/src/mmg2d/inout_2d.c +++ b/src/mmg2d/inout_2d.c @@ -23,7 +23,7 @@ #include "mmg2d.h" /* read mesh data */ -int MMG2D_loadMesh(MMG5_pMesh mesh,const char *filename) { +MMG_int MMG2D_loadMesh(MMG5_pMesh mesh,const char *filename) { FILE *inm; MMG5_pPoint ppt; MMG5_pEdge ped; @@ -31,9 +31,9 @@ int MMG2D_loadMesh(MMG5_pMesh mesh,const char *filename) { MMG5_pQuad pq1; float fc; long posnp,posnt,posncor,posned,posnq,posreq,posreqed,posntreq,posnqreq; - int k,ref,tmp,ncor,norient,nreq,ntreq,nreqed,bin,iswp,nqreq,nref; + MMG_int k,ref,tmp,ncor,norient,nreq,ntreq,nreqed,bin,iswp,nqreq,nref; double air,dtmp; - int i,bdim,binch,bpos; + MMG_int i,bdim,binch,bpos; char *ptr,*data; char chaine[MMG5_FILESTR_LGTH],strskip[MMG5_FILESTR_LGTH]; @@ -592,10 +592,10 @@ int MMG2D_loadMesh(MMG5_pMesh mesh,const char *filename) { * the mesh (mesh generation) and check that all z-componants are 0. * */ -int MMG2D_2dMeshCheck(MMG5_pMesh mesh) { +MMG_int MMG2D_2dMeshCheck(MMG5_pMesh mesh) { MMG5_pPoint ppt; double z; - int k; + MMG_int k; if (!mesh->nt) { for (k=1; k<=mesh->np; k++) { @@ -619,11 +619,11 @@ int MMG2D_2dMeshCheck(MMG5_pMesh mesh) { return 1; } -int MMG2D_loadMshMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { +MMG_int MMG2D_loadMshMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { FILE* inm; long posNodes,posElts,*posNodeData; - int ier; - int bin,iswp,nelts,nsols; + MMG_int ier; + MMG_int bin,iswp,nelts,nsols; mesh->dim = 2; @@ -680,11 +680,11 @@ int MMG2D_loadMshMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { return 1; } -int MMG2D_loadMshMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename) { +MMG_int MMG2D_loadMshMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename) { FILE* inm; long posNodes,posElts,*posNodeData; - int ier; - int bin,iswp,nelts,nsols; + MMG_int ier; + MMG_int bin,iswp,nelts,nsols; mesh->dim = 2; @@ -754,9 +754,9 @@ int MMG2D_loadMshMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * */ static inline -int MMG2D_readFloatSol(MMG5_pSol sol,FILE *inm,int bin,int iswp,int pos) { +MMG_int MMG2D_readFloatSol(MMG5_pSol sol,FILE *inm,MMG_int bin,MMG_int iswp,MMG_int pos) { float fbuf; - int i; + MMG_int i; for (i=0; isize; i++) { if ( !bin ) { @@ -785,9 +785,9 @@ int MMG2D_readFloatSol(MMG5_pSol sol,FILE *inm,int bin,int iswp,int pos) { * */ static inline -int MMG2D_readDoubleSol(MMG5_pSol sol,FILE *inm,int bin,int iswp,int pos) { +MMG_int MMG2D_readDoubleSol(MMG5_pSol sol,FILE *inm,MMG_int bin,MMG_int iswp,MMG_int pos) { double dbuf; - int i; + MMG_int i; for (i=0; isize; i++) { if ( !bin ) { @@ -812,11 +812,11 @@ int MMG2D_readDoubleSol(MMG5_pSol sol,FILE *inm,int bin,int iswp,int pos) { * Load metric field. * */ -int MMG2D_loadSol(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { +MMG_int MMG2D_loadSol(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { FILE *inm; long posnp; - int iswp,ier,dim,meshDim; - int k,ver,bin,np,nsols,*type; + MMG_int iswp,ier,dim,meshDim; + MMG_int k,ver,bin,np,nsols,*type; /** Read the file header */ meshDim = 2; @@ -899,12 +899,12 @@ int MMG2D_loadSol(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { * Load a medit solution file containing 1 or more solutions. * */ -int MMG2D_loadAllSols(MMG5_pMesh mesh,MMG5_pSol *sol, const char *filename) { +MMG_int MMG2D_loadAllSols(MMG5_pMesh mesh,MMG5_pSol *sol, const char *filename) { MMG5_pSol psl; FILE *inm; long posnp; - int iswp,ier,dim,meshDim; - int j,k,ver,bin,np,nsols,*type; + MMG_int iswp,ier,dim,meshDim; + MMG_int j,k,ver,bin,np,nsols,*type; char data[16]; static int8_t mmgWarn = 0; @@ -1003,15 +1003,15 @@ int MMG2D_loadAllSols(MMG5_pMesh mesh,MMG5_pSol *sol, const char *filename) { return 1; } -int MMG2D_saveMesh(MMG5_pMesh mesh,const char *filename) { +MMG_int MMG2D_saveMesh(MMG5_pMesh mesh,const char *filename) { FILE* inm; MMG5_pPoint ppt; MMG5_pEdge ped; MMG5_pTria pt; MMG5_pQuad pq; double dblb; - int k,ne,np,nc,nreq,nereq,nedreq,nq,nqreq,ref; - int bin, binch, bpos; + MMG_int k,ne,np,nc,nreq,nereq,nedreq,nq,nqreq,ref; + MMG_int bin, binch, bpos; char *ptr,*data,chaine[MMG5_FILESTR_LGTH]; mesh->ver = 2; @@ -1434,11 +1434,11 @@ int MMG2D_saveMesh(MMG5_pMesh mesh,const char *filename) { return 1; } -int MMG2D_saveMshMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { +MMG_int MMG2D_saveMshMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { return MMG5_saveMshMesh(mesh,&sol,filename,1); } -int MMG2D_saveMshMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename) { +MMG_int MMG2D_saveMshMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename) { return MMG5_saveMshMesh(mesh,sol,filename,0); } @@ -1452,8 +1452,8 @@ int MMG2D_saveMshMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * */ static inline -void MMG2D_writeDoubleSol(MMG5_pSol sol,FILE *inm,int bin,int pos) { - int i,isol; +void MMG2D_writeDoubleSol(MMG5_pSol sol,FILE *inm,MMG_int bin,MMG_int pos) { + MMG_int i,isol; isol = pos * sol->size; @@ -1477,11 +1477,11 @@ void MMG2D_writeDoubleSol(MMG5_pSol sol,FILE *inm,int bin,int pos) { * Write isotropic or anisotropic metric. * */ -int MMG2D_saveSol(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { +MMG_int MMG2D_saveSol(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { FILE* inm; MMG5_pPoint ppt; - int k,ier; - int binch,bin,bpos,dim; + MMG_int k,ier; + MMG_int binch,bin,bpos,dim; if ( !sol->np ) return 1; @@ -1537,20 +1537,20 @@ int MMG2D_saveSol(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { * Write 1 or more solutions. * */ -int MMG2D_saveAllSols(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename) { +MMG_int MMG2D_saveAllSols(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename) { FILE* inm; MMG5_pPoint ppt; MMG5_pSol psl; - int j,k,ier; - int binch,bin,bpos,npointSols,ncellSols; - int *type,*size,*entities; + MMG_int j,k,ier; + MMG_int binch,bin,bpos,npointSols,ncellSols; + MMG_int *type,*size,*entities; if ( !(*sol)[0].np ) return 1; - MMG5_SAFE_CALLOC(type,mesh->nsols,int,return 0); - MMG5_SAFE_CALLOC(size,mesh->nsols,int,MMG5_SAFE_FREE(type);return 0); - MMG5_SAFE_CALLOC(entities,mesh->nsols,int, + MMG5_SAFE_CALLOC(type,mesh->nsols,MMG_int,return 0); + MMG5_SAFE_CALLOC(size,mesh->nsols,MMG_int,MMG5_SAFE_FREE(type);return 0); + MMG5_SAFE_CALLOC(entities,mesh->nsols,MMG_int, MMG5_SAFE_FREE(type);MMG5_SAFE_FREE(size);return 0); npointSols = 0; @@ -1630,11 +1630,11 @@ int MMG2D_saveAllSols(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename) { } /* Custom version of Savemesh for debugging purpose */ -int MMG2D_savemesh_db(MMG5_pMesh mesh,char *filename,int8_t pack) { +MMG_int MMG2D_savemesh_db(MMG5_pMesh mesh,char *filename,int8_t pack) { MMG5_pTria pt; MMG5_pEdge pa; MMG5_pPoint ppt,p0,p1,p2; - int k,np,nt,nc; + MMG_int k,np,nt,nc; FILE *out; out = fopen(filename,"w"); @@ -1723,9 +1723,9 @@ int MMG2D_savemesh_db(MMG5_pMesh mesh,char *filename,int8_t pack) { } /* Custom version of Savemet for debugging purpose */ -int MMG2D_savemet_db(MMG5_pMesh mesh,MMG5_pSol met,char *filename,int8_t pack) { +MMG_int MMG2D_savemet_db(MMG5_pMesh mesh,MMG5_pSol met,char *filename,int8_t pack) { MMG5_pPoint ppt; - int k,np; + MMG_int k,np; char *ptr,typ=0,*data; FILE *out; @@ -1783,9 +1783,9 @@ int MMG2D_savemet_db(MMG5_pMesh mesh,MMG5_pSol met,char *filename,int8_t pack) { } /* Save normal vector field for debugging purpose */ -int MMG2D_savenor_db(MMG5_pMesh mesh,char *filename,int8_t pack) { +MMG_int MMG2D_savenor_db(MMG5_pMesh mesh,char *filename,int8_t pack) { MMG5_pPoint ppt; - int k,np; + MMG_int k,np; char *ptr,*data; FILE *out; @@ -1838,9 +1838,9 @@ int MMG2D_savenor_db(MMG5_pMesh mesh,char *filename,int8_t pack) { } /* Save displacement field for debugging purpose */ -int MMG2D_savedisp_db(MMG5_pMesh mesh,MMG5_pSol disp,char *filename,int8_t pack) { +MMG_int MMG2D_savedisp_db(MMG5_pMesh mesh,MMG5_pSol disp,char *filename,int8_t pack) { MMG5_pPoint ppt; - int k,np; + MMG_int k,np; char *ptr,*data; FILE *out; @@ -1890,10 +1890,10 @@ int MMG2D_savedisp_db(MMG5_pMesh mesh,MMG5_pSol disp,char *filename,int8_t pack) } static inline -int MMG2D_saveEle(MMG5_pMesh mesh,const char *filename) { +MMG_int MMG2D_saveEle(MMG5_pMesh mesh,const char *filename) { FILE* inm; MMG5_pTria pt; - int k,i,ne; + MMG_int k,i,ne; char *ptr,*data; if ( !mesh->nt ) { @@ -1962,10 +1962,10 @@ int MMG2D_saveEle(MMG5_pMesh mesh,const char *filename) { } static inline -int MMG2D_saveNeigh(MMG5_pMesh mesh,const char *filename) { +MMG_int MMG2D_saveNeigh(MMG5_pMesh mesh,const char *filename) { FILE* inm; MMG5_pTria pt; - int k,i,ne,idx; + MMG_int k,i,ne,idx; char *ptr,*data; if ( !mesh->nt ) { @@ -2041,8 +2041,8 @@ int MMG2D_saveNeigh(MMG5_pMesh mesh,const char *filename) { } static inline -int MMG2D_saveEdge(MMG5_pMesh mesh,const char *filename) { - int ier,nb_edges; +MMG_int MMG2D_saveEdge(MMG5_pMesh mesh,const char *filename) { + MMG_int ier,nb_edges; ier = MMG5_saveEdge(mesh,filename,".poly"); if ( !ier ) { @@ -2062,7 +2062,7 @@ int MMG2D_saveEdge(MMG5_pMesh mesh,const char *filename) { } -int MMG2D_saveTetgenMesh(MMG5_pMesh mesh,const char *filename) { +MMG_int MMG2D_saveTetgenMesh(MMG5_pMesh mesh,const char *filename) { if ( !MMG5_saveNode(mesh,filename) ) { return 0; diff --git a/src/mmg2d/inoutcpp_2d.cpp b/src/mmg2d/inoutcpp_2d.cpp index dd8b2c745..12bc62a53 100644 --- a/src/mmg2d/inoutcpp_2d.cpp +++ b/src/mmg2d/inoutcpp_2d.cpp @@ -36,10 +36,10 @@ #ifdef USE_VTK -static int MMG2D_loadVtkMesh_part2 ( MMG5_pMesh mesh,MMG5_pSol *sol, +static MMG_int MMG2D_loadVtkMesh_part2 ( MMG5_pMesh mesh,MMG5_pSol *sol, vtkDataSet **dataset, int8_t ptMeditRef, - int8_t eltMeditRef,int nsols ) { - int ier; + int8_t eltMeditRef,MMG_int nsols ) { + MMG_int ier; if ( !MMG2D_zaldy(mesh) ) { return 0; @@ -78,14 +78,14 @@ static int MMG2D_loadVtkMesh_part2 ( MMG5_pMesh mesh,MMG5_pSol *sol, #endif -int MMG2D_loadVtpMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { +MMG_int MMG2D_loadVtpMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { #ifndef USE_VTK fprintf(stderr," ** VTK library not founded. Unavailable file format.\n"); return -1; #else - int ier,nsols; + MMG_int ier,nsols; int8_t ptMeditRef,eltMeditRef; vtkDataSet *dataset; @@ -114,14 +114,14 @@ int MMG2D_loadVtpMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { #endif } -int MMG2D_loadVtpMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename) { +MMG_int MMG2D_loadVtpMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename) { #ifndef USE_VTK fprintf(stderr," ** VTK library not founded. Unavailable file format.\n"); return -1; #else - int ier,nsols; + MMG_int ier,nsols; int8_t ptMeditRef,eltMeditRef; vtkDataSet *dataset; @@ -145,14 +145,14 @@ int MMG2D_loadVtpMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil #endif } -int MMG2D_loadVtkMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { +MMG_int MMG2D_loadVtkMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { #ifndef USE_VTK fprintf(stderr," ** VTK library not founded. Unavailable file format.\n"); return -1; #else - int ier,nsols; + MMG_int ier,nsols; int8_t ptMeditRef,eltMeditRef; vtkDataSet *dataset; @@ -181,14 +181,14 @@ int MMG2D_loadVtkMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { #endif } -int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename) { +MMG_int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename) { #ifndef USE_VTK fprintf(stderr," ** VTK library not founded. Unavailable file format.\n"); return -1; #else - int ier,nsols; + MMG_int ier,nsols; int8_t ptMeditRef,eltMeditRef; vtkDataSet *dataset; @@ -212,14 +212,14 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil #endif } -int MMG2D_loadVtuMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { +MMG_int MMG2D_loadVtuMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { #ifndef USE_VTK fprintf(stderr," ** VTK library not founded. Unavailable file format.\n"); return -1; #else - int ier,nsols; + MMG_int ier,nsols; int8_t ptMeditRef,eltMeditRef; vtkDataSet *dataset; @@ -248,7 +248,7 @@ int MMG2D_loadVtuMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { #endif } -int MMG2D_loadVtuMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename) { +MMG_int MMG2D_loadVtuMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename) { #ifndef USE_VTK @@ -256,7 +256,7 @@ int MMG2D_loadVtuMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil return -1; #else - int ier,nsols; + MMG_int ier,nsols; int8_t ptMeditRef,eltMeditRef; vtkDataSet *dataset; @@ -286,7 +286,7 @@ int MMG2D_loadVtuMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil #endif } -int MMG2D_saveVtuMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { +MMG_int MMG2D_saveVtuMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { #ifndef USE_VTK @@ -301,7 +301,7 @@ int MMG2D_saveVtuMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { #endif } -int MMG2D_saveVtuMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename) { +MMG_int MMG2D_saveVtuMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename) { #ifndef USE_VTK @@ -316,7 +316,7 @@ int MMG2D_saveVtuMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil #endif } -int MMG2D_saveVtkMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { +MMG_int MMG2D_saveVtkMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { #ifndef USE_VTK @@ -331,7 +331,7 @@ int MMG2D_saveVtkMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { #endif } -int MMG2D_saveVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename) { +MMG_int MMG2D_saveVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename) { #ifndef USE_VTK @@ -346,7 +346,7 @@ int MMG2D_saveVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil #endif } -int MMG2D_saveVtpMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { +MMG_int MMG2D_saveVtpMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { #ifndef USE_VTK @@ -362,7 +362,7 @@ int MMG2D_saveVtpMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) { } -int MMG2D_saveVtpMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename) { +MMG_int MMG2D_saveVtpMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename) { #ifndef USE_VTK diff --git a/src/mmg2d/intmet_2d.c b/src/mmg2d/intmet_2d.c index be6216849..f8078a4f0 100644 --- a/src/mmg2d/intmet_2d.c +++ b/src/mmg2d/intmet_2d.c @@ -35,9 +35,9 @@ /* Interpolation of isotropic metric met along edge i of triangle k, according to parameter s; ip = index of the new point */ -int MMG2D_intmet_iso(MMG5_pMesh mesh,MMG5_pSol met,int k,int8_t i,int ip,double s) { +MMG_int MMG2D_intmet_iso(MMG5_pMesh mesh,MMG5_pSol met,MMG_int k,int8_t i,MMG_int ip,double s) { MMG5_pTria pt; - int ip1,ip2; + MMG_int ip1,ip2; int8_t i1,i2; pt = &mesh->tria[k]; @@ -51,7 +51,7 @@ int MMG2D_intmet_iso(MMG5_pMesh mesh,MMG5_pSol met,int k,int8_t i,int ip,double } /* Interpolation of metrics m and n according to parameter s; result is stored in mr. A simultaneous reduction of both matrices is performed and the sizes are interpolated. */ -int MMG5_interpmet22(MMG5_pMesh mesh,double *m,double *n,double s,double *mr) { +MMG_int MMG5_interpmet22(MMG5_pMesh mesh,double *m,double *n,double s,double *mr) { double det,imn[4],dd,den,sqDelta,trimn,lambda[2],vp[2][2],dm[2]; double dn[2],vnorm,d0,d1,ip[4]; static int8_t mmgWarn0=0,mmgWarn1=0; @@ -206,13 +206,13 @@ int MMG5_interpmet22(MMG5_pMesh mesh,double *m,double *n,double s,double *mr) { /* Interpolation of anisotropic metric met along edge i of triangle k, according to parameter s; ip = index of the new point */ -int MMG2D_intmet_ani(MMG5_pMesh mesh,MMG5_pSol met,int k,int8_t i,int ip,double s) { +MMG_int MMG2D_intmet_ani(MMG5_pMesh mesh,MMG5_pSol met,MMG_int k,int8_t i,MMG_int ip,double s) { MMG5_pTria pt; double *m1,*m2,*mr; #ifndef NDEBUG double det; #endif - int ip1,ip2; + MMG_int ip1,ip2; int8_t i1,i2; static int8_t mmgWarn=0; diff --git a/src/mmg2d/isosiz_2d.c b/src/mmg2d/isosiz_2d.c index bd9f926ae..01fa0a6c9 100644 --- a/src/mmg2d/isosiz_2d.c +++ b/src/mmg2d/isosiz_2d.c @@ -47,8 +47,8 @@ * we have processed this extremities. * */ -int MMG2D_sum_reqEdgeLengthsAtPoint(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTria pt,int8_t i) { - int ip0,ip1; +MMG_int MMG2D_sum_reqEdgeLengthsAtPoint(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTria pt,int8_t i) { + MMG_int ip0,ip1; ip0 = pt->v[MMG5_iprv2[i]]; ip1 = pt->v[MMG5_inxt2[i]]; @@ -72,9 +72,9 @@ int MMG2D_sum_reqEdgeLengthsAtPoint(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTria pt, * marked with flag 3. * */ -int MMG2D_set_metricAtPointsOnReqEdges ( MMG5_pMesh mesh,MMG5_pSol met, int8_t ismet ) { +MMG_int MMG2D_set_metricAtPointsOnReqEdges ( MMG5_pMesh mesh,MMG5_pSol met, int8_t ismet ) { MMG5_pTria pt; - int k,i,iadj; + MMG_int k,i,iadj; /* Reset the tria flag */ for ( k=1; k<=mesh->nt; k++ ) { @@ -127,13 +127,13 @@ return 1; * curvature of the external and internal curves present in the mesh * */ -int MMG2D_defsiz_iso(MMG5_pMesh mesh,MMG5_pSol met) { +MMG_int MMG2D_defsiz_iso(MMG5_pMesh mesh,MMG5_pSol met) { MMG5_pTria pt; MMG5_pPoint p0,p1,p2; MMG5_pPar ppa; double t1[2],t2[2],b1[2],b2[2],gpp1[2],gpp2[2],pv,M1,M2; double ps1,ps2,ux,uy,ll,li,lm,hmax,hausd,hmin,lhmax,lhausd; - int k,l,ip,ip1,ip2; + MMG_int k,l,ip,ip1,ip2; int8_t ismet; uint8_t i,i1,i2; diff --git a/src/mmg2d/length_2d.c b/src/mmg2d/length_2d.c index 0391c5f9d..995bf75ee 100644 --- a/src/mmg2d/length_2d.c +++ b/src/mmg2d/length_2d.c @@ -59,7 +59,7 @@ double long_ani(double *ca,double *cb,double *ma,double *mb) { } /** Calculate length of a curve in the considered isotropic metric */ -double MMG2D_lencurv_iso(MMG5_pMesh mesh,MMG5_pSol met,int ip1,int ip2) { +double MMG2D_lencurv_iso(MMG5_pMesh mesh,MMG5_pSol met,MMG_int ip1,MMG_int ip2) { MMG5_pPoint p1,p2; double h1,h2,len,l,r; @@ -78,7 +78,7 @@ double MMG2D_lencurv_iso(MMG5_pMesh mesh,MMG5_pSol met,int ip1,int ip2) { } /* Calculate length of a curve in the considered anisotropic metric by using a two-point quadrature formula */ -double MMG2D_lencurv_ani(MMG5_pMesh mesh,MMG5_pSol met,int ip1,int ip2) { +double MMG2D_lencurv_ani(MMG5_pMesh mesh,MMG5_pSol met,MMG_int ip1,MMG_int ip2) { MMG5_pPoint p1,p2; double len,*m1,*m2,ux,uy,l1,l2; static int8_t mmgWarn0=0,mmgWarn1=0; @@ -121,10 +121,10 @@ double MMG2D_lencurv_ani(MMG5_pMesh mesh,MMG5_pSol met,int ip1,int ip2) { } /* print histo of edge lengths */ -int MMG2D_prilen(MMG5_pMesh mesh,MMG5_pSol sol) { +MMG_int MMG2D_prilen(MMG5_pMesh mesh,MMG5_pSol sol) { MMG5_pTria pt; double lavg,len,ecart,som,lmin,lmax; - int k,l,navg,ia,ipa,ipb,iamin,ibmin,iamax,ibmax,nullEdge,hl[9]; + MMG_int k,l,navg,ia,ipa,ipb,iamin,ibmin,iamax,ibmax,nullEdge,hl[9]; static double bd[9] = {0.0, 0.3, 0.6, 0.7071, 0.9, 1.3, 1.4142, 2.0, 5.0}; navg = 0; diff --git a/src/mmg2d/libmmg2d.c b/src/mmg2d/libmmg2d.c index 2b95390bf..13bc0fddc 100644 --- a/src/mmg2d/libmmg2d.c +++ b/src/mmg2d/libmmg2d.c @@ -56,7 +56,7 @@ void MMG2D_solTruncatureForOptim(MMG5_pMesh mesh, MMG5_pSol met) { MMG5_pTria ptt; MMG5_pPoint ppt; - int k,i,iadr; + MMG_int k,i,iadr; double isqhmin, isqhmax; int8_t sethmin, sethmax; @@ -161,7 +161,7 @@ void MMG2D_solTruncatureForOptim(MMG5_pMesh mesh, MMG5_pSol met) { return; } -int MMG2D_mmg2dlib(MMG5_pMesh mesh,MMG5_pSol met) +MMG_int MMG2D_mmg2dlib(MMG5_pMesh mesh,MMG5_pSol met) { MMG5_pSol sol=NULL; // unused mytime ctim[TIMEMAX]; @@ -378,8 +378,8 @@ int MMG2D_mmg2dlib(MMG5_pMesh mesh,MMG5_pSol met) * */ static inline -int MMG2D_restart(MMG5_pMesh mesh){ - int k; +MMG_int MMG2D_restart(MMG5_pMesh mesh){ + MMG_int k; /** If needed, reallocate the missing structures */ if ( !mesh->tria ) { @@ -410,7 +410,7 @@ int MMG2D_restart(MMG5_pMesh mesh){ } -int MMG2D_mmg2dmesh(MMG5_pMesh mesh,MMG5_pSol met) { +MMG_int MMG2D_mmg2dmesh(MMG5_pMesh mesh,MMG5_pSol met) { MMG5_pSol sol=NULL; // unused mytime ctim[TIMEMAX]; char stim[32]; @@ -528,10 +528,10 @@ int MMG2D_mmg2dmesh(MMG5_pMesh mesh,MMG5_pSol met) { if ( mesh->info.ddebug && !MMG5_chkmsh(mesh,1,0) ) _LIBMMG5_RETURN(mesh,met,sol,MMG5_STRONGFAILURE); /* Memory alloc */ - MMG5_ADD_MEM(mesh,(3*mesh->ntmax+5)*sizeof(int),"adjacency table", + MMG5_ADD_MEM(mesh,(3*mesh->ntmax+5)*sizeof(MMG_int),"adjacency table", printf(" Exit program.\n"); return MMG5_STRONGFAILURE); - MMG5_SAFE_CALLOC(mesh->adja,3*mesh->ntmax+5,int,return MMG5_STRONGFAILURE); + MMG5_SAFE_CALLOC(mesh->adja,3*mesh->ntmax+5,MMG_int,return MMG5_STRONGFAILURE); /* Delaunay triangulation of the set of points contained in the mesh, * enforcing the edges of the mesh */ @@ -633,7 +633,7 @@ int MMG2D_mmg2dmesh(MMG5_pMesh mesh,MMG5_pSol met) { } -int MMG2D_mmg2dls(MMG5_pMesh mesh,MMG5_pSol sol,MMG5_pSol umet) +MMG_int MMG2D_mmg2dls(MMG5_pMesh mesh,MMG5_pSol sol,MMG5_pSol umet) { MMG5_pSol met=NULL; mytime ctim[TIMEMAX]; @@ -924,11 +924,11 @@ int MMG2D_mmg2dls(MMG5_pMesh mesh,MMG5_pSol sol,MMG5_pSol umet) } -int MMG2D_mmg2dmov(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pSol disp) { +MMG_int MMG2D_mmg2dmov(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pSol disp) { mytime ctim[TIMEMAX]; char stim[32]; - int ier; - int k,*invalidTris; + MMG_int ier; + MMG_int k,*invalidTris; if ( mesh->info.imprim >= 0 ) { diff --git a/src/mmg2d/libmmg2d.h b/src/mmg2d/libmmg2d.h index c39414153..aeb470f8a 100644 --- a/src/mmg2d/libmmg2d.h +++ b/src/mmg2d/libmmg2d.h @@ -114,7 +114,7 @@ extern "C" { * \remark No fortran interface to allow variadic arguments. * */ - int MMG2D_Init_mesh(const int starter,...); + MMG_int MMG2D_Init_mesh(const MMG_int starter,...); /** * \param mesh pointer toward the mesh structure. @@ -159,7 +159,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_inputMeshName(MMG5_pMesh mesh, const char* meshin); + MMG_int MMG2D_Set_inputMeshName(MMG5_pMesh mesh, const char* meshin); /** * \param mesh pointer toward the mesh structure. * \param meshout name of the output mesh file. @@ -176,7 +176,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_outputMeshName(MMG5_pMesh mesh, const char* meshout); + MMG_int MMG2D_Set_outputMeshName(MMG5_pMesh mesh, const char* meshout); /** * \param mesh pointer toward the mesh structure. * \param sol pointer toward the sol structure. @@ -194,7 +194,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_inputSolName(MMG5_pMesh mesh,MMG5_pSol sol, const char* solin); + MMG_int MMG2D_Set_inputSolName(MMG5_pMesh mesh,MMG5_pSol sol, const char* solin); /** * \param mesh pointer toward the mesh structure. * \param sol pointer toward the sol structure. @@ -212,7 +212,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_outputSolName(MMG5_pMesh mesh,MMG5_pSol sol, const char* solout); + MMG_int MMG2D_Set_outputSolName(MMG5_pMesh mesh,MMG5_pSol sol, const char* solout); /** * \param mesh pointer toward the mesh structure. * \param sol pointer toward the sol structure. @@ -230,7 +230,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_iparameter(MMG5_pMesh mesh, MMG5_pSol sol, int iparam, int val); + MMG_int MMG2D_Set_iparameter(MMG5_pMesh mesh, MMG5_pSol sol, MMG_int iparam, MMG_int val); /** * \param mesh pointer toward the mesh structure. @@ -250,7 +250,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_dparameter(MMG5_pMesh mesh, MMG5_pSol sol, int dparam, double val); + MMG_int MMG2D_Set_dparameter(MMG5_pMesh mesh, MMG5_pSol sol, MMG_int dparam, double val); /** * \param mesh pointer toward the mesh structure. @@ -275,8 +275,8 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_localParameter(MMG5_pMesh mesh, MMG5_pSol sol, int typ, - int ref,double hmin,double hmax,double hausd); + MMG_int MMG2D_Set_localParameter(MMG5_pMesh mesh, MMG5_pSol sol, MMG_int typ, + MMG_int ref,double hmin,double hmax,double hausd); /** * \param mesh pointer toward the mesh structure. @@ -297,8 +297,8 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_multiMat(MMG5_pMesh mesh, MMG5_pSol sol,int ref,int split, - int rin, int rex); + MMG_int MMG2D_Set_multiMat(MMG5_pMesh mesh, MMG5_pSol sol,MMG_int ref,MMG_int split, + MMG_int rin, MMG_int rex); /* init structure datas */ /** @@ -321,7 +321,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_meshSize(MMG5_pMesh mesh, int np, int nt, int nquad, int na); + MMG_int MMG2D_Set_meshSize(MMG5_pMesh mesh, MMG_int np, MMG_int nt, MMG_int nquad, MMG_int na); /** * \param mesh pointer toward the mesh structure. * \param sol pointer toward the sol structure. @@ -342,8 +342,8 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_solSize(MMG5_pMesh mesh, MMG5_pSol sol, int typEntity, - int np, int typSol); + MMG_int MMG2D_Set_solSize(MMG5_pMesh mesh, MMG5_pSol sol, MMG_int typEntity, + MMG_int np, MMG_int typSol); /** * \param mesh pointer toward the mesh structure. * \param sol pointer toward an allocatable sol structure. @@ -367,8 +367,8 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_solsAtVerticesSize(MMG5_pMesh mesh, MMG5_pSol *sol,int nsols, - int nentities, int *typSol); + MMG_int MMG2D_Set_solsAtVerticesSize(MMG5_pMesh mesh, MMG5_pSol *sol,MMG_int nsols, + MMG_int nentities, MMG_int *typSol); /** * \param mesh pointer toward the mesh structure. * \param c0 coordinate of the point along the first dimension. @@ -389,8 +389,8 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_vertex(MMG5_pMesh mesh, double c0, double c1, - int ref,int pos); + MMG_int MMG2D_Set_vertex(MMG5_pMesh mesh, double c0, double c1, + MMG_int ref,MMG_int pos); /** * \param mesh pointer toward the mesh structure. * \param vertices table of the points coor. @@ -413,7 +413,7 @@ extern "C" { * > ! END SUBROUTINE\n * */ - int MMG2D_Set_vertices(MMG5_pMesh mesh, double *vertices,int *refs); + MMG_int MMG2D_Set_vertices(MMG5_pMesh mesh, double *vertices,MMG_int *refs); /** * \param mesh pointer toward the mesh structure. * \param k vertex index. @@ -430,7 +430,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_corner(MMG5_pMesh mesh, int k); + MMG_int MMG2D_Set_corner(MMG5_pMesh mesh, MMG_int k); /** * \param mesh pointer toward the mesh structure. * \param k vertex index. @@ -447,7 +447,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Unset_corner(MMG5_pMesh mesh, int k); + MMG_int MMG2D_Unset_corner(MMG5_pMesh mesh, MMG_int k); /** * \param mesh pointer toward the mesh structure. @@ -464,7 +464,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_requiredVertex(MMG5_pMesh mesh, int k); + MMG_int MMG2D_Set_requiredVertex(MMG5_pMesh mesh, MMG_int k); /** * \param mesh pointer toward the mesh structure. @@ -481,7 +481,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Unset_requiredVertex(MMG5_pMesh mesh, int k); + MMG_int MMG2D_Unset_requiredVertex(MMG5_pMesh mesh, MMG_int k); /** * \param mesh pointer toward the mesh structure. @@ -503,8 +503,8 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_triangle(MMG5_pMesh mesh, int v0, int v1, - int v2, int ref, int pos); + MMG_int MMG2D_Set_triangle(MMG5_pMesh mesh, MMG_int v0, MMG_int v1, + MMG_int v2, MMG_int ref, MMG_int pos); /** * \param mesh pointer toward the mesh structure. * \param tria pointer toward the table of the tria vertices. @@ -524,7 +524,7 @@ extern "C" { * > ! END SUBROUTINE\n * */ - int MMG2D_Set_triangles(MMG5_pMesh mesh, int *tria, int *refs); + MMG_int MMG2D_Set_triangles(MMG5_pMesh mesh, MMG_int *tria, MMG_int *refs); /** * \param mesh pointer toward the mesh structure. @@ -541,7 +541,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_requiredTriangle(MMG5_pMesh mesh, int k); + MMG_int MMG2D_Set_requiredTriangle(MMG5_pMesh mesh, MMG_int k); /** * \param mesh pointer toward the mesh structure. @@ -558,7 +558,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Unset_requiredTriangle(MMG5_pMesh mesh, int k); + MMG_int MMG2D_Unset_requiredTriangle(MMG5_pMesh mesh, MMG_int k); /** * \param mesh pointer toward the mesh structure. @@ -581,8 +581,8 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_quadrilateral(MMG5_pMesh mesh, int v0, int v1, - int v2, int v3, int ref, int pos); + MMG_int MMG2D_Set_quadrilateral(MMG5_pMesh mesh, MMG_int v0, MMG_int v1, + MMG_int v2, MMG_int v3, MMG_int ref, MMG_int pos); /** * \param mesh pointer toward the mesh structure. @@ -604,8 +604,8 @@ extern "C" { * > ! END SUBROUTINE\n * */ - int MMG2D_Set_quadrilaterals(MMG5_pMesh mesh, int *quadra, - int *refs); + MMG_int MMG2D_Set_quadrilaterals(MMG5_pMesh mesh, MMG_int *quadra, + MMG_int *refs); /** * \param mesh pointer toward the mesh structure. @@ -626,7 +626,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_edge(MMG5_pMesh mesh, int v0, int v1, int ref, int pos); + MMG_int MMG2D_Set_edge(MMG5_pMesh mesh, MMG_int v0, MMG_int v1, MMG_int ref, MMG_int pos); /** * \param mesh pointer toward the mesh structure. * \param edges pointer toward the array of edges. @@ -644,7 +644,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_edges(MMG5_pMesh mesh, int *edges, int* refs); + MMG_int MMG2D_Set_edges(MMG5_pMesh mesh, MMG_int *edges, MMG_int* refs); /** * \param mesh pointer toward the mesh structure. * \param k edge index. @@ -660,7 +660,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_requiredEdge(MMG5_pMesh mesh, int k); + MMG_int MMG2D_Set_requiredEdge(MMG5_pMesh mesh, MMG_int k); /** * \param mesh pointer toward the mesh structure. * \param k edge index. @@ -676,7 +676,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Unset_requiredEdge(MMG5_pMesh mesh, int k); + MMG_int MMG2D_Unset_requiredEdge(MMG5_pMesh mesh, MMG_int k); /** * \param mesh pointer toward the mesh structure. * \param k edge index. @@ -692,7 +692,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_parallelEdge(MMG5_pMesh mesh, int k); + MMG_int MMG2D_Set_parallelEdge(MMG5_pMesh mesh, MMG_int k); /** * \param met pointer toward the sol structure. * \param s solution scalar value. @@ -711,7 +711,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_scalarSol(MMG5_pSol met, double s, int pos); + MMG_int MMG2D_Set_scalarSol(MMG5_pSol met, double s, MMG_int pos); /** * \param met pointer toward the sol structure. * \param s table of the scalar solutions values. @@ -728,7 +728,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_scalarSols(MMG5_pSol met, double *s); + MMG_int MMG2D_Set_scalarSols(MMG5_pSol met, double *s); /** * \param met pointer toward the sol structure. * \param vx x value of the vectorial solution. @@ -748,8 +748,8 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_vectorSol(MMG5_pSol met, double vx,double vy, - int pos); + MMG_int MMG2D_Set_vectorSol(MMG5_pSol met, double vx,double vy, + MMG_int pos); /** * \param met pointer toward the sol structure. * \param sols table of the vectorial solutions @@ -766,7 +766,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_vectorSols(MMG5_pSol met, double *sols); + MMG_int MMG2D_Set_vectorSols(MMG5_pSol met, double *sols); /** * \param met pointer toward the sol structure. * \param m11 value at position (1,1) in the solution tensor. @@ -787,8 +787,8 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_tensorSol(MMG5_pSol met, double m11, double m12, double m22, - int pos); + MMG_int MMG2D_Set_tensorSol(MMG5_pSol met, double m11, double m12, double m22, + MMG_int pos); /** * \param met pointer toward the sol structure. * \param sols table of the tensorial solutions. @@ -806,7 +806,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_tensorSols(MMG5_pSol met, double *sols); + MMG_int MMG2D_Set_tensorSols(MMG5_pSol met, double *sols); /** * \param sol pointer toward the array of solutions * \param i position of the solution field that we want to set. @@ -827,7 +827,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_ithSol_inSolsAtVertices(MMG5_pSol sol,int i, double* s,int pos); + MMG_int MMG2D_Set_ithSol_inSolsAtVertices(MMG5_pSol sol,MMG_int i, double* s,MMG_int pos); /** * \param sol pointer toward the array of solutions * \param i position of the solution field that we want to set. @@ -849,7 +849,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Set_ithSols_inSolsAtVertices(MMG5_pSol sol,int i, double* s); + MMG_int MMG2D_Set_ithSols_inSolsAtVertices(MMG5_pSol sol,MMG_int i, double* s); /** recover datas */ /** @@ -870,7 +870,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Get_meshSize(MMG5_pMesh mesh, int* np, int* nt, int* nquad, int* na); + MMG_int MMG2D_Get_meshSize(MMG5_pMesh mesh, MMG_int* np, MMG_int* nt, MMG_int* nquad, MMG_int* na); /** * \param mesh pointer toward the mesh structure. * \param sol pointer toward the sol structure. @@ -889,8 +889,8 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Get_solSize(MMG5_pMesh mesh, MMG5_pSol sol, int* typEntity, int* np, - int* typSol); + MMG_int MMG2D_Get_solSize(MMG5_pMesh mesh, MMG5_pSol sol, MMG_int* typEntity, MMG_int* np, + MMG_int* typSol); /** * \param mesh pointer toward the mesh structure. * \param sol pointer toward an array of sol structure. @@ -911,8 +911,8 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Get_solsAtVerticesSize(MMG5_pMesh mesh, MMG5_pSol* sol,int *nsols, - int* nentities,int* typSol); + MMG_int MMG2D_Get_solsAtVerticesSize(MMG5_pMesh mesh, MMG5_pSol* sol,MMG_int *nsols, + MMG_int* nentities,MMG_int* typSol); /** * \param mesh pointer toward the mesh structure. * \param c0 pointer toward the coordinate of the point along the first dimension. @@ -934,8 +934,8 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Get_vertex(MMG5_pMesh mesh, double* c0, double* c1, int* ref, - int* isCorner, int* isRequired); + MMG_int MMG2D_Get_vertex(MMG5_pMesh mesh, double* c0, double* c1, MMG_int* ref, + MMG_int* isCorner, MMG_int* isRequired); /** * \param mesh pointer toward the mesh structure. * \param c0 pointer toward the coordinate of the point along the first dimension. @@ -958,8 +958,8 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_GetByIdx_vertex(MMG5_pMesh mesh, double* c0, double* c1, int* ref, - int* isCorner, int* isRequired,int idx); + MMG_int MMG2D_GetByIdx_vertex(MMG5_pMesh mesh, double* c0, double* c1, MMG_int* ref, + MMG_int* isCorner, MMG_int* isRequired,MMG_int idx); /** * \param mesh pointer toward the mesh structure. * \param vertices pointer toward the table of the points coordinates. @@ -987,8 +987,8 @@ extern "C" { * > ! END SUBROUTINE\n * */ - int MMG2D_Get_vertices(MMG5_pMesh mesh, double* vertices, int* refs, - int* areCorners, int* areRequired); + MMG_int MMG2D_Get_vertices(MMG5_pMesh mesh, double* vertices, MMG_int* refs, + MMG_int* areCorners, MMG_int* areRequired); /** * \param mesh pointer toward the mesh structure. * \param v0 pointer toward the first vertex of triangle. @@ -1010,8 +1010,8 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Get_triangle(MMG5_pMesh mesh, int* v0, int* v1, int* v2, int* ref - ,int* isRequired); + MMG_int MMG2D_Get_triangle(MMG5_pMesh mesh, MMG_int* v0, MMG_int* v1, MMG_int* v2, MMG_int* ref + ,MMG_int* isRequired); /** * \param mesh pointer toward the mesh structure. * \param tria pointer toward the table of the triangles vertices @@ -1035,8 +1035,8 @@ extern "C" { * > ! END SUBROUTINE\n * */ - int MMG2D_Get_triangles(MMG5_pMesh mesh, int* tria, int* refs, - int* areRequired); + MMG_int MMG2D_Get_triangles(MMG5_pMesh mesh, MMG_int* tria, MMG_int* refs, + MMG_int* areRequired); /** * \param mesh pointer toward the mesh structure. @@ -1062,8 +1062,8 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Get_quadrilateral(MMG5_pMesh mesh, int* v0, int* v1, int* v2, - int* v3,int* ref, int* isRequired); + MMG_int MMG2D_Get_quadrilateral(MMG5_pMesh mesh, MMG_int* v0, MMG_int* v1, MMG_int* v2, + MMG_int* v3,MMG_int* ref, MMG_int* isRequired); /** * \param mesh pointer toward the mesh structure. * \param quadra pointer toward the table of the quadrilaterals vertices. @@ -1089,8 +1089,8 @@ extern "C" { * > ! END SUBROUTINE\n * */ - int MMG2D_Get_quadrilaterals(MMG5_pMesh mesh, int* quadra,int* refs, - int* areRequired); + MMG_int MMG2D_Get_quadrilaterals(MMG5_pMesh mesh, MMG_int* quadra,MMG_int* refs, + MMG_int* areRequired); /** * \param mesh pointer toward the mesh structure. * \param e0 pointer toward the first extremity of the edge. @@ -1114,8 +1114,8 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Get_edge(MMG5_pMesh mesh, int* e0, int* e1, int* ref - ,int* isRidge, int* isRequired); + MMG_int MMG2D_Get_edge(MMG5_pMesh mesh, MMG_int* e0, MMG_int* e1, MMG_int* ref + ,MMG_int* isRidge, MMG_int* isRequired); /** * \param mesh pointer toward the mesh structure. * \param edges pointer toward the array of edges. @@ -1136,8 +1136,8 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Get_edges(MMG5_pMesh mesh,int *edges,int* refs, - int *areRidges,int *areRequired); + MMG_int MMG2D_Get_edges(MMG5_pMesh mesh,MMG_int *edges,MMG_int* refs, + MMG_int *areRidges,MMG_int *areRequired); /** * \param mesh pointer toward the mesh structure. @@ -1155,7 +1155,7 @@ extern "C" { * > END SUBROUTINE\n * */ - double MMG2D_Get_triangleQuality(MMG5_pMesh mesh,MMG5_pSol met, int k); + double MMG2D_Get_triangleQuality(MMG5_pMesh mesh,MMG5_pSol met, MMG_int k); /** * \param met pointer toward the sol structure. @@ -1172,7 +1172,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Get_scalarSol(MMG5_pSol met, double* s); + MMG_int MMG2D_Get_scalarSol(MMG5_pSol met, double* s); /** * \param met pointer toward the sol structure. * \param s table of the scalar solutions at mesh vertices. s[i-1] is @@ -1189,7 +1189,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Get_scalarSols(MMG5_pSol met, double* s); + MMG_int MMG2D_Get_scalarSols(MMG5_pSol met, double* s); /** * \param met pointer toward the sol structure. * \param vx x value of the vectorial solution. @@ -1206,7 +1206,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Get_vectorSol(MMG5_pSol met, double* vx, double* vy); + MMG_int MMG2D_Get_vectorSol(MMG5_pSol met, double* vx, double* vy); /** * \param met pointer toward the sol structure. * \param sols table of the solutions at mesh vertices. sols[2*(i-1)]\@2 is @@ -1223,7 +1223,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Get_vectorSols(MMG5_pSol met, double* sols); + MMG_int MMG2D_Get_vectorSols(MMG5_pSol met, double* sols); /** * \param met pointer toward the sol structure. * \param m11 pointer toward the position (1,1) in the solution tensor. @@ -1241,7 +1241,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Get_tensorSol(MMG5_pSol met, double *m11,double *m12,double *m22); + MMG_int MMG2D_Get_tensorSol(MMG5_pSol met, double *m11,double *m12,double *m22); /** * \param met pointer toward the sol structure. * \param sols table of the solutions at mesh vertices. @@ -1258,7 +1258,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Get_tensorSols(MMG5_pSol met, double *sols); + MMG_int MMG2D_Get_tensorSols(MMG5_pSol met, double *sols); /** * \param sol pointer toward the array of solutions * \param i position of the solution field that we want to set. @@ -1279,7 +1279,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Get_ithSol_inSolsAtVertices(MMG5_pSol sol,int i, double* s,int pos); + MMG_int MMG2D_Get_ithSol_inSolsAtVertices(MMG5_pSol sol,MMG_int i, double* s,MMG_int pos); /** * \param sol pointer toward the array of solutions * \param i position of the solution field that we want to get. @@ -1301,7 +1301,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Get_ithSols_inSolsAtVertices(MMG5_pSol sol,int i, double* s); + MMG_int MMG2D_Get_ithSols_inSolsAtVertices(MMG5_pSol sol,MMG_int i, double* s); /** @@ -1319,7 +1319,7 @@ extern "C" { * > END SUBROUTINE\n * */ - int MMG2D_Chk_meshData(MMG5_pMesh mesh,MMG5_pSol met); + MMG_int MMG2D_Chk_meshData(MMG5_pMesh mesh,MMG5_pSol met); /** * \param mesh pointer toward the mesh structure. @@ -1335,7 +1335,7 @@ extern "C" { * > END SUBROUTINE\n * */ -int MMG2D_Free_allSols(MMG5_pMesh mesh,MMG5_pSol *sol); +MMG_int MMG2D_Free_allSols(MMG5_pMesh mesh,MMG5_pSol *sol); /* deallocations */ /** @@ -1369,7 +1369,7 @@ int MMG2D_Free_allSols(MMG5_pMesh mesh,MMG5_pSol *sol); * \remark no Fortran interface to allow variadic args. * */ - int MMG2D_Free_all(const int starter,...); + MMG_int MMG2D_Free_all(const MMG_int starter,...); /** * \param starter dummy argument used to initialize the variadic argument @@ -1404,7 +1404,7 @@ int MMG2D_Free_allSols(MMG5_pMesh mesh,MMG5_pSol *sol); * \remark no Fortran interface to allow variadic args. * */ - int MMG2D_Free_structures(const int starter,...); + MMG_int MMG2D_Free_structures(const MMG_int starter,...); /** * \param starter dummy argument used to initialize the variadic argument @@ -1439,7 +1439,7 @@ int MMG2D_Free_allSols(MMG5_pMesh mesh,MMG5_pSol *sol); * \remark no Fortran interface to allow variadic args. * */ - int MMG2D_Free_names(const int starter,...); + MMG_int MMG2D_Free_names(const MMG_int starter,...); /** * \param mesh pointer toward the mesh structure. @@ -1457,7 +1457,7 @@ int MMG2D_Free_allSols(MMG5_pMesh mesh,MMG5_pSol *sol); * > END SUBROUTINE\n * */ - int MMG2D_loadMesh(MMG5_pMesh mesh,const char * filename); + MMG_int MMG2D_loadMesh(MMG5_pMesh mesh,const char * filename); /** * \param mesh pointer toward the mesh structure. @@ -1477,7 +1477,7 @@ int MMG2D_Free_allSols(MMG5_pMesh mesh,MMG5_pSol *sol); * > END SUBROUTINE\n * */ -int MMG2D_loadVtpMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); +MMG_int MMG2D_loadVtpMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); /** * \param mesh pointer toward the mesh structure. * \param sol pointer toward the solution structure. @@ -1496,7 +1496,7 @@ int MMG2D_loadVtpMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); * > END SUBROUTINE\n * */ -int MMG2D_loadVtpMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename); +MMG_int MMG2D_loadVtpMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename); /** * \param mesh pointer toward the mesh structure. @@ -1516,7 +1516,7 @@ int MMG2D_loadVtpMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ -int MMG2D_loadVtuMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); +MMG_int MMG2D_loadVtuMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); /** * \param mesh pointer toward the mesh structure. @@ -1536,7 +1536,7 @@ int MMG2D_loadVtuMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); * > END SUBROUTINE\n * */ -int MMG2D_loadVtuMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename); +MMG_int MMG2D_loadVtuMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename); /** * \param mesh pointer toward the mesh structure. @@ -1556,7 +1556,7 @@ int MMG2D_loadVtuMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ -int MMG2D_loadVtkMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); +MMG_int MMG2D_loadVtkMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); /** * \param mesh pointer toward the mesh structure. @@ -1576,7 +1576,7 @@ int MMG2D_loadVtkMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); * > END SUBROUTINE\n * */ -int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename); +MMG_int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename); /** * \param mesh pointer toward the mesh structure. @@ -1596,7 +1596,7 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_loadMshMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); + MMG_int MMG2D_loadMshMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); /** * \param mesh pointer toward the mesh structure. * \param sol pointer toward a list of solution structures. @@ -1615,7 +1615,7 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_loadMshMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename); + MMG_int MMG2D_loadMshMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename); /** * \param mesh pointer toward the mesh structure. @@ -1635,7 +1635,7 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_loadSol(MMG5_pMesh mesh,MMG5_pSol sol,const char * filename); + MMG_int MMG2D_loadSol(MMG5_pMesh mesh,MMG5_pSol sol,const char * filename); /** * \param mesh pointer toward the mesh structure. * \param sol pointer toward the solutions array @@ -1653,9 +1653,9 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_loadAllSols(MMG5_pMesh mesh,MMG5_pSol *sol, const char* filename); + MMG_int MMG2D_loadAllSols(MMG5_pMesh mesh,MMG5_pSol *sol, const char* filename); - int MMG2D_loadVect(MMG5_pMesh ,char *); + MMG_int MMG2D_loadVect(MMG5_pMesh ,char *); /** * \param mesh pointer toward the mesh structure. @@ -1673,7 +1673,7 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_saveMesh(MMG5_pMesh ,const char *); + MMG_int MMG2D_saveMesh(MMG5_pMesh ,const char *); /** * \param mesh pointer toward the mesh structure. * \param sol pointer toward the solution structure. @@ -1692,7 +1692,7 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_saveMshMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); + MMG_int MMG2D_saveMshMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); /** * \param mesh pointer toward the mesh structure. * \param sol pointer toward the solution structure. @@ -1711,7 +1711,7 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_saveMshMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename); + MMG_int MMG2D_saveMshMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename); /** * \param mesh pointer toward the mesh structure. * \param sol pointer toward the solution structure. @@ -1729,7 +1729,7 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_saveVtkMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); + MMG_int MMG2D_saveVtkMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); /** * \param mesh pointer toward the mesh structure. * \param sol pointer toward the solution structure. @@ -1747,7 +1747,7 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_saveVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename); + MMG_int MMG2D_saveVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename); /** * \param mesh pointer toward the mesh structure. * \param sol pointer toward the solution structure. @@ -1765,7 +1765,7 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_saveVtuMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); + MMG_int MMG2D_saveVtuMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); /** * \param mesh pointer toward the mesh structure. * \param sol pointer toward the solution structure. @@ -1783,7 +1783,7 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_saveVtuMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename); + MMG_int MMG2D_saveVtuMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename); /** * \param mesh pointer toward the mesh structure. * \param sol pointer toward the solution structure. @@ -1801,7 +1801,7 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_saveVtpMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); + MMG_int MMG2D_saveVtpMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); /** * \param mesh pointer toward the mesh structure. * \param sol pointer toward the solution structure. @@ -1819,7 +1819,7 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_saveVtpMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename); + MMG_int MMG2D_saveVtpMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *filename); /** * \param mesh pointer toward the mesh structure. @@ -1837,7 +1837,7 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_saveTetgenMesh(MMG5_pMesh ,const char *); + MMG_int MMG2D_saveTetgenMesh(MMG5_pMesh ,const char *); /** @@ -1857,7 +1857,7 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_saveSol(MMG5_pMesh mesh,MMG5_pSol sol ,const char *filename); + MMG_int MMG2D_saveSol(MMG5_pMesh mesh,MMG5_pSol sol ,const char *filename); /** * \param mesh pointer toward the mesh structure. * \param sol pointer toward the solutions array @@ -1875,10 +1875,10 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_saveAllSols(MMG5_pMesh mesh,MMG5_pSol *sol ,const char *filename); + MMG_int MMG2D_saveAllSols(MMG5_pMesh mesh,MMG5_pSol *sol ,const char *filename); - int MMG2D_saveVect(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename,double lambda); + MMG_int MMG2D_saveVect(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename,double lambda); /** * \param mesh pointer toward the mesh structure. @@ -1896,7 +1896,7 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_mmg2dlib(MMG5_pMesh mesh,MMG5_pSol sol); + MMG_int MMG2D_mmg2dlib(MMG5_pMesh mesh,MMG5_pSol sol); /** * \param mesh pointer toward the mesh structure. @@ -1914,7 +1914,7 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_mmg2dmesh(MMG5_pMesh mesh,MMG5_pSol sol); + MMG_int MMG2D_mmg2dmesh(MMG5_pMesh mesh,MMG5_pSol sol); /** * \param mesh pointer toward the mesh structure. @@ -1935,7 +1935,7 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_mmg2dls(MMG5_pMesh mesh,MMG5_pSol sol,MMG5_pSol met) ; + MMG_int MMG2D_mmg2dls(MMG5_pMesh mesh,MMG5_pSol sol,MMG5_pSol met) ; /** * \param mesh pointer toward the mesh structure. * \param sol pointer toward a sol structure (displacement). @@ -1954,10 +1954,10 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_mmg2dmov(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pSol disp); + MMG_int MMG2D_mmg2dmov(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pSol disp); /* Tools for the library */ -// void (*MMG2D_callbackinsert) (int ,int ,int ,int, int); +// void (*MMG2D_callbackinsert) (MMG_int ,MMG_int ,MMG_int ,MMG_int, MMG_int); /** * \param mesh pointer toward the mesh structure @@ -1974,7 +1974,7 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_doSol(MMG5_pMesh mesh ,MMG5_pSol met ); + MMG_int MMG2D_doSol(MMG5_pMesh mesh ,MMG5_pSol met ); /** * \param mesh pointer toward the mesh structure @@ -1991,7 +1991,7 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_Set_constantSize(MMG5_pMesh mesh,MMG5_pSol met); + MMG_int MMG2D_Set_constantSize(MMG5_pMesh mesh,MMG5_pSol met); /** * \param mesh pointer toward the mesh structure. @@ -2029,7 +2029,7 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_Get_numberOfNonBdyEdges(MMG5_pMesh mesh, int* nb_edges); + MMG_int MMG2D_Get_numberOfNonBdyEdges(MMG5_pMesh mesh, MMG_int* nb_edges); /** * \param mesh pointer toward the mesh structure. @@ -2054,7 +2054,7 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_Get_nonBdyEdge(MMG5_pMesh mesh, int* e0, int* e1, int* ref, int idx); + MMG_int MMG2D_Get_nonBdyEdge(MMG5_pMesh mesh, MMG_int* e0, MMG_int* e1, MMG_int* ref, MMG_int idx); /** * \brief Return adjacent elements of a triangle. @@ -2077,7 +2077,7 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_Get_adjaTri(MMG5_pMesh mesh, int kel, int listri[3]); + MMG_int MMG2D_Get_adjaTri(MMG5_pMesh mesh, MMG_int kel, MMG_int listri[3]); /** * \brief Return adjacent elements of a triangle. @@ -2099,7 +2099,7 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_Get_adjaVertices(MMG5_pMesh mesh, int ip, int lispoi[MMG2D_LMAX]); + MMG_int MMG2D_Get_adjaVertices(MMG5_pMesh mesh, MMG_int ip, MMG_int lispoi[MMG2D_LMAX]); /** * \brief Return adjacent elements of a triangle. @@ -2122,8 +2122,8 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_Get_adjaVerticesFast(MMG5_pMesh mesh, int ip,int start, - int lispoi[MMG2D_LMAX]); + MMG_int MMG2D_Get_adjaVerticesFast(MMG5_pMesh mesh, MMG_int ip,MMG_int start, + MMG_int lispoi[MMG2D_LMAX]); /** * \param mesh pointer toward the mesh structure. * \param ked index of the boundary edge. @@ -2144,7 +2144,7 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_Get_triFromEdge(MMG5_pMesh mesh, int ked, int *ktri, int *ied); + MMG_int MMG2D_Get_triFromEdge(MMG5_pMesh mesh, MMG_int ked, MMG_int *ktri, MMG_int *ied); /** * \param mesh pointer toward the mesh structure. * \param ked index of the boundary edge. @@ -2168,7 +2168,7 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_Get_trisFromEdge(MMG5_pMesh mesh, int ked, int ktri[2], int ied[2]); + MMG_int MMG2D_Get_trisFromEdge(MMG5_pMesh mesh, MMG_int ked, MMG_int ktri[2], MMG_int ied[2]); /** * \param m upper part of a symetric matric diagonalizable in |R @@ -2192,7 +2192,7 @@ int MMG2D_loadVtkMesh_and_allData(MMG5_pMesh mesh,MMG5_pSol *sol,const char *fil * > END SUBROUTINE\n * */ - int MMG2D_Compute_eigenv(double m[3],double lambda[2],double vp[2][2]); + MMG_int MMG2D_Compute_eigenv(double m[3],double lambda[2],double vp[2][2]); /** diff --git a/src/mmg2d/libmmg2d_tools.c b/src/mmg2d/libmmg2d_tools.c index 5d00a0b77..0af2f8039 100644 --- a/src/mmg2d/libmmg2d_tools.c +++ b/src/mmg2d/libmmg2d_tools.c @@ -65,8 +65,8 @@ void MMG2D_setfunc(MMG5_pMesh mesh,MMG5_pSol met) { * Read parameter file DEFAULT.mmg2d * */ -int MMG2D_parsop(MMG5_pMesh mesh,MMG5_pSol met) { - int ret,ref,i,j,npar; +MMG_int MMG2D_parsop(MMG5_pMesh mesh,MMG5_pSol met) { + MMG_int ret,ref,i,j,npar; float fp1,fp2,fp3; char *ptr,data[256]; FILE *in; @@ -182,7 +182,7 @@ int MMG2D_parsop(MMG5_pMesh mesh,MMG5_pSol met) { } /* Free the structure dedicated to the management of multiple local parameters */ -int MMG2D_freeLocalPar(MMG5_pMesh mesh) { +MMG_int MMG2D_freeLocalPar(MMG5_pMesh mesh) { free(mesh->info.par); mesh->info.npar = 0; @@ -190,10 +190,10 @@ int MMG2D_freeLocalPar(MMG5_pMesh mesh) { return 1; } -int MMG2D_Get_numberOfNonBdyEdges(MMG5_pMesh mesh, int* nb_edges) { +MMG_int MMG2D_Get_numberOfNonBdyEdges(MMG5_pMesh mesh, MMG_int* nb_edges) { MMG5_pTria pt,pt1; MMG5_pEdge ped; - int *adja,k,i,j,i1,i2,iel; + MMG_int *adja,k,i,j,i1,i2,iel; *nb_edges = 0; if ( mesh->tria ) { @@ -283,7 +283,7 @@ int MMG2D_Get_numberOfNonBdyEdges(MMG5_pMesh mesh, int* nb_edges) { return 1; } -int MMG2D_Get_nonBdyEdge(MMG5_pMesh mesh, int* e0, int* e1, int* ref, int idx) { +MMG_int MMG2D_Get_nonBdyEdge(MMG5_pMesh mesh, MMG_int* e0, MMG_int* e1, MMG_int* ref, MMG_int idx) { MMG5_pEdge ped; size_t na_tot=0; char *ptr_c = (char*)mesh->edge; @@ -327,7 +327,7 @@ int MMG2D_Get_nonBdyEdge(MMG5_pMesh mesh, int* e0, int* e1, int* ref, int idx) { return 1; } -int MMG2D_Get_adjaTri(MMG5_pMesh mesh, int kel, int listri[3]) { +MMG_int MMG2D_Get_adjaTri(MMG5_pMesh mesh, MMG_int kel, MMG_int listri[3]) { if ( ! mesh->adja ) { if (! MMG2D_hashTria(mesh)) @@ -341,9 +341,9 @@ int MMG2D_Get_adjaTri(MMG5_pMesh mesh, int kel, int listri[3]) { return 1; } -int MMG2D_Get_adjaVertices(MMG5_pMesh mesh, int ip, int lispoi[MMG2D_LMAX]) +MMG_int MMG2D_Get_adjaVertices(MMG5_pMesh mesh, MMG_int ip, MMG_int lispoi[MMG2D_LMAX]) { - int start; + MMG_int start; if ( !mesh->tria ) return 0; @@ -353,10 +353,10 @@ int MMG2D_Get_adjaVertices(MMG5_pMesh mesh, int ip, int lispoi[MMG2D_LMAX]) return MMG2D_Get_adjaVerticesFast(mesh,ip,start,lispoi); } -int MMG2D_Get_adjaVerticesFast(MMG5_pMesh mesh, int ip,int start, int lispoi[MMG2D_LMAX]) +MMG_int MMG2D_Get_adjaVerticesFast(MMG5_pMesh mesh, MMG_int ip,MMG_int start, MMG_int lispoi[MMG2D_LMAX]) { MMG5_pTria pt; - int k,prevk,nbpoi,iploc,i,i1,i2,*adja; + MMG_int k,prevk,nbpoi,iploc,i,i1,i2,*adja; pt = &mesh->tria[start]; @@ -427,9 +427,9 @@ int MMG2D_Get_adjaVerticesFast(MMG5_pMesh mesh, int ip,int start, int lispoi[MMG return nbpoi; } -int MMG2D_Get_triFromEdge(MMG5_pMesh mesh, int ked, int *ktri, int *ied) +MMG_int MMG2D_Get_triFromEdge(MMG5_pMesh mesh, MMG_int ked, MMG_int *ktri, MMG_int *ied) { - int val; + MMG_int val; val = mesh->edge[ked].base; @@ -446,11 +446,11 @@ int MMG2D_Get_triFromEdge(MMG5_pMesh mesh, int ked, int *ktri, int *ied) return 1; } -int MMG2D_Get_trisFromEdge(MMG5_pMesh mesh, int ked, int ktri[2], int ied[2]) +MMG_int MMG2D_Get_trisFromEdge(MMG5_pMesh mesh, MMG_int ked, MMG_int ktri[2], MMG_int ied[2]) { - int ier,itri; + MMG_int ier,itri; #ifndef NDEBUG - int ia0,ib0,ia1,ib1; + MMG_int ia0,ib0,ia1,ib1; #endif ktri[0] = ktri[1] = 0; @@ -486,7 +486,7 @@ int MMG2D_Get_trisFromEdge(MMG5_pMesh mesh, int ked, int ktri[2], int ied[2]) return 1; } -int MMG2D_Set_constantSize(MMG5_pMesh mesh,MMG5_pSol met) { +MMG_int MMG2D_Set_constantSize(MMG5_pMesh mesh,MMG5_pSol met) { double hsiz; /* Memory alloc */ @@ -509,7 +509,7 @@ int MMG2D_Set_constantSize(MMG5_pMesh mesh,MMG5_pSol met) { return 1; } -int MMG2D_Compute_eigenv(double m[3],double lambda[2],double vp[2][2]) { +MMG_int MMG2D_Compute_eigenv(double m[3],double lambda[2],double vp[2][2]) { return MMG5_eigensym(m,lambda,vp); @@ -517,7 +517,7 @@ int MMG2D_Compute_eigenv(double m[3],double lambda[2],double vp[2][2]) { void MMG2D_Reset_verticestags(MMG5_pMesh mesh) { - int k; + MMG_int k; for ( k=1; k<=mesh->np; ++k ) { mesh->point[k].tag = 0; diff --git a/src/mmg2d/libmmg2d_toolsf.c b/src/mmg2d/libmmg2d_toolsf.c index 371aebca8..d9adf87ed 100644 --- a/src/mmg2d/libmmg2d_toolsf.c +++ b/src/mmg2d/libmmg2d_toolsf.c @@ -57,7 +57,7 @@ FORTRAN_NAME(MMG2D_SETFUNC,mmg2d_setfunc, * See \ref MMG2D_Get_numberOfNonBdyEdges function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_GET_NUMBEROFNONBDYEDGES,mmg2d_get_numberofnonbdyedges, - (MMG5_pMesh *mesh,int* nb_edges, int* retval), + (MMG5_pMesh *mesh,MMG_int* nb_edges, MMG_int* retval), (mesh,nb_edges,retval)) { *retval = MMG2D_Get_numberOfNonBdyEdges(*mesh,nb_edges); return; @@ -67,7 +67,7 @@ FORTRAN_NAME(MMG2D_GET_NUMBEROFNONBDYEDGES,mmg2d_get_numberofnonbdyedges, * See \ref MMG2D_Get_nonBdyEdge function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_GET_NONBDYEDGE,mmg2d_get_nonbdyedge, - (MMG5_pMesh *mesh,int* e0, int* e1,int *ref,int* idx,int* retval), + (MMG5_pMesh *mesh,MMG_int* e0, MMG_int* e1,MMG_int *ref,MMG_int* idx,MMG_int* retval), (mesh,e0,e1,ref,idx,retval)) { *retval = MMG2D_Get_nonBdyEdge(*mesh,e0,e1,ref,*idx); return; @@ -77,7 +77,7 @@ FORTRAN_NAME(MMG2D_GET_NONBDYEDGE,mmg2d_get_nonbdyedge, * See \ref MMG2D_Get_adjaTri function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_GET_ADJATRI,mmg2d_get_adjatri, - (MMG5_pMesh *mesh,int* kel, int* listri, int* retval), + (MMG5_pMesh *mesh,MMG_int* kel, MMG_int* listri, MMG_int* retval), (mesh,kel,listri,retval)) { *retval = MMG2D_Get_adjaTri(*mesh,*kel,listri); return; @@ -87,7 +87,7 @@ FORTRAN_NAME(MMG2D_GET_ADJATRI,mmg2d_get_adjatri, * See \ref MMG2D_Get_adjaVertices function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_GET_ADJAVERTICES,mmg2d_get_adjavertices, - (MMG5_pMesh *mesh,int* ip, int* lispoi, int* retval), + (MMG5_pMesh *mesh,MMG_int* ip, MMG_int* lispoi, MMG_int* retval), (mesh,ip,lispoi,retval)) { *retval = MMG2D_Get_adjaVertices(*mesh, *ip,lispoi); return; @@ -97,7 +97,7 @@ FORTRAN_NAME(MMG2D_GET_ADJAVERTICES,mmg2d_get_adjavertices, * See \ref MMG2D_Get_adjaVerticesFast function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_GET_ADJAVERTICESFAST,mmg2d_get_adjaverticesfast, - (MMG5_pMesh *mesh,int* ip, int *start, int* lispoi, int* retval), + (MMG5_pMesh *mesh,MMG_int* ip, MMG_int *start, MMG_int* lispoi, MMG_int* retval), (mesh,ip,start,lispoi,retval)) { *retval = MMG2D_Get_adjaVerticesFast(*mesh,*ip, *start,lispoi); return; @@ -107,7 +107,7 @@ FORTRAN_NAME(MMG2D_GET_ADJAVERTICESFAST,mmg2d_get_adjaverticesfast, * See \ref MMG2D_Get_triFromEdge function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_GET_TRIFROMEDGE,mmg2d_get_trifromedge, - (MMG5_pMesh *mesh,int *ked, int *ktri, int *ied,int *retval), + (MMG5_pMesh *mesh,MMG_int *ked, MMG_int *ktri, MMG_int *ied,MMG_int *retval), (mesh,ked,ktri,ied,retval)) { *retval = MMG2D_Get_triFromEdge(*mesh,*ked,ktri,ied); @@ -118,7 +118,7 @@ FORTRAN_NAME(MMG2D_GET_TRIFROMEDGE,mmg2d_get_trifromedge, * See \ref MMG2D_Get_trisFromEdge function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_GET_TRISFROMEDGE,mmg2d_get_trisfromedge, - (MMG5_pMesh *mesh,int *ked, int ktri[2], int ied[2],int *retval), + (MMG5_pMesh *mesh,MMG_int *ked, MMG_int ktri[2], MMG_int ied[2],MMG_int *retval), (mesh,ked,ktri,ied,retval)) { *retval = MMG2D_Get_trisFromEdge(*mesh,*ked,ktri,ied); @@ -129,7 +129,7 @@ FORTRAN_NAME(MMG2D_GET_TRISFROMEDGE,mmg2d_get_trisfromedge, * See \ref MMG2D_Compute_eigenv function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_COMPUTE_EIGENV,mmg2d_compute_eigenv, - (double m[3],double lambda[2],double vp[2][2],int *retval), + (double m[3],double lambda[2],double vp[2][2],MMG_int *retval), (m,lambda,vp,retval)) { *retval = MMG2D_Compute_eigenv(m,lambda,vp); @@ -185,7 +185,7 @@ FORTRAN_NAME(MMG2D_FREE_SOLUTIONS,mmg2d_free_solutions, * See \ref MMG2D_DoSol function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_DOSOL,mmg2d_dosol, - (MMG5_pMesh *mesh,MMG5_pSol *met,int *retval), + (MMG5_pMesh *mesh,MMG5_pSol *met,MMG_int *retval), (mesh,met,retval)) { *retval = MMG2D_doSol(*mesh,*met); return; @@ -195,7 +195,7 @@ FORTRAN_NAME(MMG2D_DOSOL,mmg2d_dosol, * See \ref MMG2D_Set_constantSize function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_SET_CONSTANTSIZE,mmg2d_set_constantsize, - (MMG5_pMesh *mesh,MMG5_pSol *met,int *retval), + (MMG5_pMesh *mesh,MMG5_pSol *met,MMG_int *retval), (mesh,met,retval)) { *retval = MMG2D_Set_constantSize(*mesh,*met); return; diff --git a/src/mmg2d/libmmg2df.c b/src/mmg2d/libmmg2df.c index 3d1fbd15a..1c536e43b 100644 --- a/src/mmg2d/libmmg2df.c +++ b/src/mmg2d/libmmg2df.c @@ -48,7 +48,7 @@ * See \ref MMG2D_mmg2dlib function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_MMG2DLIB,mmg2d_mmg2dlib,(MMG5_pMesh *mesh,MMG5_pSol *met - ,int* retval),(mesh,met + ,MMG_int* retval),(mesh,met ,retval)){ *retval = MMG2D_mmg2dlib(*mesh,*met); @@ -59,7 +59,7 @@ FORTRAN_NAME(MMG2D_MMG2DLIB,mmg2d_mmg2dlib,(MMG5_pMesh *mesh,MMG5_pSol *met * See \ref MMG2D_mmg2dmesh function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_MMG2DMESH,mmg2d_mmg2dmesh,(MMG5_pMesh *mesh,MMG5_pSol *met - ,int* retval),(mesh,met + ,MMG_int* retval),(mesh,met ,retval)){ *retval = MMG2D_mmg2dmesh(*mesh,*met); @@ -70,7 +70,7 @@ FORTRAN_NAME(MMG2D_MMG2DMESH,mmg2d_mmg2dmesh,(MMG5_pMesh *mesh,MMG5_pSol *met * See \ref MMG2D_mmg2dls function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_MMG2DLS,mmg2d_mmg2dls,(MMG5_pMesh *mesh,MMG5_pSol *sol, - MMG5_pSol *met,int* retval), + MMG5_pSol *met,MMG_int* retval), (mesh,sol,met,retval)){ if ( met ) { @@ -86,7 +86,7 @@ FORTRAN_NAME(MMG2D_MMG2DLS,mmg2d_mmg2dls,(MMG5_pMesh *mesh,MMG5_pSol *sol, * See \ref MMG2D_mmg2dmov function in \ref mmg2d/libmmg2d.h file. */ FORTRAN_NAME(MMG2D_MMG2DMOV,mmg2d_mmg2dmov,(MMG5_pMesh *mesh,MMG5_pSol *met,MMG5_pSol *disp - ,int* retval),(mesh,met,disp + ,MMG_int* retval),(mesh,met,disp ,retval)){ *retval = MMG2D_mmg2dmov(*mesh,*met,*disp); diff --git a/src/mmg2d/libmmg2df.h b/src/mmg2d/libmmg2df.h index 24c526b51..4e1721ff2 100644 --- a/src/mmg2d/libmmg2df.h +++ b/src/mmg2d/libmmg2df.h @@ -141,7 +141,7 @@ ! * ! */ -! void MMG2D_Init_mesh(const int starter,...); +! void MMG2D_Init_mesh(const MMG_int starter,...); ! /** ! * \param mesh pointer toward the mesh structure. @@ -198,7 +198,7 @@ END INTERFACE ! * ! */ -! int MMG2D_Set_inputMeshName(MMG5_pMesh mesh, const char* meshin); +! MMG_int MMG2D_Set_inputMeshName(MMG5_pMesh mesh, const char* meshin); ! /** ! * \param mesh pointer toward the mesh structure. ! * \param meshout name of the output mesh file. @@ -219,7 +219,7 @@ END INTERFACE ! * ! */ -! int MMG2D_Set_outputMeshName(MMG5_pMesh mesh, const char* meshout); +! MMG_int MMG2D_Set_outputMeshName(MMG5_pMesh mesh, const char* meshout); ! /** ! * \param mesh pointer toward the mesh structure. ! * \param sol pointer toward the sol structure. @@ -241,7 +241,7 @@ END INTERFACE ! * ! */ -! int MMG2D_Set_inputSolName(MMG5_pMesh mesh,MMG5_pSol sol, const char* solin); +! MMG_int MMG2D_Set_inputSolName(MMG5_pMesh mesh,MMG5_pSol sol, const char* solin); ! /** ! * \param mesh pointer toward the mesh structure. ! * \param sol pointer toward the sol structure. @@ -263,7 +263,7 @@ END INTERFACE ! * ! */ -! int MMG2D_Set_outputSolName(MMG5_pMesh mesh,MMG5_pSol sol, const char* solout); +! MMG_int MMG2D_Set_outputSolName(MMG5_pMesh mesh,MMG5_pSol sol, const char* solout); ! /** ! * \param mesh pointer toward the mesh structure. ! * \param sol pointer toward the sol structure. @@ -285,7 +285,7 @@ END INTERFACE ! * ! */ -! int MMG2D_Set_iparameter(MMG5_pMesh mesh, MMG5_pSol sol, int iparam, int val); +! MMG_int MMG2D_Set_iparameter(MMG5_pMesh mesh, MMG5_pSol sol, MMG_int iparam, MMG_int val); ! /** ! * \param mesh pointer toward the mesh structure. @@ -309,7 +309,7 @@ END INTERFACE ! * ! */ -! int MMG2D_Set_dparameter(MMG5_pMesh mesh, MMG5_pSol sol, int dparam, double val); +! MMG_int MMG2D_Set_dparameter(MMG5_pMesh mesh, MMG5_pSol sol, MMG_int dparam, double val); ! /* init structure datas */ ! /** @@ -335,7 +335,7 @@ END INTERFACE ! * ! */ -! int MMG2D_Set_meshSize(MMG5_pMesh mesh, int np, int nt, int na); +! MMG_int MMG2D_Set_meshSize(MMG5_pMesh mesh, MMG_int np, MMG_int nt, MMG_int na); ! /** ! * \param mesh pointer toward the mesh structure. ! * \param sol pointer toward the sol structure. @@ -358,8 +358,8 @@ END INTERFACE ! * ! */ -! int MMG2D_Set_solSize(MMG5_pMesh mesh, MMG5_pSol sol, int typEntity, -! int np, int typSol); +! MMG_int MMG2D_Set_solSize(MMG5_pMesh mesh, MMG5_pSol sol, MMG_int typEntity, +! MMG_int np, MMG_int typSol); ! /** ! * \param mesh pointer toward the mesh structure. @@ -385,8 +385,8 @@ END INTERFACE ! * ! */ -! int MMG2D_Set_vertex(MMG5_pMesh mesh, double c0, double c1, -! int ref,int pos); +! MMG_int MMG2D_Set_vertex(MMG5_pMesh mesh, double c0, double c1, +! MMG_int ref,MMG_int pos); ! /** ! * \param mesh pointer toward the mesh structure. ! * \param vertices table of the points coor. @@ -413,7 +413,7 @@ END INTERFACE ! * ! */ -! int MMG2D_Set_vertices(MMG5_pMesh mesh, double *vertices,int *refs); +! MMG_int MMG2D_Set_vertices(MMG5_pMesh mesh, double *vertices,MMG_int *refs); ! /* /\** */ ! /* * \param mesh pointer toward the mesh structure. */ ! /* * \param k vertex index. */ @@ -422,7 +422,7 @@ END INTERFACE ! /* * Set corner at point \a pos. */ ! /* * */ ! /* *\/ */ -! /* int MMG2D_Set_corner(MMG5_pMesh mesh, int k); */ +! /* MMG_int MMG2D_Set_corner(MMG5_pMesh mesh, MMG_int k); */ ! /* /\** */ ! /* * \param mesh pointer toward the mesh structure. */ ! /* * \param k vertex index. */ @@ -431,7 +431,7 @@ END INTERFACE ! /* * Set point \a k as required. */ ! /* * */ ! /* *\/ */ -! /* int MMG2D_Set_requiredVertex(MMG5_pMesh mesh, int k); */ +! /* MMG_int MMG2D_Set_requiredVertex(MMG5_pMesh mesh, MMG_int k); */ ! /** ! * \param mesh pointer toward the mesh structure. @@ -457,8 +457,8 @@ END INTERFACE ! * ! */ -! int MMG2D_Set_triangle(MMG5_pMesh mesh, int v0, int v1, -! int v2, int ref, int pos); +! MMG_int MMG2D_Set_triangle(MMG5_pMesh mesh, MMG_int v0, MMG_int v1, +! MMG_int v2, MMG_int ref, MMG_int pos); ! /** ! * \param mesh pointer toward the mesh structure. ! * \param tria pointer toward the table of the tria vertices @@ -482,7 +482,7 @@ END INTERFACE ! * ! */ -! int MMG2D_Set_triangles(MMG5_pMesh mesh, int *tria, int *refs); +! MMG_int MMG2D_Set_triangles(MMG5_pMesh mesh, MMG_int *tria, MMG_int *refs); ! /** ! * \param mesh pointer toward the mesh structure. ! * \param k triangle index. @@ -492,7 +492,7 @@ END INTERFACE ! * ! */ -! int MMG2D_Set_requiredTriangle(MMG5_pMesh mesh, int k); +! MMG_int MMG2D_Set_requiredTriangle(MMG5_pMesh mesh, MMG_int k); ! /** ! * \param mesh pointer toward the mesh structure. @@ -517,7 +517,7 @@ END INTERFACE ! * ! */ -! int MMG2D_Set_edge(MMG5_pMesh mesh, int v0, int v1, int ref, int pos); +! MMG_int MMG2D_Set_edge(MMG5_pMesh mesh, MMG_int v0, MMG_int v1, MMG_int ref, MMG_int pos); ! /** ! * \param mesh pointer toward the mesh structure. ! * \param k edge index. @@ -537,7 +537,7 @@ END INTERFACE ! * ! */ -! int MMG2D_Set_requiredEdge(MMG5_pMesh mesh, int k); +! MMG_int MMG2D_Set_requiredEdge(MMG5_pMesh mesh, MMG_int k); ! /** ! * \param met pointer toward the sol structure. ! * \param s solution scalar value. @@ -559,7 +559,7 @@ END INTERFACE ! * ! */ -! int MMG2D_Set_scalarSol(MMG5_pSol met, double s, int pos); +! MMG_int MMG2D_Set_scalarSol(MMG5_pSol met, double s, MMG_int pos); ! /** ! * \param met pointer toward the sol structure. ! * \param s table of the scalar solutions values. @@ -580,7 +580,7 @@ END INTERFACE ! * ! */ -! int MMG2D_Set_scalarSols(MMG5_pSol met, double *s); +! MMG_int MMG2D_Set_scalarSols(MMG5_pSol met, double *s); ! /** ! * \param met pointer toward the sol structure. ! * \param vx x value of the vectorial solution. @@ -604,8 +604,8 @@ END INTERFACE ! * ! */ -! int MMG2D_Set_vectorSol(MMG5_pSol met, double vx,double vy, -! int pos); +! MMG_int MMG2D_Set_vectorSol(MMG5_pSol met, double vx,double vy, +! MMG_int pos); ! /** ! * \param met pointer toward the sol structure. ! * \param sols table of the vectorial solutions @@ -626,7 +626,7 @@ END INTERFACE ! * ! */ -! int MMG2D_Set_vectorSols(MMG5_pSol met, double *sols); +! MMG_int MMG2D_Set_vectorSols(MMG5_pSol met, double *sols); ! /** ! * \param met pointer toward the sol structure. ! * \param m11 value at position (1,1) in the solution tensor. @@ -650,8 +650,8 @@ END INTERFACE ! * ! */ -! int MMG2D_Set_tensorSol(MMG5_pSol met, double m11, double m12, double m22, -! int pos); +! MMG_int MMG2D_Set_tensorSol(MMG5_pSol met, double m11, double m12, double m22, +! MMG_int pos); ! /** ! * \param met pointer toward the sol structure. ! * \param sols table of the tensorial solutions. @@ -673,7 +673,7 @@ END INTERFACE ! * ! */ -! int MMG2D_Set_tensorSols(MMG5_pSol met, double *sols); +! MMG_int MMG2D_Set_tensorSols(MMG5_pSol met, double *sols); ! /** recover datas */ ! /** ! * \param mesh pointer toward the mesh structure. @@ -696,7 +696,7 @@ END INTERFACE ! * ! */ -! int MMG2D_Get_meshSize(MMG5_pMesh mesh, int* np, int* nt, int* na); +! MMG_int MMG2D_Get_meshSize(MMG5_pMesh mesh, MMG_int* np, MMG_int* nt, MMG_int* na); ! /** ! * \param mesh pointer toward the mesh structure. ! * \param sol pointer toward the sol structure. @@ -719,8 +719,8 @@ END INTERFACE ! * ! */ -! int MMG2D_Get_solSize(MMG5_pMesh mesh, MMG5_pSol sol, int* typEntity, int* np, -! int* typSol); +! MMG_int MMG2D_Get_solSize(MMG5_pMesh mesh, MMG5_pSol sol, MMG_int* typEntity, MMG_int* np, +! MMG_int* typSol); ! /** ! * \param mesh pointer toward the mesh structure. ! * \param c0 pointer toward the coordinate of the point along the first dimension. @@ -746,8 +746,8 @@ END INTERFACE ! * ! */ -! int MMG2D_Get_vertex(MMG5_pMesh mesh, double* c0, double* c1, int* ref, -! int* isCorner, int* isRequired); +! MMG_int MMG2D_Get_vertex(MMG5_pMesh mesh, double* c0, double* c1, MMG_int* ref, +! MMG_int* isCorner, MMG_int* isRequired); ! /** ! * \param mesh pointer toward the mesh structure. ! * \param vertices pointer toward the table of the points coordinates. @@ -779,8 +779,8 @@ END INTERFACE ! * ! */ -! int MMG2D_Get_vertices(MMG5_pMesh mesh, double* vertices, int* refs, -! int* areCorners, int* areRequired); +! MMG_int MMG2D_Get_vertices(MMG5_pMesh mesh, double* vertices, MMG_int* refs, +! MMG_int* areCorners, MMG_int* areRequired); ! /** ! * \param mesh pointer toward the mesh structure. ! * \param v0 pointer toward the first vertex of triangle. @@ -806,8 +806,8 @@ END INTERFACE ! * ! */ -! int MMG2D_Get_triangle(MMG5_pMesh mesh, int* v0, int* v1, int* v2, int* ref -! ,int* isRequired); +! MMG_int MMG2D_Get_triangle(MMG5_pMesh mesh, MMG_int* v0, MMG_int* v1, MMG_int* v2, MMG_int* ref +! ,MMG_int* isRequired); ! /** ! * \param mesh pointer toward the mesh structure. ! * \param tria pointer toward the table of the triangles vertices @@ -835,8 +835,8 @@ END INTERFACE ! * ! */ -! int MMG2D_Get_triangles(MMG5_pMesh mesh, int* tria, int* refs, -! int* areRequired); +! MMG_int MMG2D_Get_triangles(MMG5_pMesh mesh, MMG_int* tria, MMG_int* refs, +! MMG_int* areRequired); ! /** ! * \param mesh pointer toward the mesh structure. ! * \param e0 pointer toward the first extremity of the edge. @@ -863,8 +863,8 @@ END INTERFACE ! * ! */ -! int MMG2D_Get_edge(MMG5_pMesh mesh, int* e0, int* e1, int* ref -! ,int* isRidge, int* isRequired); +! MMG_int MMG2D_Get_edge(MMG5_pMesh mesh, MMG_int* e0, MMG_int* e1, MMG_int* ref +! ,MMG_int* isRidge, MMG_int* isRequired); ! /** ! * \param met pointer toward the sol structure. ! * \param s pointer toward the scalar solution value. @@ -884,7 +884,7 @@ END INTERFACE ! * ! */ -! int MMG2D_Get_scalarSol(MMG5_pSol met, double* s); +! MMG_int MMG2D_Get_scalarSol(MMG5_pSol met, double* s); ! /** ! * \param met pointer toward the sol structure. ! * \param s table of the scalar solutions at mesh vertices. s[i-1] is @@ -905,7 +905,7 @@ END INTERFACE ! * ! */ -! int MMG2D_Get_scalarSols(MMG5_pSol met, double* s); +! MMG_int MMG2D_Get_scalarSols(MMG5_pSol met, double* s); ! /** ! * \param met pointer toward the sol structure. ! * \param vx x value of the vectorial solution. @@ -926,7 +926,7 @@ END INTERFACE ! * ! */ -! int MMG2D_Get_vectorSol(MMG5_pSol met, double* vx, double* vy); +! MMG_int MMG2D_Get_vectorSol(MMG5_pSol met, double* vx, double* vy); ! /** ! * \param met pointer toward the sol structure. ! * \param sols table of the solutions at mesh vertices. sols[2*(i-1)]\@2 is @@ -947,7 +947,7 @@ END INTERFACE ! * ! */ -! int MMG2D_Get_vectorSols(MMG5_pSol met, double* sols); +! MMG_int MMG2D_Get_vectorSols(MMG5_pSol met, double* sols); ! /** ! * \param met pointer toward the sol structure. ! * \param m11 pointer toward the position (1,1) in the solution tensor. @@ -969,7 +969,7 @@ END INTERFACE ! * ! */ -! int MMG2D_Get_tensorSol(MMG5_pSol met, double *m11,double *m12,double *m22); +! MMG_int MMG2D_Get_tensorSol(MMG5_pSol met, double *m11,double *m12,double *m22); ! /** ! * \param met pointer toward the sol structure. ! * \param sols table of the solutions at mesh vertices. @@ -990,7 +990,7 @@ END INTERFACE ! * ! */ -! int MMG2D_Get_tensorSols(MMG5_pSol met, double *sols); +! MMG_int MMG2D_Get_tensorSols(MMG5_pSol met, double *sols); ! /** ! * \param mesh pointer toward the mesh structure. ! * \param met pointer toward the sol structure. @@ -1010,7 +1010,7 @@ END INTERFACE ! * ! */ -! int MMG2D_Chk_meshData(MMG5_pMesh mesh,MMG5_pSol met); +! MMG_int MMG2D_Chk_meshData(MMG5_pMesh mesh,MMG5_pSol met); ! /* deallocations */ ! /** @@ -1043,7 +1043,7 @@ END INTERFACE ! * ! */ -! void MMG2D_Free_all(const int starter,...); +! void MMG2D_Free_all(const MMG_int starter,...); ! /** ! * \param starter dummy argument used to initialize the variadic argument @@ -1077,7 +1077,7 @@ END INTERFACE ! * ! */ -! void MMG2D_Free_structures(const int starter,...); +! void MMG2D_Free_structures(const MMG_int starter,...); ! /** ! * \param starter dummy argument used to initialize the variadic argument @@ -1111,7 +1111,7 @@ END INTERFACE ! * ! */ -! void MMG2D_Free_names(const int starter,...); +! void MMG2D_Free_names(const MMG_int starter,...); ! /** ! * \param mesh pointer toward the mesh structure. @@ -1133,7 +1133,7 @@ END INTERFACE ! * ! */ -! int MMG2D_loadMesh(MMG5_pMesh mesh,const char * filename); +! MMG_int MMG2D_loadMesh(MMG5_pMesh mesh,const char * filename); ! /** ! * \param mesh pointer toward the mesh structure. ! * \param sol pointer toward the solution structure. @@ -1156,7 +1156,7 @@ END INTERFACE ! * ! */ -! int MMG2D_loadMshMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); +! MMG_int MMG2D_loadMshMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); ! /** ! * \param mesh pointer toward the mesh structure. @@ -1179,9 +1179,9 @@ END INTERFACE ! * ! */ -! int MMG2D_loadSol(MMG5_pMesh mesh,MMG5_pSol sol,const char * filename); +! MMG_int MMG2D_loadSol(MMG5_pMesh mesh,MMG5_pSol sol,const char * filename); -! int MMG2D_loadVect(MMG5_pMesh ,char *); +! MMG_int MMG2D_loadVect(MMG5_pMesh ,char *); ! /** ! * \param mesh pointer toward the mesh structure. @@ -1203,7 +1203,7 @@ END INTERFACE ! * ! */ -! int MMG2D_saveMesh(MMG5_pMesh ,const char *); +! MMG_int MMG2D_saveMesh(MMG5_pMesh ,const char *); ! /** ! * \param mesh pointer toward the mesh structure. ! * \param sol pointer toward the solution structure. @@ -1226,7 +1226,7 @@ END INTERFACE ! * ! */ -! int MMG2D_saveMshMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); +! MMG_int MMG2D_saveMshMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); ! /** ! * \param mesh pointer toward the mesh structure. ! * \param sol pointer toward the solution structure.. @@ -1248,8 +1248,8 @@ END INTERFACE ! * ! */ -! int MMG2D_saveSol(MMG5_pMesh mesh,MMG5_pSol sol ,const char *filename); -! int MMG2D_saveVect(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename,double lambda); +! MMG_int MMG2D_saveSol(MMG5_pMesh mesh,MMG5_pSol sol ,const char *filename); +! MMG_int MMG2D_saveVect(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename,double lambda); ! /** ! * \param mesh pointer toward the mesh structure. @@ -1271,7 +1271,7 @@ END INTERFACE ! * ! */ -! int MMG2D_mmg2dlib(MMG5_pMesh mesh,MMG5_pSol sol); +! MMG_int MMG2D_mmg2dlib(MMG5_pMesh mesh,MMG5_pSol sol); ! /** ! * \param mesh pointer toward the mesh structure. @@ -1293,7 +1293,7 @@ END INTERFACE ! * ! */ -! int MMG2D_mmg2dmesh(MMG5_pMesh mesh,MMG5_pSol sol); +! MMG_int MMG2D_mmg2dmesh(MMG5_pMesh mesh,MMG5_pSol sol); ! /** ! * \param mesh pointer toward the mesh structure. @@ -1315,7 +1315,7 @@ END INTERFACE ! * ! */ -! int MMG2D_mmg2dls(MMG5_pMesh mesh,MMG5_pSol sol) ; +! MMG_int MMG2D_mmg2dls(MMG5_pMesh mesh,MMG5_pSol sol) ; ! /** ! * \param mesh pointer toward the mesh structure. ! * \param sol pointer toward a sol structure (displacement). @@ -1338,10 +1338,10 @@ END INTERFACE ! * ! */ -! int MMG2D_mmg2dmov(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pSol disp); +! MMG_int MMG2D_mmg2dmov(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pSol disp); ! /* Tools for the library */ -! // void (*MMG2D_callbackinsert) (int ,int ,int ,int, int); +! // void (*MMG2D_callbackinsert) (MMG_int ,MMG_int ,MMG_int ,MMG_int, MMG_int); ! /** ! * \param mesh pointer toward the mesh structure @@ -1362,7 +1362,7 @@ END INTERFACE ! * ! */ -! int MMG2D_doSol(MMG5_pMesh mesh ,MMG5_pSol met ); +! MMG_int MMG2D_doSol(MMG5_pMesh mesh ,MMG5_pSol met ); ! /** ! * \param mesh pointer toward the mesh structure. @@ -1407,7 +1407,7 @@ END INTERFACE ! * ! */ -! int MMG2D_Get_adjaTri(MMG5_pMesh mesh, int kel, int listri[3]); +! MMG_int MMG2D_Get_adjaTri(MMG5_pMesh mesh, MMG_int kel, MMG_int listri[3]); ! /** ! * \brief Return adjacent elements of a triangle. @@ -1434,7 +1434,7 @@ END INTERFACE ! */ ! extern -! int MMG2D_Get_adjaVertices(MMG5_pMesh mesh, int ip, int lispoi[MMG2D_LMAX]); +! MMG_int MMG2D_Get_adjaVertices(MMG5_pMesh mesh, MMG_int ip, MMG_int lispoi[MMG2D_LMAX]); ! /** ! * \brief Return adjacent elements of a triangle. @@ -1461,8 +1461,8 @@ END INTERFACE ! * ! */ -! int MMG2D_Get_adjaVerticesFast(MMG5_pMesh mesh, int ip,int start, -! int lispoi[MMG2D_LMAX]); +! MMG_int MMG2D_Get_adjaVerticesFast(MMG5_pMesh mesh, MMG_int ip,MMG_int start, +! MMG_int lispoi[MMG2D_LMAX]); ! /** ! * \param mesh pointer toward the mesh structure. ! * \param ked index of the boundary edge. @@ -1487,7 +1487,7 @@ END INTERFACE ! * ! */ -! int MMG2D_Get_triFromEdge(MMG5_pMesh mesh, int ked, int *ktri, int *ied); +! MMG_int MMG2D_Get_triFromEdge(MMG5_pMesh mesh, MMG_int ked, MMG_int *ktri, MMG_int *ied); ! /** ! * \param mesh pointer toward the mesh structure diff --git a/src/mmg2d/lissmet_2d.c b/src/mmg2d/lissmet_2d.c index c6b151f28..cd5d2184d 100644 --- a/src/mmg2d/lissmet_2d.c +++ b/src/mmg2d/lissmet_2d.c @@ -44,7 +44,7 @@ * Skip edges with a required extremity (treated in lissmetreq_ani). * */ -int lissmet_ani(MMG5_pMesh mesh,MMG5_pSol sol) { +MMG_int lissmet_ani(MMG5_pMesh mesh,MMG5_pSol sol) { MMG5_Hash edgeTable; MMG5_hedge *pht; MMG5_pTria pt; @@ -52,7 +52,7 @@ int lissmet_ani(MMG5_pMesh mesh,MMG5_pSol sol) { double logh,logs,*ma,*mb,ux,uy,d1,d2,dd,rap,dh; double tail,coef,ma1[3],mb1[3],m[3],dd1,dd2; double SQRT3DIV2=0.8660254037844386; - int i,nc,k,itour,maxtou,ncor,a,b,iadr; + MMG_int i,nc,k,itour,maxtou,ncor,a,b,iadr; int8_t ier; static int8_t mmgWarn = 0; diff --git a/src/mmg2d/locate_2d.c b/src/mmg2d/locate_2d.c index 9e1b637fc..17b8c40ff 100644 --- a/src/mmg2d/locate_2d.c +++ b/src/mmg2d/locate_2d.c @@ -34,7 +34,7 @@ /* Calculate the barycentric coordinates of point P(c[0],c[1]) in tria pt and the associated determinant */ /* l1 = barycentric coordinate with respect to p1, l2 = barycentric coordinate with respect to p2 */ -int MMG2D_coorbary(MMG5_pMesh mesh,MMG5_pTria pt,double c[2],double* det,double* l1,double* l2) { +MMG_int MMG2D_coorbary(MMG5_pMesh mesh,MMG5_pTria pt,double c[2],double* det,double* l1,double* l2) { MMG5_pPoint p1,p2,p3; double b2,b3; static int8_t mmgWarn0=0; @@ -66,7 +66,7 @@ int MMG2D_coorbary(MMG5_pMesh mesh,MMG5_pTria pt,double c[2],double* det,double* } /** Check whether c lies in triangle k; return k if so, 0 otherwise */ -int MMG2D_isInTriangle(MMG5_pMesh mesh,int k,double c[2]) { +MMG_int MMG2D_isInTriangle(MMG5_pMesh mesh,MMG_int k,double c[2]) { MMG5_pTria pt; double det,l1,l2,l3; int8_t ier; @@ -87,9 +87,9 @@ int MMG2D_isInTriangle(MMG5_pMesh mesh,int k,double c[2]) { of this triangle are crossed by (ppa-ppb), or only one, and ppa or ppb is a vertex of pt; if at least one edge is crossed by ia-ib, return i+1, where i is the index of one of the crossed edges */ -int MMG2D_cutEdge(MMG5_pMesh mesh,MMG5_pTria pt,MMG5_pPoint ppa,MMG5_pPoint ppb) { +MMG_int MMG2D_cutEdge(MMG5_pMesh mesh,MMG5_pTria pt,MMG5_pPoint ppa,MMG5_pPoint ppb) { double la[3],lb[3],det; - int icompt,ireturn; + MMG_int icompt,ireturn; int8_t ier,i; ier = MMG2D_coorbary(mesh,pt,ppa->c,&det,&la[0],&la[1]); @@ -126,11 +126,11 @@ int MMG2D_cutEdge(MMG5_pMesh mesh,MMG5_pTria pt,MMG5_pPoint ppa,MMG5_pPoint ppb) /* Return i+1>0 if Edge ia-ib intersects triangle k at edge i, 0 if it does not intersect k, and return -3 if edge ia-ib is one edge of k*/ -int MMG2D_cutEdgeTriangle(MMG5_pMesh mesh,int k,int ia,int ib) { +MMG_int MMG2D_cutEdgeTriangle(MMG5_pMesh mesh,MMG_int k,MMG_int ia,MMG_int ib) { MMG5_pTria pt; MMG5_pPoint p1,p2,p3,ppa,ppb; double a11,a21,a12,a22,area1,area2,area3,prod1,prod2,prod3; - int ibreak,iare; + MMG_int ibreak,iare; int8_t i; ppa = &mesh->point[ia]; @@ -212,10 +212,10 @@ int MMG2D_cutEdgeTriangle(MMG5_pMesh mesh,int k,int ia,int ib) { } /** Return the index of one triangle containing ip */ -int MMG2D_findTria(MMG5_pMesh mesh,int ip) { +MMG_int MMG2D_findTria(MMG5_pMesh mesh,MMG_int ip) { MMG5_pTria pt,pt1; - int iel,base,iadr,*adja,iter,ier; - int mvDir[3],jel,i; + MMG_int iel,base,iadr,*adja,iter,ier; + MMG_int mvDir[3],jel,i; double l1,l2,l3,det,eps; static int8_t mmgWarn0 = 0; @@ -320,14 +320,14 @@ int MMG2D_findTria(MMG5_pMesh mesh,int ip) { * and \a iare is an intersected edge. * */ -int MMG2D_locateEdge(MMG5_pMesh mesh,int ia,int ib,int* kdep,int* list) { +MMG_int MMG2D_locateEdge(MMG5_pMesh mesh,MMG_int ia,MMG_int ib,MMG_int* kdep,MMG_int* list) { MMG5_pTria pt; MMG5_pPoint ppt1,ppt2,ppt3,ppt4,ppa,ppb; double a[3],a11,a21,a12,a22,area1,area2,area3,prod1,prod2,prod3; double niaib,npti; - int iadr,*adja,k,ibreak,i,ncompt,lon,iare,ivert; + MMG_int iadr,*adja,k,ibreak,i,ncompt,lon,iare,ivert; static int8_t mmgWarn=0; - //int ktemp; + //MMG_int ktemp; k = *kdep; ncompt = 0; diff --git a/src/mmg2d/mmg2d.c b/src/mmg2d/mmg2d.c index e49df4eeb..099f0020f 100644 --- a/src/mmg2d/mmg2d.c +++ b/src/mmg2d/mmg2d.c @@ -35,7 +35,7 @@ static void MMG5_endcod(void) { fprintf(stdout,"\n ELAPSED TIME %s\n",stim); } -static int MMG2D_usage(char *name) { +static MMG_int MMG2D_usage(char *name) { /* Common generic options, file options and mode options */ MMG5_mmgUsage(name); @@ -75,7 +75,7 @@ static int MMG2D_usage(char *name) { * Print the default parameters values. * */ -static inline int MMG5_defaultValues(MMG5_pMesh mesh) { +static inline MMG_int MMG5_defaultValues(MMG5_pMesh mesh) { MMG5_mmgDefaultValues(mesh); @@ -95,8 +95,8 @@ static inline int MMG5_defaultValues(MMG5_pMesh mesh) { * */ static inline -int MMG2D_countLocalParamAtEdg( MMG5_pMesh mesh,MMG5_iNode **bdyRefs) { - int npar,k,ier; +MMG_int MMG2D_countLocalParamAtEdg( MMG5_pMesh mesh,MMG5_iNode **bdyRefs) { + MMG_int npar,k,ier; /** Count the number of different boundary references and list it */ (*bdyRefs) = NULL; @@ -139,7 +139,7 @@ int MMG2D_countLocalParamAtEdg( MMG5_pMesh mesh,MMG5_iNode **bdyRefs) { * */ static inline -int MMG2D_writeLocalParamAtEdg( MMG5_pMesh mesh, MMG5_iNode *bdryRefs, +MMG_int MMG2D_writeLocalParamAtEdg( MMG5_pMesh mesh, MMG5_iNode *bdryRefs, FILE *out ) { MMG5_iNode *cur; @@ -164,9 +164,9 @@ int MMG2D_writeLocalParamAtEdg( MMG5_pMesh mesh, MMG5_iNode *bdryRefs, * */ static inline -int MMG2D_writeLocalParam( MMG5_pMesh mesh ) { +MMG_int MMG2D_writeLocalParam( MMG5_pMesh mesh ) { MMG5_iNode *edgRefs,*triRefs; - int nparEdg,nparTri; + MMG_int nparEdg,nparTri; char *ptr,data[MMG5_FILESTR_LGTH]; FILE *out; @@ -232,7 +232,7 @@ int MMG2D_writeLocalParam( MMG5_pMesh mesh ) { * */ static inline -int MMG2D_defaultOption(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pSol sol) { +MMG_int MMG2D_defaultOption(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pSol sol) { mytime ctim[TIMEMAX]; double hsiz; char stim[32]; @@ -323,9 +323,9 @@ int MMG2D_defaultOption(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pSol sol) { // In ls mode : metric must be provided using -met option (-sol or default is the ls). // In adp mode : -sol or -met or default allow to store the metric. -int parsar(int argc,char *argv[],MMG5_pMesh mesh,MMG5_pSol met,MMG5_pSol sol) { +MMG_int parsar(MMG_int argc,char *argv[],MMG5_pMesh mesh,MMG5_pSol met,MMG5_pSol sol) { MMG5_pSol tmp = NULL; - int i; + MMG_int i; char namein[MMG5_FILESTR_LGTH]; /* First step: search if user want to see the default parameters values. */ @@ -668,10 +668,10 @@ int parsar(int argc,char *argv[],MMG5_pMesh mesh,MMG5_pSol met,MMG5_pSol sol) { return 1; } -int main(int argc,char *argv[]) { +MMG_int main(MMG_int argc,char *argv[]) { MMG5_pMesh mesh; MMG5_pSol sol,met,disp,ls; - int ier,ierSave,fmtin,fmtout; + MMG_int ier,ierSave,fmtin,fmtout; char stim[32],*ptr; fprintf(stdout," -- MMG2D, Release %s (%s) \n",MMG_VERSION_RELEASE,MMG_RELEASE_DATE); diff --git a/src/mmg2d/mmg2d.h b/src/mmg2d/mmg2d.h index fd152895d..5fc8c42fc 100644 --- a/src/mmg2d/mmg2d.h +++ b/src/mmg2d/mmg2d.h @@ -94,7 +94,7 @@ static const uint8_t MMG2D_idir_q[4][2] = { {0,1},{0,3},{1,2},{2,3} }; * */ static inline -void MMG2D_excfun(int sigid) { +void MMG2D_excfun(MMG_int sigid) { fprintf(stdout,"\n Unexpected error:"); fflush(stdout); switch(sigid) { case SIGABRT: @@ -113,29 +113,29 @@ void MMG2D_excfun(int sigid) { } typedef struct squeue { - int *stack,cur; + MMG_int *stack,cur; } Queue; typedef Queue * pQueue; typedef struct { - int size; - int *head; - int *link; + MMG_int size; + MMG_int *head; + MMG_int *link; } Bucket; typedef Bucket * pBucket; -static const int MMG2D_iare[3][2] = {{1,2},{2,0},{0,1}}; -static const int MMG2D_iopp[3][2] = {{1,2},{0,2},{0,1}}; -static const unsigned int MMG2D_idir[5] = {0,1,2,0,1}; -static const unsigned int MMG2D_inxt[5] = {1,2,0,1,2}; +static const MMG_int MMG2D_iare[3][2] = {{1,2},{2,0},{0,1}}; +static const MMG_int MMG2D_iopp[3][2] = {{1,2},{0,2},{0,1}}; +static const unsigned MMG_int MMG2D_idir[5] = {0,1,2,0,1}; +static const unsigned MMG_int MMG2D_inxt[5] = {1,2,0,1,2}; /** Reallocation of point table and sol table and creation of point ip with coordinates o and tag tag*/ #define MMG2D_POINT_REALLOC(mesh,sol,ip,wantedGap,law,o,tag ) do \ { \ - int klink; \ + MMG_int klink; \ \ assert ( mesh && mesh->point ); \ MMG5_TAB_RECALLOC(mesh,mesh->point,mesh->npmax,wantedGap,MMG5_Point, \ @@ -166,7 +166,7 @@ static const unsigned int MMG2D_inxt[5] = {1,2,0,1,2}; of tria jel */ #define MMG2D_TRIA_REALLOC(mesh,jel,wantedGap,law ) do \ { \ - int klink,oldSiz; \ + MMG_int klink,oldSiz; \ \ oldSiz = mesh->ntmax; \ MMG5_TAB_RECALLOC(mesh,mesh->tria,mesh->ntmax,wantedGap,MMG5_Tria, \ @@ -178,9 +178,9 @@ static const unsigned int MMG2D_inxt[5] = {1,2,0,1,2}; \ if ( mesh->adja ) { \ /* adja table */ \ - MMG5_ADD_MEM(mesh,3*(mesh->ntmax-oldSiz)*sizeof(int), \ + MMG5_ADD_MEM(mesh,3*(mesh->ntmax-oldSiz)*sizeof(MMG_int), \ "larger adja table",law); \ - MMG5_SAFE_RECALLOC(mesh->adja,3*oldSiz+5,3*mesh->ntmax+5,int \ + MMG5_SAFE_RECALLOC(mesh->adja,3*oldSiz+5,3*mesh->ntmax+5,MMG_int \ ,"larger adja table",law); \ } \ \ @@ -191,178 +191,178 @@ static const unsigned int MMG2D_inxt[5] = {1,2,0,1,2}; /* Prototypes */ /*zaldy*/ -int MMG2D_newPt(MMG5_pMesh mesh,double c[2],int16_t tag); -void MMG2D_delPt(MMG5_pMesh mesh,int ip) ; -void MMG5_delEdge(MMG5_pMesh mesh,int iel); -int MMG2D_newElt(MMG5_pMesh mesh); -int MMG2D_delElt(MMG5_pMesh mesh,int iel); -int MMG5_getnElt(MMG5_pMesh mesh,int n); -int MMG2D_zaldy(MMG5_pMesh mesh); +MMG_int MMG2D_newPt(MMG5_pMesh mesh,double c[2],int16_t tag); +void MMG2D_delPt(MMG5_pMesh mesh,MMG_int ip) ; +void MMG5_delEdge(MMG5_pMesh mesh,MMG_int iel); +MMG_int MMG2D_newElt(MMG5_pMesh mesh); +MMG_int MMG2D_delElt(MMG5_pMesh mesh,MMG_int iel); +MMG_int MMG5_getnElt(MMG5_pMesh mesh,MMG_int n); +MMG_int MMG2D_zaldy(MMG5_pMesh mesh); size_t MMG5_memSize(void); -int MMG2D_memOption(MMG5_pMesh mesh); -int MMG2D_setMeshSize_alloc(MMG5_pMesh); - -int MMG2D_scaleMesh(MMG5_pMesh ,MMG5_pSol, MMG5_pSol ); -int MMG2D_unscaleMesh(MMG5_pMesh ,MMG5_pSol, MMG5_pSol ); -int MMG2D_pack(MMG5_pMesh ,MMG5_pSol, MMG5_pSol ); -int MMG2D_outqua(MMG5_pMesh ,MMG5_pSol ); -//int MMG2D_mmg2d0(MMG5_pMesh ,MMG5_pSol ); -int MMG2D_mmg2d1(MMG5_pMesh ,MMG5_pSol ); -//int MMG2D_split(MMG5_pMesh ,MMG5_pSol ,int ,int ,int,double ); -//int MMG2D_splitbdry(MMG5_pMesh ,MMG5_pSol ,int ,int ,int,double*); -//int MMG2D_colpoi(MMG5_pMesh ,MMG5_pSol , int ,int ,int ,int ,double ); -//int MMG2D_colpoibdry(MMG5_pMesh ,MMG5_pSol , int ,int ,int ,int ,double ); - -int MMG2D_Init_mesh_var( va_list argptr ); -int MMG2D_Free_all_var( va_list argptr ); -int MMG2D_Free_structures_var( va_list argptr ); -int MMG2D_Free_names_var( va_list argptr ); +MMG_int MMG2D_memOption(MMG5_pMesh mesh); +MMG_int MMG2D_setMeshSize_alloc(MMG5_pMesh); + +MMG_int MMG2D_scaleMesh(MMG5_pMesh ,MMG5_pSol, MMG5_pSol ); +MMG_int MMG2D_unscaleMesh(MMG5_pMesh ,MMG5_pSol, MMG5_pSol ); +MMG_int MMG2D_pack(MMG5_pMesh ,MMG5_pSol, MMG5_pSol ); +MMG_int MMG2D_outqua(MMG5_pMesh ,MMG5_pSol ); +//MMG_int MMG2D_mmg2d0(MMG5_pMesh ,MMG5_pSol ); +MMG_int MMG2D_mmg2d1(MMG5_pMesh ,MMG5_pSol ); +//MMG_int MMG2D_split(MMG5_pMesh ,MMG5_pSol ,MMG_int ,MMG_int ,MMG_int,double ); +//MMG_int MMG2D_splitbdry(MMG5_pMesh ,MMG5_pSol ,MMG_int ,MMG_int ,MMG_int,double*); +//MMG_int MMG2D_colpoi(MMG5_pMesh ,MMG5_pSol , MMG_int ,MMG_int ,MMG_int ,MMG_int ,double ); +//MMG_int MMG2D_colpoibdry(MMG5_pMesh ,MMG5_pSol , MMG_int ,MMG_int ,MMG_int ,MMG_int ,double ); + +MMG_int MMG2D_Init_mesh_var( va_list argptr ); +MMG_int MMG2D_Free_all_var( va_list argptr ); +MMG_int MMG2D_Free_structures_var( va_list argptr ); +MMG_int MMG2D_Free_names_var( va_list argptr ); void MMG2D_solTruncatureForOptim(MMG5_pMesh mesh, MMG5_pSol met); -int MMG2D_mmg2d2(MMG5_pMesh , MMG5_pSol); -int MMG2D_mmg2d6(MMG5_pMesh ,MMG5_pSol,MMG5_pSol ); -int MMG2D_mmg2d9(MMG5_pMesh ,MMG5_pSol ,MMG5_pSol,int** ); -//int MMG2D_cendel(MMG5_pMesh ,MMG5_pSol ,double ,int ); -int MMG2D_swapdelone(MMG5_pMesh ,MMG5_pSol ,int ,int8_t ,double ,int *); -int MMG5_mmg2dChkmsh(MMG5_pMesh , int, int ); -int MMG2D_2dMeshCheck(MMG5_pMesh mesh); -int MMG2D_boulep(MMG5_pMesh , int , int , int * ); -//int MMG2D_markBdry(MMG5_pMesh ); -int MMG2D_prilen(MMG5_pMesh ,MMG5_pSol ); - -int MMG2D_coorbary(MMG5_pMesh ,MMG5_pTria ,double c[2],double* ,double* ,double* ); -int MMG2D_isInTriangle(MMG5_pMesh ,int,double c[2]); -int MMG2D_cutEdge(MMG5_pMesh ,MMG5_pTria ,MMG5_pPoint ,MMG5_pPoint ); -int MMG2D_cutEdgeTriangle(MMG5_pMesh ,int ,int ,int ); -int MMG2D_findTria(MMG5_pMesh ,int ); -//int MMG2D_findpos(MMG5_pMesh ,MMG5_pTria ,int ,int ,int ,int ,int ); -int MMG2D_locateEdge(MMG5_pMesh ,int ,int ,int* ,int* ) ; -int MMG2D_bdryenforcement(MMG5_pMesh ,MMG5_pSol); -int MMG2D_settagtriangles(MMG5_pMesh ,MMG5_pSol ); -int MMG2D_findtrianglestate(MMG5_pMesh ,int ,int ,int ,int ,int ,int ); - -pQueue MMG2D_kiuini(MMG5_pMesh mesh,int nbel,double declic,int base); +MMG_int MMG2D_mmg2d2(MMG5_pMesh , MMG5_pSol); +MMG_int MMG2D_mmg2d6(MMG5_pMesh ,MMG5_pSol,MMG5_pSol ); +MMG_int MMG2D_mmg2d9(MMG5_pMesh ,MMG5_pSol ,MMG5_pSol,MMG_int** ); +//MMG_int MMG2D_cendel(MMG5_pMesh ,MMG5_pSol ,double ,MMG_int ); +MMG_int MMG2D_swapdelone(MMG5_pMesh ,MMG5_pSol ,MMG_int ,int8_t ,double ,MMG_int *); +MMG_int MMG5_mmg2dChkmsh(MMG5_pMesh , MMG_int, MMG_int ); +MMG_int MMG2D_2dMeshCheck(MMG5_pMesh mesh); +MMG_int MMG2D_boulep(MMG5_pMesh , MMG_int , MMG_int , MMG_int * ); +//MMG_int MMG2D_markBdry(MMG5_pMesh ); +MMG_int MMG2D_prilen(MMG5_pMesh ,MMG5_pSol ); + +MMG_int MMG2D_coorbary(MMG5_pMesh ,MMG5_pTria ,double c[2],double* ,double* ,double* ); +MMG_int MMG2D_isInTriangle(MMG5_pMesh ,MMG_int,double c[2]); +MMG_int MMG2D_cutEdge(MMG5_pMesh ,MMG5_pTria ,MMG5_pPoint ,MMG5_pPoint ); +MMG_int MMG2D_cutEdgeTriangle(MMG5_pMesh ,MMG_int ,MMG_int ,MMG_int ); +MMG_int MMG2D_findTria(MMG5_pMesh ,MMG_int ); +//MMG_int MMG2D_findpos(MMG5_pMesh ,MMG5_pTria ,MMG_int ,MMG_int ,MMG_int ,MMG_int ,MMG_int ); +MMG_int MMG2D_locateEdge(MMG5_pMesh ,MMG_int ,MMG_int ,MMG_int* ,MMG_int* ) ; +MMG_int MMG2D_bdryenforcement(MMG5_pMesh ,MMG5_pSol); +MMG_int MMG2D_settagtriangles(MMG5_pMesh ,MMG5_pSol ); +MMG_int MMG2D_findtrianglestate(MMG5_pMesh ,MMG_int ,MMG_int ,MMG_int ,MMG_int ,MMG_int ,MMG_int ); + +pQueue MMG2D_kiuini(MMG5_pMesh mesh,MMG_int nbel,double declic,MMG_int base); void MMG2D_kiufree(pQueue q); -int MMG2D_kiudel(pQueue q,int iel); -int MMG2D_kiuput(pQueue q,int iel); -int MMG2D_kiupop(pQueue q); +MMG_int MMG2D_kiudel(pQueue q,MMG_int iel); +MMG_int MMG2D_kiuput(pQueue q,MMG_int iel); +MMG_int MMG2D_kiupop(pQueue q); -int MMG2D_baseBdry(MMG5_pMesh mesh); +MMG_int MMG2D_baseBdry(MMG5_pMesh mesh); -//int MMG2D_evalgeom(MMG5_pMesh mesh); +//MMG_int MMG2D_evalgeom(MMG5_pMesh mesh); -int MMG2D_cavity(MMG5_pMesh ,MMG5_pSol ,int ,int *); -int MMG2D_delone(MMG5_pMesh ,MMG5_pSol ,int ,int *,int ); -int MMG2D_cenrad_iso(MMG5_pMesh ,double *,double *,double *); +MMG_int MMG2D_cavity(MMG5_pMesh ,MMG5_pSol ,MMG_int ,MMG_int *); +MMG_int MMG2D_delone(MMG5_pMesh ,MMG5_pSol ,MMG_int ,MMG_int *,MMG_int ); +MMG_int MMG2D_cenrad_iso(MMG5_pMesh ,double *,double *,double *); /* Adds Charles */ -double MMG2D_voltri(MMG5_pMesh ,int ,int ,int ); -double MMG2D_vfrac(MMG5_pMesh ,MMG5_pSol ,int ,int ); -int MMG2D_parsop(MMG5_pMesh ,MMG5_pSol ); -int MMG2D_ismaniball(MMG5_pMesh , MMG5_pSol , int , int8_t ); -int MMG2D_snapval(MMG5_pMesh ,MMG5_pSol); -int MMG2D_chkmanimesh(MMG5_pMesh ); -int MMG2D_hashTria(MMG5_pMesh ); -int MMG2D_hashQuad(MMG5_pMesh mesh); -int MMG2D_resetRef(MMG5_pMesh ); -int MMG2D_cuttri_ls(MMG5_pMesh ,MMG5_pSol,MMG5_pSol ); -int MMG2D_rmc(MMG5_pMesh ,MMG5_pSol ); -int MMG2D_setref_ls(MMG5_pMesh ,MMG5_pSol ); -int MMG2D_split1_sim(MMG5_pMesh ,MMG5_pSol ,int ,int vx[3]); -int MMG2D_split2_sim(MMG5_pMesh ,MMG5_pSol ,int ,int vx[3]); -int MMG2D_split3_sim(MMG5_pMesh ,MMG5_pSol ,int ,int vx[3]); -int MMG2D_split1(MMG5_pMesh ,MMG5_pSol ,int ,int vx[3]); -int MMG2D_split2(MMG5_pMesh ,MMG5_pSol ,int ,int vx[3]); -int MMG2D_split3(MMG5_pMesh ,MMG5_pSol ,int ,int vx[3]); -int MMG2D_splitbar(MMG5_pMesh ,int ,int ); -int MMG2D_assignEdge(MMG5_pMesh ); -int MMG2D_bdryEdge(MMG5_pMesh ); -int MMG2D_setadj(MMG5_pMesh ); -int MMG2D_singul(MMG5_pMesh,int ); -int MMG2D_analys(MMG5_pMesh ); -int MMG2D_norver(MMG5_pMesh,int ); -int MMG2D_regnor(MMG5_pMesh ); -int MMG2D_boulen(MMG5_pMesh , int ,int8_t ,int *,int *,double *); -int MMG2D_mmg2d1n(MMG5_pMesh ,MMG5_pSol ); -int MMG2D_anatri(MMG5_pMesh ,MMG5_pSol ,int8_t ); -int MMG2D_adptri(MMG5_pMesh ,MMG5_pSol ); -int MMG2D_defsiz_iso(MMG5_pMesh ,MMG5_pSol ); -int MMG2D_defsiz_ani(MMG5_pMesh ,MMG5_pSol ); -int MMG2D_defmetbdy_2d(MMG5_pMesh ,MMG5_pSol ,int ,int8_t ); -int MMG2D_defaultmet_2d(MMG5_pMesh ,MMG5_pSol ,int ,int8_t ); -int MMG2D_grad2met_ani(MMG5_pMesh ,MMG5_pSol ,MMG5_pTria,int,int); -int MMG2D_grad2metreq_ani(MMG5_pMesh ,MMG5_pSol ,MMG5_pTria,int,int); -int MMG2D_gradsiz_ani(MMG5_pMesh ,MMG5_pSol ); -int MMG2D_gradsizreq_ani(MMG5_pMesh ,MMG5_pSol ); -int MMG2D_anaelt(MMG5_pMesh ,MMG5_pSol ,int ); -int MMG2D_colelt(MMG5_pMesh ,MMG5_pSol ,int ); -int MMG2D_swpmsh(MMG5_pMesh ,MMG5_pSol ,int ); -double MMG2D_lencurv_iso(MMG5_pMesh ,MMG5_pSol ,int ,int ); -double MMG2D_lencurv_ani(MMG5_pMesh ,MMG5_pSol ,int ,int ); -int MMG2D_chkedg(MMG5_pMesh ,int ); -int MMG2D_bezierCurv(MMG5_pMesh ,int ,int8_t ,double ,double *,double *); -int MMG2D_dichoto(MMG5_pMesh ,MMG5_pSol ,int ,int *); +double MMG2D_voltri(MMG5_pMesh ,MMG_int ,MMG_int ,MMG_int ); +double MMG2D_vfrac(MMG5_pMesh ,MMG5_pSol ,MMG_int ,MMG_int ); +MMG_int MMG2D_parsop(MMG5_pMesh ,MMG5_pSol ); +MMG_int MMG2D_ismaniball(MMG5_pMesh , MMG5_pSol , MMG_int , int8_t ); +MMG_int MMG2D_snapval(MMG5_pMesh ,MMG5_pSol); +MMG_int MMG2D_chkmanimesh(MMG5_pMesh ); +MMG_int MMG2D_hashTria(MMG5_pMesh ); +MMG_int MMG2D_hashQuad(MMG5_pMesh mesh); +MMG_int MMG2D_resetRef(MMG5_pMesh ); +MMG_int MMG2D_cuttri_ls(MMG5_pMesh ,MMG5_pSol,MMG5_pSol ); +MMG_int MMG2D_rmc(MMG5_pMesh ,MMG5_pSol ); +MMG_int MMG2D_setref_ls(MMG5_pMesh ,MMG5_pSol ); +MMG_int MMG2D_split1_sim(MMG5_pMesh ,MMG5_pSol ,MMG_int ,MMG_int vx[3]); +MMG_int MMG2D_split2_sim(MMG5_pMesh ,MMG5_pSol ,MMG_int ,MMG_int vx[3]); +MMG_int MMG2D_split3_sim(MMG5_pMesh ,MMG5_pSol ,MMG_int ,MMG_int vx[3]); +MMG_int MMG2D_split1(MMG5_pMesh ,MMG5_pSol ,MMG_int ,MMG_int vx[3]); +MMG_int MMG2D_split2(MMG5_pMesh ,MMG5_pSol ,MMG_int ,MMG_int vx[3]); +MMG_int MMG2D_split3(MMG5_pMesh ,MMG5_pSol ,MMG_int ,MMG_int vx[3]); +MMG_int MMG2D_splitbar(MMG5_pMesh ,MMG_int ,MMG_int ); +MMG_int MMG2D_assignEdge(MMG5_pMesh ); +MMG_int MMG2D_bdryEdge(MMG5_pMesh ); +MMG_int MMG2D_setadj(MMG5_pMesh ); +MMG_int MMG2D_singul(MMG5_pMesh,MMG_int ); +MMG_int MMG2D_analys(MMG5_pMesh ); +MMG_int MMG2D_norver(MMG5_pMesh,MMG_int ); +MMG_int MMG2D_regnor(MMG5_pMesh ); +MMG_int MMG2D_boulen(MMG5_pMesh , MMG_int ,int8_t ,MMG_int *,MMG_int *,double *); +MMG_int MMG2D_mmg2d1n(MMG5_pMesh ,MMG5_pSol ); +MMG_int MMG2D_anatri(MMG5_pMesh ,MMG5_pSol ,int8_t ); +MMG_int MMG2D_adptri(MMG5_pMesh ,MMG5_pSol ); +MMG_int MMG2D_defsiz_iso(MMG5_pMesh ,MMG5_pSol ); +MMG_int MMG2D_defsiz_ani(MMG5_pMesh ,MMG5_pSol ); +MMG_int MMG2D_defmetbdy_2d(MMG5_pMesh ,MMG5_pSol ,MMG_int ,int8_t ); +MMG_int MMG2D_defaultmet_2d(MMG5_pMesh ,MMG5_pSol ,MMG_int ,int8_t ); +MMG_int MMG2D_grad2met_ani(MMG5_pMesh ,MMG5_pSol ,MMG5_pTria,MMG_int,MMG_int); +MMG_int MMG2D_grad2metreq_ani(MMG5_pMesh ,MMG5_pSol ,MMG5_pTria,MMG_int,MMG_int); +MMG_int MMG2D_gradsiz_ani(MMG5_pMesh ,MMG5_pSol ); +MMG_int MMG2D_gradsizreq_ani(MMG5_pMesh ,MMG5_pSol ); +MMG_int MMG2D_anaelt(MMG5_pMesh ,MMG5_pSol ,MMG_int ); +MMG_int MMG2D_colelt(MMG5_pMesh ,MMG5_pSol ,MMG_int ); +MMG_int MMG2D_swpmsh(MMG5_pMesh ,MMG5_pSol ,MMG_int ); +double MMG2D_lencurv_iso(MMG5_pMesh ,MMG5_pSol ,MMG_int ,MMG_int ); +double MMG2D_lencurv_ani(MMG5_pMesh ,MMG5_pSol ,MMG_int ,MMG_int ); +MMG_int MMG2D_chkedg(MMG5_pMesh ,MMG_int ); +MMG_int MMG2D_bezierCurv(MMG5_pMesh ,MMG_int ,int8_t ,double ,double *,double *); +MMG_int MMG2D_dichoto(MMG5_pMesh ,MMG5_pSol ,MMG_int ,MMG_int *); double MMG2D_quickcal(MMG5_pMesh , MMG5_pTria ); -int MMG2D_chkcol(MMG5_pMesh,MMG5_pSol,int,int8_t,int *,int8_t); -int MMG2D_colver(MMG5_pMesh,int,int*); -int MMG2D_colver3(MMG5_pMesh,int*); -int MMG2D_colver2(MMG5_pMesh,int*); -int MMG2D_boulet(MMG5_pMesh,int,int8_t,int*); -int MMG2D_bouleendp(MMG5_pMesh,int,int8_t,int*,int*); -int MMG2D_savemesh_db(MMG5_pMesh ,char* ,int8_t ); -int MMG2D_savemet_db(MMG5_pMesh ,MMG5_pSol ,char* ,int8_t ); -int MMG2D_chkswp(MMG5_pMesh , MMG5_pSol ,int ,int8_t ,int8_t ); -int MMG2D_swapar(MMG5_pMesh ,int ,int8_t ); -int MMG5_interpmet22(MMG5_pMesh ,double *,double *,double ,double *); -int MMG2D_intmet_iso(MMG5_pMesh ,MMG5_pSol ,int ,int8_t ,int ,double ); -int MMG2D_intmet_ani(MMG5_pMesh ,MMG5_pSol ,int ,int8_t ,int ,double ); -int MMG2D_adpspl(MMG5_pMesh ,MMG5_pSol ); -int MMG2D_adpcol(MMG5_pMesh ,MMG5_pSol ); -int MMG2D_movtri(MMG5_pMesh ,MMG5_pSol ,int ,int8_t ); -int MMG2D_chkspl(MMG5_pMesh ,MMG5_pSol ,int ,int8_t ); -int MMG2D_split1b(MMG5_pMesh ,int ,int8_t ,int ); -int MMG2D_movedgpt(MMG5_pMesh ,MMG5_pSol ,int ,int *,int8_t ); -int MMG2D_movintpt(MMG5_pMesh ,MMG5_pSol ,int ,int *,int8_t ); -int MMG2D_movintpt_ani(MMG5_pMesh ,MMG5_pSol ,int ,int *,int8_t ); -int MMG2D_chkmsh(MMG5_pMesh ); -int MMG2D_chkor(MMG5_pMesh ); -int MMG2D_savenor_db(MMG5_pMesh ,char*,int8_t ); -int MMG2D_savedisp_db(MMG5_pMesh mesh,MMG5_pSol ,char*,int8_t ); -int MMG2D_velextLS(MMG5_pMesh ,MMG5_pSol ); +MMG_int MMG2D_chkcol(MMG5_pMesh,MMG5_pSol,MMG_int,int8_t,MMG_int *,int8_t); +MMG_int MMG2D_colver(MMG5_pMesh,MMG_int,MMG_int*); +MMG_int MMG2D_colver3(MMG5_pMesh,MMG_int*); +MMG_int MMG2D_colver2(MMG5_pMesh,MMG_int*); +MMG_int MMG2D_boulet(MMG5_pMesh,MMG_int,int8_t,MMG_int*); +MMG_int MMG2D_bouleendp(MMG5_pMesh,MMG_int,int8_t,MMG_int*,MMG_int*); +MMG_int MMG2D_savemesh_db(MMG5_pMesh ,char* ,int8_t ); +MMG_int MMG2D_savemet_db(MMG5_pMesh ,MMG5_pSol ,char* ,int8_t ); +MMG_int MMG2D_chkswp(MMG5_pMesh , MMG5_pSol ,MMG_int ,int8_t ,int8_t ); +MMG_int MMG2D_swapar(MMG5_pMesh ,MMG_int ,int8_t ); +MMG_int MMG5_interpmet22(MMG5_pMesh ,double *,double *,double ,double *); +MMG_int MMG2D_intmet_iso(MMG5_pMesh ,MMG5_pSol ,MMG_int ,int8_t ,MMG_int ,double ); +MMG_int MMG2D_intmet_ani(MMG5_pMesh ,MMG5_pSol ,MMG_int ,int8_t ,MMG_int ,double ); +MMG_int MMG2D_adpspl(MMG5_pMesh ,MMG5_pSol ); +MMG_int MMG2D_adpcol(MMG5_pMesh ,MMG5_pSol ); +MMG_int MMG2D_movtri(MMG5_pMesh ,MMG5_pSol ,MMG_int ,int8_t ); +MMG_int MMG2D_chkspl(MMG5_pMesh ,MMG5_pSol ,MMG_int ,int8_t ); +MMG_int MMG2D_split1b(MMG5_pMesh ,MMG_int ,int8_t ,MMG_int ); +MMG_int MMG2D_movedgpt(MMG5_pMesh ,MMG5_pSol ,MMG_int ,MMG_int *,int8_t ); +MMG_int MMG2D_movintpt(MMG5_pMesh ,MMG5_pSol ,MMG_int ,MMG_int *,int8_t ); +MMG_int MMG2D_movintpt_ani(MMG5_pMesh ,MMG5_pSol ,MMG_int ,MMG_int *,int8_t ); +MMG_int MMG2D_chkmsh(MMG5_pMesh ); +MMG_int MMG2D_chkor(MMG5_pMesh ); +MMG_int MMG2D_savenor_db(MMG5_pMesh ,char*,int8_t ); +MMG_int MMG2D_savedisp_db(MMG5_pMesh mesh,MMG5_pSol ,char*,int8_t ); +MMG_int MMG2D_velextLS(MMG5_pMesh ,MMG5_pSol ); /* tools */ -void MMG2D_keep_only1Subdomain ( MMG5_pMesh mesh,int nsd ); +void MMG2D_keep_only1Subdomain ( MMG5_pMesh mesh,MMG_int nsd ); /* useful functions to debug */ -int MMG2D_indElt(MMG5_pMesh mesh,int kel); -int MMG2D_indPt(MMG5_pMesh mesh,int kp); +MMG_int MMG2D_indElt(MMG5_pMesh mesh,MMG_int kel); +MMG_int MMG2D_indPt(MMG5_pMesh mesh,MMG_int kp); /* Management of local parameters */ -int MMG2D_freeLocalPar(MMG5_pMesh ); +MMG_int MMG2D_freeLocalPar(MMG5_pMesh ); /* functions pointers */ double long_ani(double *ca,double *cb,double *ma,double *mb); double long_iso(double *ca,double *cb,double *ma,double *mb); double MMG2D_caltri_ani(MMG5_pMesh mesh,MMG5_pSol sol,MMG5_pTria ); double MMG2D_caltri_iso(MMG5_pMesh mesh,MMG5_pSol sol,MMG5_pTria ); -int optlen_ani(MMG5_pMesh mesh,MMG5_pSol sol,double declic,int base); -int optlen_iso(MMG5_pMesh mesh,MMG5_pSol sol,double declic,int base); -int optlen_iso_bar(MMG5_pMesh mesh,MMG5_pSol sol,double declic,int base); -int interp_ani(double *,double *,double * ,double ); -int interp_iso(double *,double *,double * ,double ); -int lissmet_iso(MMG5_pMesh mesh,MMG5_pSol sol); -int lissmet_ani(MMG5_pMesh mesh,MMG5_pSol sol); -int MMG2D_sum_reqEdgeLengthsAtPoint(MMG5_pMesh,MMG5_pSol,MMG5_pTria,int8_t); -int MMG2D_set_metricAtPointsOnReqEdges(MMG5_pMesh,MMG5_pSol,int8_t); - -extern double (*MMG2D_lencurv)(MMG5_pMesh ,MMG5_pSol ,int ,int ); +MMG_int optlen_ani(MMG5_pMesh mesh,MMG5_pSol sol,double declic,MMG_int base); +MMG_int optlen_iso(MMG5_pMesh mesh,MMG5_pSol sol,double declic,MMG_int base); +MMG_int optlen_iso_bar(MMG5_pMesh mesh,MMG5_pSol sol,double declic,MMG_int base); +MMG_int interp_ani(double *,double *,double * ,double ); +MMG_int interp_iso(double *,double *,double * ,double ); +MMG_int lissmet_iso(MMG5_pMesh mesh,MMG5_pSol sol); +MMG_int lissmet_ani(MMG5_pMesh mesh,MMG5_pSol sol); +MMG_int MMG2D_sum_reqEdgeLengthsAtPoint(MMG5_pMesh,MMG5_pSol,MMG5_pTria,int8_t); +MMG_int MMG2D_set_metricAtPointsOnReqEdges(MMG5_pMesh,MMG5_pSol,int8_t); + +extern double (*MMG2D_lencurv)(MMG5_pMesh ,MMG5_pSol ,MMG_int ,MMG_int ); extern double (*MMG2D_caltri)(MMG5_pMesh ,MMG5_pSol ,MMG5_pTria ); -extern int (*MMG2D_optlen)(MMG5_pMesh ,MMG5_pSol ,double ,int ); -extern int (*MMG2D_intmet)(MMG5_pMesh ,MMG5_pSol ,int ,int8_t ,int ,double ); -extern int (*MMG2D_gradsiz)(MMG5_pMesh ,MMG5_pSol ); -extern int (*MMG2D_gradsizreq)(MMG5_pMesh ,MMG5_pSol ); -extern int (*MMG2D_defsiz)(MMG5_pMesh ,MMG5_pSol ); +extern MMG_int (*MMG2D_optlen)(MMG5_pMesh ,MMG5_pSol ,double ,MMG_int ); +extern MMG_int (*MMG2D_intmet)(MMG5_pMesh ,MMG5_pSol ,MMG_int ,int8_t ,MMG_int ,double ); +extern MMG_int (*MMG2D_gradsiz)(MMG5_pMesh ,MMG5_pSol ); +extern MMG_int (*MMG2D_gradsizreq)(MMG5_pMesh ,MMG5_pSol ); +extern MMG_int (*MMG2D_defsiz)(MMG5_pMesh ,MMG5_pSol ); /* init structures */ void MMG2D_Init_parameters(MMG5_pMesh mesh); diff --git a/src/mmg2d/mmg2d1.c b/src/mmg2d/mmg2d1.c index 513a48ed7..9404f44c6 100644 --- a/src/mmg2d/mmg2d1.c +++ b/src/mmg2d/mmg2d1.c @@ -36,8 +36,8 @@ based on patterns, collapses and swaps. typchk = 1 -> adaptation based on edge lengths typchk = 2 -> adaptation based on lengths calculated in metric met */ -int MMG2D_anatri(MMG5_pMesh mesh,MMG5_pSol met,int8_t typchk) { - int it,maxit,ns,nc,nsw,nns,nnc,nnsw; +MMG_int MMG2D_anatri(MMG5_pMesh mesh,MMG5_pSol met,int8_t typchk) { + MMG_int it,maxit,ns,nc,nsw,nns,nnc,nnsw; nns = nnc = nnsw = 0; it = 0; @@ -107,12 +107,12 @@ int MMG2D_anatri(MMG5_pMesh mesh,MMG5_pSol met,int8_t typchk) { } /* Travel triangles and split long edges according to patterns */ -int MMG2D_anaelt(MMG5_pMesh mesh,MMG5_pSol met,int typchk) { +MMG_int MMG2D_anaelt(MMG5_pMesh mesh,MMG5_pSol met,MMG_int typchk) { MMG5_pTria pt; MMG5_pPoint ppt,p1,p2; MMG5_Hash hash; double len,s,o[2],no[2]; - int ns,nc,npinit,ni,k,nt,ip1,ip2,ip,it,vx[3]; + MMG_int ns,nc,npinit,ni,k,nt,ip1,ip2,ip,it,vx[3]; int8_t i,ic,i1,i2,ier; static int8_t mmgWarn0=0; @@ -356,12 +356,12 @@ int MMG2D_anaelt(MMG5_pMesh mesh,MMG5_pSol met,int typchk) { * Find acceptable position for splitting. * */ -int MMG2D_dichoto(MMG5_pMesh mesh,MMG5_pSol met,int k,int *vx) { +MMG_int MMG2D_dichoto(MMG5_pMesh mesh,MMG5_pSol met,MMG_int k,MMG_int *vx) { MMG5_pTria pt; MMG5_pPoint pa,pb,ps; double o[3][2],p[3][2]; float to,tp,t; - int ia,ib,ier,it,maxit; + MMG_int ia,ib,ier,it,maxit; int8_t i,i1,i2; pt = &mesh->tria[k]; @@ -432,11 +432,11 @@ int MMG2D_dichoto(MMG5_pMesh mesh,MMG5_pSol met,int k,int *vx) { } /* Travel triangles and collapse short edges */ -int MMG2D_colelt(MMG5_pMesh mesh,MMG5_pSol met,int typchk) { +MMG_int MMG2D_colelt(MMG5_pMesh mesh,MMG5_pSol met,MMG_int typchk) { MMG5_pTria pt; MMG5_pPoint p1,p2; double ux,uy,ll,hmin2; - int list[MMG2D_LONMAX+2],ilist,nc,k; + MMG_int list[MMG2D_LONMAX+2],ilist,nc,k; uint8_t i,i1,i2,open; nc = 0; @@ -506,9 +506,9 @@ int MMG2D_colelt(MMG5_pMesh mesh,MMG5_pSol met,int typchk) { } /* Travel triangles and swap edges to improve quality */ -int MMG2D_swpmsh(MMG5_pMesh mesh,MMG5_pSol met,int typchk) { +MMG_int MMG2D_swpmsh(MMG5_pMesh mesh,MMG5_pSol met,MMG_int typchk) { MMG5_pTria pt; - int it,maxit,ns,nns,k; + MMG_int it,maxit,ns,nns,k; uint8_t i; it = nns = 0; @@ -541,8 +541,8 @@ int MMG2D_swpmsh(MMG5_pMesh mesh,MMG5_pSol met,int typchk) { /* Mesh adaptation routine for the final stage of the algorithm: intertwine splitting based on patterns, collapses, swaps and vertex relocations.*/ -int MMG2D_adptri(MMG5_pMesh mesh,MMG5_pSol met) { - int maxit,it,nns,ns,nnc,nc,nnsw,nsw,nnm,nm; +MMG_int MMG2D_adptri(MMG5_pMesh mesh,MMG5_pSol met) { + MMG_int maxit,it,nns,ns,nnc,nc,nnsw,nsw,nnm,nm; nns = nnc = nnsw = nnm = it = 0; maxit = 5; @@ -631,10 +631,10 @@ int MMG2D_adptri(MMG5_pMesh mesh,MMG5_pSol met) { * edges are only splitted on a one-by-one basis * */ -int MMG2D_adpspl(MMG5_pMesh mesh,MMG5_pSol met) { +MMG_int MMG2D_adpspl(MMG5_pMesh mesh,MMG5_pSol met) { MMG5_pTria pt; double lmax,len; - int k,ns,nt,ip,ier; + MMG_int k,ns,nt,ip,ier; int8_t i,i1,i2,imax; ns = 0; @@ -687,11 +687,11 @@ int MMG2D_adpspl(MMG5_pMesh mesh,MMG5_pSol met) { } /* Analysis and collapse routine for edges in the final step of the algorithm */ -int MMG2D_adpcol(MMG5_pMesh mesh,MMG5_pSol met) { +MMG_int MMG2D_adpcol(MMG5_pMesh mesh,MMG5_pSol met) { MMG5_pTria pt; MMG5_pPoint p1,p2; double len; - int k,nc,ilist,list[MMG2D_LONMAX+2]; + MMG_int k,nc,ilist,list[MMG2D_LONMAX+2]; int8_t i,i1,i2,open; nc = 0; @@ -744,10 +744,10 @@ int MMG2D_adpcol(MMG5_pMesh mesh,MMG5_pSol met) { } /* Analyze points to relocate them according to a quality criterion */ -int MMG2D_movtri(MMG5_pMesh mesh,MMG5_pSol met,int maxit,int8_t improve) { +MMG_int MMG2D_movtri(MMG5_pMesh mesh,MMG5_pSol met,MMG_int maxit,int8_t improve) { MMG5_pTria pt; MMG5_pPoint p0; - int base,k,nnm,nm,ns,it,ilist,list[MMG2D_LONMAX+2]; + MMG_int base,k,nnm,nm,ns,it,ilist,list[MMG2D_LONMAX+2]; int8_t i,ier; it = nnm = 0; @@ -805,7 +805,7 @@ int MMG2D_movtri(MMG5_pMesh mesh,MMG5_pSol met,int maxit,int8_t improve) { * Mesh adaptation -- new version of mmg2d1.c * **/ -int MMG2D_mmg2d1n(MMG5_pMesh mesh,MMG5_pSol met) { +MMG_int MMG2D_mmg2d1n(MMG5_pMesh mesh,MMG5_pSol met) { /* Stage 1: creation of a geometric mesh */ if ( abs(mesh->info.imprim) > 4 || mesh->info.ddebug ) diff --git a/src/mmg2d/mmg2d2.c b/src/mmg2d/mmg2d2.c index d1fc67ab3..972fe12ad 100644 --- a/src/mmg2d/mmg2d2.c +++ b/src/mmg2d/mmg2d2.c @@ -39,9 +39,9 @@ * Remove the bounding box triangles. * */ -int MMG2D_removeBBtriangles(MMG5_pMesh mesh) { +MMG_int MMG2D_removeBBtriangles(MMG5_pMesh mesh) { MMG5_pTria pt; - int ip1,ip2,ip3,ip4,k,iadr,*adja,iadr2,*adja2,iel,nd; + MMG_int ip1,ip2,ip3,ip4,k,iadr,*adja,iadr2,*adja2,iel,nd; int8_t i,ii; static int8_t mmgWarn0=0; @@ -96,10 +96,10 @@ int MMG2D_removeBBtriangles(MMG5_pMesh mesh) { /* Set tag to triangles in the case where there are no constrained edge in the supplied mesh: in = base ; out = -base ; undetermined = 0*/ -int MMG2D_settagtriangles(MMG5_pMesh mesh,MMG5_pSol sol) { +MMG_int MMG2D_settagtriangles(MMG5_pMesh mesh,MMG5_pSol sol) { MMG5_pTria pt; - int base,nd,iter,maxiter,k; - int ip1,ip2,ip3,ip4; + MMG_int base,nd,iter,maxiter,k; + MMG_int ip1,ip2,ip3,ip4; /*BB vertex*/ ip1=(mesh->np-3); @@ -129,9 +129,9 @@ int MMG2D_settagtriangles(MMG5_pMesh mesh,MMG5_pSol sol) { /* Find out whether triangle pt is inside or outside (i.e. contains bb points or not) */ /* Return <0 value if triangle outside ; > 0 if triangle inside */ -int MMG2D_findtrianglestate(MMG5_pMesh mesh,int k,int ip1,int ip2,int ip3,int ip4,int base) { +MMG_int MMG2D_findtrianglestate(MMG5_pMesh mesh,MMG_int k,MMG_int ip1,MMG_int ip2,MMG_int ip3,MMG_int ip4,MMG_int base) { MMG5_pTria pt; - int nb; + MMG_int nb; int8_t i; pt = &mesh->tria[k]; @@ -162,11 +162,11 @@ int MMG2D_findtrianglestate(MMG5_pMesh mesh,int k,int ip1,int ip2,int ip3,int ip * (Vertices mesh->np - 3, 2, 1, 0 are the vertices of the BB and have already been inserted) * */ -int MMG2D_insertpointdelone(MMG5_pMesh mesh,MMG5_pSol sol) { +MMG_int MMG2D_insertpointdelone(MMG5_pMesh mesh,MMG5_pSol sol) { MMG5_pPoint ppt; - int list[MMG2D_LONMAX],lon; - int k,kk; - int iter,maxiter,ns,nus,nu,nud; + MMG_int list[MMG2D_LONMAX],lon; + MMG_int k,kk; + MMG_int iter,maxiter,ns,nus,nu,nud; static int8_t mmgWarn0=0,mmgWarn1=0,mmgWarn2=0; for(k=1; k<=mesh->np-4; k++) { @@ -306,19 +306,19 @@ int MMG2D_insertpointdelone(MMG5_pMesh mesh,MMG5_pSol sol) { * Put different references on different subdomains * */ -int MMG2D_markSD(MMG5_pMesh mesh) { +MMG_int MMG2D_markSD(MMG5_pMesh mesh) { MMG5_pTria pt,pt1; MMG5_pEdge ped; MMG5_pPoint ppt; - int k,l,iadr,*adja,ped0,ped1,*list,ipil,ncurc,nref; - int kinit,nt,nsd,ip1,ip2,ip3,ip4,ned,iel,voy; + MMG_int k,l,iadr,*adja,ped0,ped1,*list,ipil,ncurc,nref; + MMG_int kinit,nt,nsd,ip1,ip2,ip3,ip4,ned,iel,voy; int8_t i,i1,i2; /* Reset flag field for triangles */ for(k=1 ; k<=mesh->nt ; k++) mesh->tria[k].flag = mesh->mark; - MMG5_SAFE_CALLOC(list,mesh->nt,int,return 0); + MMG5_SAFE_CALLOC(list,mesh->nt,MMG_int,return 0); kinit = 0; nref = 0; ip1 = mesh->np; @@ -492,12 +492,12 @@ int MMG2D_markSD(MMG5_pMesh mesh) { * Mesh triangulation. * **/ -int MMG2D_mmg2d2(MMG5_pMesh mesh,MMG5_pSol sol) { +MMG_int MMG2D_mmg2d2(MMG5_pMesh mesh,MMG5_pSol sol) { MMG5_pTria pt; MMG5_pPoint ppt,ppt2; double c[2],dd; - int j,k,kk,ip1,ip2,ip3,ip4,jel,kel,nt,iadr,*adja; - int *numper; + MMG_int j,k,kk,ip1,ip2,ip3,ip4,jel,kel,nt,iadr,*adja; + MMG_int *numper; mesh->base = 0; /* If triangles already exist, delete them */ @@ -516,7 +516,7 @@ int MMG2D_mmg2d2(MMG5_pMesh mesh,MMG5_pSol sol) { /* This part seems useless */ /* Deal with periodic vertices */ if ( mesh->info.nsd == -10 ) { - MMG5_SAFE_CALLOC(numper,mesh->np+1,int,return 0); + MMG5_SAFE_CALLOC(numper,mesh->np+1,MMG_int,return 0); for (k=1; k<=mesh->np; k++) { ppt = &mesh->point[k]; for (kk=k; kk<=mesh->np; kk++) { diff --git a/src/mmg2d/mmg2d6.c b/src/mmg2d/mmg2d6.c index f044bd410..fd4f25f39 100644 --- a/src/mmg2d/mmg2d6.c +++ b/src/mmg2d/mmg2d6.c @@ -42,7 +42,7 @@ * Calculate the area of a triangle given by its vertices * **/ -inline double MMG2D_voltri(MMG5_pMesh mesh,int ip0,int ip1,int ip2) { +inline double MMG2D_voltri(MMG5_pMesh mesh,MMG_int ip0,MMG_int ip1,MMG_int ip2) { MMG5_pPoint p0,p1,p2; double vol; @@ -66,11 +66,11 @@ inline double MMG2D_voltri(MMG5_pMesh mesh,int ip0,int ip1,int ip2) { * inside triangle k defined by the ls function in sol * **/ -double MMG2D_vfrac(MMG5_pMesh mesh,MMG5_pSol sol,int k,int pm) { +double MMG2D_vfrac(MMG5_pMesh mesh,MMG5_pSol sol,MMG_int k,MMG_int pm) { MMG5_pTria pt; MMG5_pPoint ppt[3]; double v[3],vfp,vfm,lam,area,eps,o1[2],o2[2]; - int ip[3],nplus,nminus,nzero; + MMG_int ip[3],nplus,nminus,nzero; int8_t i,i0,i1,i2,imin1,iplus1,iz; eps = MMG5_EPS*MMG5_EPS; @@ -188,10 +188,10 @@ double MMG2D_vfrac(MMG5_pMesh mesh,MMG5_pSol sol,int k,int pm) { * Reset MG_ISO vertex and edge references to 0. * */ -int MMG2D_resetRef(MMG5_pMesh mesh) { +MMG_int MMG2D_resetRef(MMG5_pMesh mesh) { MMG5_pTria pt; MMG5_pPoint p0; - int k,ref; + MMG_int k,ref; int8_t i; for (k=1; k<=mesh->nt; k++) { @@ -218,10 +218,10 @@ int MMG2D_resetRef(MMG5_pMesh mesh) { /* Check whether snapping the value of vertex i of k to 0 exactly leads to a non manifold situation assumption: the triangle k has vertex i with value 0 and the other two with changing values */ -int MMG2D_ismaniball(MMG5_pMesh mesh, MMG5_pSol sol, int start, int8_t istart) { +MMG_int MMG2D_ismaniball(MMG5_pMesh mesh, MMG5_pSol sol, MMG_int start, int8_t istart) { MMG5_pTria pt; double v1, v2; - int *adja,k,ip1,ip2,end1,refstart; + MMG_int *adja,k,ip1,ip2,end1,refstart; int8_t i,i1,smsgn; static int8_t mmgWarn=0; @@ -309,11 +309,11 @@ int MMG2D_ismaniball(MMG5_pMesh mesh, MMG5_pSol sol, int start, int8_t istart) { * Snap values of sol very close to 0 to 0 exactly (to avoid very small * triangles in cutting) */ -int MMG2D_snapval(MMG5_pMesh mesh, MMG5_pSol sol) { +MMG_int MMG2D_snapval(MMG5_pMesh mesh, MMG5_pSol sol) { MMG5_pTria pt,pt1; MMG5_pPoint p0; double v1,v2,*tmp; - int k,kk,iel,ns,nc,ip,ip1,ip2,npl,nmn,ilist,list[MMG2D_LONMAX+2]; + MMG_int k,kk,iel,ns,nc,ip,ip1,ip2,npl,nmn,ilist,list[MMG2D_LONMAX+2]; int8_t i,j,j1,j2; /* Allocate memory for tmp */ @@ -404,9 +404,9 @@ int MMG2D_snapval(MMG5_pMesh mesh, MMG5_pSol sol) { /* Check whether the ball of vertex i in tria start is manifold; by assumption, i inxt[i] is one edge of the implicit boundary */ -int MMG2D_chkmaniball(MMG5_pMesh mesh, int start, int8_t istart) { +MMG_int MMG2D_chkmaniball(MMG5_pMesh mesh, MMG_int start, int8_t istart) { MMG5_pTria pt; - int *adja,k,refstart; + MMG_int *adja,k,refstart; int8_t i,i1; pt = &mesh->tria[start]; @@ -474,9 +474,9 @@ int MMG2D_chkmaniball(MMG5_pMesh mesh, int start, int8_t istart) { } /* Check whether the resulting two subdomains occupying mesh are manifold */ -int MMG2D_chkmanimesh(MMG5_pMesh mesh) { +MMG_int MMG2D_chkmanimesh(MMG5_pMesh mesh) { MMG5_pTria pt,pt1; - int *adja,k,cnt,iel; + MMG_int *adja,k,cnt,iel; int8_t i,i1; static int8_t mmgWarn=0; @@ -544,10 +544,10 @@ int MMG2D_chkmanimesh(MMG5_pMesh mesh) { * mesh->info.rmc * volume of the mesh. * */ -int MMG2D_rmc(MMG5_pMesh mesh, MMG5_pSol sol){ +MMG_int MMG2D_rmc(MMG5_pMesh mesh, MMG5_pSol sol){ MMG5_pTria pt,pt1,pt2; double volc,voltot,v0,v1,v2; - int k,kk,l,ll,ncp,ncm,ip0,ip1,ip2,base,cur,ipile,*pile,*adja; + MMG_int k,kk,l,ll,ncp,ncm,ip0,ip1,ip2,base,cur,ipile,*pile,*adja; int8_t i,i1,i2; ncp = 0; @@ -568,10 +568,10 @@ int MMG2D_rmc(MMG5_pMesh mesh, MMG5_pSol sol){ } /* Memory allocation for pile */ - MMG5_ADD_MEM(mesh,(mesh->nt+1)*sizeof(int),"temporary table", + MMG5_ADD_MEM(mesh,(mesh->nt+1)*sizeof(MMG_int),"temporary table", printf(" Exit program.\n"); return 0); - MMG5_SAFE_CALLOC(pile,mesh->nt+1,int,return 0); + MMG5_SAFE_CALLOC(pile,mesh->nt+1,MMG_int,return 0); /* Investigate only positive connected components */ base = ++mesh->base; @@ -788,12 +788,12 @@ int MMG2D_rmc(MMG5_pMesh mesh, MMG5_pSol sol){ * Effective discretization of the 0 level set encoded in sol in the mesh * */ -int MMG2D_cuttri_ls(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pSol met){ +MMG_int MMG2D_cuttri_ls(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pSol met){ MMG5_pTria pt; MMG5_pPoint p0,p1; MMG5_Hash hash; double v0,v1,s,c[2]; - int k,ip0,ip1,nb,np,nt,ns,refint,refext,vx[3]; + MMG_int k,ip0,ip1,nb,np,nt,ns,refint,refext,vx[3]; int8_t i,i0,i1,ier; /* Reset flag field for points */ @@ -937,10 +937,10 @@ int MMG2D_cuttri_ls(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pSol met){ } /* Set references to the new triangles */ -int MMG2D_setref_ls(MMG5_pMesh mesh, MMG5_pSol sol){ +MMG_int MMG2D_setref_ls(MMG5_pMesh mesh, MMG5_pSol sol){ MMG5_pTria pt; double v,v1; - int k,ip,ip1,ier,ref,refint,refext; + MMG_int k,ip,ip1,ier,ref,refint,refext; int8_t i,i1,i2,nmn,npl,nz; for (k=1; k<=mesh->nt; k++) { @@ -1001,8 +1001,8 @@ int MMG2D_setref_ls(MMG5_pMesh mesh, MMG5_pSol sol){ } /* Main function of the -ls mode */ -int MMG2D_mmg2d6(MMG5_pMesh mesh, MMG5_pSol sol,MMG5_pSol met) { - int k; +MMG_int MMG2D_mmg2d6(MMG5_pMesh mesh, MMG5_pSol sol,MMG5_pSol met) { + MMG_int k; if ( abs(mesh->info.imprim) > 3 ) fprintf(stdout," ** ISOSURFACE EXTRACTION\n"); diff --git a/src/mmg2d/mmg2d9.c b/src/mmg2d/mmg2d9.c index 0b6c4e8f4..7e32b5025 100644 --- a/src/mmg2d/mmg2d9.c +++ b/src/mmg2d/mmg2d9.c @@ -41,7 +41,7 @@ double MMG2D_estavglen(MMG5_pMesh mesh) { MMG5_pTria pt; MMG5_pPoint p1,p2; - int k,na; + MMG_int k,na; double len,lent,dna; int8_t i,i1,i2; @@ -115,11 +115,11 @@ inline double MMG2D_caltri_iso_3pt(double *a,double *b,double *c) { * valid mesh. * */ -int MMG2D_chkmovmesh(MMG5_pMesh mesh,MMG5_pSol disp,short t,int *triIdx) { +MMG_int MMG2D_chkmovmesh(MMG5_pMesh mesh,MMG5_pSol disp,short t,MMG_int *triIdx) { MMG5_pTria pt; MMG5_pPoint ppt; double *v,c[3][2],tau; - int k,np,idx; + MMG_int k,np,idx; int8_t i,j; /* Pseudo time-step = fraction of disp to perform */ @@ -161,7 +161,7 @@ int MMG2D_chkmovmesh(MMG5_pMesh mesh,MMG5_pSol disp,short t,int *triIdx) { * */ short MMG2D_dikomv(MMG5_pMesh mesh,MMG5_pSol disp,short *lastt) { - int it,maxit; + MMG_int it,maxit; short t,tmin,tmax; int8_t ier; @@ -213,11 +213,11 @@ short MMG2D_dikomv(MMG5_pMesh mesh,MMG5_pSol disp,short *lastt) { } /** Perform mesh motion along disp, for a fraction t, and the corresponding updates */ -int MMG2D_dispmesh(MMG5_pMesh mesh,MMG5_pSol disp,short t,int itdeg) { +MMG_int MMG2D_dispmesh(MMG5_pMesh mesh,MMG5_pSol disp,short t,MMG_int itdeg) { MMG5_pTria pt; MMG5_pPoint ppt; double *v,tau,ctau,c[3][2],ocal,ncal; - int k,np; + MMG_int k,np; int8_t i,j; tau = (double)t /MMG2D_SHORTMAX; @@ -280,11 +280,11 @@ int MMG2D_dispmesh(MMG5_pMesh mesh,MMG5_pSol disp,short t,int itdeg) { * Only affects triangles with cc itdeg * */ -int MMG2D_spllag(MMG5_pMesh mesh,MMG5_pSol disp,MMG5_pSol met,int itdeg,int *warn) { +MMG_int MMG2D_spllag(MMG5_pMesh mesh,MMG5_pSol disp,MMG5_pSol met,MMG_int itdeg,MMG_int *warn) { MMG5_pTria pt; MMG5_pPoint p1,p2; double hma2,lmax,len; - int k,ns,ip,ip1,ip2; + MMG_int k,ns,ip,ip1,ip2; int8_t i,i1,i2,imax,ier; static int8_t mmgWarn0=0; @@ -375,11 +375,11 @@ int MMG2D_spllag(MMG5_pMesh mesh,MMG5_pSol disp,MMG5_pSol met,int itdeg,int *war * Attempt to collapse small internal edges in the Lagrangian mode; only affects tria with cc itdeg. * */ -static int MMG2D_coleltlag(MMG5_pMesh mesh,MMG5_pSol met,int itdeg) { +static MMG_int MMG2D_coleltlag(MMG5_pMesh mesh,MMG5_pSol met,MMG_int itdeg) { MMG5_pTria pt; MMG5_pPoint p1,p2; double hmi2,len; - int nc,k,ilist,list[MMG2D_LONMAX+2]; + MMG_int nc,k,ilist,list[MMG2D_LONMAX+2]; int8_t i,i1,i2,open; nc = 0; @@ -437,9 +437,9 @@ static int MMG2D_coleltlag(MMG5_pMesh mesh,MMG5_pSol met,int itdeg) { * Internal edge flipping in the Lagrangian mode; only affects trias with cc itdeg * */ -int MMG2D_swpmshlag(MMG5_pMesh mesh,MMG5_pSol met,double crit,int itdeg) { +MMG_int MMG2D_swpmshlag(MMG5_pMesh mesh,MMG5_pSol met,double crit,MMG_int itdeg) { MMG5_pTria pt; - int k,it,maxit,ns,nns; + MMG_int k,it,maxit,ns,nns; int8_t i; maxit = 2; @@ -471,9 +471,9 @@ int MMG2D_swpmshlag(MMG5_pMesh mesh,MMG5_pSol met,double crit,int itdeg) { return nns; } /** For debugging purposes: save disp */ -int MMG2D_saveDisp(MMG5_pMesh mesh,MMG5_pSol disp) { +MMG_int MMG2D_saveDisp(MMG5_pMesh mesh,MMG5_pSol disp) { FILE *out; - int k; + MMG_int k; char data[256],*ptr; strcpy(data,"disp.sol"); @@ -505,10 +505,10 @@ int MMG2D_saveDisp(MMG5_pMesh mesh,MMG5_pSol disp) { * Analyze trias with cc = itdeg and move internal points so as to make mesh more uniform. * */ -int MMG2D_movtrilag(MMG5_pMesh mesh,MMG5_pSol met,int itdeg) { +MMG_int MMG2D_movtrilag(MMG5_pMesh mesh,MMG5_pSol met,MMG_int itdeg) { MMG5_pTria pt; MMG5_pPoint p0; - int k,it,base,maxit,nm,nnm,ilist,list[MMG2D_LONMAX+2]; + MMG_int k,it,base,maxit,nm,nnm,ilist,list[MMG2D_LONMAX+2]; int8_t i,ier; nnm = 0; @@ -568,10 +568,10 @@ int MMG2D_movtrilag(MMG5_pMesh mesh,MMG5_pSol met,int itdeg) { * info.lag > 1 -> displacement+remeshing with split+collapse+swap+move * */ -int MMG2D_mmg2d9(MMG5_pMesh mesh,MMG5_pSol disp,MMG5_pSol met,int **invalidTrias) { +MMG_int MMG2D_mmg2d9(MMG5_pMesh mesh,MMG5_pSol disp,MMG5_pSol met,MMG_int **invalidTrias) { double avlen,tau,hmintmp,hmaxtmp; - int k,itmn,itdc,maxitmn,maxitdc,iit,warn,ninvalidTrias; - int nspl,nnspl,nnnspl,nc,nnc,nnnc,ns,nns,nnns,nm,nnm,nnnm; + MMG_int k,itmn,itdc,maxitmn,maxitdc,iit,warn,ninvalidTrias; + MMG_int nspl,nnspl,nnnspl,nc,nnc,nnnc,ns,nns,nnns,nm,nnm,nnnm; short t,lastt; int8_t ier; @@ -729,7 +729,7 @@ int MMG2D_mmg2d9(MMG5_pMesh mesh,MMG5_pSol disp,MMG5_pSol met,int **invalidTrias } if ( tau < MMG5_EPSD2 ) { - MMG5_SAFE_CALLOC(*invalidTrias,mesh->np,int, + MMG5_SAFE_CALLOC(*invalidTrias,mesh->np,MMG_int, printf("## Warning: Not enough memory to keep track of" " the invalid triangles.\n"); MMG5_DEL_MEM(mesh,disp->m); diff --git a/src/mmg2d/mmg2dexterns.c b/src/mmg2d/mmg2dexterns.c index 89a33814c..d8c7c0d5f 100644 --- a/src/mmg2d/mmg2dexterns.c +++ b/src/mmg2d/mmg2dexterns.c @@ -1,10 +1,10 @@ #include "mmgexterns.h" #include "mmg2d.h" -int (*MMG2D_defsiz)(MMG5_pMesh ,MMG5_pSol )=NULL; -int (*MMG2D_intmet)(MMG5_pMesh ,MMG5_pSol ,int ,int8_t ,int ,double )=NULL; -double (*MMG2D_lencurv)(MMG5_pMesh ,MMG5_pSol ,int ,int )=NULL; -int (*MMG2D_gradsizreq)(MMG5_pMesh ,MMG5_pSol )=NULL; +MMG_int (*MMG2D_defsiz)(MMG5_pMesh ,MMG5_pSol )=NULL; +MMG_int (*MMG2D_intmet)(MMG5_pMesh ,MMG5_pSol ,MMG_int ,int8_t ,MMG_int ,double )=NULL; +double (*MMG2D_lencurv)(MMG5_pMesh ,MMG5_pSol ,MMG_int ,MMG_int )=NULL; +MMG_int (*MMG2D_gradsizreq)(MMG5_pMesh ,MMG5_pSol )=NULL; double (*MMG2D_caltri)(MMG5_pMesh ,MMG5_pSol ,MMG5_pTria )=NULL; -int (*MMG2D_gradsiz)(MMG5_pMesh ,MMG5_pSol )=NULL; +MMG_int (*MMG2D_gradsiz)(MMG5_pMesh ,MMG5_pSol )=NULL; diff --git a/src/mmg2d/mmg2dexterns.h b/src/mmg2d/mmg2dexterns.h index 453ceccd4..5d4a68a96 100644 --- a/src/mmg2d/mmg2dexterns.h +++ b/src/mmg2d/mmg2dexterns.h @@ -1,10 +1,10 @@ #include "mmgexterns.h" #include "mmg2d.h" -extern int (*MMG2D_defsiz)(MMG5_pMesh ,MMG5_pSol ); -extern int (*MMG2D_intmet)(MMG5_pMesh ,MMG5_pSol ,int ,int8_t ,int ,double ); -extern double (*MMG2D_lencurv)(MMG5_pMesh ,MMG5_pSol ,int ,int ); -extern int (*MMG2D_gradsizreq)(MMG5_pMesh ,MMG5_pSol ); +extern MMG_int (*MMG2D_defsiz)(MMG5_pMesh ,MMG5_pSol ); +extern MMG_int (*MMG2D_intmet)(MMG5_pMesh ,MMG5_pSol ,MMG_int ,int8_t ,MMG_int ,double ); +extern double (*MMG2D_lencurv)(MMG5_pMesh ,MMG5_pSol ,MMG_int ,MMG_int ); +extern MMG_int (*MMG2D_gradsizreq)(MMG5_pMesh ,MMG5_pSol ); extern double (*MMG2D_caltri)(MMG5_pMesh ,MMG5_pSol ,MMG5_pTria ); -extern int (*MMG2D_gradsiz)(MMG5_pMesh ,MMG5_pSol ); +extern MMG_int (*MMG2D_gradsiz)(MMG5_pMesh ,MMG5_pSol ); diff --git a/src/mmg2d/movpt_2d.c b/src/mmg2d/movpt_2d.c index decb9f5e1..ac6a85493 100644 --- a/src/mmg2d/movpt_2d.c +++ b/src/mmg2d/movpt_2d.c @@ -49,11 +49,11 @@ * isotropic and anisotropic case * */ -int MMG2D_movedgpt(MMG5_pMesh mesh,MMG5_pSol met,int ilist,int *list, int8_t improve) { +MMG_int MMG2D_movedgpt(MMG5_pMesh mesh,MMG5_pSol met,MMG_int ilist,MMG_int *list, int8_t improve) { MMG5_pTria pt,pt0; MMG5_pPoint p0,p1,p2,ppt; double step,ll1,ll2,o[2],no[2],calold,calnew; - int k,iel,ip0,ip1,ip2,it1,it2; + MMG_int k,iel,ip0,ip1,ip2,it1,it2; int8_t i,i1,i2; static int8_t mmgWarn0=0,mmgWarn1=0; @@ -209,11 +209,11 @@ int MMG2D_movedgpt(MMG5_pMesh mesh,MMG5_pSol met,int ilist,int *list, int8_t imp * Relocate internal vertex whose ball is passed. * */ -int MMG2D_movintpt(MMG5_pMesh mesh,MMG5_pSol met,int ilist,int *list,int8_t improve) { +MMG_int MMG2D_movintpt(MMG5_pMesh mesh,MMG5_pSol met,MMG_int ilist,MMG_int *list,int8_t improve) { MMG5_pTria pt,pt0; MMG5_pPoint p0,p1,p2,ppt0; double calold,calnew,vol,volbal,b[2]; - int k,iel; + MMG_int k,iel; int8_t i,i1,i2; ppt0 = &mesh->point[0]; diff --git a/src/mmg2d/quality_2d.c b/src/mmg2d/quality_2d.c index 1bf41ff4b..2ed028c79 100644 --- a/src/mmg2d/quality_2d.c +++ b/src/mmg2d/quality_2d.c @@ -96,7 +96,7 @@ double MMG2D_caltri_ani(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTria pt) { double abx,aby,acx,acy,bcx,bcy; double *a,*b,*c,*ma,*mb,*mc; double area,aream,hm,m[6],h1,h2,h3; - int ipa,ipb,ipc,i; + MMG_int ipa,ipb,ipc,i; ipa = pt->v[0]; ipb = pt->v[1]; @@ -153,10 +153,10 @@ double MMG2D_caltri_ani(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTria pt) { * Print histogram of mesh qualities. * */ -int MMG2D_outqua(MMG5_pMesh mesh,MMG5_pSol met) { +MMG_int MMG2D_outqua(MMG5_pMesh mesh,MMG5_pSol met) { MMG5_pTria pt; double rap,rapmin,rapmax,rapavg,med,good; - int i,k,iel,ok,ir,imax,nex,his[5]; + MMG_int i,k,iel,ok,ir,imax,nex,his[5]; static int8_t mmgWarn0; /* Compute triangle quality*/ @@ -207,7 +207,7 @@ int MMG2D_outqua(MMG5_pMesh mesh,MMG5_pSol met) { if ( rap < MMG2D_BADKAL ) mesh->info.badkal = 1; rapavg += rap; rapmax = MG_MAX(rapmax,rap); - ir = MG_MIN(4,(int)(5.0*rap)); + ir = MG_MIN(4,(MMG_int)(5.0*rap)); his[ir] += 1; } @@ -227,8 +227,8 @@ int MMG2D_outqua(MMG5_pMesh mesh,MMG5_pSol met) { fprintf(stdout," %6.2f %% > 0.12\n",100.0*(good/(float)(mesh->nt-nex))); if ( abs(mesh->info.imprim) > 3 ) { fprintf(stdout," %6.2f %% > 0.5\n",100.0*( med/(float)(mesh->nt-nex))); - imax = MG_MIN(4,(int)(5.*rapmax)); - for (i=imax; i>=(int)(5*rapmin); i--) { + imax = MG_MIN(4,(MMG_int)(5.*rapmax)); + for (i=imax; i>=(MMG_int)(5*rapmin); i--) { fprintf(stdout," %5.1f < Q < %5.1f %7d %6.2f %%\n", i/5.,i/5.+0.2,his[i],100.*(his[i]/(float)(mesh->nt-nex))); } diff --git a/src/mmg2d/scalem_2d.c b/src/mmg2d/scalem_2d.c index cf5f661af..dbf0dd869 100644 --- a/src/mmg2d/scalem_2d.c +++ b/src/mmg2d/scalem_2d.c @@ -45,11 +45,11 @@ * Truncate the metric sizes between hmin/hmax * */ -int MMG2D_scaleMesh(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pSol sol) { +MMG_int MMG2D_scaleMesh(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pSol sol) { double dd,isqhmin,isqhmax; double *m; double lambda[2],v[2][2]; - int i,k,iadr; + MMG_int i,k,iadr; int8_t sethmin,sethmax; static int8_t mmgWarn0=0, mmgWarn1=0; diff --git a/src/mmg2d/solmap_2d.c b/src/mmg2d/solmap_2d.c index 800455d1f..19daa74ee 100644 --- a/src/mmg2d/solmap_2d.c +++ b/src/mmg2d/solmap_2d.c @@ -43,12 +43,12 @@ * passing through a point. * */ -int MMG2D_doSol(MMG5_pMesh mesh,MMG5_pSol sol) { +MMG_int MMG2D_doSol(MMG5_pMesh mesh,MMG5_pSol sol) { MMG5_pTria ptt,pt; MMG5_pPoint p1,p2; double ux,uy,dd; - int i,k,ib,iadr,ipa,ipb; - int MMG_inxtt[5] = {0,1,2,0,1}; + MMG_int i,k,ib,iadr,ipa,ipb; + MMG_int MMG_inxtt[5] = {0,1,2,0,1}; /* Memory alloc */ if ( sol->size!=1 && sol->size!=3 ) { diff --git a/src/mmg2d/split_2d.c b/src/mmg2d/split_2d.c index 9fdad78c0..93f816d0a 100644 --- a/src/mmg2d/split_2d.c +++ b/src/mmg2d/split_2d.c @@ -47,11 +47,11 @@ extern uint8_t ddb; * possibly perform a dichotomy to find the latest valid position for the point. * */ -int MMG2D_chkspl(MMG5_pMesh mesh,MMG5_pSol met,int k,int8_t i) { +MMG_int MMG2D_chkspl(MMG5_pMesh mesh,MMG5_pSol met,MMG_int k,int8_t i) { MMG5_pTria pt,pt1,pt0; MMG5_pPoint p1,p2,ppt; double mid[2],o[2],no[2],calnew,caltmp,tp,to,t,calseuil; - int ip,jel,*adja,it,maxit,npinit; + MMG_int ip,jel,*adja,it,maxit,npinit; int8_t i1,i2,j,j1,j2,ier,isv; calseuil = 1e-4 / MMG2D_ALPHAD; @@ -236,9 +236,9 @@ int MMG2D_chkspl(MMG5_pMesh mesh,MMG5_pSol met,int k,int8_t i) { * adjacency structure in the mesh is preserved * */ -int MMG2D_split1b(MMG5_pMesh mesh,int k,int8_t i,int ip) { +MMG_int MMG2D_split1b(MMG5_pMesh mesh,MMG_int k,int8_t i,MMG_int ip) { MMG5_pTria pt,pt1; - int *adja,iel,jel,kel,mel; + MMG_int *adja,iel,jel,kel,mel; int8_t i1,i2,m,j,j1,j2; iel = MMG2D_newElt(mesh); @@ -262,7 +262,7 @@ int MMG2D_split1b(MMG5_pMesh mesh,int k,int8_t i,int ip) { pt1 = &mesh->tria[iel]; memcpy(pt1,pt,sizeof(MMG5_Tria)); - memcpy(&mesh->adja[3*(iel-1)+1],&mesh->adja[3*(k-1)+1],3*sizeof(int)); + memcpy(&mesh->adja[3*(iel-1)+1],&mesh->adja[3*(k-1)+1],3*sizeof(MMG_int)); /* Update both triangles */ pt->v[i2] = ip; @@ -300,7 +300,7 @@ int MMG2D_split1b(MMG5_pMesh mesh,int k,int8_t i,int ip) { pt->base = mesh->base; memcpy(pt1,pt,sizeof(MMG5_Tria)); - memcpy(&mesh->adja[3*(kel-1)+1],&mesh->adja[3*(jel-1)+1],3*sizeof(int)); + memcpy(&mesh->adja[3*(kel-1)+1],&mesh->adja[3*(jel-1)+1],3*sizeof(MMG_int)); /* Update triangles */ pt->v[j1] = ip; @@ -337,7 +337,7 @@ int MMG2D_split1b(MMG5_pMesh mesh,int k,int8_t i,int ip) { * Simulate the split of one edge in triangle k * */ -int MMG2D_split1_sim(MMG5_pMesh mesh, MMG5_pSol sol, int k, int vx[3]) { +MMG_int MMG2D_split1_sim(MMG5_pMesh mesh, MMG5_pSol sol, MMG_int k, MMG_int vx[3]) { MMG5_pTria pt,pt0; double cal; uint8_t tau[3]; @@ -382,10 +382,10 @@ int MMG2D_split1_sim(MMG5_pMesh mesh, MMG5_pSol sol, int k, int vx[3]) { * Split 1 edge of triangle k * */ -int MMG2D_split1(MMG5_pMesh mesh, MMG5_pSol sol, int k, int vx[3]) { +MMG_int MMG2D_split1(MMG5_pMesh mesh, MMG5_pSol sol, MMG_int k, MMG_int vx[3]) { MMG5_pTria pt,pt1; MMG5_pPoint p0; - int iel; + MMG_int iel; uint8_t tau[3]; pt = &mesh->tria[k]; @@ -448,7 +448,7 @@ int MMG2D_split1(MMG5_pMesh mesh, MMG5_pSol sol, int k, int vx[3]) { * Simulate the split of two edges in triangle k * */ -int MMG2D_split2_sim(MMG5_pMesh mesh, MMG5_pSol sol, int k, int vx[3]) { +MMG_int MMG2D_split2_sim(MMG5_pMesh mesh, MMG5_pSol sol, MMG_int k, MMG_int vx[3]) { MMG5_pTria pt,pt0; double cal; uint8_t tau[3]; @@ -497,10 +497,10 @@ int MMG2D_split2_sim(MMG5_pMesh mesh, MMG5_pSol sol, int k, int vx[3]) { * Split 2 edges of triangle k * */ -int MMG2D_split2(MMG5_pMesh mesh, MMG5_pSol sol, int k, int vx[3]) { +MMG_int MMG2D_split2(MMG5_pMesh mesh, MMG5_pSol sol, MMG_int k, MMG_int vx[3]) { MMG5_pTria pt,pt1,pt2; MMG5_pPoint p1,p2; - int iel,jel; + MMG_int iel,jel; uint8_t tau[3]; pt = &mesh->tria[k]; @@ -584,7 +584,7 @@ int MMG2D_split2(MMG5_pMesh mesh, MMG5_pSol sol, int k, int vx[3]) { * Simulate the split of three edges in triangle k * */ -int MMG2D_split3_sim(MMG5_pMesh mesh, MMG5_pSol sol, int k, int vx[3]) { +MMG_int MMG2D_split3_sim(MMG5_pMesh mesh, MMG5_pSol sol, MMG_int k, MMG_int vx[3]) { MMG5_pTria pt,pt0; double cal; @@ -622,10 +622,10 @@ int MMG2D_split3_sim(MMG5_pMesh mesh, MMG5_pSol sol, int k, int vx[3]) { * Split the three edges of triangle k * */ -int MMG2D_split3(MMG5_pMesh mesh, MMG5_pSol sol, int k, int vx[3]) { +MMG_int MMG2D_split3(MMG5_pMesh mesh, MMG5_pSol sol, MMG_int k, MMG_int vx[3]) { MMG5_pTria pt,pt1,pt2,pt3; MMG5_pPoint p0,p1,p2; - int iel,jel,kel; + MMG_int iel,jel,kel; pt = &mesh->tria[k]; pt->flag = 0; @@ -713,11 +713,11 @@ int MMG2D_split3(MMG5_pMesh mesh, MMG5_pSol sol, int k, int vx[3]) { * Insert the point ip inside the tria k * */ -int MMG2D_splitbar(MMG5_pMesh mesh,int k,int ip) { +MMG_int MMG2D_splitbar(MMG5_pMesh mesh,MMG_int k,MMG_int ip) { MMG5_pTria pt,pt0,pt1,pt2; MMG5_pPoint p0,p1,p2,ppt; - int *adja,iel1,iel2,jel0,jel2; - int ip0,ip1,ip2; + MMG_int *adja,iel1,iel2,jel0,jel2; + MMG_int ip0,ip1,ip2; int8_t j2,j0; double cal,calseuil; @@ -779,10 +779,10 @@ int MMG2D_splitbar(MMG5_pMesh mesh,int k,int ip) { pt1 = &mesh->tria[iel1]; memcpy(pt1,pt,sizeof(MMG5_Tria)); - memcpy(&mesh->adja[3*(iel1-1)+1],&mesh->adja[3*(k-1)+1],3*sizeof(int)); + memcpy(&mesh->adja[3*(iel1-1)+1],&mesh->adja[3*(k-1)+1],3*sizeof(MMG_int)); pt2 = &mesh->tria[iel2]; memcpy(pt2,pt,sizeof(MMG5_Tria)); - memcpy(&mesh->adja[3*(iel2-1)+1],&mesh->adja[3*(k-1)+1],3*sizeof(int)); + memcpy(&mesh->adja[3*(iel2-1)+1],&mesh->adja[3*(k-1)+1],3*sizeof(MMG_int)); /* Update the three triangles */ pt->v[1] = ip; diff --git a/src/mmg2d/swapar_2d.c b/src/mmg2d/swapar_2d.c index 22b3d5ddf..4a6278bcd 100644 --- a/src/mmg2d/swapar_2d.c +++ b/src/mmg2d/swapar_2d.c @@ -36,10 +36,10 @@ /* Version of edge swapping specific to the boundary enforcement stage in Delaunay meshing; the quality of the resulting criterion should be > crit. list returns both modified triangles */ -int MMG2D_swapdelone(MMG5_pMesh mesh,MMG5_pSol sol,int k,int8_t i,double crit,int *list) { +MMG_int MMG2D_swapdelone(MMG5_pMesh mesh,MMG5_pSol sol,MMG_int k,int8_t i,double crit,MMG_int *list) { MMG5_pTria pt,pt1,pt0; double cal1,cal2,area1,area2,arean1,arean2; - int *adja,*adja1,k1,k2,k3,vo2,vo3,num1,numa1; + MMG_int *adja,*adja1,k1,k2,k3,vo2,vo3,num1,numa1; int8_t i1,i2,j,j1,j2; adja = &mesh->adja[3*(k-1)+1]; @@ -99,7 +99,7 @@ int MMG2D_swapdelone(MMG5_pMesh mesh,MMG5_pSol sol,int k,int8_t i,double crit,in /* Update edge references */ #ifndef NDEBUG - int num = pt->edg[i]; + MMG_int num = pt->edg[i]; assert ( !num ); #endif num1 = pt->edg[i1]; @@ -125,10 +125,10 @@ int MMG2D_swapdelone(MMG5_pMesh mesh,MMG5_pSol sol,int k,int8_t i,double crit,in } /* Check whether swap of edge i in triangle k is valid, and suitable for the mesh */ -int MMG2D_chkswp(MMG5_pMesh mesh, MMG5_pSol met,int k,int8_t i,int8_t typchk) { +MMG_int MMG2D_chkswp(MMG5_pMesh mesh, MMG5_pSol met,MMG_int k,int8_t i,int8_t typchk) { MMG5_pTria pt,pt0,pt1; double /*loni,lona,*/cal1,cal2,calnat,calchg; - int *adja,ip,ip1,ip2,iq,kk; + MMG_int *adja,ip,ip1,ip2,iq,kk; uint8_t i1,i2,ii,ii1,ii2; pt0 = &mesh->tria[0]; @@ -218,9 +218,9 @@ int MMG2D_chkswp(MMG5_pMesh mesh, MMG5_pSol met,int k,int8_t i,int8_t typchk) { } /* Effective swap of edge i in triangle k */ -int MMG2D_swapar(MMG5_pMesh mesh,int k,int8_t i) { +MMG_int MMG2D_swapar(MMG5_pMesh mesh,MMG_int k,int8_t i) { MMG5_pTria pt,pt1; - int *adja,adj,k11,k21; + MMG_int *adja,adj,k11,k21; int8_t i1,i2,j,jj,j2,v11,v21; pt = &mesh->tria[k]; diff --git a/src/mmg2d/tools_2d.c b/src/mmg2d/tools_2d.c index dfb0f67ca..9066bf590 100644 --- a/src/mmg2d/tools_2d.c +++ b/src/mmg2d/tools_2d.c @@ -42,9 +42,9 @@ * find the element index in packed numerotation * */ -int MMG2D_indElt(MMG5_pMesh mesh, int kel) { +MMG_int MMG2D_indElt(MMG5_pMesh mesh, MMG_int kel) { MMG5_pTria pt; - int ne, k; + MMG_int ne, k; ne = 0; for (k=1; k<=mesh->nt; k++) { @@ -66,9 +66,9 @@ int MMG2D_indElt(MMG5_pMesh mesh, int kel) { * find the point index in packed numerotation * */ -int MMG2D_indPt(MMG5_pMesh mesh, int kp) { +MMG_int MMG2D_indPt(MMG5_pMesh mesh, MMG_int kp) { MMG5_pPoint ppt; - int np, k; + MMG_int np, k; np = 0; for (k=1; k<=mesh->np; k++) { @@ -88,7 +88,7 @@ int MMG2D_indPt(MMG5_pMesh mesh, int kp) { * Keep only subdomain of index \a nsd and remove other subdomains. * */ -void MMG2D_keep_only1Subdomain ( MMG5_pMesh mesh,int nsd ) { +void MMG2D_keep_only1Subdomain ( MMG5_pMesh mesh,MMG_int nsd ) { if ( !nsd ) { return; diff --git a/src/mmg2d/variadic_2d.c b/src/mmg2d/variadic_2d.c index 51957173f..9ebd277fa 100644 --- a/src/mmg2d/variadic_2d.c +++ b/src/mmg2d/variadic_2d.c @@ -52,7 +52,7 @@ * */ static inline -int MMG2D_Alloc_mesh(MMG5_pMesh *mesh, MMG5_pSol *met, MMG5_pSol *ls, +MMG_int MMG2D_Alloc_mesh(MMG5_pMesh *mesh, MMG5_pSol *met, MMG5_pSol *ls, MMG5_pSol *disp) { /* mesh allocation */ @@ -172,18 +172,18 @@ void MMG2D_Init_woalloc_mesh(MMG5_pMesh *mesh, MMG5_pSol *met,MMG5_pSol *ls,MMG5 * Internal function for structure allocations (taking a va_list argument). * */ -int MMG2D_Init_mesh_var( va_list argptr ) { +MMG_int MMG2D_Init_mesh_var( va_list argptr ) { MMG5_pMesh *mesh; MMG5_pSol *sol,*disp,*ls; - int typArg; - int meshCount; + MMG_int typArg; + MMG_int meshCount; meshCount = 0; mesh = NULL; disp = sol = ls = NULL; - while ( (typArg = va_arg(argptr,int )) != MMG5_ARG_end ) + while ( (typArg = va_arg(argptr,MMG_int )) != MMG5_ARG_end ) { switch ( typArg ) { @@ -265,19 +265,19 @@ int MMG2D_Init_mesh_var( va_list argptr ) { * \remark we pass the structures by reference in order to have argument * compatibility between the library call from a Fortran code and a C code. */ -int MMG2D_Free_all_var(va_list argptr) +MMG_int MMG2D_Free_all_var(va_list argptr) { MMG5_pMesh *mesh; MMG5_pSol *sol,*disp,*ls,*sols; - int typArg; - int meshCount,metCount,lsCount,dispCount,fieldsCount; - int ier; + MMG_int typArg; + MMG_int meshCount,metCount,lsCount,dispCount,fieldsCount; + MMG_int ier; meshCount = metCount = lsCount = dispCount = fieldsCount = 0; disp = sol = sols = ls = NULL; - while ( (typArg = va_arg(argptr,int )) != MMG5_ARG_end ) + while ( (typArg = va_arg(argptr,MMG_int )) != MMG5_ARG_end ) { switch ( typArg ) { @@ -374,19 +374,19 @@ int MMG2D_Free_all_var(va_list argptr) * compatibility between the library call from a Fortran code and a C code. * */ -int MMG2D_Free_structures_var(va_list argptr) +MMG_int MMG2D_Free_structures_var(va_list argptr) { MMG5_pMesh *mesh; MMG5_pSol *sol,*disp,*ls,*sols; - int typArg,i; - int meshCount; + MMG_int typArg,i; + MMG_int meshCount; meshCount = 0; mesh = NULL; disp = sol = ls = sols = NULL; - while ( (typArg = va_arg(argptr,int )) != MMG5_ARG_end ) + while ( (typArg = va_arg(argptr,MMG_int )) != MMG5_ARG_end ) { switch ( typArg ) { @@ -489,18 +489,18 @@ int MMG2D_Free_structures_var(va_list argptr) * compatibility between the library call from a Fortran code and a C code. * */ -int MMG2D_Free_names_var(va_list argptr) +MMG_int MMG2D_Free_names_var(va_list argptr) { MMG5_pMesh *mesh; MMG5_pSol psl,*sol,*disp,*ls,*sols; - int typArg,i; - int meshCount; + MMG_int typArg,i; + MMG_int meshCount; meshCount = 0; disp = sol = ls = sols = NULL; - while ( (typArg = va_arg(argptr,int )) != MMG5_ARG_end ) + while ( (typArg = va_arg(argptr,MMG_int )) != MMG5_ARG_end ) { switch ( typArg ) { diff --git a/src/mmg2d/velextls_2d.c b/src/mmg2d/velextls_2d.c index 6d28691f8..be1b85434 100644 --- a/src/mmg2d/velextls_2d.c +++ b/src/mmg2d/velextls_2d.c @@ -45,12 +45,12 @@ invperm stores the permutation [ new pt nb -> old pt nb ] (for unpacking purposes) Return: npf = number of vertices in the packed mesh. */ -int* MMG2D_packLS(MMG5_pMesh mesh,MMG5_pSol disp,LSst *lsst,int *npfin) { +MMG_int* MMG2D_packLS(MMG5_pMesh mesh,MMG5_pSol disp,LSst *lsst,MMG_int *npfin) { MMG5_pTria pt,pt1; MMG5_pPoint p0; double u[2]; - int k,iel,jel,n,npf,nef,ip,nlay,refdirh,refdirnh,ilist,ilisto,ilistck; - int vper[3],*perm,*list,*adja,*invperm; + MMG_int k,iel,jel,n,npf,nef,ip,nlay,refdirh,refdirnh,ilist,ilisto,ilistck; + MMG_int vper[3],*perm,*list,*adja,*invperm; int8_t i,j,jedg; nlay = 20; @@ -60,11 +60,11 @@ int* MMG2D_packLS(MMG5_pMesh mesh,MMG5_pSol disp,LSst *lsst,int *npfin) { nef = 0; u[0] = u[1] = 0.0; ilist = ilisto = ilistck = 0; - MMG5_ADD_MEM(mesh,(mesh->nt+1)*sizeof(int),"element list",return NULL); - MMG5_SAFE_CALLOC(list,mesh->nt+1,int,return NULL); + MMG5_ADD_MEM(mesh,(mesh->nt+1)*sizeof(MMG_int),"element list",return NULL); + MMG5_SAFE_CALLOC(list,mesh->nt+1,MMG_int,return NULL); - MMG5_ADD_MEM(mesh,(mesh->np+1)*sizeof(int),"point permutation",return NULL); - MMG5_SAFE_CALLOC(perm,mesh->np+1,int,return NULL); + MMG5_ADD_MEM(mesh,(mesh->np+1)*sizeof(MMG_int),"point permutation",return NULL); + MMG5_SAFE_CALLOC(perm,mesh->np+1,MMG_int,return NULL); /* Reset flag field at triangles */ @@ -135,11 +135,11 @@ int* MMG2D_packLS(MMG5_pMesh mesh,MMG5_pSol disp,LSst *lsst,int *npfin) { } /* Creation of the inverse permutation table */ - MMG5_ADD_MEM ( mesh,(npf+1)*sizeof(int),"permutation table", + MMG5_ADD_MEM ( mesh,(npf+1)*sizeof(MMG_int),"permutation table", MMG5_DEL_MEM ( mesh,list ); MMG5_DEL_MEM ( mesh,perm ); return NULL ); - MMG5_SAFE_CALLOC ( invperm,(npf+1),int, + MMG5_SAFE_CALLOC ( invperm,(npf+1),MMG_int, MMG5_DEL_MEM ( mesh,list ); MMG5_DEL_MEM ( mesh,perm ); return NULL ); @@ -315,9 +315,9 @@ int* MMG2D_packLS(MMG5_pMesh mesh,MMG5_pSol disp,LSst *lsst,int *npfin) { } /** Transfer solution from the submesh to the global mesh */ -int MMG2D_unpackLS(MMG5_pMesh mesh,MMG5_pSol disp,LSst *lsst,int npf,int *invperm) { +MMG_int MMG2D_unpackLS(MMG5_pMesh mesh,MMG5_pSol disp,LSst *lsst,MMG_int npf,MMG_int *invperm) { double *u; - int k,ip; + MMG_int k,ip; int8_t i; u = LS_getSol(lsst); @@ -337,9 +337,9 @@ int MMG2D_unpackLS(MMG5_pMesh mesh,MMG5_pSol disp,LSst *lsst,int npf,int *invper } /** Extension of the displacement at the nodes of edges tagged MMG5_DISPREF */ -int MMG2D_velextLS(MMG5_pMesh mesh,MMG5_pSol disp) { +MMG_int MMG2D_velextLS(MMG5_pMesh mesh,MMG5_pSol disp) { LSst *lsst; - int npf,*invperm; + MMG_int npf,*invperm; /* Creation of the data structure for storing the submesh */ lsst = LS_init(mesh->dim,mesh->ver,P1,1); diff --git a/src/mmg2d/zaldy_2d.c b/src/mmg2d/zaldy_2d.c index 01d26323f..788491ff1 100644 --- a/src/mmg2d/zaldy_2d.c +++ b/src/mmg2d/zaldy_2d.c @@ -35,9 +35,9 @@ /* Create a new vertex in the mesh, and return its number */ -int MMG2D_newPt(MMG5_pMesh mesh,double c[2],int16_t tag) { +MMG_int MMG2D_newPt(MMG5_pMesh mesh,double c[2],int16_t tag) { MMG5_pPoint ppt; - int curpt; + MMG_int curpt; if ( !mesh->npnil ) return 0; @@ -54,7 +54,7 @@ int MMG2D_newPt(MMG5_pMesh mesh,double c[2],int16_t tag) { } /* Delete a point in the mesh and update the garbage collector accordingly */ -void MMG2D_delPt(MMG5_pMesh mesh,int ip) { +void MMG2D_delPt(MMG5_pMesh mesh,MMG_int ip) { MMG5_pPoint ppt; ppt = &mesh->point[ip]; @@ -67,7 +67,7 @@ void MMG2D_delPt(MMG5_pMesh mesh,int ip) { if ( ip == mesh->np ) mesh->np--; } -void MMG5_delEdge(MMG5_pMesh mesh,int iel) { +void MMG5_delEdge(MMG5_pMesh mesh,MMG_int iel) { MMG5_pEdge pt; pt = &mesh->edge[iel]; @@ -82,8 +82,8 @@ void MMG5_delEdge(MMG5_pMesh mesh,int iel) { } /* Create a new triangle in the mesh and return its address */ -int MMG2D_newElt(MMG5_pMesh mesh) { - int curiel; +MMG_int MMG2D_newElt(MMG5_pMesh mesh) { + MMG_int curiel; if ( !mesh->nenil ) { return 0; @@ -102,9 +102,9 @@ int MMG2D_newElt(MMG5_pMesh mesh) { } /* Delete a triangle in the mesh and update the garbage collector accordingly */ -int MMG2D_delElt(MMG5_pMesh mesh,int iel) { +MMG_int MMG2D_delElt(MMG5_pMesh mesh,MMG_int iel) { MMG5_pTria pt; - int iadr; + MMG_int iadr; pt = &mesh->tria[iel]; if ( !MG_EOK(pt) ) { @@ -116,7 +116,7 @@ int MMG2D_delElt(MMG5_pMesh mesh,int iel) { pt->qual = 0.0; iadr = (iel-1)*3 + 1; if ( mesh->adja ) - memset(&mesh->adja[iadr],0,3*sizeof(int)); + memset(&mesh->adja[iadr],0,3*sizeof(MMG_int)); mesh->nenil = iel; if ( iel == mesh->nt ) mesh->nt--; @@ -125,8 +125,8 @@ int MMG2D_delElt(MMG5_pMesh mesh,int iel) { /* check if n elets available */ -int MMG5_getnElt(MMG5_pMesh mesh,int n) { - int curiel; +MMG_int MMG5_getnElt(MMG5_pMesh mesh,MMG_int n) { + MMG_int curiel; if ( !mesh->nenil ) return 0; curiel = mesh->nenil; @@ -154,9 +154,9 @@ int MMG5_getnElt(MMG5_pMesh mesh,int n) { * */ static inline -int MMG2D_memOption_memSet(MMG5_pMesh mesh) { +MMG_int MMG2D_memOption_memSet(MMG5_pMesh mesh) { size_t usedMem,avMem,reservedMem,npadd; - int ctri,bytes; + MMG_int ctri,bytes; MMG5_memOption_memSet(mesh); @@ -165,7 +165,7 @@ int MMG2D_memOption_memSet(MMG5_pMesh mesh) { /* Compute the needed initial memory */ usedMem = reservedMem + (mesh->np+1)*sizeof(MMG5_Point) - + (mesh->nt+1)*sizeof(MMG5_Tria) + (3*mesh->nt+1)*sizeof(int) + + (mesh->nt+1)*sizeof(MMG5_Tria) + (3*mesh->nt+1)*sizeof(MMG_int) + (mesh->na+1)*sizeof(MMG5_Edge) + (mesh->np+1)*sizeof(double); if ( usedMem > mesh->memMax ) { @@ -181,7 +181,7 @@ int MMG2D_memOption_memSet(MMG5_pMesh mesh) { /* Euler-poincare: ne = 6*np; nt = 2*np; na = np/5 * * point+tria+edges+adjt+ aniso sol */ bytes = sizeof(MMG5_Point) + - 2*sizeof(MMG5_Tria) + 3*2*sizeof(int) + 2*sizeof(MMG5_Tria) + 3*2*sizeof(MMG_int) + 0.2*sizeof(MMG5_Edge) + 3*sizeof(double); avMem = mesh->memMax-usedMem; @@ -215,7 +215,7 @@ int MMG2D_memOption_memSet(MMG5_pMesh mesh) { * memory repartition for the -m option * */ -int MMG2D_memOption(MMG5_pMesh mesh) { +MMG_int MMG2D_memOption(MMG5_pMesh mesh) { mesh->memMax = MMG5_memSize(); @@ -234,8 +234,8 @@ int MMG2D_memOption(MMG5_pMesh mesh) { * Allocation of the array fields of the mesh. * */ -int MMG2D_setMeshSize_alloc( MMG5_pMesh mesh ) { - int k; +MMG_int MMG2D_setMeshSize_alloc( MMG5_pMesh mesh ) { + MMG_int k; MMG5_ADD_MEM(mesh,(mesh->npmax+1)*sizeof(MMG5_Point),"initial vertices", printf(" Exit program.\n"); @@ -285,7 +285,7 @@ int MMG2D_setMeshSize_alloc( MMG5_pMesh mesh ) { * allocate main structure * */ -int MMG2D_zaldy(MMG5_pMesh mesh) { +MMG_int MMG2D_zaldy(MMG5_pMesh mesh) { if ( !MMG2D_memOption(mesh) ) return 0; From 97f2524e8abad0ea90105311ebda9089023851fd Mon Sep 17 00:00:00 2001 From: Algiane Date: Sun, 28 Nov 2021 10:05:41 +0100 Subject: [PATCH 038/838] Update README.md and CONTRIBUTING.md files to make it compatible with markdown interpretation of Doxygen. --- CONTRIBUTING.md | 34 ++++++++++++++++++---------------- README.md | 44 +++++++++++++++++++++++--------------------- 2 files changed, 41 insertions(+), 37 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 32602d3a3..9a93aafc1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,7 +23,7 @@ Additionaly, it is a good practice to include text inside the routine to explain You can refer to the [Doxygen documentation](http://www.stack.nl/~dimitri/doxygen/) for a description of the **Doxygen** commands. #### API's functions -Because the library header for Fortran users is automatically generated from the C header, you must add to your documentation the interface of the fortran function. Each line of this interface must begin with the **>** symbol and end with the **\n** one. +Because the library header for Fortran users is automatically generated from the C header, you must add to your documentation the interface of the fortran function. Each line of this interface must begin with the `>` symbol and end with the `\n` one. For example, if the previous function is an API function, its documentation becames the following: ```c @@ -50,43 +50,45 @@ For example, if the previous function is an API function, its documentation beca ``` ### 2) Where -Please, comments only your functions in the **.c** file, except for the **API**'s functions that must be documentated in the suitable **_libmmg*.h_** file (and only here). +Please, comments only your functions in the `.c` file, except for the **API**'s functions that must be documentated in the suitable `libmmg.h` file (and only here). ## II/ Memory management: dynamic allocations and deallocations We need to control the memory consumption in our applications so the memory used by dynamic allocations is counted and updated at each allocation and deallocation. Note that with a high verbosity (at least 6), you can check that at the end of the process the memory count is 0. -To make the update of memory consumption easier, we have wrapped the **malloc**, **calloc**, **realloc** and **free** functions into macros that must be called in place of the matching function. +To make the update of memory consumption easier, we have wrapped the `malloc`, `calloc`, `realloc` and `free` functions into macros that must be called in place of the matching function. -| **_C function_** | **_Mmg macro_** | +| `C function` | `Mmg macro` | |----------------------|-----------------------------------| -| ``ptr = (type *) malloc(size*sizeof(type));`` | ``_MMG5_SAFE_MALLOC(ptr,size,type);`` | -| ``ptr = (type *) calloc(size,sizeof(type));`` | ``_MMG5_SAFE_CALLOC(ptr,size,type);`` | -| ``ptr = (type *) realloc(ptr,size*sizeof(type));``
``if ( high_verbosity )``
    ``printf(" ## Warning:%s:%d: %s reallocation.\n",__FILE__,__LINE__,tab_info);``| ``_MMG5_SAFE_REALLOC(ptr,size,type,tab_info);`` | -| ``Decrease_memory_count(size); ``
``free(ptr); ptr = NULL; ``| ``_MMG5_DEL_MEM(mesh,ptr,size)``| +| `ptr = (type *) malloc(size*sizeof(type));` | `MMG5_SAFE_MALLOC(ptr,size,type,law);` | +| `ptr = (type *) calloc(size,sizeof(type));` | `MMG5_SAFE_CALLOC(ptr,size,type,law);` | +| `ptr = (type *) realloc(ptr,size*sizeof(type));`
`if ( high_verbosity )`
    `printf(" ## Warning:%s:%d: %s reallocation.\n",__FILE__,__LINE__,tab_info);`| `MMG5_SAFE_REALLOC(ptr,prevSize,newSize,type,tab_name,law);` | +| `Decrease_memory_count(size); `
`free(ptr); ptr = NULL; `| `MMG5_DEL_MEM(mesh,ptr)`| + +Note that other macros which aims to help to manage the memory have been implemented. ### 1) Allocations -To check that we have enough memory to allocate a pointer of size **_siz_** and to increment the memory counter, you must precede your allocation by a call to the **_MMG5_ADD_MEM(mesh, siz, tab_info, law)** macro. +To check that we have enough memory to allocate a pointer of size `siz` and to increment the memory counter, you must precede your allocation by a call to the `MMG5_ADD_MEM(mesh, siz, "tab_name", law)` macro. For example, the following allocation: ```c Increase_memory_count(5*sizeof(double)); ptr = (double *) malloc (5*sizeof(double)); if ( !ptr ) { - fprintf(stdout," ## Error: unable to allocate ""table of double""."); + fprintf(stdout," ## Error: unable to allocate my array."); exit(EXIT_FAILURE); } ``` must be replaced by the following one in the **Mmg** code: -```c -_MMG5_ADD_MEM(mesh,5*sizeof(double),"table of double",exit(EXIT_FAILURE)); -_MMG5_SAFE_MALLOC(ptr,5,double); +```c +MMG5_ADD_MEM(mesh,5*sizeof(double),"my array",exit(EXIT_FAILURE)); +MMG5_SAFE_MALLOC(ptr,5,double,exit(EXIT_FAILURE)); ``` ### 2) Deallocations -To decrement the memory counter, to deallocate your pointer and to leave it pointing toward ``NULL``, you just need to call the ``MMG5_DEL_MEM(mesh,ptr,siz)`` macro. +To decrement the memory counter, to deallocate your pointer and to leave it pointing toward `NULL`, you just need to call the `MMG5_DEL_MEM(mesh,ptr)` macro. To deallocate the memory allocated in the previous example, instead of the following code: ```c @@ -96,7 +98,7 @@ ptr = NULL; ``` just write: ```c -MMG5_DEL_MEM(mesh,ptr,5*sizeof(double)); +MMG5_DEL_MEM(mesh,ptr); ``` ## III/ Coding style @@ -110,4 +112,4 @@ Besides, try to respect the following rules: * declaration of variables in the top of the function; * do not use exit(), use a return value instead; * do not implement void API function; - * the main library functions returns MMG*_SUCCESS if success, MMG*_LOWFAILURE if fails but we can save the mesh, MMG*_STRONGFAILURE if fails and we can't save a conform mesh; + * the main library functions returns `MMG_SUCCESS` if success, `MMG_LOWFAILURE` if fails but we can save the mesh, `MMG_STRONGFAILURE` if fails and we can't save a conform mesh; diff --git a/README.md b/README.md index 6e2b7f74b..03b1e0fa5 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ To get and build Mmg, you will need: once CMake is installed, please do not forget to mark the option: ``` - "Add CMake to the system PATH for all users" + Add CMake to the system PATH for all users ``` @@ -91,22 +91,22 @@ To get and build Mmg, you will need: #### Unix-like OS (Linux, MacOS...) 1. Get the repository: - ```Shell +``` wget https://github.com/MmgTools/mmg/archive/master.zip ``` or - ```Shell +``` git clone https://github.com/MmgTools/mmg.git ``` - The project sources are available under the **_src/_** directory, see: - * **_src/mmg2d/_** for files related to the mmg2d application; - * **_src/mmgs/_** for files related to the mmgs application; - * **_src/mmg3d/_** for files related to the mmg3d application; - * **_src/common/_** for files related to the both. + The project sources are available under the **src/** directory, see: + * **src/mmg2d/** for files related to the mmg2d application; + * **src/mmgs/** for files related to the mmgs application; + * **src/mmg3d/** for files related to the mmg3d application; + * **src/common/** for files related to the both. 2. Fast compilation (build both **mmg2d**, **mmgs**, **mmg3d**, the mmg2d static library (**libmmg3d.a**), the mmgs static library (**libmmgs.a**), the mmg3d static library (**libmmg3d.a**) and the mmg static library (**libmmg.a**)): -```Shell +``` cd mmg mkdir build cd build @@ -132,15 +132,15 @@ commands in cmd, create directories, etc...). Universal windows platform development 1. Get the **Visual Studio** software: it can be downloaded [here](https://www.visualstudio.com/downloads/); - 2. if not done during the previous step, download **C/C++** compilers: in the Visual Studio searching zone, search **C compiler** and install the **"Visual C++ compilers and libraries"** (individual componant) and the MSBuild componant; + 2. if not done during the previous step, download **C/C++** compilers: in the Visual Studio searching zone, search **C compiler** and install the **Visual C++ compilers and libraries** (individual componant) and the MSBuild componant; - 3. in the Visual Studio searching zone, search the **git** word and select the installation of the **"GitHub extension for VisualStudio"**; + 3. in the Visual Studio searching zone, search the **git** word and select the installation of the **GitHub extension for VisualStudio**; 4. stay in VisualStudio and clone the Mmg repository from the following url: https://github.com/MmgTools/mmg.git; 5. Use **CMake** to configure and generate your project. It can be done either with the graphic mode of CMake (you have to select the "VisualStudio" generator) or with a command line. In this case, it is highly recommended to specify that you intent to build a VisualStudio project. For example, if you are using VisualStudio 2017: - ```Shell + ``` cmake -G "Visual Studio 15 2017 Win64" ^ configure ``` @@ -158,14 +158,14 @@ Universal windows platform development 1. Get a **C Compiler**: * **MinGW** can be downloaded [here](http://mingw.org/). We recommand to install the *mingw-developer-tools*, *mingw32-base*, *mingw32-gcc-fortran*, *mingw32-gcc-g++* and *msys-base* packages; * Edit the environment variables and add MinGW in your **PATH** variable. It can be done in the **advanced system settings** panel. (note that you must modify the **PATH** variable, not the **Path** one); - * **MinGW** binaries are probably in **C:\MinGW\bin** - * the MinGW terminal is in **C:\MinGW\msys\1.0\msys** + * **MinGW** binaries are probably in `C:\MinGW\bin` + * the MinGW terminal is in `C:\MinGW\msys\1.0\msys` 2. Clone the Mmg repository from the following url: https://github.com/MmgTools/mmg.git; 3. Quit and restart the *CMake* application to take the PATH modification into account then use CMake to configure and generate your project (select the MinGW Makefiles generator of CMake). If you have installed the scotch libraries, you will need to set explicitely the libraries paths; - 4. Build the Mmg applications: in the minGW prompt (**C:\MinGW\msys\1.0\msys**) run: -```Shell + 4. Build the Mmg applications: in the minGW prompt (`C:\MinGW\msys\1.0\msys`) run: +``` mingw32-make ``` @@ -175,23 +175,23 @@ Again, if you use some specific options and want to make the CMake configuration ### Project's web page Project's actualities and software tutorials can be found on the [mmgtools](http://www.mmgtools.org) web page. -### **Mmg**'s forum +### Mmg's forum Share your comments and issues with other members of the Mmg community on the [Mmg forum](https://forum.mmgtools.org/). ### GitHub's Wiki More detailed informations about the compilation and configuration of the mmg's applications are available on the project [wiki](https://github.com/MmgTools/mmg/wiki). ### Man-pages -Man pages are available inside the **_doc/man_** directory: +Man pages are available inside the **doc/man** directory: * To see the **mmg2d** man page, just tap `man ./doc/man/mmg2d.1.gz` * To see the **mmgs** man page, just tap `man ./doc/man/mmgs.1.gz` * To see the **mmg3d** man page, just tap `man ./doc/man/mmg3d.1.gz` ### Code documentation Run the `make doc` command to build the Doxygen documentation. - * To see the **mmg2d** documentation, open up the **_mmg/doc/mmg2d/html/index.html_** file; - * To see the **mmgs** documentation, open up the **_mmg/doc/mmgs/html/index.html_** file; - * To see the **mmg3d** documentation, open up the **_mmg/doc/mmg3d/html/index.html_** file. + * To see the **mmg2d** documentation, open up the **mmg/doc/mmg2d/html/index.html** file; + * To see the **mmgs** documentation, open up the **mmg/doc/mmgs/html/index.html** file; + * To see the **mmg3d** documentation, open up the **mmg/doc/mmg3d/html/index.html** file. ## Platforms The **mmg** applications are validated on OS X and on most of the Linux platforms. @@ -214,4 +214,6 @@ Code is under the [terms of the GNU Lesser General Public License](https://raw.g Copyright © Bx INP/Inria/UBordeaux/UPMC, 2004- . ## Reference +[Tetrahedral remeshing in the context of large-scale numerical simulation and high performance computing - _G. Balarac, F. Basile, P. Bénard, F. Bordeu, J.-B. Chapelier, L. Cirrottola, G. Caumon, C. Dapogny, P. Frey, A. Froehly, G. Ghigliotti, R. Laraufie, G. Lartigue, C. Legentil, R. Mercier, V. Moureau, C. Nardoni, S. Pertant and M. Zakari_ - submitted, (2021)](https://membres-ljk.imag.fr/Charles.Dapogny/publis/mmgapp2.pdf) + [Three-dimensional adaptive domain remeshing, implicit domain meshing, and applications to free and moving boundary problems - _C. Dapogny, C. Dobrzynski and P. Frey_ - April 1, 2014 - _JCP_](http://www.sciencedirect.com/science/article/pii/S0021999114000266) From d4bc572c04bb49aa73ba2530d2e608c660be1230 Mon Sep 17 00:00:00 2001 From: Algiane Date: Sun, 28 Nov 2021 10:48:32 +0100 Subject: [PATCH 039/838] Build only one Doxygen doc for the overall project (instead of one per each code). --- CMakeLists.txt | 58 +- doc/doxygen/BUILD_DOXYGEN_DOC.md | 18 + doc/doxygen/{mmg3d => }/Doxyfile.in | 63 +- doc/doxygen/README | 9 - doc/doxygen/logo-Mmg.png | Bin 0 -> 17604 bytes doc/doxygen/mmg2d/Doxyfile.in | 2270 --------------------------- doc/doxygen/mmgs/Doxyfile.in | 2270 --------------------------- 7 files changed, 47 insertions(+), 4641 deletions(-) create mode 100644 doc/doxygen/BUILD_DOXYGEN_DOC.md rename doc/doxygen/{mmg3d => }/Doxyfile.in (98%) delete mode 100644 doc/doxygen/README create mode 100644 doc/doxygen/logo-Mmg.png delete mode 100644 doc/doxygen/mmg2d/Doxyfile.in delete mode 100644 doc/doxygen/mmgs/Doxyfile.in diff --git a/CMakeLists.txt b/CMakeLists.txt index ee6c3df6a..a2e2d7530 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -615,58 +615,22 @@ ENDIF () FIND_PACKAGE(Doxygen) IF(DOXYGEN_FOUND) - # MMG2D Documentation - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen/mmg2d/Doxyfile.in - ${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen/mmg2d/Doxyfile @ONLY) + # MMG Documentation + SET( MMG_DOC_DIR ${PROJECT_BINARY_DIR}/doc/ CACHE PATH "Path toward generated Doxygen doc.") + mark_as_advanced(MMG_DOC_DIR) - SET(MMG2DDOC_DIR ${PROJECT_BINARY_DIR}/doc/mmg2d) - SET(MMGSDOC_DIR ${PROJECT_BINARY_DIR}/doc/mmgs) - SET(MMG3DDOC_DIR ${PROJECT_BINARY_DIR}/doc/mmg3d) + FILE(MAKE_DIRECTORY ${MMG_DOC_DIR}) - FILE(MAKE_DIRECTORY ${MMG2DDOC_DIR}) - FILE(MAKE_DIRECTORY ${MMGSDOC_DIR}) - FILE(MAKE_DIRECTORY ${MMG3DDOC_DIR}) - - ADD_CUSTOM_TARGET(mmg2d_doc - COMMAND ${DOXYGEN_EXECUTABLE} - ${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen/mmg2d/Doxyfile - WORKING_DIRECTORY ${MMG2DDOC_DIR} - COMMENT "Generating MMG2D API - documentation with Doxygen. Open up the - ${MMG2DDOC_DIR}/html/index.html file to see - it." VERBATIM ) - - # MMGS Documentation - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen/mmgs/Doxyfile.in - ${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen/mmgs/Doxyfile @ONLY) - ADD_CUSTOM_TARGET(mmgs_doc - COMMAND ${DOXYGEN_EXECUTABLE} - ${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen/mmgs/Doxyfile - WORKING_DIRECTORY ${MMGSDOC_DIR} - COMMENT "Generating MMGS API - documentation with Doxygen. Open up the - ${MMGSDOC_DIR}/html/index.html file to see - it." VERBATIM ) - - # MMG3D Documentation - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen/mmg3d/Doxyfile.in - ${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen/mmg3d/Doxyfile @ONLY) - ADD_CUSTOM_TARGET(mmg3d_doc + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen/Doxyfile.in + ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) + ADD_CUSTOM_TARGET(doc COMMAND ${DOXYGEN_EXECUTABLE} - ${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen/mmg3d/Doxyfile - WORKING_DIRECTORY ${MMG3DDOC_DIR} - COMMENT "Generating MMG3D API documentation with Doxygen. Open up the - ${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen/mmg3d/html/index.html file to see + ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile + WORKING_DIRECTORY ${MMG_DOC_DIR} + COMMENT "Generating Mmg documentation with Doxygen. Open up the + ${MMG_DOC_DIR}/index.html file to see it" VERBATIM ) - if ( NOT TARGET doc ) - ADD_CUSTOM_TARGET(doc DEPENDS mmgs_doc mmg3d_doc mmg2d_doc COMMENT "Generating - MMG API documentation with Doxygen. Open up the - ${PROJECT_BINARY_DIR}/doc/mmg*/html/index.html file to see it" - VERBATIM ) - else() - add_dependencies( doc mmgs_doc mmg3d_doc mmg2d_doc ) - endif() ENDIF ( DOXYGEN_FOUND ) ############################################################################### diff --git a/doc/doxygen/BUILD_DOXYGEN_DOC.md b/doc/doxygen/BUILD_DOXYGEN_DOC.md new file mode 100644 index 000000000..f05fa5a2c --- /dev/null +++ b/doc/doxygen/BUILD_DOXYGEN_DOC.md @@ -0,0 +1,18 @@ +# Mmg doxygen documentation + +## Online documentation +The Doxygen documentation of the last release of Mmg is available on : https://mmgtools.github.io/ + +## Build locally your own html documentation +You can build the Mmg documentation using the `make doc` command generated by CMake. + +For CMake begginers you can follow the next steps: +``` + cd mmg + mkdir build + cd build + cmake .. + make doc +``` + +By default the Doxygen output is builded by the under the `doc` sub directory of the build directory (so in `build/doc` in the previous example). You can configure the `MMG_DOC_DIR` CMake variable to change the Doxygen output directory. diff --git a/doc/doxygen/mmg3d/Doxyfile.in b/doc/doxygen/Doxyfile.in similarity index 98% rename from doc/doxygen/mmg3d/Doxyfile.in rename to doc/doxygen/Doxyfile.in index 38f129cfd..8ee7454af 100644 --- a/doc/doxygen/mmg3d/Doxyfile.in +++ b/doc/doxygen/Doxyfile.in @@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = mmg3d +PROJECT_NAME = Mmg # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version @@ -44,14 +44,14 @@ PROJECT_NUMBER = # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = +PROJECT_BRIEF = "Simplicial remeshers (mesh adaptation, isovalue discretization, lagrangian movement)" # With the PROJECT_LOGO tag one can specify an logo or icon that is included in # the documentation. The maximum height of the logo should not exceed 55 pixels # and the maximum width should not exceed 200 pixels. Doxygen will copy the logo # to the output directory. -PROJECT_LOGO = +PROJECT_LOGO = @CMAKE_CURRENT_SOURCE_DIR@/doc/doxygen/logo-Mmg.png # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is @@ -130,7 +130,7 @@ INLINE_INHERITED_MEMB = NO # shortest path that makes the file name unique will be used # The default value is: YES. -FULL_PATH_NAMES = NO +FULL_PATH_NAMES = YES # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. # Stripping is only done if one of the specified strings matches the left-hand @@ -142,7 +142,7 @@ FULL_PATH_NAMES = NO # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = +STRIP_FROM_PATH = @CMAKE_CURRENT_SOURCE_DIR@ # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -268,8 +268,7 @@ OPTIMIZE_OUTPUT_VHDL = NO # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. -EXTENSION_MAPPING = c=C \ - h=C +EXTENSION_MAPPING = c=C h=C F90=Fortran cpp=C++ hpp=C++ # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable @@ -734,7 +733,7 @@ WARN_LOGFILE = # spaces. # Note: If this tag is empty the current directory is searched. -INPUT = @CMAKE_CURRENT_SOURCE_DIR@/src/common @CMAKE_CURRENT_SOURCE_DIR@/src/mmg3d +INPUT = @CMAKE_CURRENT_SOURCE_DIR@/README.md @CMAKE_CURRENT_SOURCE_DIR@/CONTRIBUTING.md @CMAKE_CURRENT_SOURCE_DIR@/src @CMAKE_CURRENT_SOURCE_DIR@/libexamples @CMAKE_CURRENT_SOURCE_DIR@/doc # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -754,8 +753,7 @@ INPUT_ENCODING = UTF-8 # *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, # *.qsf, *.as and *.js. -FILE_PATTERNS = *.h \ - *.c +FILE_PATTERNS = *.h *.hpp *.c *.cpp *.F90 *md # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. @@ -770,7 +768,7 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = +EXCLUDE = @CMAKE_CURRENT_SOURCE_DIR@/build @CMAKE_CURRENT_SOURCE_DIR@/cmake @CMAKE_CURRENT_SOURCE_DIR@/scripts # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -803,14 +801,14 @@ EXCLUDE_SYMBOLS = # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = +EXAMPLE_PATH = @CMAKE_CURRENT_SOURCE_DIR@/libexamples/ # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and # *.h) to filter out the source-files in the directories. If left blank all # files are included. -EXAMPLE_PATTERNS =*.c +EXAMPLE_PATTERNS =*.c *.cpp *.F90 # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude commands @@ -871,7 +869,7 @@ FILTER_SOURCE_PATTERNS = # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. -USE_MDFILE_AS_MAINPAGE = +USE_MDFILE_AS_MAINPAGE = README.md #--------------------------------------------------------------------------- # Configuration options related to source browsing @@ -884,7 +882,7 @@ USE_MDFILE_AS_MAINPAGE = # also VERBATIM_HEADERS is set to NO. # The default value is: NO. -SOURCE_BROWSER = NO +SOURCE_BROWSER = YES # Setting the INLINE_SOURCES tag to YES will include the body of functions, # classes and enums directly into the documentation. @@ -1000,7 +998,7 @@ GENERATE_HTML = YES # The default directory is: html. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_OUTPUT = html +HTML_OUTPUT = . # The HTML_FILE_EXTENSION tag can be used to specify the file extension for each # generated HTML page (for example: .htm, .php, .asp). @@ -1039,18 +1037,6 @@ HTML_HEADER = HTML_FOOTER = -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style -# sheet that is used by each HTML page. It can be used to fine-tune the look of -# the HTML output. If left blank doxygen will generate a default style sheet. -# See also section "Doxygen usage" for information on how to generate the style -# sheet that doxygen normally uses. -# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as -# it is more robust and this tag (HTML_STYLESHEET) will in the future become -# obsolete. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_STYLESHEET = - # The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- # defined cascading style sheet that is included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. @@ -1344,7 +1330,9 @@ DISABLE_INDEX = NO # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -GENERATE_TREEVIEW = YES +GENERATE_TREEVIEW = NO + +FULL_SIDEBAR = YES # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. @@ -1915,7 +1903,7 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = USE_SUSCELAS +PREDEFINED = USE_ELAS USE_SCOTCH USE_VTK ENABLE_TESTING # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The @@ -1981,12 +1969,6 @@ EXTERNAL_GROUPS = YES EXTERNAL_PAGES = YES -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of 'which perl'). -# The default file (with absolute path) is: /usr/bin/perl. - -PERL_PATH = /usr/bin/perl - #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- @@ -2000,15 +1982,6 @@ PERL_PATH = /usr/bin/perl CLASS_DIAGRAMS = NO -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see: -# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - # If set to YES, the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. # The default value is: YES. diff --git a/doc/doxygen/README b/doc/doxygen/README deleted file mode 100644 index e68bfa78a..000000000 --- a/doc/doxygen/README +++ /dev/null @@ -1,9 +0,0 @@ -MMGS doxygen documentation is in the mmgs directory and MMG3D doxygen documentation in the mmg3d directory. - -To see documentation in html : open [mmgs|mmg3d]/html/index.html - -To see it in pdf (not build for now, uncomment associated lines in CMakeLists.txt to build it): - $cd [mmgs|mmg3d] - $cd latex - $make pdf -open latex/refman.pdf diff --git a/doc/doxygen/logo-Mmg.png b/doc/doxygen/logo-Mmg.png new file mode 100644 index 0000000000000000000000000000000000000000..6e96bcf6795bc52d61948c2cb978424bd994f0ca GIT binary patch literal 17604 zcmV)cK&ZcoP)004R>004l5008;`004mK004C`008P>0026e000+ooVrmw00006 zVoOIv0RI600RN!9r;`8x010qNS#tmY6A}Ob6A}TG*Qp`2S^AZ2}ve| zOp^J9OlFc_7Lwm&5+;-6$s{vLW+0FRvJfzf*>|u3177eh%a$xl*4o`tOTFH;s?K?T zf7I;*bwGRmr+B~v7Pt)f1K>-j`CBBog?L55 zkKKnho*>)xPv7scFB#5Dkn=bdW|XKLGV`{jSE*ZpYy7-sQ?J+Y2fsuz@n4Z>=k%IB z+%tcVx%)3r>*tPUfJ04WIGJ~><4!2Rh9Z=0es-_OeN(U|M*i@*@A(ZlPmuFC84UBu z0pL=H_*AoLPcn(7Q-Z5oeAWy4Q;1my{8Gn5_dY34eiF4h|5!z=>A=b|psjUmPm2aK z@5P8yr3Op@)6GBImlj^p4HFsqjy0{_4f0oezb7~0JVDOmM7Rvpd4gC05rOHcDc%3x z|L!g-`Irp@ff?)*>FI)E0gM5!05^iXAN7BLOFTAQ3##Edx~Z%pM!diT!hz^#Ry@t2qRs-HP)BIgb+{4}Ao@ z+snomPH6vy%K)m4ME>-%_uF5a9Fi>sBWY(FvZ5EWZYB2St1;JHoO`q2TH059h-K@9 z$pdYO09yA~xoy>#o8C}?z2NQvJ`X&I z2@a*xO}0Hb#``XZ3!{Kr9?F*dUYs}5&*KEh?gx;a_dY9++%?RRy%}N_N z&D6{2IR5cx$Ub=w$zS|4{^{MhBtfCn-L99sroghbO;Bih#}h}J9H;~+ir3_XlVSOTb5gFQe`+B`~*VO4lWEhywRq8*ulvA@^Kw&){lL zjq?OKj}u`7D0UoTa`+kZ$j6OLA5IlPRJpgN_OBYTZy2j$4Fnb)8YTVPkE4gjz(_7h zN<9HvUT3wmrpgmXQVv!lKtKhr!7jLh%Hsqcg&h1v5SFwJ;v3m8Y+4ris^JoA5=TGMb zpjL!ZJw?nzjO}|pkKC2{HLuK6B@l&=Ok>yC*!^7Cu&4^g;Gft@`hiaq{pwFZAx1=e zbSxp69VF9CiH<(t4KfUo0p7%Qy2{gvolKaa1~5fn@j>ADJRiCHI|@t_{s*X9P- zJe()U4=@G>`cYLzM@Lz`W{vdtn%@74VK`9Ce_I5W)uATH$NagTZVsj9%)5sW(_mzK z!A_*9^-TpxyvqNc60>$$h-Ggi74&$*LX^MZMw$urPH1o!mcnA4JX*rQ{n^f08uIe6f9=`QPhCRuPY;QAiW$q){K-_HtGc|qnAAD}$ugREeks|%d&k}b z+qMq)B<&Vsm`*j^J?)#DI<2vSRi{B~#%s2>k-Ec41YnkhN+@LaPpVG4AUE(uXM-jJ zelkmvC#y!AK0u)0#I~m+Mikb#@9XT>y0{~iYTs@N&P^b zuscJw3Q_|qKozI~M}aQ^BZwlL#}5oTiiX=Zm-)n_(*pGLcLbZSSY5d3KqYubt!@V1 zyV-r|Wy_NN>dDBTiYd&#pZPmkU`v5CJ%=1|f3N$X;)Io@{gYujzIu54oIEY|5Q z7yVe4HXfWZ+VBCY1TXAt+O-93-ZdJMsYSu|M_J+e4vR&!?z85@)6N}9jv{G7xXPus>>_OyI6h9MNm1)7vN$5Ykey z7KPbBoGCCNA$w5n1HKMC3~~^!POVZ|S0wjWK`v%|6L^RgL5dOfw{I1{drXrD_YqkG z_g2-uCkm6F?M`(xazQE@$iluKbD-kFvL#vG?n6z~CEKg2ja(97M5S!A?18C(MD6S$ zg#0m{sY{-&X2+8Qpe+^C+0$3=xb=o$`HeT2(yD<-j1l#o`Q$JrKbR&*4D|yIDXop+ z1R){7?ZAhDcb%6Y&ofr9UWJIktEW+K5Tuj5?WQjN+vkpiz>16dqsuN^72mjJRs6y& zE8|Nxt%&8}wRbt(5QdzD|IyFSjz*TQCVIP^VlBpvCE@*8(0UQRN0KNfy6WHcP+?d@I zJV8Z=QPu+B;p#!c-?>$iKl-xwKi1vwFKACg6h!d`oKZ0bFiK_>F)B7t5-X?$nw6|t zjKVnFTml6FNu5teM`{up%_5LM#TZ2de73)lHFnj5rq!$(sIP=dHBf0ctGEfoFhkNlET6zOnf0QkLuI zKWNho_xKl+YX8xs7>i_9F-Eb0N@f&m6l;-83@Wi=N@UW8A=ZFUM3%Q_w8e4DcP-UQ znmoGoC_eKx^x|WW7E;mPzIeKhn$huQxnb327NaexGk@@^O0lmu)z`c}`S#vQ@aPkJ zcxKm#J$z)!G#aT&tN{fqMwWQkD_ z2t=6l@ZP?N|9GUn`L&Y%N*V+M;Xv%d%$HX!3zBkdRFxQ2A^*WoDhX7fzcZlH9ncs~ ziLHQQIVwh*B+{>r!lG3!33{+@n#?y_v4|7V4qO9VqgDOo=GU6d_?9@84hd(RuHg~y zt{wL!O>BS=&XPy4SUg2C%BqwRVzpQzq-Ef!qEmG*#n2;SLCG>NUe$WRG_Bf(fwWuF z)z^omwyrks_ca;aIjz}5BIt?9z#>BP$dT~LcmJb%_nz2JI|+;k#t7CL9I!6*ex+5b zVxXCtHyXJxsHP z^J(3Q>hW$S(|J)V6^sVgyJx1IEXxoJs6tgRrN2#ef z`O>rX(%|w)JBnsTf}C=4ixEa^P8!>549*cG|Axa-5kX0$fM8B*mx#oO*2%OC)Wg&-pgg7Jw)b8I3BMPTs4I9YR1A(A-4UK817^(o-D5oy5rRFkttBv4hQ+X!Q-rJbpN)h~7gcl>;NSbRZj#(+qb7|2r9APq%J zp-E8!z+K!EHVRhE=e{-3cH0X&*}O7x>Q5m>6jpQve5Wg*aX2Ni3+^UNNvw$^(yvY0 zH9FPtY?;t@kz_})iwYU5N28U>|NGZPF;d{@kY{91rU!Rr4DW`+2MiO34fTqUrFqcd zRL51dI^D>m7`ZglKvh{j7$xgA7eYDSJC|jlG#X7Ul`M)ViVcnJ+t_Zq*OcAla6KE@ zF_n$&uLfzu+rij}Kfb)#{M(^|t9!Alth&`k?R22YzOpx|U}s$D^TxOx_&s0}z+UjP z=LvGA2!N6is;zXQn(9?AE!rRdskUI%kGI+BHX}8k6T=EP0ay1Zk@$j@j2Wd!aqGK+ zd;#sV@ARD9{!g!hwjfk(2>@67RhLO(H!gne@=4M?=g>q={gH zUW}V2)%2tW`!O(AU98gE6Cs6w-c_*qdPKdFrAocxnLO&*{b-_}{EL+8RFTvRnKyVZ zc+J(W`Po(VG@y~DN$TnB3DS+16^#wWE^u)|y>5x3j3AgDt9r#)vE8f7wrge4PmeaU zksVXn(LEJ=y-&kuyG-(#qp{f>sK%kscDFfcSPf^ByhKzGL+-izePEjk*lh0iK95Dh zlIL|SGce^@eqm_d@S2jn`rmhimCcbkpsIxyIUITETP9$uirPqAWJt-?s0^?uZlKMk zKfWri-}UfxshO(2U}I7BBq=~fgyn-V2Oq7l5;=7+-4WkVyhKf$S?s)!NOxuOttEHC)#rJdQ~XQthcKT~CQ zJ!@VRcsJDMf=Zy#>_yJhO9~$N8=)WY|N63h&O$hk82RLHkp#%5REcBb#E{{06>D~1#da4>_U6@b^RBHG(@0cr z-dsA#L{$a{Vs=D^>lT-4VvbR{+7?u~Bv?k^rbvC2=%f_!imd2ya=}`2N}HuRn(_2q zmWg_dT1QV1Ap+JwA;@(jP*R^_8q>7-vQ{-4n2@w!Oc9UA=ANttiPCI_6bdO}7%zB- za_MB+dg7>jL!>J&=}hCzGBx$x5j!4e`Gku%#-jQKvF3lM^A2*=YVHP}$4PN$WEAH- z)|y^1a&fA9$;FX*$1it;xBf$4eBejhf&&7XM;++Qq@SDo;1Jw|M@j{g9`pbCo8sDI zlf8LOAsK$A>b|_Sg4YEe=RUVXCb}$%Uwkqa4I(`tmZQ={IUz4zLV~at#c=YRc~#7o z4PLrC{6fdb4`g7^y^f>XLjohZzj^Gw`H%&{=!8?vG@{!^ro#kgTUuy*rXkI*HPh_r ztm!9wipQUD6I89#YM|;)GSJ*slEBlsI*qS;jo$pzZ!K=@En9bdG}Z{o#KaEQXudNU zpF9d+bn=*8&U>*=0gEzGDBCE@{<7I<{K-{Tm;G6n-TU^=@IYIhBib^mrR9N=`9VKJ zt`(WBnePZz#j?3KY|Qgkov;N~%;t{3JhiWBc2+X8aYckR$Ig%_5Vjp?vT7uy%`Vbg z1i6>1Du$Fqia>De!_mZuZ<1-_ByL}8eE6o@z1_S?C0bz+bKJvKpgHaM&R=?__J>TO zx-&J>8+wYzW%hdYJX23uK`5QZ>PVJkyPef4kstGc+vkkiAwbHg?Wn zZALIJMMO2XZlX5F^3AEPzuB|)g#q1bL!E3||G955?&?NGX2&feThpnj|KJ+QclUql za}3;m3+BRqf6P$NOOSae$T6>R=KN*-M-Tm6d%d!vkR|n>?u@qGRY1t2z#>k zMsTkjjO{mun)YMgndJ31bkG)?mOYf)AQWI%s*a~V0j_B<7AcBofa-8!Wo?|&VIvf9>eUB%0WXVSu#_)i?B5`H2_CruWagg9pC8 zGQQ_ObcXu|MeDCE@YDlMKUnuFa|D=`A}wj4F7IJGM+8-T)rfS&CP6vgPC4cFl9jPu zn0P*V?*!vDmp``^2D(GWIs?)(u|wuVfQ&##B+_9?$jD|wd_fP^6poW3M$}xj8KTgD zq$gNM#=y|S8AA^T%xEwL5kgTKK4{q@Ix9U!(|{Ny!0VV({7j8w3yRuxwi&%BvQiL> zQA;t)Z4NI1O&c>|W3iW5z5J(@<(p%|Qh@3S#ZdrSsd=0?U5PP8Cx4$A{Y798~qA9jKifh&Qx6oi{E31#^GeT7edW3c$GpKP;7D&G5=$2U~`>&o_!SJKbaT(=d{ z8B*vms@3so7cNzN(?WYVYapLm%{unIf5D1~YmD&mZ%%M%DxV{rMT7K*O!!44UY!bx zVO(O}ZydF}Zd)S4pcmJ2edg*_N7ORz7Wn3agM8@m&GP7NB~z_tXrkgJ zSEC%@I*g=O#j@)QHMj0qdt*j=NNZxxewG2QuBurmS`JOZ8Ay-T=27(WzL1+smQUR~ z&c3mfAP{;63k>U$)JzL`jfpTJ4Lm;RB(!a$Gnu!tZlyPa%Prp1DpQ@;M8U$y){Oo4 z2ej<=%)#G3j{Sv^D14XiDM3YEHTWlejd_|7C3#V>vM^o=flm9reaS*LBPmWMMFd>MD-wz? z1Ts@UzF6ro^IlQ7Xj#B3y8^!W?MZfxB&=B#b0Am(dO$1Di%^Fo)I*Y>XwU}|;7~AE zT;wSg^SL56I!12!)bsQwmBv&qJq&Cefj__3%Y9~<9DM0(`F|U2^4rfCoj%guki_RX z01@bfGqa9d1=DAe!b>8uvIIw_JVTSpWPRQ!i`kqM5m8EA9xzf^8A@SAx}X$MR41p? z)<-kt$K3kRNxa0z;fKLUF98<=mykCvcmjBqxmGYV3~&%N>v0jOYZ5xI;tb*h?-X?& zahoHl4qApjT5)Tx>9N~UooATOH@5Tt3uKcX2_ln4hOFh{J(a{bnei?tvZf>84kLW_ zz6myLDl^_0;3u*?pJ*vCQ)AK~vHgneBF&~_?3J6$TvpXQ2_gm#Kb5iPn|9XrQ2hSG zCYx&bh~@-e`SjQLk+Ow5L86 zwNx)pB}}#yO?1&R&r@Tbv{ok!Lf-P`A2A(QTpn}L1zxUwLBc)n&nPt=Y}!HaK#lj*r%S_VSqK{Q@)M7Z1kh#iD)Os!$28mB2Rb>O)4}mZkw)8)yiF+ZTS$yVC^FcW{8*7O}K!5jn>7t7c5G?Pm}J;nY&ZATZwWY~5Amb%AoTNwkE@ zl96NXrl_nfIyHydzx=!ZhrwH}=hD~QK<9-~fN6Q4c6`=RITRyCvuCr09##zo11}L~ zQx|Mn(dn|j3sU#up9$ig?qJph>z!&y2vPo|_Z|gG#gJFtdMRJO_bGg<@I1nELziZ; zv!KRe5K7LFLivk*ioo$R){w`pBz*FFXk}@OB+8Aaf~U=EYc}&MBHH zYU@hy=CVETm3n&lSL(j=0!l4xOp(aqRH~bFkw0?8DPs zJDPGys7$39CbVbvtDhb!YvLxGOJP@NY`;wC-GA{>wten?x%#a~qD$WRyq`j}0nL^u%^H%~ZK^3u z*~$yx-vU7d=m1ucFUHbG{uDR_JPmA8)vv3vElu4s&bcp=PpY=ozWwBD>b1ANS7DAc zM_YgUF9K4Bfe41c$KqV3&Z*j#M@pUIoyWSBfoWV6%HB^@vvn^o#gDbrsacPf%tqC* z(}L|Pm^x=?d(3Tu+dh`suRk%2!#;`J5nWMN!^hugK;7kmqNn4p~9sX6lLqq z8Y55bmNQ9Y4QHRt3TFKZXK%bPAZ*LT7Uv$qMyOV5Jo@1M zzOM@n;tnTqUna%X-jvpg6jxg*4TLLus(#Sjr;}6OjZb(x)0{!_=`X&CzihH9y{lu( znu4Wy)Z=Oycqd{(tcWce(993*R`>aDS(?c`i2Mr5vl!uzC(=dTkRKEY5|MkI)&PU# z1eqo$#69Hd(flh4fY*>qgin$`Wfe}@`X&R$TicG-|3aX%b?$!P2B7pnMiRY`sTDRm zdUaeIe^WWEzrG}{-I9Px=8e6vU?-NDZ1m2mTlLOm!E<>j?R+U>TtmGk209{Xw#Iil zmFk4egZuKXx*d9=!t0f+BM|W|fe}ewyfu`m_C#`Sc8D%a4gf^C?1Cas?yNCAopSM| z1-b)EDZDGbVL}Ko~-a^fA%-r^|4Qf@BH0g$$s*!Z!vkE z$_%?(9rOA&+rbOE?2qC!$%<9H{}j&uK7l=`7DN|+r@mhj!~(s*X5a3E$%D87w3Jpl6=DNJA-lf);UMXb91(lt8GIHS*G+3IX2(ZaF>2y+Ff*K z#jU!x;oC-?nhp_-h58qodevpc=+FxBndXv1X#MI(9r3pUR=#pmc_cQiW@IOm634$6 zOw+6V__k`f`ee=AVI(WrTza+k!2mTyh8|C#NcQ<}{F)S^BQz33p>5Bid^fWb^?Ly!e^PG*t|fm`Z_Ixh zo+VeA9wAqOCV-PA$dt(=;X}aP$9>jMu5Rr)$FVw~YK6m1HM?pX?2hFo-rZ(6l7bv^ zEPo`?3qDiJHf_sT_oxPM{$^0V_}0)r)PuSfNsIw=Ak*R_1zG;;i%KI#PODzcZGxF> zYVg5FraL=#)%De(NkW6nQ{!f{Z3BTP6VIiwm9w%#6r?|F%H?H4@#N*MB2b7eMjV?a z6&Z4~%MTv2siNyvioN-2D`EuSv@WT*|M|Z^E`Rs;9~SRD#uz3iCK)?ChDbQquw-^h0wNxZ3&PA{LcvCQh!*1h$N=fYAFBqH}3ttIz3l{vK?aVF>k?jSeNA3w=HOGXd?4uSj% z@Fg519#`}P#ywO?qW?0UUGsR;_aF9pXSA&NH>NuE)_O5iV#z>*nHb1nuR$@ACc;eg z`P7~&L$>Wm+V<&(rn_#P%BHT2jd!_9xe%EwAQ8}Ggac0LI}?H^NN?DbD;7bH7OVx+ z7iAA0s+snp+66OQoTn`r=i){)udi{Qd+vRT@yVJ5c235LK&9H`z6ZAjx4n2XTH4T* z!pgi+oC1B92vOOSRxJqH(0ckv8jw+%$3~d0S@-4pQ?q5`@qHF|0PppZJIl_79Gv5X zIzArJNuJ*{MBY;W5Q_}dod&DO*QdCb+#7W=%%wn_BLq+b+yzO3M(dKaG8P7J*x$V9 z$;4ef=5<%1e6Ao=3iTR8N%r8sR%O#Qh3J_)-jU~Kje5ei)4O={_d<5>{^qi8J~G|; zBZ-b)5E)wJI2EY^1qK7ymnl~*wmYu^JwYOumkp)Gkz?k2eSNWMXq1hNH0KfaKeOIy?T&b^AVhLjEzmuXf$T# z&HQ*oZ)+fjX&JVhE~Vqlu^xCC@D<>>)9kxs1c5wxT1G$x?VF^(q19U&il)lPJBUm-k2tm6hD=clV#d(0zhG)CBF6EFXKLL~Z>_ffBn%IPBJ;>`Dvy^{ zkO3<^k$4idoHoH%fn`BrE-wphXF!e?!cgpG7nZWS?r!?&nwr&pLQhAYnVCPTg>uFFjusqR4Xjmeq(csB>1Uy9Lb>DXj}BbQyXtOc~pWPWpPf zH7%eE)XR&YM<=ZN+Jl+dFgVk3>we&0W-j+!u%KO+ODefWM1I{Exdym}ymsRCdkc*V5mu~hkxz;IpXLRAwsRmu}6xPHFKJor}eN<6)~K zM;u0)z+VHS2$+4V&uI>vFrk($>tx@)1C-09cUG&l-*?VWWLfqYx!d&ta%nN6J}r3) zPzzU(d%8Z=I@e-QCYNm6mf-xBJV^O+atZlG@&F`oVy?>0)KgKK!1X`X77S_2&3jj( z8?L{gcw}9NZJ@L6+1cRVWYb4~{ovF_ySt%37n`B75%r4+93K1L1Rx_WUtxJwa1uL2 zfliy4E8C#6RUdw~HzyDyg4?;TVN{Vy112i@icZBiZ_jQD1^RBdmWfJ}2Or(T#tkcY zdgn0pN|l?o^zbu3dL8fhcel{pRl>I(I3l8m7+lq$NhU!lbN7BVOYg517FaKR7Lpq@ z#`JY#F1_Fjz#l_i@MW%f{W(p96I7Dn;e0-hkB>iNjCp^SrCY-=d?-!N*1kStynwuZ z<72dXq%IOmB|+8!H<7P;`Uw`1n$RN5?xzy1ezop9ZZDcj-D}V=nC^n9&#OhxRU{+X zzNxJI?gu6>*mNYVys2Q1h)C?w#iX8`pmHhL!9duPd9IBYPzn_2u!*^%taRFVDIRMV zt|+`UaMB%|+eZ_t`J9rF@kBRq(QP4c4UF z+4hTfFQ8F5Jn;}l!MO~uXhQH`{rfwZLL%+^ZF)fBXWsz*y`A6@pWY^qYil3bHp41>Mg3OH1VkLWIBw6-> z2PZeZq~b?jQ?wJg8&^+n$e)BX3TA~x9!YY$C_HBAC7``Uj;>%y$bmw!VC)qamD1tS z$-JtM+^#q>36(mmN~c);^mYmp+ZovVAa7hg%hU99bg$3+uy6M@wV4rLSJ6q29`)i!yy%b<4mhzxUi^fY-M~lt9vS}N+L!&#jthE= z{KWl#vji8quu*G(8_5@S%*fY_elxj>v3E(%dLo3}81EvN9L=*h#{68TGpQho$Rqg| z16#>$tLzNE59FQRfhQhpx*PYVKB_p3T5+9`X)@#DwUT{)SAF2qk4#4yAKk+9IIzOIa_ed>E??i$Yyfsco_HyFm<*UA;5;fOzq2b=f766 zffvPQ(!`Rsg_5-N0`qr|Pj7r+TXo$pT6yA%q9m!#CkGjvw&L)lQY8Sh+=}eWl$A3} zgO^PvmzR~Er6&gpZDngOyRejf?ZK(}{o3=76%Os2W@Ml6-2mF#4a=8XdV4K4XeISZ zo+CXu_lDbrb|MtM-<^#LyeZNt#53LKtr%D0H6tQxQ)HtaW zIVDl@ZaHFiW*%Y#C6meJWhcGi(vxEja><6GeRO**8=K6+6WYnO>;~^)V!|^%?%A>9 zB(|*NdRi69z99wo9ARwWROvI%0Q+YYYUdn>n`dIOE)K_^|5|bv?n0iU`}3jjq9rGeMoqYZ1g;!-r#B!ZL3&keU3|S;%bu>I}GnKyG$7IVQ}9X8mqv3P7do&_M%N>Dq=W(BI4?CVl;&k;rfr;F&UG31hJxHk5@kOPjD zAf4nY$45?nJ7(>XAr=>#I2k&~V=6nzZJnjSsR&|#%gO6Uo&!F_(nR@BKm38pI zx?jB&o_+i0kGx=DBCGsiN3bInLPg_HBvn)tF$%^bMpdncz~#lP-ht0M)9H+%AqkjF zv6*5Vm{irIAWrj(A5x?5ORVfFmiV82VK|#E^?Z^9fKU@cNb@^=%WWd1zbyYUWdMo z-1z^VMLAXBh}fq}&F24kTUR*rU(0p}>SKf$m6%)$%O^Jy&%RfQ5shd`74j7KnZ;~{ z+z`(ctOIXacFK3^K6vj$67NhrHwLD;3=Ms&`-yXE507Q`(9tY>bbHlzwFho>f0S$( zj2Y~YY)9D|In`=Ti@s>+?+$~D))taSw$~Qb?@@s9mgE>Zb8X zh{#Rt?QQ=8I-O;U_Ok9JS6!ybYdcPbi^z@RFR=8n6!G52qoZTjTWkMF#9WzW*=};f z|5?u6_&*~|O-++dOlY^dO}|xU_nOdTnPOGdDp*BYuX#da{vOlXtS*phBCYq*+RuR0 z6#K80tm8wIX*80mTost4C-?5o|1Pt&+=|p1-VPs0gJ-8tIT`nU}ANdq{yy0vi$M#)wOVaWxm+G7 zmFxqrdCki|_sLIwPS1esON}TL;_g5isCt7q4^Gh89$KxMk$KT^bzn{#D7270mud0u zC)3V-4d&grGh{Cij+_jJt=VHtTF zpOD=3IZf^!-qAYlR99E0kK_0gz~KiTctxap~?d*tY| z*{8LdJiIB0{z{`@ixHQuR^Wp>^dqCpthp=xx$385U zy!3+ZjtU2tI(*$ipsKs`8z!jg6nRn7Ofl3N^0qiHB9|Bk$O&_px#rIgkrV61BJvFp z!RJLQH<8zKe3XUBWtfu)J*{m%5mIs@jFA&zto8Ryhmd1$ycoRqvxfij<-H6IJ+JEN zsZa<7-(#f-8VTwQlI3p6Q%Q(fDRK-^44A5F^iNY+-@R2=SObTiQ+i^N>;gkWb6e(^ zH2BtbvWeYn{mx$mJ}1IsR}I?fH(V30(55d_PXetcc>#JHWKxJc#n2F1i&WOOIgx{(}qs-;t|LqvV}y z3*@bF){!Ul#pF-!8I|m-z>fkKc<-MDZY7`acajsS#KICGASc39>k7BGj(bufoD9Rm z-#0QWgi<7uS}`f=EyuJZWuC;yi>qXo6k?B8v5ZKzGx6>3nM_t4Zu(@i$kAuKE^mTf zWo1m!P>yXWl(z0&$ebI0#ta_=zDe%x{*I!DXF?^fzcfIbS|(Rr00gfA^%SkA%A|Or zz)2xYDTan9Sdc71Am*w~C7wIb^v>&if<6qqy^cKEE=s2SGw@%|@jkE8ycx#xW@j$8 z0++5KHh9LtK_vKuWaobkP~H!Ts3-%oCuZHvH!0@ zEAycoqYaE?xSSM%TFGO2?wIBdvyx-JB*{BD3S^(FX8r#>UP9~z}tZ*E>=gDKlc6^_(}2xerJmnlCMwyyjkgI zTcSGE+MXs?1-jbW+TLo6yt>&;%FQN!Nj~{!+W7omM}(81wb));BvcWfF>e*zd?|(b zDJ8Q_uQS2SNRP~*W?G5gJ(;e(znYaU5ZTpjMRz-0{tXS=8bRq$T_jML*eda-Vt8(| zF3yuJp~id0)R#jLkV&`feS@5!V{W(4zO(|7&VWV&g*srAdP>@PrY&};AA zKIo|j#RIKKoE3PwEIM?zmiS=(j9Si~3^VrMVv&<2$t+2RPS-twby5tIjmxaA=?}lQ zeP8mcg-D)$bZyMldz$=y!?Ci+jPm?1z)z88KKaHM0YgwzxkqrplbH@er!b;o6e*s%Yn29-4|FaiLB%;v$W`cibHR zr?=c*dfJO{&E6)z*T~bRhU#Paih{x(-~;D4-rl9U_=T_}clIQP{tqR}Mws+kDvQ~V ziU;rV;CG(JE-iz7PKp?3MYAzS;m;?U7e8Ec?OTK=`V5&D;wi7eS29^U8Wayk##YJG z&x)`vE5g4S{pYDCdVjtX^UWIXtRHJf>s;OEhk&<| zdrQw0v$2qMU0v*%m{^jVFdsimi+FxdFzQr*sKZEguC_zx+aj5nGnz9in%>v&ZNGH5 zdF^90*Sx{J{V;m9q;^C=f~} z>tZKsqOa0!{%PYccG7R)_v_O6^QE!^Pt~L6#l?5Of== zsA)+K-+IkSBB--SW|8c#C)2gRbEJ8dq`LD)D^G?(qTn*%tEpbFN8<6wMh7{*cuII2 z(T1s?yN6R>Q<{0(d3FZ?N+y*HVx>PgjN!kN>J%R2cNb+Ie3(1|_H3{UAPSzJtoQQ- zS$c#DEVsViYCkt`?ex}~>Oy+hsrmWQ<~1Lj%my!k?_3$kUR8Xnyu;n?*to;Q%_xYU zo7WX(&VErk3>Ym5gT-a%HsWMftLiw5Z!2B4DHp}C%v#{DP#(w~%%>Jc!?iIa4=Nu7 z{(-YgnOp^S>6f5u;XFZ>9Ns>Y86N#;j*xB_9HH2Gm*A4BZ%Nx9yH~`*itqj z%2$B*&3^p*izvOBOWOJfdD_yMVgTG?o35TQ&J$$mQS#7y*)mNa$>s>68KT*L9Bp3k zyGPR($4pd@d}GAPQJbKsgM&i&oCvB2_Df>fT8Vbac$%ZIpFpMzR)_?y7seCKn=M3%q zIVtin&b-RBo3m357lrc#S$dR#T5B~KCv92s{~T&`zjmbgx`T;N-(dAKR~U{a`2qya zKo%*w9@wK1&efV^4A-*IMj=AGnuf6ohkP}V5?zX@faY6010+^V2{ z`LyGve#0YgFR(lD6jJrE7?X)&kAz`ix3cEJB-xS##fOR}n9{tNoX?kzX-N-VP>N*a z6XX@5ytnoF*&^oDs*2KW6ImA-ie`Sdl%wS7B1cf*caOmDp83h0pKWh&7x3@MYls$u z60Kn2K&ktL4~J{#mgRe1f-DhMuU<8?eoGmcc8UT2ibENftyVty8zr_j1n&i>st&I% zwZ?y`-2QXlFu|Wr#qpyBTlg%48b#?`%a_Lo~yf+=KeO+?hql;XP=tJlue`0o!7qsmLo<<{8~AIiR}|#8&oN**mvH$h;OEJE9-IyW{3qZY^Zp(uU#{bu!P!?4 z1Lp~{WDrr-tQow1Vq)_5>h;F9G)@0h;PK~xHDI4g$aX!mN#4*V<7GU zt4GPD$n`8Pc{1YICBTcoe+C}q9M`QmPmrZWU$IzN>708eP18#?ugE-bJq*3pQ@O*D zR3njn&O{$=x)-gBrTXE%=zb9&T-F_a;lGS$w_azm$ENDpfkVh$ZPsw8ew6-F4>*T4 zM#){j3CaY3wRKd5l}Uw1vgBOGULuzwv&$vO`Uu+0f~`v@wxvft^qK0qLk-Pn+ih0oS_s^CnfzE^rKSSPB@aD6;o|}P7Sa`wL#SiCPzI-0XLRG&S$MH+UFdVK{ zYZ-Z-&|m|$d;)?m)S2##+E%84yu1|Dp1!@vXWlcN_5@Ifh3JI^^Xvy}+3P1vxS}JD z)=C~*;Lsv+t(KskvP}LIR{DZO)<%X{PF#gbz#sBS@Nl|*ePI6AQRBumuNM3Yxi{-+ z&b|RT!__fXmU>bAIQcq*H*lLBY z5s}wS1mUxPGG1R}L~N_Ck6JWIOXaF96t54AxrTf()aM`haNDsM2Es&Eg#m%s1sC2- z)FlrmYHAu?TefB-^UL=qdWYmq$e$%|DSJ+E* ziEx^fe-BI)i-n2KuFl`_-rwok+rD{uQl03jOf%_~n!vaGRQ226v%z;+ za2iX0sPqN#NtYlJG~1q~?tqIBC<*qaw!nR6BFidX1Ie8S#WOtn2^gu5&$w(Sf!`x1 z$YPvyLSB#mQCboG%$-{j<9UL7kFa|60AO&=?F051V9&BXzA!S^4QX|67dSVpxfkbq z2H6-v%6Dip|BE~ZvEsy?z>oSgeIm8^ymO-hD?)}{yXHY zW6uhs=h*fAJVCxk*uQ^x5&L|f3eWQDzQc5y-(}L@1^g=T2IfcBQ(W>$qFT{tzCTMr zE-l(KsOD05UK#F)cALEif@uGB7$dG&(RgD=;uRFfb~)RZ0K=03~!q zSaf7zbY(hiZ)9m^c>ppnF*z+TGc7PQR539+F*Q0hH!CnOIxsLeQF8zQ000?uMObuG rZ)S9NVRB^vcXxL#X>MzCV_|S*E^l&Yo9;Xs00000NkvXXu0mjfVxe`W literal 0 HcmV?d00001 diff --git a/doc/doxygen/mmg2d/Doxyfile.in b/doc/doxygen/mmg2d/Doxyfile.in deleted file mode 100644 index 1b9f29025..000000000 --- a/doc/doxygen/mmg2d/Doxyfile.in +++ /dev/null @@ -1,2270 +0,0 @@ -# Doxyfile 1.8.5 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a double hash (##) is considered a comment and is placed in -# front of the TAG it is preceding. -# -# All text after a single hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists, items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (\" \"). - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all text -# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv -# for the list of possible encodings. -# The default value is: UTF-8. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by -# double-quotes, unless you are using Doxywizard) that should identify the -# project for which the documentation is generated. This name is used in the -# title of most generated pages and in a few other places. -# The default value is: My Project. - -PROJECT_NAME = mmg2d - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. This -# could be handy for archiving the generated documentation or if some version -# control system is used. - -PROJECT_NUMBER = - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer a -# quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = - -# With the PROJECT_LOGO tag one can specify an logo or icon that is included in -# the documentation. The maximum height of the logo should not exceed 55 pixels -# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo -# to the output directory. - -PROJECT_LOGO = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path -# into which the generated documentation will be written. If a relative path is -# entered, it will be relative to the location where doxygen was started. If -# left blank the current directory will be used. - -OUTPUT_DIRECTORY = . - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- -# directories (in 2 levels) under the output directory of each output format and -# will distribute the generated files over these directories. Enabling this -# option can be useful when feeding doxygen a huge amount of source files, where -# putting all generated files in the same directory would otherwise causes -# performance problems for the file system. -# The default value is: NO. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# Possible values are: Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese- -# Traditional, Croatian, Czech, Danish, Dutch, English, Esperanto, Farsi, -# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en, -# Korean, Korean-en, Latvian, Norwegian, Macedonian, Persian, Polish, -# Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, -# Turkish, Ukrainian and Vietnamese. -# The default value is: English. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member -# descriptions after the members that are listed in the file and class -# documentation (similar to Javadoc). Set to NO to disable this. -# The default value is: YES. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief -# description of a member or function before the detailed description -# -# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. -# The default value is: YES. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator that is -# used to form the text in various listings. Each string in this list, if found -# as the leading text of the brief description, will be stripped from the text -# and the result, after processing the whole list, is used as the annotated -# text. Otherwise, the brief description is used as-is. If left blank, the -# following values are used ($name is automatically replaced with the name of -# the entity):The $name class, The $name widget, The $name file, is, provides, -# specifies, contains, represents, a, an and the. - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# doxygen will generate a detailed section even if there is only a brief -# description. -# The default value is: NO. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. -# The default value is: NO. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path -# before files name in the file list and in the header files. If set to NO the -# shortest path that makes the file name unique will be used -# The default value is: YES. - -FULL_PATH_NAMES = NO - -# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. -# Stripping is only done if one of the specified strings matches the left-hand -# part of the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the path to -# strip. -# -# Note that you can specify absolute paths here, but also relative paths, which -# will be relative from the directory where doxygen is started. -# This tag requires that the tag FULL_PATH_NAMES is set to YES. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the -# path mentioned in the documentation of a class, which tells the reader which -# header file to include in order to use a class. If left blank only the name of -# the header file containing the class definition is used. Otherwise one should -# specify the list of include paths that are normally passed to the compiler -# using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but -# less readable) file names. This can be useful is your file systems doesn't -# support long names like on DOS, Mac, or CD-ROM. -# The default value is: NO. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the -# first line (until the first dot) of a Javadoc-style comment as the brief -# description. If set to NO, the Javadoc-style will behave just like regular Qt- -# style comments (thus requiring an explicit @brief command for a brief -# description.) -# The default value is: NO. - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first -# line (until the first dot) of a Qt-style comment as the brief description. If -# set to NO, the Qt-style will behave just like regular Qt-style comments (thus -# requiring an explicit \brief command for a brief description.) -# The default value is: NO. - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a -# multi-line C++ special comment block (i.e. a block of //! or /// comments) as -# a brief description. This used to be the default behavior. The new default is -# to treat a multi-line C++ comment block as a detailed description. Set this -# tag to YES if you prefer the old behavior instead. -# -# Note that setting this tag to YES also means that rational rose comments are -# not recognized any more. -# The default value is: NO. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the -# documentation from any documented member that it re-implements. -# The default value is: YES. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a -# new page for each member. If set to NO, the documentation of a member will be -# part of the file/class/namespace that contains it. -# The default value is: NO. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen -# uses this value to replace tabs by spaces in code fragments. -# Minimum value: 1, maximum value: 16, default value: 4. - -TAB_SIZE = 8 - -# This tag can be used to specify a number of aliases that act as commands in -# the documentation. An alias has the form: -# name=value -# For example adding -# "sideeffect=@par Side Effects:\n" -# will allow you to put the command \sideeffect (or @sideeffect) in the -# documentation, which will result in a user-defined paragraph with heading -# "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines. - -ALIASES = - -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. - -TCL_SUBST = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. For -# instance, some of the names that are used will be different. The list of all -# members will be omitted, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_FOR_C = YES - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or -# Python sources only. Doxygen will then generate output that is more tailored -# for that language. For instance, namespaces will be presented as packages, -# qualified scopes will look different, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources. Doxygen will then generate output that is tailored for Fortran. -# The default value is: NO. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for VHDL. -# The default value is: NO. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given -# extension. Doxygen has a built-in mapping, but you can override or extend it -# using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make -# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C -# (default is Fortran), use: inc=Fortran f=C. -# -# Note For files without extension you can use no_extension as a placeholder. -# -# Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. - -EXTENSION_MAPPING = c=C \ - h=C - -# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments -# according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you can -# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in -# case of backward compatibilities issues. -# The default value is: YES. - -MARKDOWN_SUPPORT = YES - -# When enabled doxygen tries to link words that correspond to documented -# classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by by putting a % sign in front of the word -# or globally by setting AUTOLINK_SUPPORT to NO. -# The default value is: YES. - -AUTOLINK_SUPPORT = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should set this -# tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); -# versus func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. -# The default value is: NO. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. -# The default value is: NO. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen -# will parse them like normal C++ but will assume all classes use public instead -# of private inheritance when no explicit protection keyword is present. -# The default value is: NO. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate -# getter and setter methods for a property. Setting this option to YES will make -# doxygen to replace the get and set methods by a property in the documentation. -# This will only work if the methods are indeed getting or setting a simple -# type. If this is not the case, or you want to show the methods anyway, you -# should set this option to NO. -# The default value is: YES. - -IDL_PROPERTY_SUPPORT = NO - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. -# The default value is: NO. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES to allow class member groups of the same type -# (for instance a group of public functions) to be put as a subgroup of that -# type (e.g. under the Public Functions section). Set it to NO to prevent -# subgrouping. Alternatively, this can be done per class using the -# \nosubgrouping command. -# The default value is: YES. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions -# are shown inside the group in which they are included (e.g. using \ingroup) -# instead of on a separate page (for HTML and Man pages) or section (for LaTeX -# and RTF). -# -# Note that this feature does not work in combination with -# SEPARATE_MEMBER_PAGES. -# The default value is: NO. - -INLINE_GROUPED_CLASSES = NO - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions -# with only public data fields or simple typedef fields will be shown inline in -# the documentation of the scope in which they are defined (i.e. file, -# namespace, or group documentation), provided this scope is documented. If set -# to NO, structs, classes, and unions are shown on a separate page (for HTML and -# Man pages) or section (for LaTeX and RTF). -# The default value is: NO. - -INLINE_SIMPLE_STRUCTS = NO - -# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or -# enum is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically be -# useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. -# The default value is: NO. - -TYPEDEF_HIDES_STRUCT = NO - -# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This -# cache is used to resolve symbols given their name and scope. Since this can be -# an expensive process and often the same symbol appears multiple times in the -# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small -# doxygen will become slower. If the cache is too large, memory is wasted. The -# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range -# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 -# symbols. At the end of a run doxygen will report the cache usage and suggest -# the optimal cache size from a speed point of view. -# Minimum value: 0, maximum value: 9, default value: 0. - -LOOKUP_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. Private -# class members and static file members will be hidden unless the -# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. -# Note: This will also disable the warnings about undocumented members that are -# normally produced when WARNINGS is set to YES. -# The default value is: NO. - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will -# be included in the documentation. -# The default value is: NO. - -EXTRACT_PRIVATE = YES - -# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal -# scope will be included in the documentation. -# The default value is: NO. - -EXTRACT_PACKAGE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file will be -# included in the documentation. -# The default value is: NO. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO -# only classes defined in header files are included. Does not have any effect -# for Java sources. -# The default value is: YES. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local methods, -# which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO only methods in the interface are -# included. -# The default value is: NO. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base name of -# the file that contains the anonymous namespace. By default anonymous namespace -# are hidden. -# The default value is: NO. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all -# undocumented members inside documented classes or files. If set to NO these -# members will be included in the various overviews, but no documentation -# section is generated. This option has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. If set -# to NO these classes will be included in the various overviews. This option has -# no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO these declarations will be -# included in the documentation. -# The default value is: NO. - -HIDE_FRIEND_COMPOUNDS = YES - -# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO these -# blocks will be appended to the function's detailed documentation block. -# The default value is: NO. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation that is typed after a -# \internal command is included. If the tag is set to NO then the documentation -# will be excluded. Set it to YES to include the internal documentation. -# The default value is: NO. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. -# The default value is: system dependent. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES the -# scope will be hidden. -# The default value is: NO. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of -# the files that are included by a file in the documentation of that file. -# The default value is: YES. - -SHOW_INCLUDE_FILES = YES - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include -# files with double quotes in the documentation rather than with sharp brackets. -# The default value is: NO. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the -# documentation for inline members. -# The default value is: YES. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the -# (detailed) documentation of file and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. -# The default value is: YES. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief -# descriptions of file, namespace and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. -# The default value is: NO. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the -# (brief and detailed) documentation of class members so that constructors and -# destructors are listed first. If set to NO the constructors will appear in the -# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. -# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief -# member documentation. -# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting -# detailed member documentation. -# The default value is: NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy -# of group names into alphabetical order. If set to NO the group names will -# appear in their defined order. -# The default value is: NO. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by -# fully-qualified names, including namespaces. If set to NO, the class list will -# be sorted only by class name, not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the alphabetical -# list. -# The default value is: NO. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper -# type resolution of all parameters of a function it will reject a match between -# the prototype and the implementation of a member function even if there is -# only one candidate or it is obvious which candidate to choose by doing a -# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still -# accept a match between prototype and implementation in such cases. -# The default value is: NO. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the -# todo list. This list is created by putting \todo commands in the -# documentation. -# The default value is: YES. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the -# test list. This list is created by putting \test commands in the -# documentation. -# The default value is: YES. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug -# list. This list is created by putting \bug commands in the documentation. -# The default value is: YES. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) -# the deprecated list. This list is created by putting \deprecated commands in -# the documentation. -# The default value is: YES. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional documentation -# sections, marked by \if ... \endif and \cond -# ... \endcond blocks. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the -# initial value of a variable or macro / define can have for it to appear in the -# documentation. If the initializer consists of more lines than specified here -# it will be hidden. Use a value of 0 to hide initializers completely. The -# appearance of the value of individual variables and macros / defines can be -# controlled using \showinitializer or \hideinitializer command in the -# documentation regardless of this setting. -# Minimum value: 0, maximum value: 10000, default value: 30. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES the list -# will mention the files that were used to generate the documentation. -# The default value is: YES. - -SHOW_USED_FILES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This -# will remove the Files entry from the Quick Index and from the Folder Tree View -# (if specified). -# The default value is: YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces -# page. This will remove the Namespaces entry from the Quick Index and from the -# Folder Tree View (if specified). -# The default value is: YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command command input-file, where command is the value of the -# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided -# by doxygen. Whatever the program writes to standard output is used as the file -# version. For an example see the documentation. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. To create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. You can -# optionally specify a file name after the option, if omitted DoxygenLayout.xml -# will be used as the name of the layout file. -# -# Note that if you run doxygen from a directory containing a file called -# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE -# tag is left empty. - -LAYOUT_FILE = - -# The CITE_BIB_FILES tag can be used to specify one or more bib files containing -# the reference definitions. This must be a list of .bib files. The .bib -# extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. -# For LaTeX the style of the bibliography can be controlled using -# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the -# search path. Do not use file names with spaces, bibtex cannot handle them. See -# also \cite for info how to create references. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# Configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated to -# standard output by doxygen. If QUIET is set to YES this implies that the -# messages are off. -# The default value is: NO. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES -# this implies that the warnings are on. -# -# Tip: Turn warnings on while writing the documentation. -# The default value is: YES. - -WARNINGS = YES - -# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate -# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag -# will automatically be disabled. -# The default value is: YES. - -WARN_IF_UNDOCUMENTED = YES - -# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some parameters -# in a documented function, or documenting parameters that don't exist or using -# markup commands wrongly. -# The default value is: YES. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that -# are documented, but have no documentation for their parameters or return -# value. If set to NO doxygen will only warn about wrong or incomplete parameter -# documentation, but not about the absence of documentation. -# The default value is: NO. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that doxygen -# can produce. The string should contain the $file, $line, and $text tags, which -# will be replaced by the file and line number from which the warning originated -# and the warning text. Optionally the format may contain $version, which will -# be replaced by the version of the file (if it could be obtained via -# FILE_VERSION_FILTER) -# The default value is: $file:$line: $text. - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning and error -# messages should be written. If left blank the output is written to standard -# error (stderr). - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# Configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag is used to specify the files and/or directories that contain -# documented source files. You may enter file names like myfile.cpp or -# directories like /usr/src/myproject. Separate the files or directories with -# spaces. -# Note: If this tag is empty the current directory is searched. - -INPUT = @CMAKE_CURRENT_SOURCE_DIR@/src/common @CMAKE_CURRENT_SOURCE_DIR@/src/mmg2d - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses -# libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of -# possible encodings. -# The default value is: UTF-8. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank the -# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, -# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, -# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, -# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, -# *.qsf, *.as and *.js. - -FILE_PATTERNS = *.h \ - *.c - -# The RECURSIVE tag can be used to specify whether or not subdirectories should -# be searched for input files as well. -# The default value is: NO. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. -# The default value is: NO. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories for example use the pattern */test/* - -EXCLUDE_PATTERNS = */libmmg2df.h - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories use the pattern */test/* - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or directories -# that contain example code fragments that are included (see the \include -# command). - -EXAMPLE_PATH =../libexamples/mmg2d/example0 ../libexamples/mmg2d/example0_fortran ../libexamples/mmg2d/example1 - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank all -# files are included. - -EXAMPLE_PATTERNS =*.c - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude commands -# irrespective of the value of the RECURSIVE tag. -# The default value is: NO. - -EXAMPLE_RECURSIVE = YES - -# The IMAGE_PATH tag can be used to specify one or more files or directories -# that contain images that are to be included in the documentation (see the -# \image command). - -IMAGE_PATH = . - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command: -# -# -# -# where is the value of the INPUT_FILTER tag, and is the -# name of an input file. Doxygen will then use the output that the filter -# program writes to standard output. If FILTER_PATTERNS is specified, this tag -# will be ignored. -# -# Note that the filter must not add or remove lines; it is applied before the -# code is scanned, but not when the output code is generated. If lines are added -# or removed, the anchors will not be placed correctly. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: pattern=filter -# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how -# filters are used. If the FILTER_PATTERNS tag is empty or if none of the -# patterns match the file name, INPUT_FILTER is applied. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER ) will also be used to filter the input files that are used for -# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). -# The default value is: NO. - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and -# it is also possible to disable source filtering for a specific pattern using -# *.ext= (so without naming a filter). -# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. - -FILTER_SOURCE_PATTERNS = - -# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that -# is part of the input, its contents will be placed on the main page -# (index.html). This can be useful if you have a project on for instance GitHub -# and want to reuse the introduction page also for the doxygen output. - -USE_MDFILE_AS_MAINPAGE = - -#--------------------------------------------------------------------------- -# Configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will be -# generated. Documented entities will be cross-referenced with these sources. -# -# Note: To get rid of all source code in the generated output, make sure that -# also VERBATIM_HEADERS is set to NO. -# The default value is: NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body of functions, -# classes and enums directly into the documentation. -# The default value is: NO. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any -# special comment blocks from generated source code fragments. Normal C, C++ and -# Fortran comments will always remain visible. -# The default value is: YES. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# function all documented functions referencing it will be listed. -# The default value is: NO. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES then for each documented function -# all documented entities called/used by that function will be listed. -# The default value is: NO. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES, then the hyperlinks from functions in REFERENCES_RELATION and -# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will -# link to the documentation. -# The default value is: YES. - -REFERENCES_LINK_SOURCE = YES - -# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the -# source code will show a tooltip with additional information such as prototype, -# brief description and links to the definition and documentation. Since this -# will make the HTML file larger and loading of large files a bit slower, you -# can opt to disable this feature. -# The default value is: YES. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -SOURCE_TOOLTIPS = YES - -# If the USE_HTAGS tag is set to YES then the references to source code will -# point to the HTML generated by the htags(1) tool instead of doxygen built-in -# source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version -# 4.8.6 or higher. -# -# To use it do the following: -# - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the config file -# - Make sure the INPUT points to the root of the source tree -# - Run doxygen as normal -# -# Doxygen will invoke htags (and that will in turn invoke gtags), so these -# tools must be available from the command line (i.e. in the search path). -# -# The result: instead of the source browser generated by doxygen, the links to -# source code will now point to the output of htags. -# The default value is: NO. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a -# verbatim copy of the header file for each class for which an include is -# specified. Set to NO to disable this. -# See also: Section \class. -# The default value is: YES. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# Configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all -# compounds will be generated. Enable this if the project contains a lot of -# classes, structs, unions or interfaces. -# The default value is: YES. - -ALPHABETICAL_INDEX = NO - -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all classes will -# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag -# can be used to specify a prefix (or a list of prefixes) that should be ignored -# while generating the index headers. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output -# The default value is: YES. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a -# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of -# it. -# The default directory is: html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each -# generated HTML page (for example: .htm, .php, .asp). -# The default value is: .html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a user-defined HTML header file for -# each generated HTML page. If the tag is left blank doxygen will generate a -# standard header. -# -# To get valid HTML the header file that includes any scripts and style sheets -# that doxygen needs, which is dependent on the configuration options used (e.g. -# the setting GENERATE_TREEVIEW). It is highly recommended to start with a -# default header using -# doxygen -w html new_header.html new_footer.html new_stylesheet.css -# YourConfigFile -# and then modify the file new_header.html. See also section "Doxygen usage" -# for information on how to generate the default header that doxygen normally -# uses. -# Note: The header is subject to change so you typically have to regenerate the -# default header when upgrading to a newer version of doxygen. For a description -# of the possible markers and block names see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each -# generated HTML page. If the tag is left blank doxygen will generate a standard -# footer. See HTML_HEADER for more information on how to generate a default -# footer and what special commands can be used inside the footer. See also -# section "Doxygen usage" for information on how to generate the default footer -# that doxygen normally uses. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style -# sheet that is used by each HTML page. It can be used to fine-tune the look of -# the HTML output. If left blank doxygen will generate a default style sheet. -# See also section "Doxygen usage" for information on how to generate the style -# sheet that doxygen normally uses. -# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as -# it is more robust and this tag (HTML_STYLESHEET) will in the future become -# obsolete. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_STYLESHEET = - -# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- -# defined cascading style sheet that is included after the standard style sheets -# created by doxygen. Using this option one can overrule certain style aspects. -# This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefor more robust against future updates. -# Doxygen will copy the style sheet file to the output directory. For an example -# see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_STYLESHEET = - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that the -# files will be copied as-is; there are no commands or markers available. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_FILES = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the stylesheet and background images according to -# this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value -# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 -# purple, and 360 is red again. -# Minimum value: 0, maximum value: 359, default value: 220. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors -# in the HTML output. For a value of 0 the output will use grayscales only. A -# value of 255 will produce the most vivid colors. -# Minimum value: 0, maximum value: 255, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the -# luminance component of the colors in the HTML output. Values below 100 -# gradually make the output lighter, whereas values above 100 make the output -# darker. The value divided by 100 is the actual gamma applied, so 80 represents -# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not -# change the gamma. -# Minimum value: 40, maximum value: 240, default value: 80. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting this -# to NO can help when comparing the output of multiple runs. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_TIMESTAMP = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_DYNAMIC_SECTIONS = NO - -# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries -# shown in the various tree structured indices initially; the user can expand -# and collapse entries dynamically later on. Doxygen will expand the tree to -# such a level that at most the specified number of entries are visible (unless -# a fully collapsed tree already exceeds this amount). So setting the number of -# entries 1 will produce a full collapsed tree by default. 0 is a special value -# representing an infinite number of entries and will result in a full expanded -# tree by default. -# Minimum value: 0, maximum value: 9999, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_INDEX_NUM_ENTRIES = 100 - -# If the GENERATE_DOCSET tag is set to YES, additional index files will be -# generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://developer.apple.com/tools/xcode/), introduced with -# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a -# Makefile in the HTML output directory. Running make will produce the docset in -# that directory and running make install will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_DOCSET = NO - -# This tag determines the name of the docset feed. A documentation feed provides -# an umbrella under which multiple documentation sets from a single provider -# (such as a company or product suite) can be grouped. -# The default value is: Doxygen generated docs. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# This tag specifies a string that should uniquely identify the documentation -# set bundle. This should be a reverse domain-name style string, e.g. -# com.mycompany.MyDocSet. Doxygen will append .docset to the name. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. -# The default value is: org.doxygen.Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. -# The default value is: Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three -# additional HTML index files: index.hhp, index.hhc, and index.hhk. The -# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on -# Windows. -# -# The HTML Help Workshop contains a compiler that can convert all HTML output -# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML -# files are now used as the Windows 98 help format, and will replace the old -# Windows help format (.hlp) on all Windows platforms in the future. Compressed -# HTML files also contain an index, a table of contents, and you can search for -# words in the documentation. The HTML workshop also contains a viewer for -# compressed HTML files. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_HTMLHELP = NO - -# The CHM_FILE tag can be used to specify the file name of the resulting .chm -# file. You can add a path in front of the file if the result should not be -# written to the html output directory. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_FILE = - -# The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler ( hhc.exe). If non-empty -# doxygen will try to run the HTML help compiler on the generated index.hhp. -# The file has to be specified with full path. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -HHC_LOCATION = - -# The GENERATE_CHI flag controls if a separate .chi index file is generated ( -# YES) or that it should be included in the master .chm file ( NO). -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -GENERATE_CHI = NO - -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) -# and project file content. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_INDEX_ENCODING = - -# The BINARY_TOC flag controls whether a binary table of contents is generated ( -# YES) or a normal table of contents ( NO) in the .chm file. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members to -# the table of contents of the HTML help documentation and to the tree view. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that -# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help -# (.qch) of the generated HTML documentation. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify -# the file name of the resulting .qch file. The path specified is relative to -# the HTML output folder. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help -# Project output. For more information please see Qt Help Project / Namespace -# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_NAMESPACE = - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt -# Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- -# folders). -# The default value is: doc. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_VIRTUAL_FOLDER = doc - -# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom -# filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_SECT_FILTER_ATTRS = - -# The QHG_LOCATION tag can be used to specify the location of Qt's -# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the -# generated .qhp file. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be -# generated, together with the HTML files, they form an Eclipse help plugin. To -# install this plugin and make it available under the help contents menu in -# Eclipse, the contents of the directory containing the HTML and XML files needs -# to be copied into the plugins directory of eclipse. The name of the directory -# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. -# After copying Eclipse needs to be restarted before the help appears. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the Eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have this -# name. Each documentation set should have its own identifier. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# If you want full control over the layout of the generated HTML pages it might -# be necessary to disable the index and replace it with your own. The -# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top -# of each HTML page. A value of NO enables the index and the value YES disables -# it. Since the tabs in the index contain the same information as the navigation -# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -DISABLE_INDEX = NO - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. If the tag -# value is set to YES, a side panel will be generated containing a tree-like -# index structure (just like the one that is generated for HTML Help). For this -# to work a browser that supports JavaScript, DHTML, CSS and frames is required -# (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can -# further fine-tune the look of the index. As an example, the default style -# sheet generated by doxygen has an example that shows how to put an image at -# the root of the tree instead of the PROJECT_NAME. Since the tree basically has -# the same information as the tab index, you could consider setting -# DISABLE_INDEX to YES when enabling this option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_TREEVIEW = YES - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that -# doxygen will group on one line in the generated HTML documentation. -# -# Note that a value of 0 will completely suppress the enum values from appearing -# in the overview section. -# Minimum value: 0, maximum value: 20, default value: 4. -# This tag requires that the tag GENERATE_HTML is set to YES. - -ENUM_VALUES_PER_LINE = 4 - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used -# to set the initial width (in pixels) of the frame in which the tree is shown. -# Minimum value: 0, maximum value: 1500, default value: 250. -# This tag requires that the tag GENERATE_HTML is set to YES. - -TREEVIEW_WIDTH = 250 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to -# external symbols imported via tag files in a separate window. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of LaTeX formulas included as images in -# the HTML documentation. When you change the font size after a successful -# doxygen run you need to manually remove any form_*.png images from the HTML -# output directory to force them to be regenerated. -# Minimum value: 8, maximum value: 50, default value: 10. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are not -# supported properly for IE 6.0, but are supported on all modern browsers. -# -# Note that when changing this option you need to delete any form_*.png files in -# the HTML output directory before the changes have effect. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_TRANSPARENT = YES - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering -# instead of using prerendered bitmaps. Use this if you do not have LaTeX -# installed or if you want to formulas look prettier in the HTML output. When -# enabled you may also need to install MathJax separately and configure the path -# to it using the MATHJAX_RELPATH option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -USE_MATHJAX = NO - -# When MathJax is enabled you can set the default output format to be used for -# the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. -# Possible values are: HTML-CSS (which is slower, but has the best -# compatibility), NativeMML (i.e. MathML) and SVG. -# The default value is: HTML-CSS. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_FORMAT = HTML-CSS - -# When MathJax is enabled you need to specify the location relative to the HTML -# output directory using the MATHJAX_RELPATH option. The destination directory -# should contain the MathJax.js script. For instance, if the mathjax directory -# is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax -# Content Delivery Network so you can quickly see the result without installing -# MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest - -# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax -# extension names that should be enabled during MathJax rendering. For example -# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_EXTENSIONS = - -# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces -# of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an -# example see the documentation. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_CODEFILE = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box for -# the HTML output. The underlying search engine uses javascript and DHTML and -# should work on any modern browser. Note that when using HTML help -# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) -# there is already a search function so this one should typically be disabled. -# For large projects the javascript based search engine can be slow, then -# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to -# search using the keyboard; to jump to the search box use + S -# (what the is depends on the OS and browser, but it is typically -# , /nA?}X`S?IgpOn$HADamB@ph!{_b>d;Nif5!Od{L{U-_z(PtF|$9(0@?X z^<;a$Ua-H9X7`iMGgu20+=esk$`r7?XaNBoGOTM;0$)b}hDplw*Jk;qUG|R(MIwNw zOx^EP6#?_{qU5Dlk8^jcyF#F75=ZMAOf_tfw9Ju-35wlw}8j-Brbe| z?P)qdfCVkl77kikA1Aq{x+LI zU^O52uh`q+@aF+@`l_>F85ymGXe@lk&Z=Y)&zTmnG*-)9X>ljZcphKFYG>OS6JAG| z$D+Q9&P;uO=?{y0HWS8R?Sse#uE$p8E|n3R$w=fzFb*%#jKS@_s@>Uby(4orwZrZd zPH>L6VnSkFGj~~)v!Ck2DwS7EX|JirEnP!1RnX2pY(KM<+jjGFFSM79narKuL>0JJ z0%f@VNv0{=304}hFViaqN%m>F{kXi}dOf4X1N$@zTCYco?ZdASw~3R80Y!g%?*a#R z#=>%$n$Gnf5N-og)0idvC=m8YAfIB!S%jSXuK~S02uaf2@mlOtl^>joocDV&_gbiY z3>z<357Whma0VAl)=p(L)eqTp&vIq2m=VJ7`AcGL@$UNibUKBHybP5-T&MmVbN$zl ztx~}aU5m$Lmef_EM#wG%GChCO0aY#=aw>A6dvP+b$qh<7m1B?GyE@@fBnnG%nXl6y zjVnR;K4x=%X2YMUfNy@mgk|&jhYh<4!lfbeOb~7owiwMPLAc1OnMKS-F)yqu9Um6d zLMFfY30#gdQ|djBaA$x?ekfDFq(z~H5xJF!5od)&LYyRAlgeCh&3J!NX!R(wR#EOz zAU)HLTIoTk4B&PSopqas#d5WoZaNl@6dP%WcfUK>93hpK1JyF z;LF9~ViP2A7^_v{LebOpr2aTIJ1Y6SBNaDN1jyB#*z+>A^>9>wz!zS@BNVWI(p0XS z<1&CqyWCFm$Csv!{Pus+G%rp3()>a5SLe0(`odCUb!yyFJ^Ug>F+e5M<6MhF^Q|PR zNZWRtsiSB|=ERH6NPff7FX}OkTU`>?1D#()0BQ1mvKgY>ZzDi-Fs#uPmy9T?=d zOKGx+%beCo5fZf&P2cUvmU-lB-?oRl6Rv0+gf15X-ywm>sX7@lPCSyQr4>Lqw+H3z zdKczctTG%Oy3Kz+l->Qb9ilK@v`2m|c`DKF9NOd3g@~*Z%%zn)^+MzV2U4#(y51TF zE>XtI`Fyl^&t}ubgpJl8?&p)m7U+VcshU1KsvXPND|fedL3o?8fyhhb-_!=KH6c)y zbhT{xfelVFhOKWP)q$R;xbub$a$zV12a(Fa>ugYMNDzNLnOl~KvnL0V;;8!F)StMtJB5HJ_MV^FX zl7hB#$0C2PY7KuL4(W5Qm?Ba~4W=-ak9g5Bb;pV73 zRILk7&t;ohkA~&Y_fSp`(*S z|92Ak?s3r_r#ZUfCCWAC6V-%#r*qPdr5nDo3lPqo9go<-j>cPaMd44Mtbc%o`5V|B>EB6ZBnh3|?p}q(U}Jqgd6WR%_8o%S6MY_@*|BL1(TfbQUXTUg+2sQ+N<9c9Vhpjpm;`dK}WU;fHP5G z_w;`TKpLd(5g>eTz?4b2F4!J!C?VNd1L?)-zJXT2R&g4~E9L<3tc%|rG0$# zrvyzS@|oTA;ZAlpN*jW=P^?e{etrz=u49pki(6IfuMyRPpqE5i3C9Q_A>xCehYyZ@f@ZEX_%0O_?DciXtSs8Wk+wsi>I2}BKPk^1S-#UM# zp*%==k@5&Y$Ob3_E8DTj6r6owpiem8HF?EmOu4IEO|C?OJyvbA16qFOw_$KfWQ07X zy`VXQV8AQLCgMoai^57C`AgDBXIpy0;BEhFvwYJod-APF1nDVL_d`xaRD8UMVbkltxx3Zz_B%T0x?U#7pX^Io k!seEn3Ha)4vkbz2Xu9A}F)=p({g%G}18-in^_~;}0Q}@8YybcN diff --git a/src/common/libtools.c b/src/common/libtools.c index 52a8a2956..e452bba62 100644 --- a/src/common/libtools.c +++ b/src/common/libtools.c @@ -245,6 +245,8 @@ void MMG5_paramUsage1(void) { fprintf(stdout,"-hmax val maximal mesh size\n"); fprintf(stdout,"-hmin val minimal mesh size\n"); fprintf(stdout,"-hsiz val constant mesh size\n"); + fprintf(stdout,"-rmc [val] enable the removal of componants whose volume fraction is less than\n" + " val (1e-5 if not given) of the mesh volume (ls mode).\n"); } /** @@ -288,9 +290,6 @@ void MMG5_2d3dUsage(void) { fprintf(stdout,"-opnbdy preserve input triangles at the interface of" " two domains of the same reference.\n"); - - fprintf(stdout,"-rmc [val] enable the removal of componants whose volume fraction is less than\n" - " val (1e-5 if not given) of the mesh volume (ls mode).\n"); } /** From d82fcc50131d71a5879cf0a88881e40b4ae6b1ee Mon Sep 17 00:00:00 2001 From: Corentin Prigent Date: Fri, 25 Nov 2022 10:54:29 +0100 Subject: [PATCH 785/838] Replaced MMG5_regver with two functions: MMGS_regver and MMG3D_regver --- src/common/mmgcommon.h | 1 - src/mmg3d/analys_3d.c | 17 +++++++++++++---- src/mmg3d/libmmg3d_private.h | 1 + src/mmgs/libmmgs_private.h | 1 + 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/common/mmgcommon.h b/src/common/mmgcommon.h index 7e8f305cf..0117ac8b4 100644 --- a/src/common/mmgcommon.h +++ b/src/common/mmgcommon.h @@ -691,7 +691,6 @@ typedef struct MMG5_iNode_s { int MMG5_invmat33(double m[3][3],double mi[3][3]); int MMG5_invmat22(double m[2][2],double mi[2][2]); int MMG5_regnor(MMG5_pMesh mesh); - int MMG5_regver(MMG5_pMesh mesh); double MMG5_ridSizeInNormalDir(MMG5_pMesh,int,double*,MMG5_pBezier,double,double); double MMG5_ridSizeInTangentDir(MMG5_pMesh, MMG5_pPoint,MMG5_int,MMG5_int*,double,double); int MMG5_scale_meshAndSol(MMG5_pMesh,MMG5_pSol,MMG5_pSol,double*); diff --git a/src/mmg3d/analys_3d.c b/src/mmg3d/analys_3d.c index 3304b2922..fa630f84c 100644 --- a/src/mmg3d/analys_3d.c +++ b/src/mmg3d/analys_3d.c @@ -827,7 +827,7 @@ int MMG3D_regver(MMG5_pMesh mesh) { MMG5_Tria tnew; double *tabl,c[3],cprev[3],n[3],nnew[3],*cptr,*nptr,lm1,lm2,dd,cx,cy,cz,nx,ny,nz,res0,res,result; int i,ii,it,nit,ilist,noupdate,ier; - MMG5_int k,kt,nn,iel,list[MMG5_LMAX],tlist[MMG5_LMAX],*adja,*adjatet,iad,v[4]; + MMG5_int k,kt,nn,iel,list[MMG5_LMAX],tlist[MMG5_LMAX],*adja,*adjatet,iad,v[4],ntet; int64_t tetlist[MMG5_LMAX]; /* assign seed to vertex */ @@ -840,6 +840,11 @@ int MMG3D_regver(MMG5_pMesh mesh) { } } + for (k=1; k<=mesh->np; k++) { + ppt = &mesh->point[k]; + ppt->flag = 0; + } + for (k=1; k<=mesh->ne; k++) { ptet = &mesh->tetra[k]; if ( !MG_EOK(ptet) ) continue; @@ -992,14 +997,18 @@ int MMG3D_regver(MMG5_pMesh mesh) { if ( !noupdate ) { iel = ppt->flag; ptet = &mesh->tetra[iel]; + + if ( !MG_EOK(ptet) ) continue; + i = 0; if ( ptet->v[1] == k ) i = 1; else if ( ptet->v[2] == k ) i = 2; + else if ( ptet->v[3] == k ) i = 3; ilist = MMG5_boulevolp(mesh, iel, i, tetlist); for( kt=0 ; kttetra[iel]; for ( ii=0 ; ii<4 ; ii++ ) { @@ -1030,7 +1039,7 @@ int MMG3D_regver(MMG5_pMesh mesh) { } if ( it > 1 && res < MMG5_EPS ) break; } - /* reset the ppt->s tag */ + /* reset the ppt->s and ppt->flag tags */ for (k=1; k<=mesh->np; ++k) { mesh->point[k].s = 0; mesh->point[k].flag = 0; diff --git a/src/mmg3d/libmmg3d_private.h b/src/mmg3d/libmmg3d_private.h index d83bcc16c..b4b3c9cc4 100644 --- a/src/mmg3d/libmmg3d_private.h +++ b/src/mmg3d/libmmg3d_private.h @@ -264,6 +264,7 @@ int MMG3D_analys(MMG5_pMesh mesh); void MMG3D_set_reqBoundaries(MMG5_pMesh mesh); int MMG5_chkVertexConnectedDomains(MMG5_pMesh mesh); int MMG5_norver(MMG5_pMesh mesh); +int MMG3D_regver(MMG5_pMesh mesh); int MMG5_setadj(MMG5_pMesh mesh); int MMG5_setdhd(MMG5_pMesh mesh); int MMG5_singul(MMG5_pMesh mesh); diff --git a/src/mmgs/libmmgs_private.h b/src/mmgs/libmmgs_private.h index 313ec46aa..34b8422ac 100644 --- a/src/mmgs/libmmgs_private.h +++ b/src/mmgs/libmmgs_private.h @@ -130,6 +130,7 @@ int MMGS_zaldy(MMG5_pMesh mesh); int MMGS_assignEdge(MMG5_pMesh mesh); int MMGS_analys_for_norver(MMG5_pMesh mesh); int MMGS_analys(MMG5_pMesh mesh); +int MMGS_regver(MMG5_pMesh mesh); int MMGS_inqua(MMG5_pMesh,MMG5_pSol); int MMGS_outqua(MMG5_pMesh,MMG5_pSol); int MMGS_hashTria(MMG5_pMesh ); From 44cc0d766c6ecb5435c3cd57e7ea50b2a7fbe110 Mon Sep 17 00:00:00 2001 From: Corentin Prigent Date: Fri, 25 Nov 2022 14:55:26 +0100 Subject: [PATCH 786/838] Minor bug correction in MMGS --- src/mmgs/analys_s.c | 10 +++++----- src/mmgs/libmmgs_tools.c | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/mmgs/analys_s.c b/src/mmgs/analys_s.c index 71a4f8b31..2e91f8b6c 100644 --- a/src/mmgs/analys_s.c +++ b/src/mmgs/analys_s.c @@ -1090,12 +1090,12 @@ int MMGS_analys(MMG5_pMesh mesh) { } /* regularize vertices coordinates */ - if( !mesh->xp ){ - if ( mesh->info.xreg && !MMGS_regver(mesh) ){ - fprintf(stderr,"\n ## Coordinates regularization problem. Exit program.\n"); - return 0; - } + //if( !mesh->xp ){ + if ( mesh->info.xreg && !MMGS_regver(mesh) ){ + fprintf(stderr,"\n ## Coordinates regularization problem. Exit program.\n"); + return 0; } + //} return 1; } diff --git a/src/mmgs/libmmgs_tools.c b/src/mmgs/libmmgs_tools.c index 2fa1dfe85..d94304cd1 100644 --- a/src/mmgs/libmmgs_tools.c +++ b/src/mmgs/libmmgs_tools.c @@ -391,6 +391,7 @@ int MMGS_parsar(int argc,char *argv[],MMG5_pMesh mesh,MMG5_pSol met,MMG5_pSol so if ( !MMGS_Set_iparameter(mesh,met,MMGS_IPARAM_xreg,1) ) return 0; } + break; default: fprintf(stderr,"Unrecognized option %s\n",argv[i]); MMGS_usage(argv[0]); From 14ffd9c66f89a5946c184fb2d20806e01060ca54 Mon Sep 17 00:00:00 2001 From: Corentin Prigent Date: Mon, 28 Nov 2022 17:50:29 +0100 Subject: [PATCH 787/838] Modified headers for API integration --- src/common/mmg_export.h | 2 +- src/mmg3d/mmg3d_export.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/mmg_export.h b/src/common/mmg_export.h index 1c7c5bd1f..2b17c70f3 100644 --- a/src/common/mmg_export.h +++ b/src/common/mmg_export.h @@ -24,7 +24,7 @@ #ifndef MMG_EXPORT_H #define MMG_EXPORT_H -#include +#include "mmgcmakedefines.h" #if(MMG_DYN_LIB) # if defined(_WIN32) || defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(__TOS_WIN__) || defined(__WINDOWS__) diff --git a/src/mmg3d/mmg3d_export.h b/src/mmg3d/mmg3d_export.h index 867cbf8d7..08a3ac05f 100644 --- a/src/mmg3d/mmg3d_export.h +++ b/src/mmg3d/mmg3d_export.h @@ -24,7 +24,7 @@ #ifndef MMG3D_EXPORT_H #define MMG3D_EXPORT_H -#include +#include "mmg_export.h" #if defined(libmmg_so_EXPORTS) || defined(libmmg3d_so_EXPORTS) # define LIBMMG3D_EXPORT MMG_DECL_EXPORT #else From 78ec5c13c78ce1fff65f1a348ed055cc3dd4d9ae Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Tue, 29 Nov 2022 16:37:52 +0100 Subject: [PATCH 788/838] Fix regression in patterns (wrong position for the computation of the bdy face to which an edge belongs leading to use wrong indices in adaptation). --- src/mmg3d/mmg3d1_delone.c | 2 +- src/mmg3d/mmg3d1_pattern.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mmg3d/mmg3d1_delone.c b/src/mmg3d/mmg3d1_delone.c index 8a1e61b9f..9338171c0 100644 --- a/src/mmg3d/mmg3d1_delone.c +++ b/src/mmg3d/mmg3d1_delone.c @@ -215,7 +215,7 @@ int MMG3D_mmg3d1_delone_split(MMG5_pMesh mesh, MMG5_pSol met, } else if(ilist%2) { /* Edge is bdy: we want to treat it from a bdy face */ - return 1; + return 0; } o[0] = 0.5*(p0->c[0] + p1->c[0]); diff --git a/src/mmg3d/mmg3d1_pattern.c b/src/mmg3d/mmg3d1_pattern.c index 1237c141e..91d41290a 100644 --- a/src/mmg3d/mmg3d1_pattern.c +++ b/src/mmg3d/mmg3d1_pattern.c @@ -96,6 +96,8 @@ static MMG5_int MMG5_adpspl(MMG5_pMesh mesh,MMG5_pSol met, int* warn) { if ( lmax < MMG3D_LOPTL ) continue; /* proceed edges according to lengths */ + MMG3D_find_bdyface_from_edge(mesh,pt,imax,&i,&j,&i1,&i2,&ip1,&ip2,&p0,&p1); + if ( pt->xt && (pxt->ftag[i] & MG_BDY) ) { /* Case of a boundary face */ if ( !(MG_GET(pxt->ori,i)) ) continue; @@ -113,8 +115,6 @@ static MMG5_int MMG5_adpspl(MMG5_pMesh mesh,MMG5_pSol met, int* warn) { } else { /* Case of an internal face */ - MMG3D_find_bdyface_from_edge(mesh,pt,imax,&i,&j,&i1,&i2,&ip1,&ip2,&p0,&p1); - if ( (p0->tag & MG_BDY) && (p1->tag & MG_BDY) ) continue; ilist = MMG5_coquil(mesh,k,imax,list); if ( !ilist ) continue; From 49bde3aa90593b23d615889979ecd23d9385eefd Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Tue, 29 Nov 2022 16:37:52 +0100 Subject: [PATCH 789/838] Fix regression in patterns (wrong position for the computation of the bdy face to which an edge belongs leading to use wrong indices in adaptation). --- src/mmg3d/mmg3d1_delone.c | 2 +- src/mmg3d/mmg3d1_pattern.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mmg3d/mmg3d1_delone.c b/src/mmg3d/mmg3d1_delone.c index 8a1e61b9f..9338171c0 100644 --- a/src/mmg3d/mmg3d1_delone.c +++ b/src/mmg3d/mmg3d1_delone.c @@ -215,7 +215,7 @@ int MMG3D_mmg3d1_delone_split(MMG5_pMesh mesh, MMG5_pSol met, } else if(ilist%2) { /* Edge is bdy: we want to treat it from a bdy face */ - return 1; + return 0; } o[0] = 0.5*(p0->c[0] + p1->c[0]); diff --git a/src/mmg3d/mmg3d1_pattern.c b/src/mmg3d/mmg3d1_pattern.c index 1237c141e..91d41290a 100644 --- a/src/mmg3d/mmg3d1_pattern.c +++ b/src/mmg3d/mmg3d1_pattern.c @@ -96,6 +96,8 @@ static MMG5_int MMG5_adpspl(MMG5_pMesh mesh,MMG5_pSol met, int* warn) { if ( lmax < MMG3D_LOPTL ) continue; /* proceed edges according to lengths */ + MMG3D_find_bdyface_from_edge(mesh,pt,imax,&i,&j,&i1,&i2,&ip1,&ip2,&p0,&p1); + if ( pt->xt && (pxt->ftag[i] & MG_BDY) ) { /* Case of a boundary face */ if ( !(MG_GET(pxt->ori,i)) ) continue; @@ -113,8 +115,6 @@ static MMG5_int MMG5_adpspl(MMG5_pMesh mesh,MMG5_pSol met, int* warn) { } else { /* Case of an internal face */ - MMG3D_find_bdyface_from_edge(mesh,pt,imax,&i,&j,&i1,&i2,&ip1,&ip2,&p0,&p1); - if ( (p0->tag & MG_BDY) && (p1->tag & MG_BDY) ) continue; ilist = MMG5_coquil(mesh,k,imax,list); if ( !ilist ) continue; From a9480489d6c117d94c874696d1b5e1943ca07b6d Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Wed, 30 Nov 2022 15:13:38 +0100 Subject: [PATCH 790/838] Add code comments. --- src/mmg3d/mmg3d1_pattern.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mmg3d/mmg3d1_pattern.c b/src/mmg3d/mmg3d1_pattern.c index 91d41290a..82cf75276 100644 --- a/src/mmg3d/mmg3d1_pattern.c +++ b/src/mmg3d/mmg3d1_pattern.c @@ -115,10 +115,18 @@ static MMG5_int MMG5_adpspl(MMG5_pMesh mesh,MMG5_pSol met, int* warn) { } else { /* Case of an internal face */ + + /* Following test skip boundary edges but also, as side effect, internal + * edges connecting boundary points. + * For now there is no way to skip safely only boundary edges: + * - testing if edge shell is open will fail for bdy edge at interface of 2 domains + * - testing edge tag is not possible because we don't have a bdy face */ if ( (p0->tag & MG_BDY) && (p1->tag & MG_BDY) ) continue; + ilist = MMG5_coquil(mesh,k,imax,list); if ( !ilist ) continue; else if ( ilist<0 ) return -1; + o[0] = 0.5*(p0->c[0] + p1->c[0]); o[1] = 0.5*(p0->c[1] + p1->c[1]); o[2] = 0.5*(p0->c[2] + p1->c[2]); From 7a9ab5f507b8a69137a60eab2a544ee657c8a759 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Wed, 30 Nov 2022 16:25:35 +0100 Subject: [PATCH 791/838] Test if an edge is bdy while computing its shell. Should not change the results. --- src/mmg3d/boulep_3d.c | 24 +++++++++++++++++++----- src/mmg3d/libmmg3d_private.h | 2 +- src/mmg3d/mmg3d1.c | 3 ++- src/mmg3d/mmg3d1_delone.c | 9 ++++++++- src/mmg3d/mmg3d1_pattern.c | 4 +++- src/mmg3d/mmg3d3.c | 5 ++++- src/mmg3d/quality_3d.c | 12 +++++------- src/mmg3d/split_3d.c | 9 ++++++++- 8 files changed, 50 insertions(+), 18 deletions(-) diff --git a/src/mmg3d/boulep_3d.c b/src/mmg3d/boulep_3d.c index f6fa17f6e..39d4011f1 100644 --- a/src/mmg3d/boulep_3d.c +++ b/src/mmg3d/boulep_3d.c @@ -1391,6 +1391,8 @@ int MMG5_deltag(MMG5_pMesh mesh,MMG5_int start,int ia,int16_t tag) { * \param start index of the starting tetra * \param ia index of the edge * \param list list of tetra sharing the edge \a ia + * \param isbdy 1 if edge is bdy, 0 otherwise (note that at interface of + * 2 domains the edge shell of a bdy edge can be closed) * * \return 2*ilist if shell is closed, 2*ilist +1 otherwise, 0 if one of the tet * of the shell is required, -1 if fail. @@ -1398,7 +1400,7 @@ int MMG5_deltag(MMG5_pMesh mesh,MMG5_int start,int ia,int16_t tag) { * Find all tets sharing edge ia of tetra start. * */ -int MMG5_coquil(MMG5_pMesh mesh,MMG5_int start,int ia,int64_t * list) { +int MMG5_coquil(MMG5_pMesh mesh,MMG5_int start,int ia,int64_t*list,int8_t *isbdy) { MMG5_pTetra pt; MMG5_int *adja,piv,na,nb,adj; int ilist; @@ -1418,6 +1420,7 @@ int MMG5_coquil(MMG5_pMesh mesh,MMG5_int start,int ia,int64_t * list) { adja = &mesh->adja[4*(start-1)+1]; adj = adja[MMG5_ifar[ia][0]] / 4; // start travelling by face (ia,0) piv = pt->v[MMG5_ifar[ia][1]]; + *isbdy = (pt->xt && (mesh->xtetra[pt->xt].ftag[MMG5_ifar[ia][0]] & MG_BDY))? 1 : 0; while ( adj && (adj != start) ) { pt = &mesh->tetra[adj]; @@ -1443,15 +1446,25 @@ int MMG5_coquil(MMG5_pMesh mesh,MMG5_int start,int ia,int64_t * list) { /* set new triangle for travel */ adja = &mesh->adja[4*(adj-1)+1]; - if ( pt->v[ MMG5_ifar[i][0] ] == piv ) { - adj = adja[ MMG5_ifar[i][0] ] / 4; + int8_t travel_fac = MMG5_ifar[i][0]; + if ( pt->v[ travel_fac ] == piv ) { + adj = adja[ travel_fac ] / 4; piv = pt->v[ MMG5_ifar[i][1] ]; } else { - assert(pt->v[ MMG5_ifar[i][1] ] == piv ); - adj = adja[ MMG5_ifar[i][1] ] /4; + travel_fac = MMG5_ifar[i][1]; + assert(pt->v[ travel_fac ] == piv ); + adj = adja[ travel_fac ] /4; piv = pt->v[ MMG5_ifar[i][0] ]; } + + /* If we haven't cross yet a bdy face, test traveled triangle. Avoid the + * test otherwise (to not add a useless access to the xtetra strcuture) */ + if ( !*isbdy ) { + if ( pt->xt && (mesh->xtetra[pt->xt].ftag[travel_fac] & MG_BDY) ) { + *isbdy = 1; + } + } } /* At this point, the first travel, in one direction, of the shell is @@ -1462,6 +1475,7 @@ int MMG5_coquil(MMG5_pMesh mesh,MMG5_int start,int ia,int64_t * list) { adj = list[ilist-1] / 6; i = list[ilist-1] % 6; ilist = 0; + *isbdy = 1; /* Start back everything from this tetra adj */ list[ilist] = 6*(int64_t)adj + i; diff --git a/src/mmg3d/libmmg3d_private.h b/src/mmg3d/libmmg3d_private.h index 07d571857..ed6c0e1eb 100644 --- a/src/mmg3d/libmmg3d_private.h +++ b/src/mmg3d/libmmg3d_private.h @@ -241,7 +241,7 @@ int MMG5_boulesurfvolp(MMG5_pMesh mesh,MMG5_int start,int ip,int iface,int64_t int MMG5_bouletrid(MMG5_pMesh,MMG5_int,int,int,int *,MMG5_int *,int *,MMG5_int *,MMG5_int *,MMG5_int *); int MMG5_startedgsurfball(MMG5_pMesh mesh,MMG5_int nump,MMG5_int numq,MMG5_int *list,int ilist); int MMG5_srcbdy(MMG5_pMesh mesh,MMG5_int start,int ia); -int MMG5_coquil(MMG5_pMesh mesh, MMG5_int start, int ia, int64_t * list); +int MMG5_coquil(MMG5_pMesh mesh, MMG5_int start, int ia, int64_t * list,int8_t*); int MMG5_coquilface(MMG5_pMesh mesh, MMG5_int start,int8_t iface,int,int64_t*,MMG5_int*,MMG5_int*,int); int MMG3D_coquilFaceFirstLoop(MMG5_pMesh mesh,MMG5_int start,MMG5_int na,MMG5_int nb,int8_t iface, int8_t ia,int64_t *list,int *ilist,MMG5_int *it1,MMG5_int *it2, diff --git a/src/mmg3d/mmg3d1.c b/src/mmg3d/mmg3d1.c index 822f3b676..5c6fb6fc9 100644 --- a/src/mmg3d/mmg3d1.c +++ b/src/mmg3d/mmg3d1.c @@ -1775,7 +1775,8 @@ int8_t MMG3D_build_bezierEdge(MMG5_pMesh mesh,MMG5_int k, } (*tag) |= MG_BDY; - *ilist = MMG5_coquil(mesh,k,imax,list); + int8_t dummy; + *ilist = MMG5_coquil(mesh,k,imax,list,&dummy); if ( !(*ilist) ) { /* On of the tetra of the edge shell is required: we cannot split the edge */ return 0; diff --git a/src/mmg3d/mmg3d1_delone.c b/src/mmg3d/mmg3d1_delone.c index 9338171c0..2f6786d73 100644 --- a/src/mmg3d/mmg3d1_delone.c +++ b/src/mmg3d/mmg3d1_delone.c @@ -205,7 +205,8 @@ int MMG3D_mmg3d1_delone_split(MMG5_pMesh mesh, MMG5_pSol met, * edges with Delauney kernel. */ /* Note that it is possible that non bdy tetra contains a bdy edge, here * only non bdy edge are considered */ - ilist = MMG5_coquil(mesh,k,imax,list); + int8_t isbdy; + ilist = MMG5_coquil(mesh,k,imax,list,&isbdy); if ( !ilist ){ /* Unable to compute edge shell: treat next element */ return 0; @@ -218,6 +219,12 @@ int MMG3D_mmg3d1_delone_split(MMG5_pMesh mesh, MMG5_pSol met, return 0; } +#warning FIXME + /* Edge is bdy: skip it (we want to treat it from a bdy tetra) */ +// if ( isbdy ) { +// return 0; + // } + o[0] = 0.5*(p0->c[0] + p1->c[0]); o[1] = 0.5*(p0->c[1] + p1->c[1]); o[2] = 0.5*(p0->c[2] + p1->c[2]); diff --git a/src/mmg3d/mmg3d1_pattern.c b/src/mmg3d/mmg3d1_pattern.c index 82cf75276..a90cd1301 100644 --- a/src/mmg3d/mmg3d1_pattern.c +++ b/src/mmg3d/mmg3d1_pattern.c @@ -121,9 +121,11 @@ static MMG5_int MMG5_adpspl(MMG5_pMesh mesh,MMG5_pSol met, int* warn) { * For now there is no way to skip safely only boundary edges: * - testing if edge shell is open will fail for bdy edge at interface of 2 domains * - testing edge tag is not possible because we don't have a bdy face */ +#warning this test is too restrictive if ( (p0->tag & MG_BDY) && (p1->tag & MG_BDY) ) continue; - ilist = MMG5_coquil(mesh,k,imax,list); + int8_t isbdy; + ilist = MMG5_coquil(mesh,k,imax,list,&isbdy); if ( !ilist ) continue; else if ( ilist<0 ) return -1; diff --git a/src/mmg3d/mmg3d3.c b/src/mmg3d/mmg3d3.c index adad18655..d673066cf 100644 --- a/src/mmg3d/mmg3d3.c +++ b/src/mmg3d/mmg3d3.c @@ -137,8 +137,10 @@ static MMG5_int MMG5_spllag(MMG5_pMesh mesh,MMG5_pSol disp,MMG5_pSol met,int itd /* Skip the non-internal edges */ if ( pxt && (pxt->tag[i] & MG_BDY) ) continue; + /* Skip boundary edges - WARNING: This also skips edges connecting two * boundary points. */ +#warning too restrictive test if( (p0->tag & MG_BDY) && (p1->tag & MG_BDY) ) continue; len = (p1->c[0]-p0->c[0])*(p1->c[0]-p0->c[0]) @@ -174,7 +176,8 @@ static MMG5_int MMG5_spllag(MMG5_pMesh mesh,MMG5_pSol disp,MMG5_pSol met,int itd if ( pxt ) { assert( !(pxt->tag[imax] & MG_BDY) ); } #endif - ilist = MMG5_coquil(mesh,k,imax,list); + int8_t isbdy; + ilist = MMG5_coquil(mesh,k,imax,list,&isbdy); if ( !ilist ) continue; else if ( ilist<0 ) return -1; diff --git a/src/mmg3d/quality_3d.c b/src/mmg3d/quality_3d.c index f25bcf1a7..839b95bfd 100644 --- a/src/mmg3d/quality_3d.c +++ b/src/mmg3d/quality_3d.c @@ -811,7 +811,6 @@ int MMG5_countelt(MMG5_pMesh mesh,MMG5_pSol sol, double *weightelt, long *npcibl int ia,ipa,ipb,lon,l; //int npbdry; int lenint,loc,nedel,longen; - //int isbdry; double dned,dnface,dnint/*,dnins*/,w,lenavg,lent[6]; double dnpdel,dnadd,leninv,dnaddloc,dnpdelloc; int ddebug=0,ib,nv; @@ -861,17 +860,16 @@ int MMG5_countelt(MMG5_pMesh mesh,MMG5_pSol sol, double *weightelt, long *npcibl nedel = 0; for (ia=0; ia<6; ia++) { - longen = MMG5_coquil(mesh,k,ia,list); + int8_t isbdy; + longen = MMG5_coquil(mesh,k,ia,list,&isbdy); lon = longen/2; - //isbdry = 0;//longen%2; + if ( lon<=0 ) { MMG5_SAFE_FREE(pdel); return 0; } - /* if ( isbdry ) { */ - /* assert(longen%2); */ - /* //printf("MMG5_coquil %" MMG5_PRId "\n",longen/2); */ - /* continue; */ + /* if ( isbdy ) { */ + /* continue; */ /* } */ //assert(!(longen%2)); for (l=1; ltetra[iel]; - lon = MMG5_coquil(mesh,iel,iar,list); + +#warning isbdy is not used for now but should be used instead of test on MG_BDY points + int8_t isbdy; + lon = MMG5_coquil(mesh,iel,iar,list,&isbdy); if ( (!lon || lon<0) ) return 0; + + /* Skip edges along an external boundary (test on open shell) */ if(lon%2) return 0; i0 = pt->v[MMG5_iare[iar][0]]; @@ -4787,6 +4792,8 @@ MMG5_int MMG5_splitedg(MMG5_pMesh mesh, MMG5_pSol met,MMG5_int iel, int iar, dou return 0; } +#warning I think that this test is too restrictive: we should authorize splitting of internal edges connecting bdy points + /* Skip edge if it connects bdy point (edge can be internal or external) */ if ( (p0->tag & MG_BDY) && (p1->tag & MG_BDY) ) { return 0; } From fe18344558148412d4aaca9b6c013bf053f56757 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Wed, 30 Nov 2022 16:46:14 +0100 Subject: [PATCH 792/838] Replace too restrictive test on bdy points to detect and skip bdy edges at split step (leading to skip internal edges linking bdy points too) by a test on the edge (the shell of edge is travelled to detect all bdy edges). It modifies results in pattern mode (adaptation) and -lag option. Also fix an erroneous test on the fact that the edge belongs to an open ball to detect if it is a bdy edge (in delaunay insertion), which is not true for bdy edges at interface of two domaines. For now messages are printed to show if we pass through previous modifs. --- src/mmg3d/mmg3d1_delone.c | 19 +++++++++---------- src/mmg3d/mmg3d1_pattern.c | 21 ++++++++++++--------- src/mmg3d/mmg3d3.c | 22 +++++++++++++++------- 3 files changed, 36 insertions(+), 26 deletions(-) diff --git a/src/mmg3d/mmg3d1_delone.c b/src/mmg3d/mmg3d1_delone.c index 2f6786d73..603777996 100644 --- a/src/mmg3d/mmg3d1_delone.c +++ b/src/mmg3d/mmg3d1_delone.c @@ -207,23 +207,22 @@ int MMG3D_mmg3d1_delone_split(MMG5_pMesh mesh, MMG5_pSol met, * only non bdy edge are considered */ int8_t isbdy; ilist = MMG5_coquil(mesh,k,imax,list,&isbdy); + + if ( ilist > 0 && (!ilist%2) && isbdy ) { + puts("We were treating a bdy edge as a non bdy one"); + } + if ( !ilist ){ /* Unable to compute edge shell: treat next element */ return 0; } + else if ( isbdy ) { + /* Edge is bdy: skip it (we want to treat it from a bdy tetra) */ + return 0; + } else if ( ilist<0 ) { return -1; } - else if(ilist%2) { - /* Edge is bdy: we want to treat it from a bdy face */ - return 0; - } - -#warning FIXME - /* Edge is bdy: skip it (we want to treat it from a bdy tetra) */ -// if ( isbdy ) { -// return 0; - // } o[0] = 0.5*(p0->c[0] + p1->c[0]); o[1] = 0.5*(p0->c[1] + p1->c[1]); diff --git a/src/mmg3d/mmg3d1_pattern.c b/src/mmg3d/mmg3d1_pattern.c index a90cd1301..2ceb30cd4 100644 --- a/src/mmg3d/mmg3d1_pattern.c +++ b/src/mmg3d/mmg3d1_pattern.c @@ -116,18 +116,21 @@ static MMG5_int MMG5_adpspl(MMG5_pMesh mesh,MMG5_pSol met, int* warn) { else { /* Case of an internal face */ - /* Following test skip boundary edges but also, as side effect, internal - * edges connecting boundary points. - * For now there is no way to skip safely only boundary edges: - * - testing if edge shell is open will fail for bdy edge at interface of 2 domains - * - testing edge tag is not possible because we don't have a bdy face */ -#warning this test is too restrictive - if ( (p0->tag & MG_BDY) && (p1->tag & MG_BDY) ) continue; - + /* Skip only boundary edges but try to trat internal edges connecting bdy + * points */ int8_t isbdy; ilist = MMG5_coquil(mesh,k,imax,list,&isbdy); if ( !ilist ) continue; - else if ( ilist<0 ) return -1; + else if ( isbdy ) { + continue; + } + else if ( ilist<0 ) { + return -1; + } + + if ( (p0->tag & MG_BDY) && (p1->tag & MG_BDY) ) { + puts("I try to split an internal edge connecting bdy points"); + } o[0] = 0.5*(p0->c[0] + p1->c[0]); o[1] = 0.5*(p0->c[1] + p1->c[1]); diff --git a/src/mmg3d/mmg3d3.c b/src/mmg3d/mmg3d3.c index d673066cf..b5ed9f2e4 100644 --- a/src/mmg3d/mmg3d3.c +++ b/src/mmg3d/mmg3d3.c @@ -138,9 +138,7 @@ static MMG5_int MMG5_spllag(MMG5_pMesh mesh,MMG5_pSol disp,MMG5_pSol met,int itd /* Skip the non-internal edges */ if ( pxt && (pxt->tag[i] & MG_BDY) ) continue; - /* Skip boundary edges - WARNING: This also skips edges connecting two - * boundary points. */ -#warning too restrictive test + if( (p0->tag & MG_BDY) && (p1->tag & MG_BDY) ) continue; len = (p1->c[0]-p0->c[0])*(p1->c[0]-p0->c[0]) @@ -172,15 +170,25 @@ static MMG5_int MMG5_spllag(MMG5_pMesh mesh,MMG5_pSol disp,MMG5_pSol met,int itd p1 = &mesh->point[ip2]; /* Deal only with internal faces */ -#ifndef NDEBUG - if ( pxt ) { - assert( !(pxt->tag[imax] & MG_BDY) ); } -#endif int8_t isbdy; ilist = MMG5_coquil(mesh,k,imax,list,&isbdy); if ( !ilist ) continue; else if ( ilist<0 ) return -1; + else if ( isbdy ) { + /* Skip bdy edges */ + continue; + } + + if ( (p0->tag & MG_BDY) && (p1->tag & MG_BDY) ) { + puts("I try to split an internal edge connecting bdy points"); + } + + +#ifndef NDEBUG + if ( pxt ) { + assert( !(pxt->tag[imax] & MG_BDY) ); } +#endif o[0] = 0.5*(p0->c[0] + p1->c[0]); o[1] = 0.5*(p0->c[1] + p1->c[1]); From eb1cf80c4fd077c54a0727c37887c66c3bfa976f Mon Sep 17 00:00:00 2001 From: Corentin Prigent Date: Thu, 1 Dec 2022 15:59:26 +0100 Subject: [PATCH 793/838] Added dichotomy for vertices regularization in MMGS and MMG3D --- src/mmg2d/analys_2d.c | 25 ++++--- src/mmg3d/analys_3d.c | 157 ++++++++++++++++++++++++++++++++++++++---- src/mmgs/analys_s.c | 97 +++++++++++++++++++++----- 3 files changed, 235 insertions(+), 44 deletions(-) diff --git a/src/mmg2d/analys_2d.c b/src/mmg2d/analys_2d.c index 55512241b..e1b3ddbca 100644 --- a/src/mmg2d/analys_2d.c +++ b/src/mmg2d/analys_2d.c @@ -774,9 +774,8 @@ int MMG2D_regnor(MMG5_pMesh mesh) { static inline int MMG2D_dichotomy(MMG5_pMesh mesh, MMG5_pTria pt, MMG5_int k, double *c) { MMG5_pPoint ppt; - double mid[3],co[3][3],vol,to,tp,t; + double p[2],co[3][3],vol,to,tp,t; int it,maxit,pos,i,j; - const double s = 0.5; it = 0; maxit = 5; @@ -790,16 +789,20 @@ static inline int MMG2D_dichotomy(MMG5_pMesh mesh, MMG5_pTria pt, MMG5_int k, do for ( i=0 ; i<3 ; i++ ) { for ( j=0 ; j<3 ; j++ ) { co[i][j] = mesh->point[pt->v[i]].c[j]; - } + } } + /* initial coordinates of new point */ + p[0] = c[0]; + p[1] = c[1]; + i = 0; if ( pt->v[1] == k ) i = 1; if ( pt->v[2] == k ) i = 2; do { - co[i][0] = ppt->c[0] + t*(c[0] - ppt->c[0]); - co[i][1] = ppt->c[1] + t*(c[1] - ppt->c[1]); + co[i][0] = ppt->c[0] + t*(p[0] - ppt->c[0]); + co[i][1] = ppt->c[1] + t*(p[1] - ppt->c[1]); vol = MMG2D_quickarea(co[0],co[1],co[2]); @@ -1031,6 +1034,12 @@ int MMG2D_analys(MMG5_pMesh mesh) { return 0; } + /* Regularize vertix vector field with a Laplacian / anti-laplacian smoothing */ + if ( mesh->info.xreg && !MMG2D_regver(mesh) ) { + fprintf(stderr,"\n ## Problem in regularizing vertices coordinates. Exit program.\n"); + return 0; + } + /* Define normal vectors at vertices on curves */ if ( !MMG2D_norver(mesh,MMG5_UNSET) ) { fprintf(stderr,"\n ## Problem in calculating normal vectors. Exit program.\n"); @@ -1042,11 +1051,7 @@ int MMG2D_analys(MMG5_pMesh mesh) { fprintf(stderr,"\n ## Problem in regularizing normal vectors. Exit program.\n"); return 0; } - /* Regularize vertix vector field with a Laplacian / anti-laplacian smoothing */ - if ( mesh->info.xreg && !MMG2D_regver(mesh) ) { - fprintf(stderr,"\n ## Problem in regularizing vertices coordinates. Exit program.\n"); - return 0; - } + if ( mesh->nquad ) MMG5_DEL_MEM(mesh,mesh->adjq); return 1; diff --git a/src/mmg3d/analys_3d.c b/src/mmg3d/analys_3d.c index fa630f84c..0f6141f45 100644 --- a/src/mmg3d/analys_3d.c +++ b/src/mmg3d/analys_3d.c @@ -812,6 +812,140 @@ int MMG5_norver(MMG5_pMesh mesh) { return 1; } +/** + * \param mesh pointer towards the mesh + * \param pt pointer towards current triangle + * \param k number of current point + * \param c newly computed coordinates (giving negative area) +* \param n normal of triangle before regularization + * + * \return 0 if fail, 1 if success + * + * In coordinate regularization, performs a dichotomy between previous point / + * and newly computed point in the case of negative area of a triangle + * + */ +static inline int MMG3D_dichotomytria(MMG5_pMesh mesh, MMG5_pTria pt, MMG5_int k, double *c, double *n) { + + MMG5_pPoint ppt; + double to,tp,t,nnew[3],p[3],o[3],result; + int it,maxit,pos,ier; + + it = 0; + maxit = 5; + to = 0.0; + tp = 1.0; + t = 0.5; + pos = 0; + + ppt = &mesh->point[k]; + + /* initial coordinates of point before regularization */ + o[0] = ppt->c[0]; + o[1] = ppt->c[1]; + o[2] = ppt->c[2]; + + /* initial coordinates of new point */ + p[0] = c[0]; + p[1] = c[1]; + p[2] = c[2]; + + do { + mesh->point[0].c[0] = o[0] + t*(p[0] - o[0]); + mesh->point[0].c[1] = o[1] + t*(p[1] - o[1]); + mesh->point[0].c[2] = o[2] + t*(p[2] - o[2]); + + ier = MMG5_nortri(mesh, pt, nnew); + MMG5_dotprod(3,n,nnew,&result); + + if ( result <= 0.0 ) { + tp = t; + } + else { + c[0] = mesh->point[0].c[0]; + c[1] = mesh->point[0].c[1]; + c[2] = mesh->point[0].c[2]; + to = t; + pos = 1; + } + + t = 0.5*(to + tp); + } + while ( ++it < maxit ); + + if ( pos ) { + return 1; + } + else + return 0; +} + +/** + * \param mesh pointer towards the mesh + * \param v list of vertices of current tetrahedron + * \param k number of current point + * \param c input : newly computed coordinates (giving negative area), output : coordinates after dichotomy + * + * \return 0 if fail, 1 if success + * + * In coordinate regularization, performs a dichotomy between previous point / + * and newly computed point in the case of negative volume + * + */ +static inline int MMG3D_dichotomytetra(MMG5_pMesh mesh, MMG5_int *v, MMG5_int k, double *c) { + + MMG5_pPoint ppt; + double p[3],o[3],vol,to,tp,t; + int it,maxit,pos,i,j; + + it = 0; + maxit = 5; + to = 0.0; + tp = 1.0; + t = 0.5; + pos = 0; + + ppt = &mesh->point[k]; + + /* initial coordinates of point before regularization */ + o[0] = ppt->c[0]; + o[1] = ppt->c[1]; + o[2] = ppt->c[2]; + + /* initial coordinates of new point */ + p[0] = c[0]; + p[1] = c[1]; + p[2] = c[2]; + + do { + mesh->point[0].c[0] = o[0] + t*(p[0] - o[0]); + mesh->point[0].c[1] = o[1] + t*(p[1] - o[1]); + mesh->point[0].c[2] = o[2] + t*(p[2] - o[2]); + + vol = MMG5_orvol(mesh->point,v); + + if ( vol <= 0.0 ) { + tp = t; + } + else { + c[0] = mesh->point[0].c[0]; + c[1] = mesh->point[0].c[1]; + c[2] = mesh->point[0].c[2]; + to = t; + pos = 1; + } + + t = 0.5*(to + tp); + } + while ( ++it < maxit ); + + if ( pos ) { + return 1; + } + else + return 0; +} + /** * \param mesh pointer toward a MMG5 mesh structure. * \return 0 if fail, 1 otherwise. @@ -968,12 +1102,6 @@ int MMG3D_regver(MMG5_pMesh mesh) { ier = MMG5_nortri(mesh, pt, n); - if ( !ier ) { - fprintf(stderr,"\n ## Error: %s: Unable to compute normal vector.\n",__func__); - MMG5_SAFE_FREE(tabl); - return 0; - } - for (i=0;i<3;i++) { tnew.v[i] = pt->v[i]; } @@ -987,8 +1115,7 @@ int MMG3D_regver(MMG5_pMesh mesh) { ier = MMG5_nortri(mesh, &tnew, nnew); MMG5_dotprod(3,n,nnew,&result); if ( result < 0.0 ) { - // changement d'orientation, faire la dichotomie - noupdate = 1; + if (!MMG3D_dichotomytria(mesh,&tnew,k,c,n)) noupdate = 1; continue; } } @@ -1018,7 +1145,7 @@ int MMG3D_regver(MMG5_pMesh mesh) { result = MMG5_orvol(mesh->point,v); if ( result <= 0.0 ) { - noupdate = 1; + if (!MMG3D_dichotomytetra(mesh,v,k,c)) noupdate = 1; continue; } } @@ -1293,6 +1420,12 @@ int MMG3D_analys(MMG5_pMesh mesh) { if ( abs(mesh->info.imprim) > 3 || mesh->info.ddebug ) fprintf(stdout," ** DEFINING GEOMETRY\n"); + /* regularize vertices coordinates*/ + if ( mesh->info.xreg && !MMG3D_regver(mesh) ) { + fprintf(stderr,"\n ## Coordinates regularization problem. Exit program.\n"); + return 0; + } + /* define (and regularize) normals */ if ( !MMG5_norver(mesh) ) { fprintf(stderr,"\n ## Normal problem. Exit program.\n"); @@ -1304,12 +1437,6 @@ int MMG3D_analys(MMG5_pMesh mesh) { return 0; } - /* regularize vertices coordinates*/ - if ( mesh->info.xreg && !MMG3D_regver(mesh) ) { - fprintf(stderr,"\n ## Coordinates regularization problem. Exit program.\n"); - return 0; - } - /* set bdry entities to tetra and fill the orientation field */ if ( !MMG5_bdrySet(mesh) ) { fprintf(stderr,"\n ## Boundary problem. Exit program.\n"); diff --git a/src/mmgs/analys_s.c b/src/mmgs/analys_s.c index 2e91f8b6c..0a12d6107 100644 --- a/src/mmgs/analys_s.c +++ b/src/mmgs/analys_s.c @@ -737,6 +737,74 @@ static int norver(MMG5_pMesh mesh) { return 1; } +/** + * \param mesh pointer towards the mesh + * \param pt pointer towards current triangle + * \param k number of current point + * \param c newly computed coordinates (giving negative area) + * \param n normal of triangle before regularization + * + * \return 0 if fail, 1 if success + * + * In coordinate regularization, performs a dichotomy between previous point / + * and newly computed point in the case of negative area + * + */ +static inline int MMGS_dichotomy(MMG5_pMesh mesh, MMG5_pTria pt, MMG5_int k, double *c, double *n) { + + MMG5_pPoint ppt; + double to,tp,t,nnew[3],p[3],o[3],result; + int it,maxit,pos,ier; + + it = 0; + maxit = 5; + to = 0.0; + tp = 1.0; + t = 0.5; + pos = 0; + + ppt = &mesh->point[k]; + + /* initial coordinates of point before regularization */ + o[0] = ppt->c[0]; + o[1] = ppt->c[1]; + o[2] = ppt->c[2]; + + /* initial coordinates of new point */ + p[0] = c[0]; + p[1] = c[1]; + p[2] = c[2]; + + do { + mesh->point[0].c[0] = o[0] + t*(p[0] - o[0]); + mesh->point[0].c[1] = o[1] + t*(p[1] - o[1]); + mesh->point[0].c[2] = o[2] + t*(p[2] - o[2]); + + ier = MMG5_nortri(mesh, pt, nnew); + MMG5_dotprod(3,n,nnew,&result); + + if ( result <= 0.0 ) { + tp = t; + } + else { + c[0] = mesh->point[0].c[0]; + c[1] = mesh->point[0].c[1]; + c[2] = mesh->point[0].c[2]; + to = t; + pos = 1; + } + + t = 0.5*(to + tp); + } + while ( ++it < maxit ); + + if ( pos ) { + return 1; + } + else + return 0; +} + /** * \param mesh pointer toward a MMG5 mesh structure. * \return 0 if fail, 1 otherwise. @@ -783,12 +851,12 @@ int MMGS_regver(MMG5_pMesh mesh) { tabl[iad+0] = ppt->c[0]; tabl[iad+1] = ppt->c[1]; tabl[iad+2] = ppt->c[2]; + if ( !MG_VOK(ppt) ) continue; if ( ppt->tag & MG_CRN || ppt->tag & MG_NOM || MG_EDG(ppt->tag) ) continue; iel = ppt->s; - if ( !iel ) continue; // Mmg3d - + pt = &mesh->tria[iel]; i = 0; if ( pt->v[1] == k ) i = 1; @@ -827,8 +895,7 @@ int MMGS_regver(MMG5_pMesh mesh) { if ( ppt->tag & MG_CRN || ppt->tag & MG_NOM || MG_EDG(ppt->tag) ) continue; iel = ppt->s; - if ( !iel ) continue; // Mmg3d - + pt = &mesh->tria[iel]; i = 0; if ( pt->v[1] == k ) i = 1; @@ -869,12 +936,6 @@ int MMGS_regver(MMG5_pMesh mesh) { ier = MMG5_nortri(mesh, pt, n); - if ( !ier ) { - fprintf(stderr,"\n ## Error: %s: Unable to compute normal vector.\n",__func__); - MMG5_SAFE_FREE(tabl); - return 0; - } - for (i=0;i<3;i++) { tnew.v[i] = pt->v[i]; } @@ -888,8 +949,7 @@ int MMGS_regver(MMG5_pMesh mesh) { ier = MMG5_nortri(mesh, &tnew, nnew); MMG5_dotprod(3,n,nnew,&result); if ( result < 0.0 ) { - // changement d'orientation, faire la dichotomie - noupdate = 1; + if (!MMGS_dichotomy(mesh,&tnew,k,c,n)) noupdate = 1; continue; } } @@ -1076,6 +1136,12 @@ int MMGS_analys(MMG5_pMesh mesh) { return 0; } + /* regularize vertices coordinates */ + if ( mesh->info.xreg && !MMGS_regver(mesh) ){ + fprintf(stderr,"\n ## Coordinates regularization problem. Exit program.\n"); + return 0; + } + /* define normals */ if ( !mesh->xp ) { if ( !norver(mesh) ) { @@ -1089,13 +1155,6 @@ int MMGS_analys(MMG5_pMesh mesh) { } } - /* regularize vertices coordinates */ - //if( !mesh->xp ){ - if ( mesh->info.xreg && !MMGS_regver(mesh) ){ - fprintf(stderr,"\n ## Coordinates regularization problem. Exit program.\n"); - return 0; - } - //} return 1; } From 51ee0ffc35a0da912d78c7fce60fddd55d9566a9 Mon Sep 17 00:00:00 2001 From: Corentin Prigent Date: Thu, 1 Dec 2022 16:53:27 +0100 Subject: [PATCH 794/838] Added Ci tests for coordinates regularization for MMGS and MMG3D --- cmake/testing/mmg3d_tests.cmake | 11 +++++++++++ cmake/testing/mmgs_tests.cmake | 10 ++++++++++ 2 files changed, 21 insertions(+) diff --git a/cmake/testing/mmg3d_tests.cmake b/cmake/testing/mmg3d_tests.cmake index 4f25decdb..53cfdd555 100644 --- a/cmake/testing/mmg3d_tests.cmake +++ b/cmake/testing/mmg3d_tests.cmake @@ -696,6 +696,17 @@ ADD_TEST(NAME mmg3d_OptLs_plane_rembub2 -sol ${MMG3D_CI_TESTS}/OptLs_plane/bub.sol ${CTEST_OUTPUT_DIR}/mmg3d_OptLs_plane-rembub2.o.meshb) +# xreg +ADD_TEST( NAME mmg3d_CoorRegularizationCube + COMMAND ${EXECUT_MMG3D} -v 5 -nr -xreg + ${MMG3D_CI_TESTS}/CoorRegularizationCube/cube + -out ${CTEST_OUTPUT_DIR}/CoorRegularizationCube.o.meshb) + +ADD_TEST( NAME mmg3d_CoorRegularizationRandomCube + COMMAND ${EXECUT_MMG3D} -v 5 -xreg + ${MMG3D_CI_TESTS}/CoorRegularizationRandomCube/cubeRandom.mesh + -out ${CTEST_OUTPUT_DIR}/CoorRegularizationRandomCube.o.meshb) + # Preservation of orphan points ADD_TEST(NAME mmg3d_OptLs_temp_orphan COMMAND ${EXECUT_MMG3D} -v 5 -ls diff --git a/cmake/testing/mmgs_tests.cmake b/cmake/testing/mmgs_tests.cmake index 1e210d6dd..835a26bbe 100644 --- a/cmake/testing/mmgs_tests.cmake +++ b/cmake/testing/mmgs_tests.cmake @@ -245,6 +245,16 @@ ADD_TEST(NAME mmgs_OptLs_teapot-nsd3 ${MMGS_CI_TESTS}/OptLs_teapot/teapot ${CTEST_OUTPUT_DIR}/mmgs_OptLs_teapot-ls-nsd3.o.meshb) +# test xreg option +ADD_TEST(NAME mmgs_CoorRegularizationCube + COMMAND ${EXECUT_MMGS} -v 5 -xreg + ${MMGS_CI_TESTS}/CoorRegularizationCube/cube.mesh + -out ${CTEST_OUTPUT_DIR}/CoorRegularizationCube.o.meshb) + +ADD_TEST(NAME mmgs_CoorRegularizationRandomCube + COMMAND ${EXECUT_MMGS} -v 5 -xreg + ${MMGS_CI_TESTS}/CoorRegularizationRandomCube/cubeRandom.mesh + -out ${CTEST_OUTPUT_DIR}/CoorRegularizationRandomCube.o.meshb) ############################################################################### ##### From 87020ba6d7c8d396daa8ac939fe63d01dcbbebf8 Mon Sep 17 00:00:00 2001 From: Corentin Prigent Date: Thu, 1 Dec 2022 17:07:38 +0100 Subject: [PATCH 795/838] Modified ci_tests for MMG2D --- cmake/testing/mmg2d_tests.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/testing/mmg2d_tests.cmake b/cmake/testing/mmg2d_tests.cmake index 4b9f0ea11..725cef658 100644 --- a/cmake/testing/mmg2d_tests.cmake +++ b/cmake/testing/mmg2d_tests.cmake @@ -640,19 +640,19 @@ ADD_TEST(NAME mmg2d_LSMultiMat_withMetAndLs ${CTEST_OUTPUT_DIR}/mmg2d_LSMultiMat-withMetAndLs.o.meshb) # ls discretisation + xreg -ADD_TEST(NAME CoorRegularization_apple +ADD_TEST(NAME mmg2d_CoorRegularization_apple COMMAND ${EXECUT_MMG2D} -v 5 -ls -xreg ${MMG2D_CI_TESTS}/CoorRegularization_apple/apple -out ${CTEST_OUTPUT_DIR}/CoorRegularization_apple.o.meshb) # ls discretisation + xreg + nr -ADD_TEST(NAME CoorRegularization_appleNR +ADD_TEST(NAME mmg2d_CoorRegularization_appleNR COMMAND ${EXECUT_MMG2D} -v 5 -ls -xreg -nr ${MMG2D_CI_TESTS}/CoorRegularization_apple/apple -out ${CTEST_OUTPUT_DIR}/CoorRegularization_appleNR.o.meshb) # ls discretisation + xreg + nr + check of negative areas -ADD_TEST(NAME CoorRegularizationNegativeArea +ADD_TEST(NAME mmg2d_CoorRegularizationNegativeArea COMMAND ${EXECUT_MMG2D} -v 5 -ls -xreg -hmax 0.1 ${MMG2D_CI_TESTS}/CoorRegularizationNegativeArea/CoorRegularizationNegativeArea -out ${CTEST_OUTPUT_DIR}/CoorRegularizationNegativeArea.o.meshb) From 16509b0267d12c4db49be60ed7bb624779d28bf7 Mon Sep 17 00:00:00 2001 From: Corentin Prigent Date: Mon, 28 Nov 2022 17:50:29 +0100 Subject: [PATCH 796/838] Modified headers for API integration --- src/common/mmg_export.h | 2 +- src/mmg3d/mmg3d_export.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/mmg_export.h b/src/common/mmg_export.h index 1c7c5bd1f..2b17c70f3 100644 --- a/src/common/mmg_export.h +++ b/src/common/mmg_export.h @@ -24,7 +24,7 @@ #ifndef MMG_EXPORT_H #define MMG_EXPORT_H -#include +#include "mmgcmakedefines.h" #if(MMG_DYN_LIB) # if defined(_WIN32) || defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(__TOS_WIN__) || defined(__WINDOWS__) diff --git a/src/mmg3d/mmg3d_export.h b/src/mmg3d/mmg3d_export.h index 867cbf8d7..08a3ac05f 100644 --- a/src/mmg3d/mmg3d_export.h +++ b/src/mmg3d/mmg3d_export.h @@ -24,7 +24,7 @@ #ifndef MMG3D_EXPORT_H #define MMG3D_EXPORT_H -#include +#include "mmg_export.h" #if defined(libmmg_so_EXPORTS) || defined(libmmg3d_so_EXPORTS) # define LIBMMG3D_EXPORT MMG_DECL_EXPORT #else From 8f389232e034bf9b41147c3a93b037d5a12875af Mon Sep 17 00:00:00 2001 From: Corentin Prigent Date: Thu, 1 Dec 2022 18:25:16 +0100 Subject: [PATCH 797/838] Revert "Modified headers for API integration" This reverts commit 14ffd9c66f89a5946c184fb2d20806e01060ca54. --- src/common/mmg_export.h | 2 +- src/mmg3d/mmg3d_export.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/mmg_export.h b/src/common/mmg_export.h index 2b17c70f3..1c7c5bd1f 100644 --- a/src/common/mmg_export.h +++ b/src/common/mmg_export.h @@ -24,7 +24,7 @@ #ifndef MMG_EXPORT_H #define MMG_EXPORT_H -#include "mmgcmakedefines.h" +#include #if(MMG_DYN_LIB) # if defined(_WIN32) || defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(__TOS_WIN__) || defined(__WINDOWS__) diff --git a/src/mmg3d/mmg3d_export.h b/src/mmg3d/mmg3d_export.h index 08a3ac05f..867cbf8d7 100644 --- a/src/mmg3d/mmg3d_export.h +++ b/src/mmg3d/mmg3d_export.h @@ -24,7 +24,7 @@ #ifndef MMG3D_EXPORT_H #define MMG3D_EXPORT_H -#include "mmg_export.h" +#include #if defined(libmmg_so_EXPORTS) || defined(libmmg3d_so_EXPORTS) # define LIBMMG3D_EXPORT MMG_DECL_EXPORT #else From b1d68042fd8fd372287c4771389a5d4ac1f9af37 Mon Sep 17 00:00:00 2001 From: Corentin Prigent Date: Mon, 5 Dec 2022 16:00:56 +0100 Subject: [PATCH 798/838] Requested fixes for PR: cleaning unused variables, updated manpages, improved readability, minor bug fixes --- doc/man/mmg2d.1.gz | Bin 2296 -> 2318 bytes doc/man/mmg3d.1.gz | Bin 2473 -> 2495 bytes doc/man/mmgs.1.gz | Bin 2229 -> 2251 bytes src/common/mmgcommon.h | 1 + src/mmg2d/analys_2d.c | 11 +++++------ src/mmg2d/boulep_2d.c | 4 ++-- src/mmg3d/analys_3d.c | 23 ++++++++--------------- src/mmgs/analys_s.c | 17 +++++++++-------- 8 files changed, 25 insertions(+), 31 deletions(-) diff --git a/doc/man/mmg2d.1.gz b/doc/man/mmg2d.1.gz index 6eb8f7e7ef92b4ebfa9e890f028bb78f9bc8bbb2..24740c8687443b33c45b2ee3036d9849e7d3ad7f 100644 GIT binary patch literal 2318 zcmV+p3GwzHiwFR>1&(6?1Fcx=ZW}ii{y$Ga1lV00uw~h9fJM4pK(^&X3*8{e%^C<$ zP%|8f=*)0JawIF*7wU8L#r8WS=OV{$12h2w56Q#Bb3flv@6#Lh(|7zA^}vv=w$iXv zW`f~w$+cxFWp*oAo^O~@soirea1j5>H-e=~yF)9i=39|yo_RL8Fk6?A&Aqe4s0&e>>k!%iLwxf9w*`}=P!5$s0kMDXhA6zAjrjK?6DPi{}o z*j2y(!#Q*O!dsAxgw{ed624;xRk4^COp8PstL3_~(8)4hBo~m{$#%eo=TQ}js8!Lq zsg-^|ePCl@49?z*LO?w>uhyB2*;vM+FoJPdiFORM_pH_jclDmcS=I)-S9rl0;*1H2 zbIqKxs$kdkV}a!vQ`&Pn;g;0UOqF!=6tW*!#%+7~Yb&(MCQKHN?^cyiYYS#je=oC) ztp%%$NUQ9Ofs%b3tv<{iR-Vsb`p7;G7K_1j_4p&m?N)(A?1X0~^D>j*4XrdU?16-z z3>UW_KtH${jYq4;M*jQJYC2pl+5K$625df9tVXvF9~Sf3a@b=_A^zCTo>6V= z)Hx33OoZh!GadCG;cf#_vxIH=PQdN4Ks+Ukvlub=rw%=S2tm@l@tW^5RcxGzob^v+ z;ki)y7k37hZ(>;FIreEAj|mQ5z_ukP4o)SDTS?+WrSw`@9?45QvOueYWN8zj86 zE_=LZkPf;0;y0k*S|&1wrLcsPsPqWqSS=r?v-xtg?6MmuHqegf7gy#6aQ&>LJ;Zrg zS-0!9?lY8=jQI=ra&|kqbWg8YR)?KXdUY1_yzFKzS6Brol6G=Ftpi_b3{={$B@^*ZC57u3(p z5mBKe!d}~UovWQ_S7y)4&Z^RBXC=Qtl4h;Nrv85Fd>4&=T`^Qytdm2#LX_2u>tupH zVvjB%!0v|2+r?j>A6aaW zil&Ti4s|3@`9}HGu!T=)qW)a*Ori|CDx`%eMQrH}X$|VXv=T4CCIZaXI-27$9!J&U zAzodvI&+PYlFYQ6!Gyj`FpW_)AUg3e41J_fiJ;=^To?K7gld?ny`gL3iFB711;%kg z7j|s}TP#sImxY(+V`wf%l2|fhWBx90r`EUX?|N0x-w_5Qz-hO$$z(9SW8=|u$Oen| z50l|^g&F||hE5A5wQKFEa!S36dN&z67e$4D7}?1614taG!?8tdpYLS?LEeC>Q$L;; zk2mbR5Qd`RJXSftl#RlLEnFlE%eEpbd-djyc(|BbRfS*~nsG*T4{DV$nfVb1eBvic)FuuPNn$Mn@@jl9?qMGmnd_nAu@O7 zL=QeVgTm4gT`Z!>&A|%uEswnI|BXIFU$V-AWw|{V-EK~F*P%cLZ0ung)oVZXDPu6EB z>$!wJ^$})-CAWDaw+=$p_I@Lk>U3@RnwEZ;xd6JShbUGXeB2G9zZ^xr2ORadQGwpp z)|vpxJvrqd=sW$7Zp_^Bl`F4^6pa-+gwN+QAE@Ur84w|Xk22#iiW|&CaT z=KJ<7V5toS8F?*@aslr|d5TW@y*@HJtiS}wmzAy)iR85P;=IY1@9CdGG%TEfcmcVr zCQN*?|GM*>Hfni*b%d@~TeOy~!f-(&2wa@G83et?K~TWME!QPWVTKBnoil_0UiaNR zl=uMA988*^N9E62R88g~n1sk)B6H>H1Dz4xI$Kp{&Y3xUiwLXpi5e_H4#DTCXeHoqQ>_QNxWE3nwVFiHCeycDz?GRWwg@opDooSfn2p939 z4(Q9CIDh+kNY^tLIA$R$99uz=LX@#83dBc1gMO|{g%+^AiE1`f@SeA(;{w=*Y(TDa z#GcSQs+Cl_MY8dD&4VGZaXuvJ_9`H;=BEyWhgvZj&J7lyDpo3LaefWcTqGhBM=lFM zy&=_tIxLa26b`O~qK>HUk3^=!$$@;(krHG#N1SG|EW63n0RE}NhJ=Q~Q0R0bh=T7n zJe)-!qi*+hq)puE=5A=1DoqK8PeSJPuvr;OhKy5Hrz(GrT3}_nHn~E?bp>=&$Io~| zJi+a*0iaZxzs@*}Fdm)p0Etbt_HK1$80q^I;8~{|HZ5nrl`*OW-37jG@0xC05eT19 z1PA2pTG_XPZO^1LJ2`0s`trZSxgRwAxw~1n`s=%1H1Y|Cx`K|lcem)Jt2m|w)x%=Sejbb;hTWePv_Ro+K-{{@kQqm< zC?d)Gb&X76?HDm<(klD0IlgR<{p6*H1d%T@_d6ZoVec-gAm~K76TM|{^#=?{Gcfpv oZCT_Ei(aGPa)_B|yqrb7|7z0hI-#k+e;a)MA7y!3u67mx0P~@HPXGV_ literal 2296 zcmVpwlXmy4Qw)Lx0LBbtyL_X(s?iJ z-{|6C)Mo4GBtE54Zj_*N8cnY0Vp{SPIQuC+;|D4$MoKK{pe41(F@=JbrN z`u(5I$@8n;f@CbTk+PBSJsosOvB=5DL|JFls&vrFk;sz^NbO}iU?cD-^F-FFn9SBn zf0#bdSXzs-4>Fffk7ng6RWXfKEORSKz)HMhp?zSrI{2%1EY6}f*qz1;-VkRb70wNL zWpz$(>&GgVXQWNwbRrz9VMrHz^AxflC>5@~{H+yQWfM}l=eyMf)Y^g>)ZeQ#rIn=8 z%5|BZ5h&@?X!-H}VHx-grjPV#FrN>m%g3KV?zS2vawh{bl@+N1Z)jyi?hY*cWH`V1 z2>QYGXgpdzHuB$%meb*4L3j6a8qjPoUyg1b#)CP{9_F+A#jr;UDSzM2fl+PjwRarM znMfy8YCGyb!rd04rU`AuPQvZ6L_8%VC`Qcvp+k=!LXdQCyyp8<=NoS#Z~YUM2QHjG zmTvB6kE7{_-WVnr&OOU&>$FFsHRal!k(Dys`PXt5}-o0h{t|0$nOVhz*81<%Ey){i}kch(h>BwRoJ~&laOam)$_qz<8oxeVH4;_4ftuA^EP zCzfqFg9(2ZU>c)RKy>C~3B4oNiR6Oo-4%t7gbJAIz2$52iFH>FMa6SM=k=`uTa@Tb zs60sXscI-kk~lVFWBx90uh#eK@B34wzbCAW0H@vDPbP!uEsaOhAr0mq9wx)-5_JI% zthy_dG`^j$wO8tW)VogUT;?SLV&o#<10ZolT^&2b^Z8yS5abQ0IyK{Y!FWUGxwIS& z=dsQJpj=d4*uq6BceIsh(W^Ii%)`grvdkr=Xuv7gIyC+jg4`W~IhW!$xCd3E#GjRP zdx<`Me(B5PW#1QbCc~fGDxf?q!qXoOGcLcM-+caa^KjNYyg+F~-B6h~C;INe8x)p~ z_+lPSt`APy?|I~1|4;l`^&+PoSQguZMSe8A(Tn!dLpI6Rg@I3MGAL3YTFmX4C{_iLXb^oZZjdJv}w$@ZIJdkq^ zg1*!9_{P0ozH;Rik)p9iR|xrh76SDgCIbp&z)_?kMsb6gn7oa$&^Dj-%nqk&2FW`N zE4NnWoM83LoOIGuOC{HXu_30#J z&oBK5!^~x~yo^rSWLM3`RRo;q$FZs)@)v_Pu>(-%+NcvuX79gYW!h=o_t%F-WMD5y-o&w2mi&HIFEvSwU5`;{^0D((`Ckw-kEy4WOv2 z3NrFqS?vSfi}Dnm^m~0|bhQE#pj|3_Cz8o&>&01hgJ_t01Bo1RIm0;kWdCjF zIc?Mmpy~)wEw^YbTaAH&#}2qS^>YV$jfb6pgj-<>TEh$_C_85e0lXf%c~#;oSmvS8 z1U)Ky)}m^%0Mi0lQ+mH4t6-ZayFuVPOkyw5)i|yuge6j6u0HaKHtV&Y2}B;tx_|mX zI6ZL4GO$7*(?)8x+2Ich{bWsW`}2m4y z*F(CVv%oQ}vcj{K94Sm0>pVw%RA?~Fa%*WMY;U8Q4HvxUt?9S`wjo;~*BN3@njP0l zF5NQO1iTi&5ZHJhvUGc0A+hG?4U30bF&fSd{+?7?~HnWpMR73|KQT_={^fAJ|wJgSC&M5V#(j zSL;m1Y%F6@7{NHaL^B4r_o~(hxAmUPS=J7_S2)2r;(`f(iFM7~WmUo6)rSR@7ffld z>5N;thGwdyo#(Lqz%p*z&Ck8iUN&K}aC*0@#I?3ihU@QTma(;9l@V!`T`)+p&!g3+ z*~7}~8B8D9=fPqzn64gwgt*-*h=`r=%4A+<61s6K%?o=V<0r$#?I*|&ZbswL>anr^ zezcknmrHhkKU=T?n-3PN(e1-{uwe6t#eB9L_SjO0-}bXtR69F$4+nQ9!g86J&h;Ph z+y~=PP98Ev= z#&E%K;Z%mH^Bx}T zWR}zcs4>umhs+LiK)|vgrveMzi<5y3HVAgAz#f^pIN@dg$<_YU?iw`@9?45QvOucxL78zj86E_(dSARKb}%}?Nd zyqkZ2eCi=F2h|vuPgKqk3$!4MP0yXOe4Nha%h9rX(m=6+c4EJ{3^)KPW+lxb1j@>~ zSvPf`A=6~cZ@`yx>CvWpGQ_f4CHx+ru5as)U9%&|7aggjk)qrh=0wV?%+|v}{lRrm z@B{_yKQvY7=C~X_XqVe*{`Atck>6gL=9Ni*UYg%%{_4CIUtd_#dF-a@u_}voa;Qfc z-@M?A%p7egR4VdzAQ3Fuw&PswL_0EjUUo*6PCFy{4MsL&EjIP{Q|G%dNoy=1cr-wm zH{;k+@_%l=E{-Mv!@J?~b}^c-Mzd+O+KLVuc}eK?7^l3BGKLWnnpH<|*P_AojY1}W zqKom^r?4H6nTrq+NSnSOiv%HH%IM}$1IbWjD1}CTMM`;AyA4$mD#w}*k5yqcz)xAF zIjk(TdXjlv>eo7&YqgUJ>_T{Y{JXq(;c76&v+;R}4x=mKyVSzONKm*W9t0^AC96=0 zFwZq+C`j3*L4>)WBAXE6v_^^$DwSw|ig-u1Dq^2SY><>*AlHcUn`zT)Kynj;E+pdEO^0klu=w~e z8BSNgI^Y_JiE-cp6H1kH*@viild(%tR0xrgja>P}c|kfXTSWNfUM9Ha8%T9>>S;oK z!!8S92>X|@%E3L8>jWBqnbwGOd+?97;=ckT0V-=@_W~5>^4bN?b>G!N62qT6A0=KE z{&P#ioGRCsH(&nR9Go`?F99~>RRjb*7AVWXJr~|2qK!o~xj9&2{>UNk`+uR&fMu&J zRF>O=L2NddHt*#2fl$f(yU~@xDXm`9 z$`3OKpnE!qBB4!59T5F#6#2S%RQE>(>ODgg^I{Xip)sE#9P%AbKs#n`_{x@7Op3+| zRnupS3!-ObhHRRD3wQ?6c%0)}lzCcl!YMkMLi<*96oh9D?wnwB;!bu}KZ6VffH$1$ z{CoO3)O8mnV-9vuY~V0|$)@NrvdVcCh=mW2t;dOLQ{(9R?yp2Gy zT_+ndB7G6xRhZ#4PQa*Yx zxz-$UmsiG8GnG08aNTJ*4mRh(yx2s^8M>ruL&G9X2GL@(ViWrwib+`iI@Xb zLhmRGwn;hjjM5V+#Ep9gI%2N^i)$#OL1e)fsn7xs+-Udx#+`Cz0@~O=$z6hqeMob} zMnT1YQe-}hkY?~pbQQJt7_+Vbep(S>Rl@}MO)!I z6{?H6Zrm$F@sM#!`BVZf5iVA?W0Na@u4|xw>&1S?5#kAebJYP(H-BDn;bYxXHy+ry zsn+3#1Ip2e;HSXdI;FCyNBgaekwR!M*mt|vbfDREh5j5@e?29ysUisT8t%k-{>@7o z_-(O(+Orpm80F=r#VK~2bnLMb!{4yJ#!+2|;teq-tSiqnqb=;xV# zx~(9SDtm%V-wy|>?rG>rO;^aXovQB))580SUfI934W0AycDB0x6xHSVC3hXw{2+ho zF8}LMfPJhiUba?AHQg8cx)RfWbV-Zh>R~ZuKM%$a!|sntTA;)=bah>22=k+&8__BK zI_IZ=PK*FDX_fuhEMK?FzE4&pf-sgpnfn2kn7_v!b;8ueyO(Gcy!{OYbXh3)n{8F( mjf!4#!Q~L$-*`ETdjHmRH$&}@|9p#vDf&Nc5u~V(7ytl6W0wH{ delta 2323 zcmV+u3GDX26R8sjABzY84a|LCkq99lrUn8Ws9ml^-0pHiawRM13*B?vi}f3l`$MvQ zcR&-7NHPJ!k$X9R+pjDU>_+KC@apLt>*Ifo#}JrLZqF~++kXFtOXl>2vtSt+t%YbT z{J;*XVlgk67Kt=g%XMXOC(C$|T)}E*+W`|^M^z-EzKYIGed&+W2R0VQVC|zQ1g^*C z)jE?g8_QS}MlcR9(Tu_Ey{h%WZM`RRmbJs~6;5!DxL`tmVqG(LSyixi^mra-~oZhV}ajh+s;re@-Wo#{2WkgzK7Yvf@^Jw*H z_OSAL2Gd9Od9YXvrmM#vA#S${B4Q`JGMSf|gl^nQ^THm;_{nf_`w8-co6&f*dTi{! zAFZat<&xch&lYUJ=7Ys*bo($KEZF>EF`q4mJ+>6$_xA6sk74_8slY<_;$&ch4T7C2ut%mYPIw%P(vn>6BjS>#1qN1_>{%iyr?n2!~vL^Aorq z@8%zWpL$5lK{W>E6P0ts0xig5({raRAE&eVa)ZNc*X#)LMMo-Wq$szBIg#=zv-NOLe{dZX zJV62bFHIG?IWC6}+U0hdKfN?<cXmz`0i)6PhKgOSZxi%s)wlGZ@L?r4C}ZpN{t zg#X-RT^vmUdUwO+?P4@vjb_tmwG|x%@{$niaZR}#r3)h@F{_Rsu0@088-?scm*KI0 zPg^^nF&7~UkScu<771W)%IM}$gU3)cD1}B&MH+cluMJfXD#4l#k5yqc08g2uIjk(T zdXjlv-q$*sYqgUJ>_SL-%)4B8;p#5Mu<^Nw4x=mKyVSzONJ_XQ9sy|+WvWn#FwZq+ zC_>q#K~%XwBAXD_v_^^$9+hYccSp8=Dq^2GY><>*AlHcUn`zT)KXVU;E+pdEO^0l-`1mlBumlG< z$cS;^0{cmobJ>TecayP8QB(+#k&Rr*#CbtFEL%kN$| zvC6?WlkWr?f0NdTZhP>Lwc@`3BLOOFVfO;G=JMJF&UN3_J`%&9J0B%p7XEWf!36K!ZBPy+qq-67qy1J_xtoYQA`op+)E=GlN0zzHxmIsDp*$=3j5AtC@r70ghm9N zqBGG5Z~z?1z&+2I1FCqkpeF>ro=acn9=`}WdN%Lm_JL5nlfMNRf8QwbweYCcj|$Xy zhA8I6CWJ#{K1Dd>J3N4P%-rymEw7jqjTI`T&lVR%$;u4bG#Bs;qVYJ#wJ7sc;)F+Z zG=-L}=qL!!8r(U-=)|4utbPU=3IK0-*7^7Jb*SYoO2!UQ-fQO>wxQwox z{jATcPH=$!oZwwZVvfmXZjHDpBkB96;9&wF?>;Ugfd5X^Zy*?s3jGzR~0V`eY6Ulk|e~R-aUcTr145DG-9K?%I zC=NcvPwLuvb1hFak67kvi^8>4=)b6{;E6NWrU_qsF=e(~mn?-FDoA$L00ErtnR!U@ zfvP&XI6(!>PYPfy=BcX}Yf|qsu|Q>=*e!r>(YU@OS99B1u%SGkXhrEXbuAPxz<%oD z(PczU=RuS1e;0-9Kwz%dH$ss&4}Vw!CMg3TPD@S0v7gyT3&+W)%e!9}XQ@^>2*=k- zYTyDP2(BTB{-C{2eCcRYcthA1f|xZU6sZEfG;F_BXgVGBB&=v2*CB{bm`EQlYNTKH z#O3?fv0f86Xv~5~1EW1VPHin1L*p<9s)XKA7HpGpf94sbCsK$T_YQQ#UIiA{P)38u zf-h2`1s=H3?t6?o<;(=Mv44`g1Qq*`=7^1gilxYW79*oO+e23}RjgE0|NI#4xk|9( z=+#2Y(uit7<(EWS3D>wlq5)l(w0AVQb_a4I*$4_hC!A)oEW44`v_4bE9EmE0rrNoL z_zS*Ue}q6890pd^&h6+nai`R~_GyZ?!gVTC7j@mNSBByt2H{I*y??b!>phSFzUZsvp4YPgs_f2%fK7*nq>A;bp`@6hyTdxDMyTA8nflAb{%5{|? zT^f&SV??L)>(rbAIx%o=(klD0S-x(UeLJg21koll_uDEFbdNo1SgF}|FVQM^`#TEg tvQY3h+p5SL6}{$y%ORSy@p2aR{-fz`hPo90`4)Xm^glrqU#}_{003`pXTF*FsQB|6_UjM)7sXJ>)_ZB$ zR%U|XZ^4aYddu8iusq)}tGDjJjle?kh3^F0YU3B3aE9+iYIqjZ{33pPf zILr@qaWrzbckC?bv9U6evkNw!UbC}1B_D*b(*5V(EEVipn^f@fv4{1^KPD3hET+TW zIeXjh|9ru`zUnMkMn)SU8VldEqb^y(6*D50))~1e9q!~9SLr3J_O=}{5pre-PI^9O;jCjxj%8D|MF_df%AdJsU;-SJxNGp%;sMc(^o zQUxuPK9&vVi~I5HHlDx*qor3_P4!|n-ZG`#IkQ59J%8IfSG>QxJRA=3PL;7XyUQ$` zV=w<6vqdJjrEBq&%#x-8Y65g2klB$AsIY9wslY<_;$&ch4T7Ck*dw<-Pk54u!jW7a z^7Kd7l_>s@vME2Z{?C-aSMM<4*mQckVpmZ-w`87;;?i?rmg(;(ljq^`qKQ)@K@)J`1-<<$rC?Sk28BR{31kgfrO~XN=qb= zaqT$Q5278}11~xw`3{VJLXVE`s@Xp89jScj8pdLaxdBZ|SZu4}0WP$M;@I?>7*Adu=o zeauN3K>5Z*3!@)o8qy|!&{wo`-#sZAZKx=87_`zirCNg0f-As@D1K-*N~gj;*O;M| zWEU1N_sAxjxKy-8ih$QrH0`$|TdE|K0M{PwPdKM>6niX0p;4kRXZm2tIPplHmQJA9 z`8~*T-@-7*Qk~=I*l!M@?Cz)S5QXWYJ@RYGGl{O}i#{%0h{Sn8C7tA15F!`&TJ@@< z>#cF*fij#=r-RuCHW|-GY_Pn&n~r8{6d8b~>izJj@nmDG{oUS2@pZ;7gerl*v5S0% zLZB+?YT5A}yEw=cw!VQ>rvg1KKX2HD5|$u%k?0)s&PCORJ)$R-V|$SmaXtA!Iy}zT zrK;jYK?5z>AdTEH#C^@bAedE5H^LnRSj5GZ_svz`w;B?|pAQw9y)1IVFO72Q4xitA z{&RD1-W4-L}XnK8g!u~&pyzBpoJ}b~U?Vz&QA1#uo(Tz@d z5S~y9+Ri!LK8V@l4FJDcv|He^NDdnzSBTy$J`HJ+471>(L|%gR8)&jUB6FDzhB;_TZXVdEu#(ddS(SJ zoMu*+jlC|8=eN$$*1nb!FK$M>+etw^7%#;%l*P6_5seFwT?%4kjKHE5TxQu}ufftE z0IZxKVR%yWB)qDKdT><(`YIL|?_P&=O(UQ&tFpqY6@(O$1o=?FM<8CC@V?p#Bj9@* z)oLi~pBCiPD$qi<;hzh7dzc5&5QD%qI{IN1nqd+$w&53@tZkGwBzC4*p{b~cF}!k_ zicFkDt75o~s1ejsNTikUtQQg@-Fa7dL~S!!6y5x2`0&j0AZqK?OUct3>b3Z8BMxOC zZeRfI+yhyebo!F#)H85Zcm$s);--Gem6q_G@gn013Ou_&dOO*UZLR^Lu7RGE|Ar&P zBO(cwD;0cc|F~imGBnT(UeP~WZmJkkjF6F!70>8Y`7rZqKRWDXg2bo2;F9fL+d?G} z&M5`GVwpLT<{7c{zqvdmmu()Y4iO6^eHR{P(V^`1XGejFV;EV7}@Q$lq zC#&InJ^UDDa$`71&zb*`fIo1!i%PdQ&dWmI-D>oEB~RHatCz|)L$@G;Co7;N+QApK zO8TLWehX_m4*drQUXIpx%NhG^Fu5Cb-q%K;k~d^zQ)a;XNpFehkbYhCw(xZV#My0` z{n9L7waekPqDcg}mznUjGd9dzBG<1g+dEpc@{{{aD&%o9d008P)Urhi2 literal 2229 zcmV;m2uk-KiwFR^D1KuA1Fcx=j@!Bs{;#JX0<^V(wbpyi2~gzp6!1FU#D#CLy-gPg za6n6xO+*qElCsx9U#QQ~7wb2qZr)2;pa~GHNDha?nQvx3I{f^G{q_U@1tAo&?Liur z$W$==Ex5K!CCnZK%d$N)DzPW71s0+&d@op{v|F^oYJL#0=BZbc33FhXie(}rZl%gY zKR;H*S3@(_Bl=25dUNWxe}c9)&j2{`+4n7VK8(Sn%?(kM-H#W-|z^=Hvbq z`)N4*Wx$-i>MU4BMr$D&3*WJ`Dp|yHrbR4`)pA!_+{rSY$Jemh*>=W+*HPxNsIQ_k zQ(yYS;-1ZfFTyfg&`cGyvk%+PEakS{{M-xeWn(6Dr}v-=Th}(mLh&T$bOlCzYp&Pf-Jhx{u zem+@`KSF+VJDp9p4~_kI)9qri*|59invK|MwBAm~_p{NOt?t*Wk748G>S4P05YFI&$=a!`rure9CM;L>iWwpNp1&NdE#6&UpH8Q6pO>N1`|H%7 zW3K-ivQ;X$p=um#JUUqR_&K+)BiVvqAz8CkfZ2G8bGkUKCnA%B)qC z`zny0X-BPeFI0x&b`G6&n}@}6wV7@@7LF7fX;<%lcV%+~C@l+`L*5jnb+c~jE=74t zncsjf7l(^YkicQAR*4HmPuCCi$FbQ_$>$xZxRIiQT+NAum#M9Xqxu8B@CqKGfc=xE za@`!4p@_80?KFRUY1+tdFHQ5(#4pY7HGg$pi?1&%=`3awg=II2G~oh zzUXQ;S`H*Y9HK~qNZZ!}{^`JiH zA`PH?r-PMNM;ZIH@gQ^+?aFmeN=D-=3LOTm^i8Q2p|s!%a2$#snoX`^VV-MD(Mr;R z0n8n;$tEsyS|dfkYbl!c+mS8v$d>@y9_~)KqHz#9ECjw$qA;iGWXL%2NS>BfpxC)R z$a2@hFvnt*;pot9_Mz7qUIYspiIuIGwAE?tPoI>B68$x|;xE^xK#RY%ub z!@vP$yqwQRi}!3cT};?${o#H-S!_{c0Gg`z!=u`fjYPS-y$izIlnq2)0)JB*xDJIt zRnpb6<$E?b$r!f2fmEjgJuN?P*dP~%AUKFr26|_MYQq81leuLFkrrV+c_bYU=i4%` z;zU6ME!iP;?AgbC%fBF)RZMrno&;FL;KuppX6RZCiQ&)t3e8RyIpLNj8Fh!xZ$AIA zIXG($-T)P-LU1T~9jxH&{ccr28}nd(d$z*-FNeGx{((L#&{<`nvN)U#lBm&*PI(fJ zPzu`49htnUHT-!vq|doxinty1na1Q8KGM{0k+QpTPx;wdtcvm{4UAHDC^{3ong+uiG* zM0rO+701efbBvxikoB4xU6p3uP?`RZ^e&p9?}B5{Lt9lUpjjH_;_MRQG3X7$A#hxc zU=tW9D_m(7algIFs)5OmG;$P7a=uHcFv2eMA#l@P{k-Tnx!(lE6O#*8vOS=19u!DE zJp}-R)V&3S?+utT2d)d2zzroNJ8R&+INdkUs<2hm#?gy83V7D7-yJbeb-Y+paGr@( z)W?a95q*o-(MxhQ7peuDj{K2Ului=I(|JxDz<1a0)6(ykw|T-4_NQgEVP4OypoPoK z>awxd#qs=B8QR*{QsTwUh<95ls0ZVv82hr=)+eHI90$*UrDM5}^frZ-QD4 zW&P8Fd|3rr$Ts|QMQ;y%6b&)(T%)5OR-qY2K4Tkx(aG9IX+vBWiWQ2Ax*x+U*Re>& zMYJkb+lXpGErmo{3CDCHA>zGrg+o-5%A)AzN5g>^jt5a&uU<-y)=;m-cN=ji191Zb zXy=Y(Wz^|Qjz=%RRpAkQqKNDIDOVc8cgl;DM=0=Yfb_Pq9h*!6L>C77MDlEaS1iqx zyUNw%N+ix>MF%>?*w6en3{D3bAwOv^C||qRv=Q~Za89wQ$Y2I+KjVMyr;(=|u!Vcx z;Y*$i^eQ86fnA?}X`S?IgpOn$HADamB@ph!{_b>d;Nif5!Od{L{U-_z(PtF|%Fe^Ax+WP86}u)mLH z_mj>uSPK-~hBNHS6tKK#0RbH{tZP#OUq=9jNy_xsX8ERF_KylhB7mn%-S1Qt0rT;q zv|o3vM*@~n_F%s;Ni2)G6?^n>4HDU#6 MMG2D_LONMAX-2 ) return -ilist; + if ( ilist > MMG2D_LMAX-2 ) return -ilist; list[ilist] = k; ++ilist; @@ -310,7 +310,7 @@ int MMG2D_bouleendp(MMG5_pMesh mesh,MMG5_int start,int8_t ip,MMG5_int *ip1,MMG5_ do { - if ( ilist > MMG2D_LONMAX-2 ) return -ilist; + if ( ilist > MMG2D_LMAX-2 ) return -ilist; list[ilist] = k ; ++ilist; diff --git a/src/mmg3d/analys_3d.c b/src/mmg3d/analys_3d.c index 0f6141f45..044e328ad 100644 --- a/src/mmg3d/analys_3d.c +++ b/src/mmg3d/analys_3d.c @@ -896,7 +896,7 @@ static inline int MMG3D_dichotomytetra(MMG5_pMesh mesh, MMG5_int *v, MMG5_int k, MMG5_pPoint ppt; double p[3],o[3],vol,to,tp,t; - int it,maxit,pos,i,j; + int it,maxit,pos; it = 0; maxit = 5; @@ -957,11 +957,10 @@ int MMG3D_regver(MMG5_pMesh mesh) { MMG5_pTria pt; MMG5_pTetra ptet; MMG5_pPoint ppt,p0; - MMG5_pxPoint pxp; MMG5_Tria tnew; - double *tabl,c[3],cprev[3],n[3],nnew[3],*cptr,*nptr,lm1,lm2,dd,cx,cy,cz,nx,ny,nz,res0,res,result; + double *tabl,c[3],n[3],nnew[3],*cptr,lm1,lm2,cx,cy,cz,res0,res,result; int i,ii,it,nit,ilist,noupdate,ier; - MMG5_int k,kt,nn,iel,list[MMG5_LMAX],tlist[MMG5_LMAX],*adja,*adjatet,iad,v[4],ntet; + MMG5_int k,kt,nn,iel,list[MMG5_LMAX],tlist[MMG5_LMAX],*adja,iad,v[4]; int64_t tetlist[MMG5_LMAX]; /* assign seed to vertex */ @@ -992,15 +991,7 @@ int MMG3D_regver(MMG5_pMesh mesh) { MMG5_SAFE_CALLOC(tabl,3*mesh->np+1,double,return 0); /* Pointer toward the suitable adjacency array for Mmgs and Mmg3d */ - if ( mesh->adjt ) { - /* Mmg3d */ - adja = mesh->adjt; - adjatet = mesh->adja; - } - else { - /* Mmgs */ - adja = mesh->adja; - } + adja = mesh->adjt; it = 0; nit = 10; @@ -1115,7 +1106,8 @@ int MMG3D_regver(MMG5_pMesh mesh) { ier = MMG5_nortri(mesh, &tnew, nnew); MMG5_dotprod(3,n,nnew,&result); if ( result < 0.0 ) { - if (!MMG3D_dichotomytria(mesh,&tnew,k,c,n)) noupdate = 1; + if (!MMG3D_dichotomytria(mesh,&tnew,k,c,n)) + noupdate = 1; continue; } } @@ -1145,7 +1137,8 @@ int MMG3D_regver(MMG5_pMesh mesh) { result = MMG5_orvol(mesh->point,v); if ( result <= 0.0 ) { - if (!MMG3D_dichotomytetra(mesh,v,k,c)) noupdate = 1; + if (!MMG3D_dichotomytetra(mesh,v,k,c)) + noupdate = 1; continue; } } diff --git a/src/mmgs/analys_s.c b/src/mmgs/analys_s.c index ef8a44d25..6e27c7307 100644 --- a/src/mmgs/analys_s.c +++ b/src/mmgs/analys_s.c @@ -810,16 +810,16 @@ static inline int MMGS_dichotomy(MMG5_pMesh mesh, MMG5_pTria pt, MMG5_int k, dou * \param mesh pointer toward a MMG5 mesh structure. * \return 0 if fail, 1 otherwise. * - * Regularization procedure for vertices coordinates, dual Laplacian for a surface mesh. + * Regularization procedure for vertices coordinates, + * dual Laplacian for a surface mesh. * */ int MMGS_regver(MMG5_pMesh mesh) { MMG5_pTria pt; MMG5_pPoint ppt,p0; - MMG5_pxPoint pxp; MMG5_Tria tnew; - double *tabl,c[3],cprev[3],n[3],nnew[3],*cptr,*nptr,lm1,lm2,dd,cx,cy,cz,nx,ny,nz,res0,res,result; - int i,ii,it,nit,ilist,noupdate,ier; + double *tabl,c[3],n[3],nnew[3],*cptr,lm1,lm2,cx,cy,cz,res0,res,result; + int i,it,nit,ilist,noupdate,ier; MMG5_int k,kt,nn,iel,list[MMG5_LMAX],tlist[MMG5_LMAX],*adja,iad; /* assign seed to vertex */ @@ -835,7 +835,7 @@ int MMGS_regver(MMG5_pMesh mesh) { /* allocate memory for coordinates */ MMG5_SAFE_CALLOC(tabl,3*mesh->np+1,double,return 0); - /* Pointer toward the suitable adjacency array for Mmgs and Mmg3d */ + /* Pointer toward the suitable adjacency array */ adja = mesh->adja; it = 0; @@ -857,7 +857,7 @@ int MMGS_regver(MMG5_pMesh mesh) { if ( ppt->tag & MG_CRN || ppt->tag & MG_NOM || MG_EDG(ppt->tag) ) continue; iel = ppt->s; - + pt = &mesh->tria[iel]; i = 0; if ( pt->v[1] == k ) i = 1; @@ -896,7 +896,7 @@ int MMGS_regver(MMG5_pMesh mesh) { if ( ppt->tag & MG_CRN || ppt->tag & MG_NOM || MG_EDG(ppt->tag) ) continue; iel = ppt->s; - + pt = &mesh->tria[iel]; i = 0; if ( pt->v[1] == k ) i = 1; @@ -950,7 +950,8 @@ int MMGS_regver(MMG5_pMesh mesh) { ier = MMG5_nortri(mesh, &tnew, nnew); MMG5_dotprod(3,n,nnew,&result); if ( result < 0.0 ) { - if (!MMGS_dichotomy(mesh,&tnew,k,c,n)) noupdate = 1; + if (!MMGS_dichotomy(mesh,&tnew,k,c,n)) + noupdate = 1; continue; } } From 6e1b1dfd6415e00a026a4030fd3429c29442ac22 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Tue, 6 Dec 2022 04:02:10 +0100 Subject: [PATCH 799/838] Trigger tests on PR update --- .github/workflows/long-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/long-tests.yml b/.github/workflows/long-tests.yml index 91b544648..e160afbc3 100644 --- a/.github/workflows/long-tests.yml +++ b/.github/workflows/long-tests.yml @@ -5,6 +5,8 @@ on: push: # run tests on PR events pull_request: + types: [synchronize] + # run tests manually on a given branch (default is master) workflow_dispatch: # Inputs the workflow accepts. From f141ba1d8d210c44cee8d34a974614676ec403bd Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Tue, 6 Dec 2022 04:03:06 +0100 Subject: [PATCH 800/838] Trigger fast tests on PR update --- .github/workflows/fast-check.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/fast-check.yml b/.github/workflows/fast-check.yml index 9d95b1c5b..4ea3b84bc 100644 --- a/.github/workflows/fast-check.yml +++ b/.github/workflows/fast-check.yml @@ -1,6 +1,10 @@ name: Fast check without dependencies -on: [push] +on: + push: + # run tests on PR events + pull_request: + types: [synchronize] jobs: build: From b36a498619754922bc7e80ff16417a461c485541 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Tue, 6 Dec 2022 12:14:28 +0100 Subject: [PATCH 801/838] Move ci tests for coor regularization in mmg directory. --- cmake/testing/mmg3d_tests.cmake | 11 ----------- cmake/testing/mmg_tests.cmake | 11 +++++++++++ cmake/testing/mmgs_tests.cmake | 11 ----------- 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/cmake/testing/mmg3d_tests.cmake b/cmake/testing/mmg3d_tests.cmake index 53cfdd555..4f25decdb 100644 --- a/cmake/testing/mmg3d_tests.cmake +++ b/cmake/testing/mmg3d_tests.cmake @@ -696,17 +696,6 @@ ADD_TEST(NAME mmg3d_OptLs_plane_rembub2 -sol ${MMG3D_CI_TESTS}/OptLs_plane/bub.sol ${CTEST_OUTPUT_DIR}/mmg3d_OptLs_plane-rembub2.o.meshb) -# xreg -ADD_TEST( NAME mmg3d_CoorRegularizationCube - COMMAND ${EXECUT_MMG3D} -v 5 -nr -xreg - ${MMG3D_CI_TESTS}/CoorRegularizationCube/cube - -out ${CTEST_OUTPUT_DIR}/CoorRegularizationCube.o.meshb) - -ADD_TEST( NAME mmg3d_CoorRegularizationRandomCube - COMMAND ${EXECUT_MMG3D} -v 5 -xreg - ${MMG3D_CI_TESTS}/CoorRegularizationRandomCube/cubeRandom.mesh - -out ${CTEST_OUTPUT_DIR}/CoorRegularizationRandomCube.o.meshb) - # Preservation of orphan points ADD_TEST(NAME mmg3d_OptLs_temp_orphan COMMAND ${EXECUT_MMG3D} -v 5 -ls diff --git a/cmake/testing/mmg_tests.cmake b/cmake/testing/mmg_tests.cmake index 158ee1dc0..37ccba11f 100644 --- a/cmake/testing/mmg_tests.cmake +++ b/cmake/testing/mmg_tests.cmake @@ -365,6 +365,17 @@ ADD_TEST(NAME mmg_CommandLineAni_${SHRT_EXEC} ${MMG_CI_TESTS}/c1/c1.meshb -out ${CTEST_OUTPUT_DIR}/mmg_nreg_${SHRT_EXEC}.o.meshb) + # xreg + ADD_TEST( NAME mmg_CoorRegularizationCube_${SHRT_EXEC} + COMMAND ${EXEC} -v 5 -nr -xreg + ${MMG_CI_TESTS}/CoorRegularizationCube/cube + -out ${CTEST_OUTPUT_DIR}/CoorRegularizationCube_${SHRT_EXEC}.o.meshb) + + ADD_TEST( NAME mmg_CoorRegularizationRandomCube_${SHRT_EXEC} + COMMAND ${EXEC} -v 5 -xreg + ${MMG_CI_TESTS}/CoorRegularizationRandomCube/cubeRandom.mesh + -out ${CTEST_OUTPUT_DIR}/CoorRegularizationRandomCube_${SHRT_EXEC}.o.meshb) + ############################################################################## ##### ##### Various test cases diff --git a/cmake/testing/mmgs_tests.cmake b/cmake/testing/mmgs_tests.cmake index 0427bcc65..e4677bea9 100644 --- a/cmake/testing/mmgs_tests.cmake +++ b/cmake/testing/mmgs_tests.cmake @@ -245,17 +245,6 @@ ADD_TEST(NAME mmgs_OptLs_teapot-nsd3 ${MMGS_CI_TESTS}/OptLs_teapot/teapot ${CTEST_OUTPUT_DIR}/mmgs_OptLs_teapot-ls-nsd3.o.meshb) -# test xreg option -ADD_TEST(NAME mmgs_CoorRegularizationCube - COMMAND ${EXECUT_MMGS} -v 5 -xreg - ${MMGS_CI_TESTS}/CoorRegularizationCube/cube.mesh - -out ${CTEST_OUTPUT_DIR}/CoorRegularizationCube.o.meshb) - -ADD_TEST(NAME mmgs_CoorRegularizationRandomCube - COMMAND ${EXECUT_MMGS} -v 5 -xreg - ${MMGS_CI_TESTS}/CoorRegularizationRandomCube/cubeRandom.mesh - -out ${CTEST_OUTPUT_DIR}/CoorRegularizationRandomCube.o.meshb) - ############################################################################### ##### ##### Detected Bugs From c1a77497cbe5e9fd292a2a729c653c2118891f07 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Wed, 20 Jul 2022 15:49:32 +0200 Subject: [PATCH 802/838] Try to fix issues in previous commit [skip output comparison]. --- .github/workflows/main-job.yml | 17 +++++++++++++++++ cmake/modules/macros.cmake | 30 ------------------------------ cmake/modules/mmg2d.cmake | 2 +- cmake/modules/mmg3d.cmake | 4 ++-- cmake/modules/mmgs.cmake | 4 ++-- cmake/testing/mmg3d_tests.cmake | 2 -- cmake/testing/mmg_tests.cmake | 6 +++--- cmake/testing/mmgs_tests.cmake | 2 -- 8 files changed, 25 insertions(+), 42 deletions(-) diff --git a/.github/workflows/main-job.yml b/.github/workflows/main-job.yml index afd91ea47..994431f15 100644 --- a/.github/workflows/main-job.yml +++ b/.github/workflows/main-job.yml @@ -160,6 +160,12 @@ jobs: env: NJOBS: "2" + - name: Set environment variables for output comparison + if: "! contains(github.event.head_commit.message, '[skip output comparison]')" + run: | + echo "C_FLG=\"-DCMAKE_C_FLAGS=-DMMG_COMPARABLE_OUTPUT\"" >> "$GITHUB_ENV" + echo "MMG_ERROR_RULE=\"COMMAND_ERROR_IS_FATAL ANY\"" >> "$GITHUB_ENV" + - name: Install VTK # Download vtk only if used if: matrix.vtk == 'on' @@ -222,6 +228,7 @@ jobs: - name: Test compilation with shared libs linkage run: | cmake -Smmg -Bbuild_shared \ + ${{ env.C_FLG }} \ ${{ env.FORT_FLG }} \ -DCI_CONTEXT=ON \ -DBUILD_TESTING=ON \ @@ -243,6 +250,7 @@ jobs: - name: Test compilation without library linkage run: | cmake -Smmg -Bbuild_nolibs \ + ${{ env.C_FLG }} \ ${{ env.FORT_FLG }} \ -DCI_CONTEXT=ON \ -DBUILD_TESTING=ON \ @@ -263,6 +271,7 @@ jobs: - name: Configure Mmg with static libs (default behaviour) run: | cmake -Smmg -Bbuild \ + ${{ env.C_FLG }} \ ${{ env.FORT_FLG }} \ -DCI_CONTEXT=ON \ -DBUILD_TESTING=ON \ @@ -302,3 +311,11 @@ jobs: run: | cd build ctest -R "msh|vtk" -VV -C ${{ inputs.cmake_build_type }} -j ${{ env.NJOBS }} + + - name: Archive production artifacts for tests + if: success() || failure() + uses: actions/upload-artifact@v2 + with: + name: Mmg-tests + path: | + build/TEST_OUTPUTS diff --git a/cmake/modules/macros.cmake b/cmake/modules/macros.cmake index e21a9efdd..1158b300c 100644 --- a/cmake/modules/macros.cmake +++ b/cmake/modules/macros.cmake @@ -311,36 +311,6 @@ MACRO ( ADD_TARGET_POSTFIX target_name ) ENDIF ( ) ENDMACRO ( ) -############################################################################### -##### -##### Add Executable that must be tested by ci -##### -############################################################################### - -MACRO ( ADD_EXEC_TO_CI_TESTS exec_name list_name ) - - IF(${CMAKE_BUILD_TYPE} MATCHES "Debug") - SET(EXECUT ${EXECUTABLE_OUTPUT_PATH}/${exec_name}_debug) - SET(BUILDNAME ${BUILDNAME}_debug CACHE STRING "build name variable") - ELSEIF(${CMAKE_BUILD_TYPE} MATCHES "Release") - SET(EXECUT ${EXECUTABLE_OUTPUT_PATH}/${exec_name}_O3) - SET(BUILDNAME ${BUILDNAME}_O3 CACHE STRING "build name variable") - ELSEIF(${CMAKE_BUILD_TYPE} MATCHES "RelWithDebInfo") - SET(EXECUT ${EXECUTABLE_OUTPUT_PATH}/${exec_name}_O3d) - SET(BUILDNAME ${BUILDNAME}_O3d CACHE STRING "build name variable") - ELSEIF(${CMAKE_BUILD_TYPE} MATCHES "MinSizeRel") - SET(EXECUT ${EXECUTABLE_OUTPUT_PATH}/${exec_name}_Os) - SET(BUILDNAME ${BUILDNAME}_Os CACHE STRING "build name variable") - ELSE() - SET(EXECUT ${EXECUTABLE_OUTPUT_PATH}/${exec_name}) - SET(BUILDNAME ${BUILDNAME} CACHE STRING "build name variable") - ENDIF() - - SET ( ${list_name} ${EXECUT} ) - -ENDMACRO ( ) - - ############################################################################### ##### ##### Add a library test diff --git a/cmake/modules/mmg2d.cmake b/cmake/modules/mmg2d.cmake index 65d3152b1..82ee2fdc1 100644 --- a/cmake/modules/mmg2d.cmake +++ b/cmake/modules/mmg2d.cmake @@ -184,7 +184,7 @@ IF ( BUILD_TESTING ) # Add runtime that we want to test for mmg2d IF ( MMG2D_CI ) - ADD_EXEC_TO_CI_TESTS ( ${PROJECT_NAME}2d EXECUT_MMG2D ) + SET ( EXECUT_MMG2D $ ) IF ( ONLY_VERY_SHORT_TESTS ) # Add tests that doesn't require to download meshes diff --git a/cmake/modules/mmg3d.cmake b/cmake/modules/mmg3d.cmake index 26b985845..b957c2a2d 100644 --- a/cmake/modules/mmg3d.cmake +++ b/cmake/modules/mmg3d.cmake @@ -206,8 +206,8 @@ IF ( BUILD_TESTING ) SET ( RUN_AGAIN OFF ) ENDIF ( ) - ADD_EXEC_TO_CI_TESTS ( ${PROJECT_NAME}3d EXECUT_MMG3D ) - SET ( LISTEXEC_MMG ${EXECUT_MMG3D} ) + SET ( EXECUT_MMG3D $ ) + SET ( SHRT_EXECUT_MMG3D ${PROJECT_NAME}3d ) IF ( ONLY_VERY_SHORT_TESTS ) # Add tests that doesn't require to download meshes diff --git a/cmake/modules/mmgs.cmake b/cmake/modules/mmgs.cmake index 98b8e04c9..16b4ebf7a 100644 --- a/cmake/modules/mmgs.cmake +++ b/cmake/modules/mmgs.cmake @@ -164,8 +164,8 @@ IF ( BUILD_TESTING ) # Add runtime that we want to test for mmgs IF( MMGS_CI ) - ADD_EXEC_TO_CI_TESTS ( ${PROJECT_NAME}s EXECUT_MMGS ) - SET ( LISTEXEC_MMG ${EXECUT_MMGS} ) + SET ( EXECUT_MMGS $ ) + SET ( SHRT_EXECUT_MMGS ${PROJECT_NAME}s) IF ( ONLY_VERY_SHORT_TESTS ) # Add tests that doesn't require to download meshes diff --git a/cmake/testing/mmg3d_tests.cmake b/cmake/testing/mmg3d_tests.cmake index 4f25decdb..4454425f9 100644 --- a/cmake/testing/mmg3d_tests.cmake +++ b/cmake/testing/mmg3d_tests.cmake @@ -20,8 +20,6 @@ ## use this copy of the mmg distribution only if you accept them. ## ============================================================================= -GET_FILENAME_COMPONENT ( SHRT_EXECUT_MMG3D ${EXECUT_MMG3D} NAME ) - ############################################################################## ##### ##### Tests that may be run twice diff --git a/cmake/testing/mmg_tests.cmake b/cmake/testing/mmg_tests.cmake index 158ee1dc0..09a6abb92 100644 --- a/cmake/testing/mmg_tests.cmake +++ b/cmake/testing/mmg_tests.cmake @@ -24,6 +24,7 @@ # executable is in EXECUT_MMG3D (filled by mmg3d.cmake) and the mmgs executable # is in EXECUTE_MMGS (filled by mmgs.cmake)) SET(EXECUT_MMG ${EXECUT_MMGS} ${EXECUT_MMG3D}) +SET(SHRT_EXECUT_MMG ${SHRT_EXECUT_MMGS} ${SHRT_EXECUT_MMG3D}) # Make some files not openable IF ( EXISTS ${CTEST_OUTPUT_DIR}/unwrittable7.meshb @@ -43,8 +44,7 @@ IF ( NOT EXISTS ${CTEST_OUTPUT_DIR}/unwrittable8.sol) ENDIF() # Lists of tests that are common to mmgs and mmg3d -FOREACH(EXEC ${EXECUT_MMG}) - GET_FILENAME_COMPONENT ( SHRT_EXEC ${EXEC} NAME ) +FOREACH(EXEC SHRT_EXEC IN ZIP_LISTS EXECUT_MMG SHRT_EXECUT_MMG) ############################################################################### ##### @@ -391,4 +391,4 @@ ADD_TEST(NAME mmg_CommandLineAni_${SHRT_EXEC} -ENDFOREACH(EXEC) +ENDFOREACH() diff --git a/cmake/testing/mmgs_tests.cmake b/cmake/testing/mmgs_tests.cmake index ac4a5c049..476f0061e 100644 --- a/cmake/testing/mmgs_tests.cmake +++ b/cmake/testing/mmgs_tests.cmake @@ -20,8 +20,6 @@ ## use this copy of the Mmg distribution only if you accept them. ## ============================================================================= -GET_FILENAME_COMPONENT ( SHRT_EXECUT_MMGS ${EXECUT_MMGS} NAME ) - ############################################################################### ##### ##### Continuous Integration From 2f1cf133bce21af1cb4b1302456103fe3e442157 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Wed, 20 Jul 2022 16:07:02 +0200 Subject: [PATCH 803/838] fix issue in executable name. [skip output comparison] --- cmake/modules/mmg2d.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/modules/mmg2d.cmake b/cmake/modules/mmg2d.cmake index 82ee2fdc1..c4628a790 100644 --- a/cmake/modules/mmg2d.cmake +++ b/cmake/modules/mmg2d.cmake @@ -184,7 +184,7 @@ IF ( BUILD_TESTING ) # Add runtime that we want to test for mmg2d IF ( MMG2D_CI ) - SET ( EXECUT_MMG2D $ ) + SET ( EXECUT_MMG2D $ ) IF ( ONLY_VERY_SHORT_TESTS ) # Add tests that doesn't require to download meshes From 52d5106850e1909193b8fef5044d0ed6e2f166e6 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Tue, 6 Dec 2022 16:08:10 +0100 Subject: [PATCH 804/838] Comment creation of archive artifacts for tests outputs as it is subject to errors due to the artifact size. --- .github/workflows/main-job.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main-job.yml b/.github/workflows/main-job.yml index 994431f15..57d107182 100644 --- a/.github/workflows/main-job.yml +++ b/.github/workflows/main-job.yml @@ -312,10 +312,10 @@ jobs: cd build ctest -R "msh|vtk" -VV -C ${{ inputs.cmake_build_type }} -j ${{ env.NJOBS }} - - name: Archive production artifacts for tests - if: success() || failure() - uses: actions/upload-artifact@v2 - with: - name: Mmg-tests - path: | - build/TEST_OUTPUTS + # - name: Archive production artifacts for tests + # if: success() || failure() + # uses: actions/upload-artifact@v2 + # with: + # name: Mmg-tests + # path: | + # build/TEST_OUTPUTS From f1152fdeff728946f0daaca2732e9aa8706afa1a Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Wed, 7 Dec 2022 10:17:06 +0100 Subject: [PATCH 805/838] Add a 3D test case for lssurf+opnbdy mode where the opnbdy is splitted by the isovalue. --- cmake/testing/mmg3d_tests.cmake | 2 +- cmake/testing/mmg_tests.cmake | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cmake/testing/mmg3d_tests.cmake b/cmake/testing/mmg3d_tests.cmake index 14ff03887..44093a9e2 100644 --- a/cmake/testing/mmg3d_tests.cmake +++ b/cmake/testing/mmg3d_tests.cmake @@ -451,7 +451,7 @@ ADD_TEST(NAME mmg3d_opnbdy_ls_peninsula -sol ${MMG3D_CI_TESTS}/OpnBdy_peninsula/ls.sol -out ${CTEST_OUTPUT_DIR}/mmg3d_OpnBdy_ls_peninsula.o.meshb) -ADD_TEST(NAME mmg3d_opnbdy_lssurf_peninsula +ADD_TEST(NAME mmg3d_opnbdy_lssurf-nofile_peninsula COMMAND ${EXECUT_MMG3D} -v 5 -opnbdy -lssurf 0.6 -nr -hgrad 1.5 -hausd 0.02 -in ${MMG3D_CI_TESTS}/OpnBdy_peninsula/peninsula -sol ${MMG3D_CI_TESTS}/OpnBdy_peninsula/ls.sol diff --git a/cmake/testing/mmg_tests.cmake b/cmake/testing/mmg_tests.cmake index 158ee1dc0..f453b633d 100644 --- a/cmake/testing/mmg_tests.cmake +++ b/cmake/testing/mmg_tests.cmake @@ -365,6 +365,13 @@ ADD_TEST(NAME mmg_CommandLineAni_${SHRT_EXEC} ${MMG_CI_TESTS}/c1/c1.meshb -out ${CTEST_OUTPUT_DIR}/mmg_nreg_${SHRT_EXEC}.o.meshb) + # -lssurf + ADD_TEST(NAME mmg_OptLsSurf_peninsula_${SHRT_EXEC} + COMMAND ${EXEC} -v 5 -opnbdy -lssurf -nr -hgrad 1.5 -hausd 0.02 + -in ${MMG_CI_TESTS}/OptLsSurf_peninsula/peninsula + -sol ${MMG_CI_TESTS}/OptLsSurf_peninsula/ls.sol + -out ${CTEST_OUTPUT_DIR}/mmg_OptLsSurf_peninsula_${SHRT_EXEC}.o.meshb) + ############################################################################## ##### ##### Various test cases From c583bd6a5731ab8b15034954ef58bfa7e8ff80a3 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Wed, 7 Dec 2022 10:50:07 +0100 Subject: [PATCH 806/838] Add lssurf option to mmgs + fix minor issues. --- cmake/testing/mmg_tests.cmake | 6 +++++- src/mmg2d/analys_2d.c | 4 ++-- src/mmg2d/libmmg2d.c | 8 ++++---- src/mmg3d/libmmg3d.c | 16 +++++++++------- src/mmgs/API_functions_s.c | 3 +++ src/mmgs/libmmgs.c | 12 ++++++++---- src/mmgs/libmmgs.h | 1 + src/mmgs/libmmgs_tools.c | 15 +++++++++++++-- src/mmgs/mmgs.c | 6 +++--- 9 files changed, 48 insertions(+), 23 deletions(-) diff --git a/cmake/testing/mmg_tests.cmake b/cmake/testing/mmg_tests.cmake index f453b633d..033f9ade3 100644 --- a/cmake/testing/mmg_tests.cmake +++ b/cmake/testing/mmg_tests.cmake @@ -366,8 +366,12 @@ ADD_TEST(NAME mmg_CommandLineAni_${SHRT_EXEC} -out ${CTEST_OUTPUT_DIR}/mmg_nreg_${SHRT_EXEC}.o.meshb) # -lssurf + IF ( ${SHRT_EXEC} MATCHES "3d" ) + SET ( ADD_ARG "-opnbdy" ) + ENDIF() + ADD_TEST(NAME mmg_OptLsSurf_peninsula_${SHRT_EXEC} - COMMAND ${EXEC} -v 5 -opnbdy -lssurf -nr -hgrad 1.5 -hausd 0.02 + COMMAND ${EXEC} -v 5 ${ADD_ARG} -lssurf -nr -hgrad 1.5 -hausd 0.02 -in ${MMG_CI_TESTS}/OptLsSurf_peninsula/peninsula -sol ${MMG_CI_TESTS}/OptLsSurf_peninsula/ls.sol -out ${CTEST_OUTPUT_DIR}/mmg_OptLsSurf_peninsula_${SHRT_EXEC}.o.meshb) diff --git a/src/mmg2d/analys_2d.c b/src/mmg2d/analys_2d.c index 5684aa43b..096f177a8 100644 --- a/src/mmg2d/analys_2d.c +++ b/src/mmg2d/analys_2d.c @@ -783,7 +783,7 @@ int MMG2D_analys(MMG5_pMesh mesh) { fprintf(stderr,"\n ## Hashing problem. Exit program.\n"); return 0; } - + /* Creation quadrilaterals adjacency relations in the mesh */ if ( !MMG2D_hashQuad(mesh) ) { fprintf(stderr,"\n ## Quadrilaterals hashing problem. Exit program.\n"); @@ -797,7 +797,7 @@ int MMG2D_analys(MMG5_pMesh mesh) { } /** \warning possible time improvment here: in lssurf mode, the second call of - * #MMG2D_setadj only adds BDY tag to points that has been inserted by the + * #MMG2D_setadj only adds BDY tag to points that have been inserted by the * level-set splitting (the rest of the job of setadj has alredy be done by * the first call). */ if ( !MMG2D_setadj(mesh,init_cc) ) { diff --git a/src/mmg2d/libmmg2d.c b/src/mmg2d/libmmg2d.c index ae0a86c84..a7ac09829 100644 --- a/src/mmg2d/libmmg2d.c +++ b/src/mmg2d/libmmg2d.c @@ -94,9 +94,9 @@ int MMG2D_mmg2dlib(MMG5_pMesh mesh,MMG5_pSol met) " MMG2D_mmg2dmesh function\n."); _LIBMMG5_RETURN(mesh,met,sol,MMG5_STRONGFAILURE); } - else if ( mesh->info.iso ) { + else if ( mesh->info.iso || mesh->info.isosurf ) { fprintf(stdout,"\n ## ERROR: LEVEL-SET DISCRETISATION UNAVAILABLE" - " (MMG2D_IPARAM_iso):\n" + " (MMG2D_IPARAM_iso or MMG2D_IPARAM_isosurf ):\n" " YOU MUST CALL THE MMG2D_mmg2dls FUNCTION TO USE THIS" " OPTION.\n"); _LIBMMG5_RETURN(mesh,met,sol,MMG5_STRONGFAILURE); @@ -336,9 +336,9 @@ int MMG2D_mmg2dmesh(MMG5_pMesh mesh,MMG5_pSol met) { _LIBMMG5_RETURN(mesh,met,sol,MMG5_STRONGFAILURE); } - else if ( mesh->info.iso ) { + else if ( mesh->info.iso || mesh->info.isosurf ) { fprintf(stdout,"\n ## ERROR: LEVEL-SET DISCRETISATION UNAVAILABLE" - " (MMG2D_IPARAM_iso):\n" + " (MMG2D_IPARAM_iso || MMG2D_IPARAM_isosurf ):\n" " YOU MUST CALL THE MMG2D_MMG2DLS FUNCTION TO USE THIS OPTION.\n"); _LIBMMG5_RETURN(mesh,met,sol,MMG5_STRONGFAILURE); } diff --git a/src/mmg3d/libmmg3d.c b/src/mmg3d/libmmg3d.c index 67b61616f..f45be44bd 100644 --- a/src/mmg3d/libmmg3d.c +++ b/src/mmg3d/libmmg3d.c @@ -1010,9 +1010,9 @@ int MMG3D_mmg3dlib(MMG5_pMesh mesh,MMG5_pSol met) { " YOU MUST CALL THE MMG3D_MMG3DMOV FUNCTION TO MOVE A RIGIDBODY.\n"); _LIBMMG5_RETURN(mesh,met,sol,MMG5_STRONGFAILURE); } - else if ( mesh->info.iso ) { + else if ( mesh->info.iso || mesh->info.isosurf ) { fprintf(stderr,"\n ## ERROR: LEVEL-SET DISCRETISATION UNAVAILABLE" - " (MMG3D_IPARAM_iso):\n" + " (MMG3D_IPARAM_iso or MMG3D_IARAM_isosurf ):\n" " YOU MUST CALL THE MMG3D_MMG3DMOV FUNCTION TO USE THIS OPTION.\n"); _LIBMMG5_RETURN(mesh,met,sol,MMG5_STRONGFAILURE); } @@ -1500,10 +1500,10 @@ int MMG3D_mmg3dmov(MMG5_pMesh mesh,MMG5_pSol met, MMG5_pSol disp) { chrono(ON,&(ctim[0])); /* Check options */ - if ( mesh->info.iso ) { + if ( mesh->info.iso || mesh->info.isosurf ) { fprintf(stderr,"\n ## ERROR: LEVEL-SET DISCRETISATION UNAVAILABLE" - " (MMG3D_IPARAM_iso):\n" - " YOU MUST CALL THE MMG3D_mmg3dmov FUNCTION TO USE THIS OPTION.\n"); + " (MMG3D_IPARAM_iso || MMG3D_IPARAM_isosurf ):\n" + " YOU MUST CALL THE MMG3D_mmg3dls FUNCTION TO USE THIS OPTION.\n"); _LIBMMG5_RETURN(mesh,met,disp,MMG5_STRONGFAILURE); } else if ( mesh->info.optimLES ) { @@ -1599,7 +1599,9 @@ int MMG3D_mmg3dmov(MMG5_pMesh mesh,MMG5_pSol met, MMG5_pSol disp) { MMG5_RETURN_AND_PACK(mesh,met,disp,MMG5_LOWFAILURE); } - if ( mesh->info.imprim > 4 && !mesh->info.iso && met->m ) MMG3D_prilen(mesh,met,0); + if ( mesh->info.imprim > 4 && met->m ) { + MMG3D_prilen(mesh,met,0); + } chrono(OFF,&(ctim[2])); printim(ctim[2].gdif,stim); @@ -1710,7 +1712,7 @@ int MMG3D_mmg3dmov(MMG5_pMesh mesh,MMG5_pSol met, MMG5_pSol disp) { MMG5_RETURN_AND_PACK(mesh,met,disp,MMG5_LOWFAILURE); } - if ( mesh->info.imprim > 1 && (!mesh->info.iso) && met->m ) + if ( mesh->info.imprim > 1 && met->m ) MMG3D_prilen(mesh,met,1); chrono(ON,&(ctim[1])); diff --git a/src/mmgs/API_functions_s.c b/src/mmgs/API_functions_s.c index 7f701470f..6d961efbd 100644 --- a/src/mmgs/API_functions_s.c +++ b/src/mmgs/API_functions_s.c @@ -1338,6 +1338,9 @@ int MMGS_Set_iparameter(MMG5_pMesh mesh, MMG5_pSol sol, int iparam, MMG5_int val case MMGS_IPARAM_isoref : mesh->info.isoref = val; break; + case MMGS_IPARAM_isosurf : + mesh->info.isosurf = val; + break; case MMGS_IPARAM_keepRef : if ( mesh->info.nmat ) { fprintf(stderr,"\n ## Warning: %s: multi material mode not compatible with" diff --git a/src/mmgs/libmmgs.c b/src/mmgs/libmmgs.c index 88f49dd33..f078481de 100644 --- a/src/mmgs/libmmgs.c +++ b/src/mmgs/libmmgs.c @@ -310,7 +310,10 @@ int MMGS_mmgsls(MMG5_pMesh mesh,MMG5_pSol sol,MMG5_pSol umet) MMG5_version(mesh,"S"); - if ( !mesh->info.iso ) { mesh->info.iso = 1; } + if ( (!mesh->info.iso) && (!mesh->info.isosurf) ) { + fprintf(stdout,"\n ## WARNING: ISO MODE NOT PROVIDED: ENABLING ISOVALUE DISCRETIZATION MODE (-ls) \n"); + mesh->info.iso = 1; + } if ( !umet ) { /* User doesn't provide the metric (library mode only), allocate our own one */ @@ -570,9 +573,9 @@ int MMGS_mmgslib(MMG5_pMesh mesh,MMG5_pSol met) tminit(ctim,TIMEMAX); chrono(ON,&(ctim[0])); - if ( mesh->info.iso ) { + if ( mesh->info.iso || mesh->info.isosurf ) { fprintf(stderr,"\n ## ERROR: LEVEL-SET DISCRETISATION UNAVAILABLE" - " (MMGS_IPARAM_iso):\n" + " (MMGS_IPARAM_iso or MMGS_IPARAM_isosurf):\n" " YOU MUST CALL THE MMGS_MMGSLS FUNCTION TO USE THIS OPTION.\n"); _LIBMMG5_RETURN(mesh,met,sol,MMG5_STRONGFAILURE); } @@ -663,8 +666,9 @@ int MMGS_mmgslib(MMG5_pMesh mesh,MMG5_pSol met) } } - if ( mesh->info.imprim > 1 && !mesh->info.iso && met->m ) + if ( mesh->info.imprim > 1 && met->m ) { MMGS_prilen(mesh,met,0); + } chrono(OFF,&(ctim[2])); printim(ctim[2].gdif,stim); diff --git a/src/mmgs/libmmgs.h b/src/mmgs/libmmgs.h index 2ed7b53c3..4d0d07819 100644 --- a/src/mmgs/libmmgs.h +++ b/src/mmgs/libmmgs.h @@ -64,6 +64,7 @@ enum MMGS_Param { MMGS_IPARAM_debug, /*!< [1/0], Turn on/off debug mode */ MMGS_IPARAM_angle, /*!< [1/0], Turn on/off angle detection */ MMGS_IPARAM_iso, /*!< [1/0], Level-set meshing */ + MMGS_IPARAM_isosurf, /*!< [1/0], Level-set meshing on the surface part */ MMGS_IPARAM_isoref, /*!< [0/n], Iso-surface boundary material reference */ MMGS_IPARAM_keepRef, /*!< [1/0], Preserve the initial domain references in level-set mode */ MMGS_IPARAM_optim, /*!< [1/0], Optimize mesh keeping its initial edge sizes */ diff --git a/src/mmgs/libmmgs_tools.c b/src/mmgs/libmmgs_tools.c index dd302916f..4b34a79e4 100644 --- a/src/mmgs/libmmgs_tools.c +++ b/src/mmgs/libmmgs_tools.c @@ -243,6 +243,16 @@ int MMGS_parsar(int argc,char *argv[],MMG5_pMesh mesh,MMG5_pSol met,MMG5_pSol so } else i--; } + else if ( !strcmp(argv[i],"-lssurf") ) { + if ( !MMGS_Set_iparameter(mesh,met,MMGS_IPARAM_isosurf,1) ) + return 0; + if ( ++i < argc && (isdigit(argv[i][0]) || + (argv[i][0]=='-' && isdigit(argv[i][1])) ) ) { + if ( !MMGS_Set_dparameter(mesh,met,MMGS_DPARAM_ls,atof(argv[i])) ) + return 0; + } + else i--; + } break; case 'm': if ( !strcmp(argv[i],"-met") ) { @@ -451,14 +461,15 @@ int MMGS_parsar(int argc,char *argv[],MMG5_pMesh mesh,MMG5_pSol met,MMG5_pSol so } /* adp mode: if the metric name has been stored in sol, move it in met */ - if ( met->namein==NULL && sol && sol->namein && !(mesh->info.iso || mesh->info.lag>=0) ) { + if ( met->namein==NULL && sol && sol->namein && + !(mesh->info.iso || mesh->info.isosurf || mesh->info.lag>=0) ) { if ( !MMGS_Set_inputSolName(mesh,met,sol->namein) ) return 0; MMG5_DEL_MEM(mesh,sol->namein); } /* default : store solution name in iso mode, metric name otherwise */ - tmp = ( mesh->info.iso || mesh->info.lag >=0 ) ? sol : met; + tmp = ( mesh->info.iso || mesh->info.isosurf || mesh->info.lag >=0 ) ? sol : met; assert ( tmp ); if ( tmp->namein == NULL ) { if ( !MMGS_Set_inputSolName(mesh,tmp,"") ) { return 0; } diff --git a/src/mmgs/mmgs.c b/src/mmgs/mmgs.c index 8d7687b85..e5bf239e4 100644 --- a/src/mmgs/mmgs.c +++ b/src/mmgs/mmgs.c @@ -429,7 +429,7 @@ int main(int argc,char *argv[]) { if ( ier < 1 ) { break; } /* read level-set in iso mode */ - if ( mesh->info.iso ) { + if ( mesh->info.iso || mesh->info.isosurf ) { if ( MMGS_loadSol(mesh,ls,ls->namein) < 1 ) { fprintf(stderr,"\n ## ERROR: UNABLE TO LOAD LEVEL-SET.\n"); MMGS_RETURN_AND_FREE(mesh,met,ls,MMG5_STRONGFAILURE); @@ -464,7 +464,7 @@ int main(int argc,char *argv[]) { } /* Check input data */ - if ( mesh->info.iso ) { + if ( mesh->info.iso || mesh->info.isosurf ) { if ( ls->m==NULL ) { fprintf(stderr,"\n ## ERROR: NO ISOVALUE DATA.\n"); MMGS_RETURN_AND_FREE(mesh,met,ls,MMG5_STRONGFAILURE); @@ -487,7 +487,7 @@ int main(int argc,char *argv[]) { ier = MMGS_defaultOption(mesh,met,ls); MMGS_RETURN_AND_FREE(mesh,met,ls,ier); } - else if ( mesh->info.iso ) { + else if ( mesh->info.iso || mesh->info.isosurf ) { ier = MMGS_mmgsls(mesh,ls,met); } else { From 5b297d935b598adb2996a3ca39d024f11d9ac395 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Wed, 7 Dec 2022 11:15:32 +0100 Subject: [PATCH 807/838] Add doc for lssurf option. --- doc/man/mmg2d.1.gz | Bin 2296 -> 2413 bytes doc/man/mmg3d.1.gz | Bin 2473 -> 2546 bytes doc/man/mmgs.1.gz | Bin 2229 -> 2274 bytes src/common/libtools.c | 3 ++- 4 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/man/mmg2d.1.gz b/doc/man/mmg2d.1.gz index 6eb8f7e7ef92b4ebfa9e890f028bb78f9bc8bbb2..b0424af89901e2135256e5300164f00c800738e6 100644 GIT binary patch literal 2413 zcmV-z36l07iwFQ|W{_h51Fcx=ZX3B3{y$Ga1ZZmmwk+ElpvZO$$hMqlp&KN*seu3s zYK9{bJ2RY+9LWm$LVb?DSieJZF7jn}izYzeA$fRs?&mw|eR;=z`i}pi9vHIKRvMPd zOfdW{xwcHD%x(qC^9?g9wR^4w4&q<=MzB%jy z{;etxT5h(Moy4bXRA|ZBIU7xG*vUg7cS0L!|MPE_2zH}%B6#(5iu3W$<1q;4liSlX zcGd6yaLydR@D?N^p|uc=gdf;JRV?NO(;|_^YPqf~bh3;W$pxf#vK_GDc~nIrYE^V@ zYNbC;AJ|wJgR_sK5KxcJt92%0HkPp{j9?sAq8$V6J*)M>UA-r9mbJm|6<%*7BiLhK|rlbBN+-)Fgmar|~3AjBLh^K^c79-|<*P+J`AxOG6-tv8>ij6aov;K)J zJQqqI!)|Bu$Iz3ruAh~(hd3`Q z>vrANeTH(9F@FJH&TdDS?&&qlYL+l={QP`df9#qYfxhTaB@Go7(6A>`US+mk4(boC z1A`|pVE>}6LO0LlNc#4;-R4iPZ5#RRwQXLRoyTsgUT1vsiu##3 zCNied>Csl9Br-wUcAcx8Xjf*>%gzedJ1hAO!Zm9xHqCdVW>*?j7VG5Dt`KbX;yRh2 zo!FyGh_k!l@^&$ruST^MJ~)x-^hXvO zWTYvhn?oHCRK-i7Q45j&FZ!&Zs!y#`(-W~OtVRq|1t6pF7*(q*wR)0y-ImunnrpR# zFeqj`gt4n(XRcpT?ipW0=rM4m?@|jBqnJPy*casv?WItOFrMS*&^L~_Su#yyQs2~2 zL^HKF#1^dua)|b+uNBWET8yi(c&`+(t>2f0v@&G7lfb|GT$>DyD?2wxQkR!x500xi zBPPhUN;J*BLt7QG7tXfQIPF>`GV@Xc@kHL1R-m-HJHQ{VVPcOZD#z2VfVDhaqy|0) zgf_Tz?eKz@BpvRs(&pdEO^0l-`1mjxPFE1X{z*;**lqzSE4^i(XW9Oo%kU%3F zxi*Su2-M-&q9mN}Wda|+168N&KCij&*m)rgWzTu6a$ry!g$r9)LPCM9$jV;5xg#Df zM^{x5+)KU&c3Pt-*n_v>ivJ3ugiu%uyBB~u=aO^k&~@$*?^(^^ul+uKP83rFK=;y!M&txG(gX@nW!BY(N=oN2bfV81p-thV z=uHd<9O;chTXnAT&GgH&UrCZw+75(hoBiK=K@b10dfoa!6sJFtOn%-r&gD{qJtjTIWJua#$=Is~}; zBCFdd^T^{F?C5X`V_eZ;7~C4nIl=0gIoV0mWkMz54fZ;e(Fb<2QQoDWpqj=yJ|MBB0z07(S{O8Uxa)44&wt~Lq->#t{&sY z!*ck`a6DK>B&_tlV<|)>E;OJOg6m<%jiri?Sxm0AtCf|pG*qQjJbiPAs&YpO=#aSM z(Wq{i$2PY>^EPxBIODm#G(d0?pKQJK*>;}xs6a{v%~MUkV(qm_UEmtf%Gq=po8P$)rI+Q zle1K-9BA!pB{jT{6b4We1dsMyC%*NxEr8|&AG!-ch@Mff01p=cLi?@4B)dak4ye34-i#nh$d*b~4+aX;eJaEiHzB#snB84b{3k$?Yz~z3>PK6e*y@^`vRlI0= z$ECFm*)T)Q5qm=Ks0ve45Xr_PWshLN#`%z>+p7Q&8#rq4P%B2mxtWBfij|6*r(eS~ z7m3Kkk;}rE)R1aHy_-l{3I{5rDUcem)Jt2 literal 2296 zcmVpwlXmy4Qw)Lx0LBbtyL_X(s?iJ z-{|6C)Mo4GBtE54Zj_*N8cnY0Vp{SPIQuC+;|D4$MoKK{pe41(F@=JbrN z`u(5I$@8n;f@CbTk+PBSJsosOvB=5DL|JFls&vrFk;sz^NbO}iU?cD-^F-FFn9SBn zf0#bdSXzs-4>Fffk7ng6RWXfKEORSKz)HMhp?zSrI{2%1EY6}f*qz1;-VkRb70wNL zWpz$(>&GgVXQWNwbRrz9VMrHz^AxflC>5@~{H+yQWfM}l=eyMf)Y^g>)ZeQ#rIn=8 z%5|BZ5h&@?X!-H}VHx-grjPV#FrN>m%g3KV?zS2vawh{bl@+N1Z)jyi?hY*cWH`V1 z2>QYGXgpdzHuB$%meb*4L3j6a8qjPoUyg1b#)CP{9_F+A#jr;UDSzM2fl+PjwRarM znMfy8YCGyb!rd04rU`AuPQvZ6L_8%VC`Qcvp+k=!LXdQCyyp8<=NoS#Z~YUM2QHjG zmTvB6kE7{_-WVnr&OOU&>$FFsHRal!k(Dys`PXt5}-o0h{t|0$nOVhz*81<%Ey){i}kch(h>BwRoJ~&laOam)$_qz<8oxeVH4;_4ftuA^EP zCzfqFg9(2ZU>c)RKy>C~3B4oNiR6Oo-4%t7gbJAIz2$52iFH>FMa6SM=k=`uTa@Tb zs60sXscI-kk~lVFWBx90uh#eK@B34wzbCAW0H@vDPbP!uEsaOhAr0mq9wx)-5_JI% zthy_dG`^j$wO8tW)VogUT;?SLV&o#<10ZolT^&2b^Z8yS5abQ0IyK{Y!FWUGxwIS& z=dsQJpj=d4*uq6BceIsh(W^Ii%)`grvdkr=Xuv7gIyC+jg4`W~IhW!$xCd3E#GjRP zdx<`Me(B5PW#1QbCc~fGDxf?q!qXoOGcLcM-+caa^KjNYyg+F~-B6h~C;INe8x)p~ z_+lPSt`APy?|I~1|4;l`^&+PoSQguZMSe8A(Tn!dLpI6Rg@I3MGAL3YTFmX4C{_iLXb^oZZjdJv}w$@ZIJdkq^ zg1*!9_{P0ozH;Rik)p9iR|xrh76SDgCIbp&z)_?kMsb6gn7oa$&^Dj-%nqk&2FW`N zE4NnWoM83LoOIGuOC{HXu_30#J z&oBK5!^~x~yo^rSWLM3`RRo;q$FZs)@)v_Pu>(-%+NcvuX79gYW!h=o_t%F-WMD5y-o&w2mi&HIFEvSwU5`;{^0D((`Ckw-kEy4WOv2 z3NrFqS?vSfi}Dnm^m~0|bhQE#pj|3_Cz8o&>&01hgJ_t01Bo1RIm0;kWdCjF zIc?Mmpy~)wEw^YbTaAH&#}2qS^>YV$jfb6pgj-<>TEh$_C_85e0lXf%c~#;oSmvS8 z1U)Ky)}m^%0Mi0lQ+mH4t6-ZayFuVPOkyw5)i|yuge6j6u0HaKHtV&Y2}B;tx_|mX zI6ZL4GO$7*(?)8x+2Ich{bWsW`}2m4y z*F(CVv%oQ}vcj{K94Sm0>pVw%RA?~Fa%*WMY;U8Q4HvxUt?9S`wjo;~*BN3@njP0l zF5NQO1iTi&5ZHJhvUGc0A+hG?4U30bF&fSd{+?7?~HnWpMR73|KQT_={^w`ObPwFgdhutgO;2d$m zgv7dL&RA8jclBjK&S3h;J`Wa)!F2WbBevVE!WOX;UYN|wOhPuS(!8(- zQhqXA+@x_uZA7Hs~on9r8O9$O0W+kWyFY@Can z_s?YErBM19b~~Ftj;0@bW4K_ra3aIhd5?`!Rw#SHj1d0J-?rA4AFi(U`+aXyR6V6P zSDC-ZT>ZVr=9%Dz%;E{DC3OhY7}14?%no!xh-E`gMJ#j;Ck30>ps-T~&dAi|36En@ zTH2TUJpJCd67}v9HsJ@>|A7+t`aLErn@m2wyJOc;Z)QlpchG;iWz)fA81<%kJvB|( zAmOET+2daZ>5$8BeggLKF8+Avp=~ZyW5j%-a*kY}1zBu*?v~}_bT(g(mff2MiVd{e z_KQQn0it47(i~EttgM@LQ}-E=CS(2pzMM;s4&9R?menHR_xN;uTYv1D6JdYR*_AZA z2wTIPNO_gndN`;*xDEoIAb|agrV8C$m%|6`ay!kRUYa)Y+e_2DGRaHx8_i#x*W&97 zOFEC;R6SN@u}%*4DC3(KoROKMBbhOkPLHMvm5RI_NaT;U?KoFE(T>cXmz@!0bw=_V z^lrvlY?^PAv^paaj|Ry0W*l3p0ne?_#nB|9@ou=hU5w_d(QF#6wxSc1yrdxZp-%9Q zYK9ST&8nlQ*P;pU8wEfjV|eV5Y=;2NMMw;wr?1N*K_-|ox;fPGWT-%tLIY-jEYC`~ zp@KqHS<~gQDy&8h5V$m#m8DisGOsKCT1RuOb~1rp$WosM4jwODDWC>J;^$D3j-**~TJs>jUIL#pwKpUdPyjtdd)3#9XA;%Rfj90e zMQrQ)Wg)GsfrK>ZwW8^HUzHAYMM21X{g*~zSVF_23#o)b2;}Bf=H2?-Q5ni@c4>eg z4l>Bq05Do3$pC^%G!&(?w<=<VhlFg z5G-p)akMCX>PRj*UmtAsZ|{K1_zw6*3e_7Fd;WDFGUnD(8_8QST;Wm!hbU*drUc z+K*QZyTh^tJYDW(g6MgJU7dn(S`FT?%R(5+*vnYuAkH=l2e$BpgaKQTmA!g$M=~5P ztg0fsE{wtgkB4I7;UVxunUb~07?z=xj9&2{>UZo`+uU(5UN&Lh%C1U14LcDwNnj>yr;*v_p35Gkf|2N4Y zKITm(e$SU5M8m?lo)@98A3S)RFp<_o&&7|3_-YHLu~leMi3K2dGS|rpU$rr1wp^Di zg@Y^X?5rWUaJz3_Lh%S}-ZAP4$U%O>Sn6$_-TQ3~s6X2l*uL9#i zv7&igCwC?ckziibk$&A1m+xPX^_uxXVir6a82;HYXtu!^daF62O6VQoYYX?8XV{+k zB5&L~&=q?X=wHJ%4KfS9NQD-7;6}Rdx$cxx6QPasliWdH?7@N~Hwr4lBJ=o2N_UQj zE^VqX!ziG+pU9h^&u8R5H)5D0_Az}MQj9a$51NQ7%Ar)aZW=SCG**S}{}hVmif zR7|M2Tq0epY{w>72)ZK$eM)-n#zU85s&(M*1ky;fr$F91wX!Kl`>l+T>2wxtL3`G8 zBB*I*{XMP#`%b6kieSuZSdIJq)08yu$6^7oXD?JSg3r2;%?GR1a4~&W$GTxm-Q9#D zKJ;8Jn*L}L*AYT}+|spcr;Xatk4ts8Mk-bIB!GMyAGo^bp(jOM0S-H5-zlbr_Y=Lc ze`^~W{^jj#b^9r*>+?(QIx6~M|EatDZ(kugV`cHOwMZ)JzS`FXlm4SkS`1eYiz)lZ zVEi!b{v@UaDpA8%*HwmWJgSWm-O{h2IYsEih;x%x*^kZgb-V1_dqrE2Z8CE|KNI!$ zu}7UQ{rKQsq80G=Hw2Ke5bzhOj5MaLBV7vj0@ I3QZXR06-S$x&QzG literal 2473 zcmV;a30C$WiwFP>%za+~1Fcy9ZX3A~{(ql>2+-CBY*|h&K#}VekZn0ppQk!YTIHMuZbma9ajGUisQ zqUYytRe8{Iv$gCjK4+ssOU^FYXmZ2O9tyb=+DQA`uPhPlM(ITG>ggQoO;$g=j4Nzz(WnF)x@Fi8NNrb!BlU%XpDo!D?sQ0TW(FRV1Rm ziq1`a>5tO~HWtQU?V~6JuE*xpI+HOQ%UBdfFb*%#jKS@_s`bHby(e>)wZrZePH>L6 zU_xSDGj~~4uy^%gLFENg+G{%Fmad_hDrx6AY(KD!+jjGFFSM6Um@J&$ttxS?EtKK< zdzocyEm&nlT4fgulI-(n^=bC7@_Gi-NA`KJSPZ7C#~&eXw+bR+C%iJ5mzjia+)DGp z9?1B~aB=$y@`Ibvc(i(K?7ttaro-iu-Omb%EBDJzt{U`7bP=O0^Z%MVvq`~AMRDXN~* zo2$&9W3K+$WAjXKL)YR7nI&}qY7BJYA+rM=5U^~>slY<_;$&ch4T7C2ut%mYPIw%P z(vn>6BjS>#1qN z1_>{%iyr?n2!~vL^Aorq@8%z$dPvMcH3sGrm2<=bEy!ZibEhmHr?dHTwCtWVP;8)` z*v~El4uFbTNplE+va)X0P2Fe6G#T?7@a0^3wCSD9#sa2*spK>_QKi$)NPdHn%~*>~ z^KFvWK)~*3fY5Hnv89Cn++_eB~u}@n&pfMLA3Xm#&5f%wxZ_4QAP=m)%H7JEfPDL7dR<8|J4=TZ$ z4v$q~H2_bUq&ciCwR)0yUEbF^nrpR_3G6~hdd$0Ac;V_U#jx?Yhz_GG;k(qr#7IiG zBpv~26J@GUi7?MKW++10r9o7=Kq8wE*0e^75FV9i3U^1gDq^2GY><>*AlHcUn`zT)KXVU;E+

pdE zO^0l-`1mjxPFKJ>;2Ow?ao_^`NtJWihp2axu}e`@2$7MET*<_FK{_m3MD^ufCb;Gs zNOkh)X%c7@`G!K62qT6A0=KE{&P#ioT}BAH(&nR9Go`?F99~>QUnA& z7HG=BJr~|2qK!o~xj9&2{>&lo`+uR&fMu&JRF>O=L2NdJd#dpd|Bp-o905dGgM^0n}&){hF* zc!ntE#U_M9V?ISV`ES&l=o0!RW-D?5utU843Vzc-Hy%^mVA^E=tB6jG)-SVgAS?2Y`p79&wF?>;Ugfd5X^Zy*?s3jGzR~0V`eY6Ulk|it{F3zUTW4qG912#EVcU z4nD+B>e_j8El)I$SmtVr!nIZCzo@FtkEfg=ne(K`U zWkgNqL6hzmh3r6JuGcq0kv9*2SOO*~10YUIO~bLD*+&b<$*0S^Ul(VoRyhdA*Gg*O z0wD;lA&CBhe(e8VUJLSv-w6TAZy95>ckmiVuf{LZcd=?|4JKIB7GF7ZpRR8=K?zu{^2H{I*y??b!>phSFzUZsvp4YPgs_t2SL2Q?D=~#0L)V(DY|}f{qeu3zm-lpA!G0 zUruWFPbO9N1VFxR4UF2e#go#jkPbV=*%_vV_Y=Lce`^~W+~w_Tb^9r*tLRJaIx5XU z{?uLmhn;}VSXsPmt&&QwugP`6r2lAU7Q@xUV#@wK7(WcVzxQZ?O4P8*b(J9+k7{E? zr}XR8oB}#AaBk8n`>|QRZkK&Kt4IXVCNuZjDiL&#J!)8~*>*3{DtP-l3h1&>@HgA4 n$Qu>C=7P&1nzZq97WMw4>28L)6#w}aeNFT~K@?xFDi{C&n+3+l diff --git a/doc/man/mmgs.1.gz b/doc/man/mmgs.1.gz index a436446b5803270ef3b3a93b80c85b9a3165b6b0..46b5dd1dcc8f704b90d0512015e521297f2f9bbb 100644 GIT binary patch literal 2274 zcmV<82p#tyiwFR!XOLq61Fcx=j@!5u{;#JX259R6#u`s{0~FbA0gvNJyzmXSr|AFz z7PLg!L?lrmDSI6Bh58(Qv3`ft&2vdxGyw*YsKdi^{mw^+pD)<2Kk#1=LLuAirD2Io z1;hUZ*OsY-*}Y&{wqr&m_Qz^zZ>{jVm@bd8z->1J#rw~}qMweIY z&0z3zpE-TiS+Im8Z1t^;WS`Fu$hhHFW_X;B7AiOe}6{&=7c%^x6Ph|XT zyc&Ik{P1=%oopT&`|l>3`FOo%cZ(GpvgL5KnT+nI!xdZJua=ATIAm)fz8`0=s1A1G z5{Gcc!g86Kj{6Ttw}Gi?%=Y{skoHKRo?^yXgqr)02|YguMbh2zTJBSo?_7vn^m{V* zTBv;t8!eU(llg~miV%!fPGz-p8L~;ja%HcW5yJ2J%ih}J-SzeHcno)W87jTIPW?IN z`mZ5drh*%Ci^pV^)K#HIs4gTjJ<$PGEgK3dYN6{m8Q9bYm7U75M<%XMcod1kl3eEd z^he`L5WbJujGx%xXKLV^w^*=jHv6zsrUB z1-+2TZ+-#Jab`-L@CZHwO!8fs`cGOES{RXAi5ziONEF0TA~dPY1=oxhg;tL;YZc`l z1=17ksFm)7$^dSs&{?;Bm@k&=$+~0VP_dzQc=x-5%^^x@QP3LtrYNmjbxU_C;3;K( z1D;$S&Ne{;hp}2E9EzTP-`5X^W=AETcckJ*iU7G<6A3R4_eA~ zb6f@xX+O8i{PCq_Bfq`0%u5r$w7%2))paetzVJzBkz1K-{46&pp!ehTXf;`GCX0En*^9Q0 zP>yLeDjketYT*s|W!0+%PDO`WMQNHMxINVwCYUdT23P_go(*C{V}WL?Ce@M3twvE2 zMAXNebq17gb+FXxAY9d_?ox{Jmi7%= z&vhFGg+n>Mkuvm9DH=-9kuCGcn{HcMor_oW?p#dGbN|F6rCM460CszTJZ`LFjm0X% z(X}I$4sxf~V<3odZylk~Cnn-uYn)R@hq1!BM^0vs)7v*G+bn@;9qHe7wU zpN;1m;2Dasq8Z4PcDyE0&g6GNc$>1m$V=4q#0G8{q5vxC>a*oL)<4P^8M=T}2kf3A z-39CC!cb}VBb9+k+MwF7M^a>N*D=%y2t$>s zt*}P{!qUHSfxH>GspiV=^TqqBOPnmi<35cu8bqHjKL4>fIBO1GBiR5vlo8b$2*}A- zn^ggA%!AqO$qMt|9P)PX2YRg1WtD}>Vt+Dd&PF$e@=-YMDrh@*y!EQq@aMsR9%qUv zqLDPx8k1whNYiKs6l}{K^?m1Kh5w&4N{@eSHxT||Cfoz3G(jyZgeo{jlL zZXw^9)wE;bUSHYrib=s#VVYIw2%>rpDs5T$0smyWclY|+SKd)j<*^Fj3~x^Y$a)R- zSCG#e)^zzJqlkh<@m?vyrtiiHpVikdNVj~om z#U1Y@xth_{f(?oINMDpr5_j9+InfqR2)<9QzmJ@=gdy!u5xU`z&#a&i=S|z?l&_1k zM5_!u;cF>1vQM`MD+Nt$+;?M-xGnS%8TGZh5=0ys6^qIdGQ*C0g}cT9g_TiBXdczn z4tGOhOFXX&`X&_px38CUJ=>u%ts2g$6;vrC3A&P_K0H_4`deZmv_R}l(DH!%8P=Zz zOk1)IWnR(^N*_eSv?_Me>W5XBvylgbmVqQ4+EFQOxb|GJLeaeN?}*BEEK+fnt%`^@ zqFT_jB9T_Yk#k58P*5mbMJ1^$if(^2w0-V~B{7ETzUO!%jd47;8TY6Ia?!3G$jYcQ z@*MS_gI*&dc*K0r^@X%FRNpBtQXXM;us+(`%J$u43Pp5gpl>8kG1w68yjsE<#vmoRfvV z`}O$uN}ifbR(GHz1*j9nlT|(=Wf6;7CH*Q$^Q0XN^amEa8gK4bbN094^nTpA%xeL_ zZRp6hOi`9+BOstd1~oP%h;@X*FiDyI(tN&YKl^)-A`z6QOx>?-6}R*GqUNQGnhSTU w7!-fHUIgLaH97cGOeEJozoF-U144f5OhXm`07Q6mv;Y7A literal 2229 zcmV;m2uk-KiwFR^D1KuA1Fcx=j@!Bs{;#JX0<^V(wbpyi2~gzp6!1FU#D#CLy-gPg za6n6xO+*qElCsx9U#QQ~7wb2qZr)2;pa~GHNDha?nQvx3I{f^G{q_U@1tAo&?Liur z$W$==Ex5K!CCnZK%d$N)DzPW71s0+&d@op{v|F^oYJL#0=BZbc33FhXie(}rZl%gY zKR;H*S3@(_Bl=25dUNWxe}c9)&j2{`+4n7VK8(Sn%?(kM-H#W-|z^=Hvbq z`)N4*Wx$-i>MU4BMr$D&3*WJ`Dp|yHrbR4`)pA!_+{rSY$Jemh*>=W+*HPxNsIQ_k zQ(yYS;-1ZfFTyfg&`cGyvk%+PEakS{{M-xeWn(6Dr}v-=Th}(mLh&T$bOlCzYp&Pf-Jhx{u zem+@`KSF+VJDp9p4~_kI)9qri*|59invK|MwBAm~_p{NOt?t*Wk748G>S4P05YFI&$=a!`rure9CM;L>iWwpNp1&NdE#6&UpH8Q6pO>N1`|H%7 zW3K-ivQ;X$p=um#JUUqR_&K+)BiVvqAz8CkfZ2G8bGkUKCnA%B)qC z`zny0X-BPeFI0x&b`G6&n}@}6wV7@@7LF7fX;<%lcV%+~C@l+`L*5jnb+c~jE=74t zncsjf7l(^YkicQAR*4HmPuCCi$FbQ_$>$xZxRIiQT+NAum#M9Xqxu8B@CqKGfc=xE za@`!4p@_80?KFRUY1+tdFHQ5(#4pY7HGg$pi?1&%=`3awg=II2G~oh zzUXQ;S`H*Y9HK~qNZZ!}{^`JiH zA`PH?r-PMNM;ZIH@gQ^+?aFmeN=D-=3LOTm^i8Q2p|s!%a2$#snoX`^VV-MD(Mr;R z0n8n;$tEsyS|dfkYbl!c+mS8v$d>@y9_~)KqHz#9ECjw$qA;iGWXL%2NS>BfpxC)R z$a2@hFvnt*;pot9_Mz7qUIYspiIuIGwAE?tPoI>B68$x|;xE^xK#RY%ub z!@vP$yqwQRi}!3cT};?${o#H-S!_{c0Gg`z!=u`fjYPS-y$izIlnq2)0)JB*xDJIt zRnpb6<$E?b$r!f2fmEjgJuN?P*dP~%AUKFr26|_MYQq81leuLFkrrV+c_bYU=i4%` z;zU6ME!iP;?AgbC%fBF)RZMrno&;FL;KuppX6RZCiQ&)t3e8RyIpLNj8Fh!xZ$AIA zIXG($-T)P-LU1T~9jxH&{ccr28}nd(d$z*-FNeGx{((L#&{<`nvN)U#lBm&*PI(fJ zPzu`49htnUHT-!vq|doxinty1na1Q8KGM{0k+QpTPx;wdtcvm{4UAHDC^{3ong+uiG* zM0rO+701efbBvxikoB4xU6p3uP?`RZ^e&p9?}B5{Lt9lUpjjH_;_MRQG3X7$A#hxc zU=tW9D_m(7algIFs)5OmG;$P7a=uHcFv2eMA#l@P{k-Tnx!(lE6O#*8vOS=19u!DE zJp}-R)V&3S?+utT2d)d2zzroNJ8R&+INdkUs<2hm#?gy83V7D7-yJbeb-Y+paGr@( z)W?a95q*o-(MxhQ7peuDj{K2Ului=I(|JxDz<1a0)6(ykw|T-4_NQgEVP4OypoPoK z>awxd#qs=B8QR*{QsTwUh<95ls0ZVv82hr=)+eHI90$*UrDM5}^frZ-QD4 zW&P8Fd|3rr$Ts|QMQ;y%6b&)(T%)5OR-qY2K4Tkx(aG9IX+vBWiWQ2Ax*x+U*Re>& zMYJkb+lXpGErmo{3CDCHA>zGrg+o-5%A)AzN5g>^jt5a&uU<-y)=;m-cN=ji191Zb zXy=Y(Wz^|Qjz=%RRpAkQqKNDIDOVc8cgl;DM=0=Yfb_Pq9h*!6L>C77MDlEaS1iqx zyUNw%N+ix>MF%>?*w6en3{D3bAwOv^C||qRv=Q~Za89wQ$Y2I+KjVMyr;(=|u!Vcx z;Y*$i^eQ86fnA?}X`S?IgpOn$HADamB@ph!{_b>d;Nif5!Od{L{U-_z(PtF|%Fe^Ax+WP86}u)mLH z_mj>uSPK-~hBNHS6tKK#0RbH{tZP#OUq=9jNy_xsX8ERF_KylhB7mn%-S1Qt0rT;q zv|o3vM*@~n_F%s;Ni2)G6?^n>4HDU#6 Date: Wed, 7 Dec 2022 15:48:40 +0100 Subject: [PATCH 808/838] Add tests for mmgs lssurf + fix issue with missing MG_BDY tests. --- cmake/testing/mmg_tests.cmake | 1 - cmake/testing/mmgs_tests.cmake | 17 +++++++++++++++++ src/common/mmg2s.c | 6 +++--- src/mmgs/mmgs2.c | 6 ++++++ 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/cmake/testing/mmg_tests.cmake b/cmake/testing/mmg_tests.cmake index 033f9ade3..0e19c8968 100644 --- a/cmake/testing/mmg_tests.cmake +++ b/cmake/testing/mmg_tests.cmake @@ -369,7 +369,6 @@ ADD_TEST(NAME mmg_CommandLineAni_${SHRT_EXEC} IF ( ${SHRT_EXEC} MATCHES "3d" ) SET ( ADD_ARG "-opnbdy" ) ENDIF() - ADD_TEST(NAME mmg_OptLsSurf_peninsula_${SHRT_EXEC} COMMAND ${EXEC} -v 5 ${ADD_ARG} -lssurf -nr -hgrad 1.5 -hausd 0.02 -in ${MMG_CI_TESTS}/OptLsSurf_peninsula/peninsula diff --git a/cmake/testing/mmgs_tests.cmake b/cmake/testing/mmgs_tests.cmake index ac4a5c049..a21c7cbde 100644 --- a/cmake/testing/mmgs_tests.cmake +++ b/cmake/testing/mmgs_tests.cmake @@ -389,6 +389,23 @@ ADD_TEST(NAME mmgs_LSTriaOri ${MMGS_CI_TESTS}/LSTriaOri/fault.mesh ${CTEST_OUTPUT_DIR}/mmgs_LSTriaOri.o.meshb) +# lssurf: discretization of boundaries only +ADD_TEST(NAME mmgs_OptLsSurf_box + COMMAND ${EXECUT_MMGS} -v 5 -lssurf + -sol ${MMGS_CI_TESTS}/OptLsSurf_box/box.sol + ${MMGS_CI_TESTS}/OptLsSurf_box/box-3D.mesh + ${CTEST_OUTPUT_DIR}/mmgs_OptLsSurf_box.o.meshb + ) + +# lssurf + multimat: discretization of boundaries only +ADD_TEST(NAME mmgs_OptLsSurf_multiMat_box + COMMAND ${EXECUT_MMGS} -v 5 -lssurf + -sol ${MMGS_CI_TESTS}/OptLsSurf_box/box.sol + ${MMGS_CI_TESTS}/OptLsSurf_box/box_multiMat-3D.mesh + ${CTEST_OUTPUT_DIR}/mmgs_OptLsSurf_multiMat_box.o.meshb + ) + + ############################################################################### ##### ##### Check snapping (prevision of non-manifold situations) diff --git a/src/common/mmg2s.c b/src/common/mmg2s.c index 017c5c9db..89b9caa99 100644 --- a/src/common/mmg2s.c +++ b/src/common/mmg2s.c @@ -78,7 +78,7 @@ int MMG5_snpval_lssurf(MMG5_pMesh mesh, MMG5_pSol sol) { if ( !pt->v[0] ) continue; for (i=0; i<3; i++) { - if ( !(pt->tag[i] & MG_BDY) ) continue; + if ( !(pt->tag[i] & MG_REF) ) continue; i0 = MMG5_inxt2[i]; i1 = MMG5_inxt2[i0]; @@ -137,7 +137,7 @@ int MMG5_resetRef_lssurf(MMG5_pMesh mesh) { if ( !pt->v[0] ) continue; for (i=0; i<3; i++) { - if ( !(pt->tag[i] & MG_BDY) ) continue; + if ( !(pt->tag[i] & MG_REF) ) continue; if( !MMG5_getStartRef(mesh,pt->edg[i],&ref) ) return 0; pt->edg[i] = ref; @@ -169,7 +169,7 @@ int MMG5_setref_lssurf(MMG5_pMesh mesh, MMG5_pSol sol){ if ( !MG_EOK(pt) ) continue; for (i=0; i<3; i++) { - if ( !(pt->tag[i] & MG_BDY) ) continue; + if ( !(pt->tag[i] & MG_REF) ) continue; ref = pt->edg[i]; nmn = npl = nz = 0; diff --git a/src/mmgs/mmgs2.c b/src/mmgs/mmgs2.c index 148e1ac88..645c2c166 100644 --- a/src/mmgs/mmgs2.c +++ b/src/mmgs/mmgs2.c @@ -65,6 +65,12 @@ static int MMGS_cuttri(MMG5_pMesh mesh, MMG5_pSol sol,MMG5_pSol met){ if ( !MG_EOK(pt) ) continue; for (i=0; i<3; i++) { + + /* If only surface edges are discretized, skip non boundary entities: as + * mmgs doesn't add MG_BDY tags, we check if an edge is bdy from the + * MG_REF tag */ + if ( mesh->info.isosurf && !(pt->tag[i] & MG_REF) ) continue; + ip0 = pt->v[MMG5_inxt2[i]]; ip1 = pt->v[MMG5_iprv2[i]]; p0 = &mesh->point[ip0]; From 894bbd4b4b77388c8b53474321556a2e2ba15522 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Wed, 7 Dec 2022 16:33:07 +0100 Subject: [PATCH 809/838] Fix issue in lssurf In case where an edge has to be splitted, for mmgs and mmg2d, the cuttri function was checking the triangle ref instead of the edge one. Error was not raised by ci tets for mmg2d because no triangle has to be splitted (test has been modified since). --- src/mmg2d/mmg2d6.c | 15 ++++++++++++++- src/mmgs/mmgs2.c | 16 ++++++++++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/mmg2d/mmg2d6.c b/src/mmg2d/mmg2d6.c index 87ac4706d..1c345153e 100644 --- a/src/mmg2d/mmg2d6.c +++ b/src/mmg2d/mmg2d6.c @@ -96,13 +96,26 @@ int MMG2D_cuttri(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pSol met){ if ( !MG_EOK(pt) ) continue; for (i=0; i<3; i++) { + if ( mesh->info.isosurf && !(pt->tag[i] & MG_REF) ) { + continue; + } + ip0 = pt->v[MMG5_inxt2[i]]; ip1 = pt->v[MMG5_iprv2[i]]; np = MMG5_hashGet(&hash,ip0,ip1); if ( np ) continue; - if ( !MMG5_isSplit(mesh,pt->ref,&refint,&refext) ) continue; + /* Look either at the triangle ref or at the boundary one */ + MMG5_int ref; + if ( mesh->info.isosurf ) { + ref = pt->edg[i]; + } + else { + ref = pt->ref; + } + + if ( !MMG5_isSplit(mesh,ref,&refint,&refext) ) continue; v0 = sol->m[ip0]; v1 = sol->m[ip1]; diff --git a/src/mmgs/mmgs2.c b/src/mmgs/mmgs2.c index 645c2c166..cf1f415f8 100644 --- a/src/mmgs/mmgs2.c +++ b/src/mmgs/mmgs2.c @@ -65,7 +65,6 @@ static int MMGS_cuttri(MMG5_pMesh mesh, MMG5_pSol sol,MMG5_pSol met){ if ( !MG_EOK(pt) ) continue; for (i=0; i<3; i++) { - /* If only surface edges are discretized, skip non boundary entities: as * mmgs doesn't add MG_BDY tags, we check if an edge is bdy from the * MG_REF tag */ @@ -99,15 +98,28 @@ static int MMGS_cuttri(MMG5_pMesh mesh, MMG5_pSol sol,MMG5_pSol met){ if ( !MG_EOK(pt) ) continue; for (i=0; i<3; i++) { + if ( mesh->info.isosurf && !(pt->tag[i] & MG_REF) ) { + continue; + } + ip0 = pt->v[MMG5_inxt2[i]]; ip1 = pt->v[MMG5_iprv2[i]]; np = MMG5_hashGet(&hash,ip0,ip1); if ( np ) continue; + /* Look either at the triangle ref or at the boundary one */ + MMG5_int ref; + if ( mesh->info.isosurf ) { + ref = pt->edg[i]; + } + else { + ref = pt->ref; + } + /* If user asks to keep input refs, ignore multi-mat mode */ if ( mesh->info.iso!=2 ) { - if ( !MMG5_isSplit(mesh,pt->ref,&refint,&refext) ) continue; + if ( !MMG5_isSplit(mesh,ref,&refint,&refext) ) continue; } v0 = sol->m[ip0]; From 63b7fafb2b28e2a0ce47a5715ac94f967ed1b8f8 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Wed, 7 Dec 2022 19:02:16 +0100 Subject: [PATCH 810/838] Fix implementation issues in integer sizes (for int64 build). --- .../code/ridge-preservation-in-ls-mode.c | 17 ++++++++++------- src/common/mmg2.c | 9 +++++---- src/common/mmg2s.c | 6 +++--- src/mmg2d/libmmg2d_private.h | 2 +- src/mmg3d/mmg3d2s.c | 14 +++++++------- 5 files changed, 26 insertions(+), 22 deletions(-) diff --git a/cmake/testing/code/ridge-preservation-in-ls-mode.c b/cmake/testing/code/ridge-preservation-in-ls-mode.c index aeb76923a..f8b65d755 100644 --- a/cmake/testing/code/ridge-preservation-in-ls-mode.c +++ b/cmake/testing/code/ridge-preservation-in-ls-mode.c @@ -108,14 +108,15 @@ int main(int argc,char *argv[]) { * output of Mmg, that is, the second mesh of the current app) */ /* Step 1: Hash edges of mesh2 and store their tags */ - int k; + MMG5_int k; MMG5_HGeom hash; MMG5_hNew(mesh2,&hash,mesh2->na,3*mesh2->na); for ( k=1; k<=mesh2->na; ++k ) { MMG5_pEdge ped = &mesh2->edge[k]; if ( !MMG5_hEdge(mesh2,&hash,ped->a,ped->b,ped->ref,ped->tag) ) { - fprintf(stderr,"Error: %s: %d: Unable to hash edge %d: %d %d.\n", + fprintf(stderr,"Error: %s: %d: Unable to hash edge %" MMG5_PRId + ": %" MMG5_PRId " %" MMG5_PRId ".\n", __func__,__LINE__,k,ped->a,ped->b); exit(EXIT_FAILURE); } @@ -125,18 +126,19 @@ int main(int argc,char *argv[]) { * is a ridge too (as level-set splitting may splits boudary edges, we can't * ensure that all ridges of input mesh will be present in the output mesh * (they may have been splitted) */ - int ier = 0; + MMG5_int ier = 0; for ( k=1; k<=mesh1->na; ++k ) { MMG5_pEdge ped = &mesh1->edge[k]; if ( ped->tag & MG_GEO ) { - int ref; - int16_t tag; + MMG5_int ref; + int16_t tag; if ( !MMG5_hGet(&hash,ped->a,ped->b,&ref,&tag) ) { continue; } if ( ! (tag & MG_GEO) ) { /* ridge of mesh1 exists in mesh2 but is not ridge anymore */ - fprintf(stderr,"Error: %s: %d: Ridge %d (%d %d) of first mesh is not" + fprintf(stderr,"Error: %s: %d: Ridge %" MMG5_PRId + " (%" MMG5_PRId " %" MMG5_PRId ") of first mesh is not" " ridge in second mesh.\n",__func__,__LINE__,k,ped->a,ped->b); ++ier; } @@ -144,7 +146,8 @@ int main(int argc,char *argv[]) { } if ( ier ) { - fprintf(stderr,"Error: %s: %d: At least %d missing ridges.\n",__func__,__LINE__,ier); + fprintf(stderr,"Error: %s: %d: At least %" MMG5_PRId " missing ridges.\n", + __func__,__LINE__,ier); exit(EXIT_FAILURE); } diff --git a/src/common/mmg2.c b/src/common/mmg2.c index 6b333909e..9299225fd 100644 --- a/src/common/mmg2.c +++ b/src/common/mmg2.c @@ -43,7 +43,7 @@ * * Compute key for the material in the hash table. */ -static int MMG5_InvMat_key(MMG5_pInvMat pim,int ref) { +static MMG5_int MMG5_InvMat_key(MMG5_pInvMat pim,int ref) { return (ref - pim->offset); } @@ -185,7 +185,7 @@ static int MMG5_InvMat_getParent(MMG5_pMesh mesh,MMG5_pInvMat pim,MMG5_int ref,M /* Material not found in the table */ if( k == -1 ) { - fprintf(stderr,"\n ## Warning: %s: material %d not found in table.\n", + fprintf(stderr,"\n ## Warning: %s: material %" MMG5_PRId " not found in table.\n", __func__,ref); fprintf(stderr," Please ensure that you provide all mesh" " references in the material map\n" @@ -243,8 +243,9 @@ static void MMG5_InvMat_print(MMG5_pMesh mesh,MMG5_pInvMat pim) { /* Scan all references in the table limits, some may not exist */ for( ref = pim->offset; ref < pim->offset + pim->size; ref++ ) { if( !MMG5_InvMat_getParent(mesh,pim,ref,&pref) ) continue; - printf("%" MMG5_PRId " (%" MMG5_PRId "): %" MMG5_PRId " %d\n",ref,MMG5_InvMat_key(pim,ref),pref, - MMG5_InvMat_getAttrib(pim,ref)); + printf("%" MMG5_PRId " (%" MMG5_PRId "): %" MMG5_PRId " %d\n",ref, + MMG5_InvMat_key(pim,ref),pref, + MMG5_InvMat_getAttrib(pim,ref)); } } diff --git a/src/common/mmg2s.c b/src/common/mmg2s.c index 89b9caa99..7245bb702 100644 --- a/src/common/mmg2s.c +++ b/src/common/mmg2s.c @@ -129,7 +129,7 @@ int MMG5_snpval_lssurf(MMG5_pMesh mesh, MMG5_pSol sol) { int MMG5_resetRef_lssurf(MMG5_pMesh mesh) { MMG5_pTria pt; MMG5_pPoint p0,p1; - int k,ref; + MMG5_int k,ref; int8_t i,i0,i1; for (k=1; k<=mesh->nt; k++) { @@ -160,8 +160,8 @@ int MMG5_resetRef_lssurf(MMG5_pMesh mesh) { int MMG5_setref_lssurf(MMG5_pMesh mesh, MMG5_pSol sol){ MMG5_pTria pt; double v,v1; - int k,ier,ip1,ref,refint,refext; - int8_t i,i1,j,nmn,npl,nz; + MMG5_int k,ip1,ref,refint,refext; + int8_t ier,i,i1,j,nmn,npl,nz; /* Travel all surface edges (via triangles) */ for(k=1; k<=mesh->nt; k++) { diff --git a/src/mmg2d/libmmg2d_private.h b/src/mmg2d/libmmg2d_private.h index 425e8b24f..39dc6f2dc 100644 --- a/src/mmg2d/libmmg2d_private.h +++ b/src/mmg2d/libmmg2d_private.h @@ -244,7 +244,7 @@ int MMG2D_splitbar(MMG5_pMesh ,MMG5_int ,MMG5_int ); int MMG2D_assignEdge(MMG5_pMesh ); int MMG2D_bdryEdge(MMG5_pMesh ); int MMG2D_setadj(MMG5_pMesh,int8_t ); -int MMG2D_singul(MMG5_pMesh,int ); +int MMG2D_singul(MMG5_pMesh,MMG5_int ); int MMG2D_analys(MMG5_pMesh ); int MMG2D_norver(MMG5_pMesh,MMG5_int ); int MMG2D_regnor(MMG5_pMesh ); diff --git a/src/mmg3d/mmg3d2s.c b/src/mmg3d/mmg3d2s.c index 2f90af052..5d42f7fff 100755 --- a/src/mmg3d/mmg3d2s.c +++ b/src/mmg3d/mmg3d2s.c @@ -52,7 +52,7 @@ int MMG3D_resetRef_lssurf(MMG5_pMesh mesh) { MMG5_pTetra pt; MMG5_pPoint p1,p2; MMG5_pxTetra pxt; - int k,ref,ip1,ip2; + MMG5_int k,ref,ip1,ip2; int8_t i,ia,j,j1,j2; for (k=1; k<=mesh->ne; k++) { @@ -107,7 +107,7 @@ int MMG3D_resetRef_lssurf(MMG5_pMesh mesh) { int MMG3D_snpval_lssurf(MMG5_pMesh mesh,MMG5_pSol sol) { MMG5_pPoint p0; double *tmp; - int k,ns; + MMG5_int k,ns; /* create tetra adjacency */ if ( !MMG3D_hashTetra(mesh,1) ) { @@ -132,7 +132,7 @@ int MMG3D_snpval_lssurf(MMG5_pMesh mesh,MMG5_pSol sol) { if ( !MG_VOK(p0) ) continue; if ( fabs(sol->m[k]-mesh->info.ls) < MMG5_EPS ) { if ( mesh->info.ddebug ) - fprintf(stderr," ## Warning: %s: snapping value %d; " + fprintf(stderr," ## Warning: %s: snapping value %" MMG5_PRId "; " "previous value: %E.\n",__func__,k,fabs(sol->m[k])); tmp[k] = ( fabs(sol->m[k]-mesh->info.ls) < MMG5_EPSD ) ? @@ -163,7 +163,7 @@ int MMG3D_cuttet_lssurf(MMG5_pMesh mesh, MMG5_pSol sol,MMG5_pSol met){ MMG5_pPoint p0,p1; MMG5_Hash hash; double c[3],v0,v1,s; - int vx[6],nb,k,ip0,ip1,np,ns,ne,ier,src,refext,refint; + MMG5_int vx[6],nb,k,ip0,ip1,np,ns,ne,ier,src,refext,refint; int8_t ia,iface,j,npneg; static int8_t mmgWarn = 0; @@ -402,7 +402,7 @@ int MMG3D_cuttet_lssurf(MMG5_pMesh mesh, MMG5_pSol sol,MMG5_pSol met){ if ( !ier ) return 0; } if ( (mesh->info.ddebug || abs(mesh->info.imprim) > 5) && ns > 0 ) - fprintf(stdout," %7d splitted\n",ns); + fprintf(stdout," %7" MMG5_PRId " splitted\n",ns); MMG5_DEL_MEM(mesh,hash.item); return ns; @@ -420,8 +420,8 @@ int MMG3D_setref_lssurf(MMG5_pMesh mesh, MMG5_pSol sol) { MMG5_pTetra pt; MMG5_pxTetra pxt; double v,v1,v2; - int k,ip,ip1,ip2,ref,refint,refext,ier; - int8_t nmns,npls,nz,i,ia,j,j1,j2; + MMG5_int k,ip,ip1,ip2,ref,refint,refext; + int8_t nmns,npls,nz,i,ia,j,j1,j2,ier; /* Travel all boundary faces (via tetra) */ for (k=1; k<=mesh->ne; k++) { From 05d42068fea7ce59e744ee867da926bb7efae898 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Fri, 9 Dec 2022 13:57:12 +0100 Subject: [PATCH 811/838] Remove log messages. --- src/mmg3d/mmg3d1_delone.c | 3 --- src/mmg3d/mmg3d1_pattern.c | 4 ---- src/mmg3d/mmg3d3.c | 5 ----- 3 files changed, 12 deletions(-) diff --git a/src/mmg3d/mmg3d1_delone.c b/src/mmg3d/mmg3d1_delone.c index 603777996..f9a2e3e0f 100644 --- a/src/mmg3d/mmg3d1_delone.c +++ b/src/mmg3d/mmg3d1_delone.c @@ -208,9 +208,6 @@ int MMG3D_mmg3d1_delone_split(MMG5_pMesh mesh, MMG5_pSol met, int8_t isbdy; ilist = MMG5_coquil(mesh,k,imax,list,&isbdy); - if ( ilist > 0 && (!ilist%2) && isbdy ) { - puts("We were treating a bdy edge as a non bdy one"); - } if ( !ilist ){ /* Unable to compute edge shell: treat next element */ diff --git a/src/mmg3d/mmg3d1_pattern.c b/src/mmg3d/mmg3d1_pattern.c index 2ceb30cd4..6a4b4ab04 100644 --- a/src/mmg3d/mmg3d1_pattern.c +++ b/src/mmg3d/mmg3d1_pattern.c @@ -128,10 +128,6 @@ static MMG5_int MMG5_adpspl(MMG5_pMesh mesh,MMG5_pSol met, int* warn) { return -1; } - if ( (p0->tag & MG_BDY) && (p1->tag & MG_BDY) ) { - puts("I try to split an internal edge connecting bdy points"); - } - o[0] = 0.5*(p0->c[0] + p1->c[0]); o[1] = 0.5*(p0->c[1] + p1->c[1]); o[2] = 0.5*(p0->c[2] + p1->c[2]); diff --git a/src/mmg3d/mmg3d3.c b/src/mmg3d/mmg3d3.c index b5ed9f2e4..3cefd4259 100644 --- a/src/mmg3d/mmg3d3.c +++ b/src/mmg3d/mmg3d3.c @@ -180,11 +180,6 @@ static MMG5_int MMG5_spllag(MMG5_pMesh mesh,MMG5_pSol disp,MMG5_pSol met,int itd continue; } - if ( (p0->tag & MG_BDY) && (p1->tag & MG_BDY) ) { - puts("I try to split an internal edge connecting bdy points"); - } - - #ifndef NDEBUG if ( pxt ) { assert( !(pxt->tag[imax] & MG_BDY) ); } From 9ec4ca4e456a13726054527ae65dd6cbe46fa62e Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Fri, 9 Dec 2022 18:55:27 +0100 Subject: [PATCH 812/838] Fix issues in previous commit. --- src/mmg3d/mmg3d1_delone.c | 4 ++-- src/mmg3d/mmg3d1_pattern.c | 4 ++-- src/mmg3d/split_3d.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mmg3d/mmg3d1_delone.c b/src/mmg3d/mmg3d1_delone.c index f9a2e3e0f..eb872b62a 100644 --- a/src/mmg3d/mmg3d1_delone.c +++ b/src/mmg3d/mmg3d1_delone.c @@ -1018,7 +1018,7 @@ int MMG5_mmg3d1_delone(MMG5_pMesh mesh,MMG5_pSol met,MMG5_int *permNodGlob) { if ( abs(mesh->info.imprim) > 4 ) fprintf(stdout," ** MESH ANALYSIS\n"); - if ( mesh->info.iso && !MMG5_chkmani(mesh) ) { + if ( mesh->info.iso && !MMG3D_chkmani(mesh) ) { fprintf(stderr,"\n ## Non orientable implicit surface. Exit program.\n"); return 0; } @@ -1130,7 +1130,7 @@ int MMG5_mmg3d1_delone(MMG5_pMesh mesh,MMG5_pSol met,MMG5_int *permNodGlob) { int ier = 1; - if ( mesh->info.iso && !MMG5_chkmani(mesh) ) { + if ( mesh->info.iso && !MMG3D_chkmani(mesh) ) { fprintf(stderr,"\n ## Non orientable implicit surface. Exit program.\n"); ier = 0; } diff --git a/src/mmg3d/mmg3d1_pattern.c b/src/mmg3d/mmg3d1_pattern.c index 6a4b4ab04..066d9f65d 100644 --- a/src/mmg3d/mmg3d1_pattern.c +++ b/src/mmg3d/mmg3d1_pattern.c @@ -430,7 +430,7 @@ int MMG5_mmg3d1_pattern(MMG5_pMesh mesh,MMG5_pSol met,MMG5_int *permNodGlob) { if ( abs(mesh->info.imprim) > 4 ) fprintf(stdout," ** MESH ANALYSIS\n"); - if ( mesh->info.iso && !MMG5_chkmani(mesh) ) { + if ( mesh->info.iso && !MMG3D_chkmani(mesh) ) { fprintf(stderr,"\n ## Non orientable implicit surface. Exit program.\n"); return 0; } @@ -501,7 +501,7 @@ int MMG5_mmg3d1_pattern(MMG5_pMesh mesh,MMG5_pSol met,MMG5_int *permNodGlob) { return 0; } - if ( mesh->info.iso && !MMG5_chkmani(mesh) ) { + if ( mesh->info.iso && !MMG3D_chkmani(mesh) ) { fprintf(stderr,"\n ## Non orientable implicit surface. Exit program.\n"); return 0; } diff --git a/src/mmg3d/split_3d.c b/src/mmg3d/split_3d.c index 5ece2a582..7c0655178 100644 --- a/src/mmg3d/split_3d.c +++ b/src/mmg3d/split_3d.c @@ -4763,7 +4763,7 @@ MMG5_int MMG5_splitedg(MMG5_pMesh mesh, MMG5_pSol met,MMG5_int iel, int iar, dou warn = 0; pt = &mesh->tetra[iel]; -#warning isbdy is not used for now but should be used instead of test on MG_BDY points +//#warning isbdy is not used for now but should be used instead of test on MG_BDY points int8_t isbdy; lon = MMG5_coquil(mesh,iel,iar,list,&isbdy); if ( (!lon || lon<0) ) @@ -4792,7 +4792,7 @@ MMG5_int MMG5_splitedg(MMG5_pMesh mesh, MMG5_pSol met,MMG5_int iel, int iar, dou return 0; } -#warning I think that this test is too restrictive: we should authorize splitting of internal edges connecting bdy points +//#warning I think that this test is too restrictive: we should authorize splitting of internal edges connecting bdy points /* Skip edge if it connects bdy point (edge can be internal or external) */ if ( (p0->tag & MG_BDY) && (p1->tag & MG_BDY) ) { return 0; From 9ae466ff8395895ef5eab26fc1858ca8e4827bad Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Fri, 9 Dec 2022 19:48:18 +0100 Subject: [PATCH 813/838] Fix issue with internal edges connecting bdy points. Skip only boundary edge in splitedg function and not internal edge connecting boundary points. (splitedg function is called by opttyp function for improvement of very bad elements.) --- src/mmg3d/split_3d.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/mmg3d/split_3d.c b/src/mmg3d/split_3d.c index 7c0655178..7ffb3e517 100644 --- a/src/mmg3d/split_3d.c +++ b/src/mmg3d/split_3d.c @@ -4763,7 +4763,6 @@ MMG5_int MMG5_splitedg(MMG5_pMesh mesh, MMG5_pSol met,MMG5_int iel, int iar, dou warn = 0; pt = &mesh->tetra[iel]; -//#warning isbdy is not used for now but should be used instead of test on MG_BDY points int8_t isbdy; lon = MMG5_coquil(mesh,iel,iar,list,&isbdy); if ( (!lon || lon<0) ) @@ -4792,9 +4791,8 @@ MMG5_int MMG5_splitedg(MMG5_pMesh mesh, MMG5_pSol met,MMG5_int iel, int iar, dou return 0; } -//#warning I think that this test is too restrictive: we should authorize splitting of internal edges connecting bdy points /* Skip edge if it connects bdy point (edge can be internal or external) */ - if ( (p0->tag & MG_BDY) && (p1->tag & MG_BDY) ) { + if ( isbdy ) { return 0; } From 993a44170ef8bad9ce23680551536ad2a5f3c4ad Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Fri, 9 Dec 2022 20:44:19 +0100 Subject: [PATCH 814/838] Fix inclusion of mmg_export.h header. --- src/common/mmg_core_export.h | 2 +- src/mmg2d/mmg2d_export.h | 2 +- src/mmgs/mmgs_export.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/mmg_core_export.h b/src/common/mmg_core_export.h index cf8f9c4ad..707f17430 100644 --- a/src/common/mmg_core_export.h +++ b/src/common/mmg_core_export.h @@ -24,7 +24,7 @@ #ifndef MMG_CORE_EXPORT_H #define MMG_CORE_EXPORT_H -#include +#include "mmg_export.h" #if defined(libmmg_so_EXPORTS) || defined(libmmgs_so_EXPORTS) || defined(libmmg2d_so_EXPORTS) || defined(libmmg3d_so_EXPORTS) # define LIBMMG_CORE_EXPORT MMG_DECL_EXPORT #else diff --git a/src/mmg2d/mmg2d_export.h b/src/mmg2d/mmg2d_export.h index c8a27b920..1549e22d4 100644 --- a/src/mmg2d/mmg2d_export.h +++ b/src/mmg2d/mmg2d_export.h @@ -24,7 +24,7 @@ #ifndef MMG2D_EXPORT_H #define MMG2D_EXPORT_H -#include +#include "mmg_export.h" #if defined(libmmg_so_EXPORTS) || defined(libmmg2d_so_EXPORTS) # define LIBMMG2D_EXPORT MMG_DECL_EXPORT #else diff --git a/src/mmgs/mmgs_export.h b/src/mmgs/mmgs_export.h index 43df92974..e9196fdf7 100644 --- a/src/mmgs/mmgs_export.h +++ b/src/mmgs/mmgs_export.h @@ -24,7 +24,7 @@ #ifndef MMGS_EXPORT_H #define MMGS_EXPORT_H -#include +#include ""mmg_export.h"" #if defined(libmmg_so_EXPORTS) || defined(libmmgs_so_EXPORTS) # define LIBMMGS_EXPORT MMG_DECL_EXPORT #else From 6550c18f1af2aff54b132630afdbea9b1a78955c Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Fri, 9 Dec 2022 21:54:06 +0100 Subject: [PATCH 815/838] Rename private mmg headers with _private postfix. --- cmake/modules/mmg.cmake | 2 +- src/common/API_functions.c | 2 +- src/common/API_functionsf.c | 2 +- src/common/analys.c | 2 +- src/common/anisomovpt.c | 2 +- src/common/anisosiz.c | 6 +++--- src/common/apptools.c | 2 +- src/common/bezier.c | 2 +- src/common/boulep.c | 2 +- src/common/chrono.c | 2 +- src/common/{chrono.h => chrono_private.h} | 4 ++-- src/common/eigenv.c | 4 ++-- src/common/{eigenv.h => eigenv_private.h} | 0 src/common/hash.c | 2 +- .../{inlined_functions.h => inlined_functions_private.h} | 2 +- src/common/inout.c | 2 +- src/common/intmet.c | 4 ++-- src/common/isosiz.c | 2 +- src/common/libmmgcommon.h | 4 ++-- src/common/{mmgcommon.h => libmmgcommon_private.h} | 2 +- src/common/librnbg.c | 4 ++-- src/common/{librnbg.h => librnbg_private.h} | 0 src/common/libtools.c | 2 +- src/common/mettools.c | 4 ++-- src/common/mmg2.c | 4 ++-- src/common/mmg2s.c | 4 ++-- src/common/mmg3.c | 2 +- src/common/{mmg_core_export.h => mmg_core_export_private.h} | 0 src/common/mmgexterns.c | 4 ++-- src/common/{mmgexterns.h => mmgexterns_private.h} | 2 +- src/common/quality.c | 2 +- src/common/scalem.c | 4 ++-- src/common/tools.c | 2 +- src/common/vtkparser.hpp | 2 +- src/mmg2d/anisomovpt_2d.c | 2 +- src/mmg2d/anisosiz_2d.c | 2 +- src/mmg2d/colver_2d.c | 2 +- src/mmg2d/isosiz_2d.c | 4 ++-- src/mmg2d/length_2d.c | 2 +- src/mmg2d/libmmg2d.c | 4 ++-- src/mmg2d/libmmg2d_tools.c | 4 ++-- src/mmg2d/libmmg2df.c | 2 +- src/mmg2d/mmg2d1.c | 2 +- src/mmg2d/mmg2d2.c | 2 +- src/mmg2d/mmg2d6.c | 4 ++-- src/mmg2d/mmg2dexterns.c | 2 +- src/mmg2d/{mmg2dexterns.h => mmg2dexterns_private.h} | 2 +- src/mmg2d/movpt_2d.c | 2 +- src/mmg2d/quality_2d.c | 2 +- src/mmg2d/solmap_2d.c | 4 ++-- src/mmg2d/split_2d.c | 2 +- src/mmg2d/variadic_2d.c | 2 +- src/mmg3d/API_functions_3d.c | 2 +- src/mmg3d/PRoctree_3d.c | 4 ++-- src/mmg3d/{PRoctree_3d.h => PRoctree_3d_private.h} | 0 src/mmg3d/anisomovpt_3d.c | 4 ++-- src/mmg3d/anisosiz_3d.c | 4 ++-- src/mmg3d/colver_3d.c | 2 +- src/mmg3d/inlined_functions_3d.h | 4 ++-- src/mmg3d/isosiz_3d.c | 4 ++-- src/mmg3d/libmmg3d.c | 4 ++-- src/mmg3d/libmmg3d_private.h | 2 +- src/mmg3d/libmmg3d_tools.c | 6 +++--- src/mmg3d/libmmg3df.c | 2 +- src/mmg3d/mmg3d1.c | 4 ++-- src/mmg3d/mmg3d1_delone.c | 2 +- src/mmg3d/mmg3d1_pattern.c | 2 +- src/mmg3d/mmg3d2.c | 2 +- src/mmg3d/mmg3d3.c | 2 +- src/mmg3d/mmg3dexterns.c | 2 +- src/mmg3d/{mmg3dexterns.h => mmg3dexterns_private.h} | 4 ++-- src/mmg3d/movpt_3d.c | 4 ++-- src/mmg3d/optbdry_3d.c | 2 +- src/mmg3d/optlap_3d.c | 2 +- src/mmg3d/quality_3d.c | 2 +- src/mmg3d/split_3d.c | 2 +- src/mmg3d/swap_3d.c | 2 +- src/mmg3d/swapgen_3d.c | 2 +- src/mmg3d/variadic_3d.c | 2 +- src/mmgs/analys_s.c | 2 +- src/mmgs/anisomovpt_s.c | 2 +- src/mmgs/anisosiz_s.c | 6 +++--- src/mmgs/colver_s.c | 4 ++-- src/mmgs/isosiz_s.c | 4 ++-- src/mmgs/libmmgs.c | 4 ++-- src/mmgs/libmmgs_tools.c | 6 +++--- src/mmgs/libmmgsf.c | 2 +- src/mmgs/mmgs1.c | 6 +++--- src/mmgs/mmgs2.c | 2 +- src/mmgs/mmgs_export.h | 2 +- src/mmgs/mmgsexterns.c | 2 +- src/mmgs/{mmgsexterns.h => mmgsexterns_private.h} | 2 +- src/mmgs/movpt_s.c | 2 +- src/mmgs/quality_s.c | 6 +++--- src/mmgs/split_s.c | 4 ++-- src/mmgs/swapar_s.c | 6 +++--- src/mmgs/variadic_s.c | 2 +- 97 files changed, 135 insertions(+), 135 deletions(-) rename src/common/{chrono.h => chrono_private.h} (96%) rename src/common/{eigenv.h => eigenv_private.h} (100%) rename src/common/{inlined_functions.h => inlined_functions_private.h} (99%) rename src/common/{mmgcommon.h => libmmgcommon_private.h} (99%) rename src/common/{librnbg.h => librnbg_private.h} (100%) rename src/common/{mmg_core_export.h => mmg_core_export_private.h} (100%) rename src/common/{mmgexterns.h => mmgexterns_private.h} (98%) rename src/mmg2d/{mmg2dexterns.h => mmg2dexterns_private.h} (95%) rename src/mmg3d/{PRoctree_3d.h => PRoctree_3d_private.h} (100%) rename src/mmg3d/{mmg3dexterns.h => mmg3dexterns_private.h} (96%) rename src/mmgs/{mmgsexterns.h => mmgsexterns_private.h} (96%) diff --git a/cmake/modules/mmg.cmake b/cmake/modules/mmg.cmake index c62d597bc..a682790df 100644 --- a/cmake/modules/mmg.cmake +++ b/cmake/modules/mmg.cmake @@ -119,7 +119,7 @@ IF ( LIBMMG_STATIC OR LIBMMG_SHARED ) SET( mmg_headers ${COMMON_SOURCE_DIR}/mmg_export.h ${COMMON_BINARY_DIR}/mmgcmakedefines.h - ${PROJECT_SOURCE_DIR}/src/common/mmg_core_export.h + # ${PROJECT_SOURCE_DIR}/src/common/mmg_core_export.h ${PROJECT_SOURCE_DIR}/src/mmg/libmmg.h ${PROJECT_SOURCE_DIR}/src/mmg/libmmgf.h ) diff --git a/src/common/API_functions.c b/src/common/API_functions.c index 266484d54..4d3b21aaa 100644 --- a/src/common/API_functions.c +++ b/src/common/API_functions.c @@ -40,7 +40,7 @@ * */ -#include "mmgcommon.h" +#include "libmmgcommon_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/common/API_functionsf.c b/src/common/API_functionsf.c index 92d4050f0..2e8059a3b 100644 --- a/src/common/API_functionsf.c +++ b/src/common/API_functionsf.c @@ -38,7 +38,7 @@ * */ -#include "mmgcommon.h" +#include "libmmgcommon_private.h" /** diff --git a/src/common/analys.c b/src/common/analys.c index c8f2a61f7..b9c6b636b 100644 --- a/src/common/analys.c +++ b/src/common/analys.c @@ -33,7 +33,7 @@ * \todo doxygen documentation. */ -#include "mmgcommon.h" +#include "libmmgcommon_private.h" /** diff --git a/src/common/anisomovpt.c b/src/common/anisomovpt.c index 91f83a908..cdd28e7ed 100644 --- a/src/common/anisomovpt.c +++ b/src/common/anisomovpt.c @@ -33,7 +33,7 @@ * \todo Doxygen documentation */ -#include "mmgcommon.h" +#include "libmmgcommon_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/common/anisosiz.c b/src/common/anisosiz.c index ccc8d7251..0c5087ad0 100644 --- a/src/common/anisosiz.c +++ b/src/common/anisosiz.c @@ -32,9 +32,9 @@ * \copyright GNU Lesser General Public License. */ -#include "mmgcommon.h" -#include "mmgexterns.h" -#include "inlined_functions.h" +#include "libmmgcommon_private.h" +#include "mmgexterns_private.h" +#include "inlined_functions_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/common/apptools.c b/src/common/apptools.c index 2d1e02f1c..f0e62ce6d 100644 --- a/src/common/apptools.c +++ b/src/common/apptools.c @@ -32,7 +32,7 @@ * \copyright GNU Lesser General Public License. **/ -#include "mmgcommon.h" +#include "libmmgcommon_private.h" /** * \param mesh pointer toward the mesh structure (for count of used memory). diff --git a/src/common/bezier.c b/src/common/bezier.c index c29076d57..89a94ef63 100644 --- a/src/common/bezier.c +++ b/src/common/bezier.c @@ -33,7 +33,7 @@ * \todo doxygen documentation. */ -#include "mmgcommon.h" +#include "libmmgcommon_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/common/boulep.c b/src/common/boulep.c index 1a1c43f6c..be7bbbeac 100644 --- a/src/common/boulep.c +++ b/src/common/boulep.c @@ -32,7 +32,7 @@ * \copyright GNU Lesser General Public License. */ -#include "mmgcommon.h" +#include "libmmgcommon_private.h" extern MMG5_Info info; diff --git a/src/common/chrono.c b/src/common/chrono.c index 94a7d1b03..21a049bdf 100644 --- a/src/common/chrono.c +++ b/src/common/chrono.c @@ -37,7 +37,7 @@ #include #include #include -#include "chrono.h" +#include "chrono_private.h" /** * \fn void chrono(int cmode,mytime *ptt) diff --git a/src/common/chrono.h b/src/common/chrono_private.h similarity index 96% rename from src/common/chrono.h rename to src/common/chrono_private.h index 0a3a1adb8..58abf3580 100644 --- a/src/common/chrono.h +++ b/src/common/chrono_private.h @@ -25,7 +25,7 @@ #define CHRONO_H #include -#include "mmgcommon.h" +#include "libmmgcommon_private.h" #ifndef MMG_POSIX #include @@ -34,7 +34,7 @@ #include #endif -#include "mmg_core_export.h" +#include "mmg_core_export_private.h" #ifdef __cplusplus extern "C" { diff --git a/src/common/eigenv.c b/src/common/eigenv.c index 76b420681..95aef0967 100644 --- a/src/common/eigenv.c +++ b/src/common/eigenv.c @@ -39,8 +39,8 @@ #include #include #include -#include "eigenv.h" -#include "mmgcommon.h" +#include "eigenv_private.h" +#include "libmmgcommon_private.h" /* seeking at least 1.e-05 accuracy, more if not sufficient */ #define MG_EIGENV_EPS27 1.e-27 diff --git a/src/common/eigenv.h b/src/common/eigenv_private.h similarity index 100% rename from src/common/eigenv.h rename to src/common/eigenv_private.h diff --git a/src/common/hash.c b/src/common/hash.c index e3088b6d3..8fa7dc0a2 100644 --- a/src/common/hash.c +++ b/src/common/hash.c @@ -32,7 +32,7 @@ * \copyright GNU Lesser General Public License. */ -#include "mmgcommon.h" +#include "libmmgcommon_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/common/inlined_functions.h b/src/common/inlined_functions_private.h similarity index 99% rename from src/common/inlined_functions.h rename to src/common/inlined_functions_private.h index ffbc84d41..c7a96199a 100644 --- a/src/common/inlined_functions.h +++ b/src/common/inlined_functions_private.h @@ -32,7 +32,7 @@ * \copyright GNU Lesser General Public License. */ -#include "mmgcommon.h" +#include "libmmgcommon_private.h" #ifndef _INLINED_FUNC_H #define _INLINED_FUNC_H diff --git a/src/common/inout.c b/src/common/inout.c index 8ea12455d..bb2d2d5b0 100644 --- a/src/common/inout.c +++ b/src/common/inout.c @@ -33,7 +33,7 @@ * \todo doxygen documentation. */ -#include "mmgcommon.h" +#include "libmmgcommon_private.h" /** * swap bytes if needed (conversion from big/little endian toward little/big diff --git a/src/common/intmet.c b/src/common/intmet.c index 8feaa220c..df7ba95f5 100644 --- a/src/common/intmet.c +++ b/src/common/intmet.c @@ -32,8 +32,8 @@ * \copyright GNU Lesser General Public License. */ -#include "mmgcommon.h" -#include "mmgexterns.h" +#include "libmmgcommon_private.h" +#include "mmgexterns_private.h" /** * \param m input metric. diff --git a/src/common/isosiz.c b/src/common/isosiz.c index b624fbc1f..ce4e9c466 100644 --- a/src/common/isosiz.c +++ b/src/common/isosiz.c @@ -27,7 +27,7 @@ * \copyright GNU Lesser General Public License. */ -#include "mmgcommon.h" +#include "libmmgcommon_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/common/libmmgcommon.h b/src/common/libmmgcommon.h index 17e74f5d0..d881f0d6c 100644 --- a/src/common/libmmgcommon.h +++ b/src/common/libmmgcommon.h @@ -39,9 +39,9 @@ #include "libmmgtypes.h" -#include "chrono.h" +#include "chrono_private.h" -#include "mmg_core_export.h" +#include "mmg_core_export_private.h" #ifdef __cplusplus extern "C" { diff --git a/src/common/mmgcommon.h b/src/common/libmmgcommon_private.h similarity index 99% rename from src/common/mmgcommon.h rename to src/common/libmmgcommon_private.h index 4a247f76b..f21dd65e5 100644 --- a/src/common/mmgcommon.h +++ b/src/common/libmmgcommon_private.h @@ -48,7 +48,7 @@ extern "C" { #endif -#include "eigenv.h" +#include "eigenv_private.h" #include "libmmgcommon.h" #define MG_STR "&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&" diff --git a/src/common/librnbg.c b/src/common/librnbg.c index fa0a3cbd6..8a704d482 100644 --- a/src/common/librnbg.c +++ b/src/common/librnbg.c @@ -31,8 +31,8 @@ * \copyright GNU Lesser General Public License. */ -#include "mmgcommon.h" -#include "mmgexterns.h" +#include "libmmgcommon_private.h" +#include "mmgexterns_private.h" #ifdef USE_SCOTCH diff --git a/src/common/librnbg.h b/src/common/librnbg_private.h similarity index 100% rename from src/common/librnbg.h rename to src/common/librnbg_private.h diff --git a/src/common/libtools.c b/src/common/libtools.c index 9de9fa8ab..7816d7f42 100644 --- a/src/common/libtools.c +++ b/src/common/libtools.c @@ -32,7 +32,7 @@ * \copyright GNU Lesser General Public License. **/ -#include "mmgcommon.h" +#include "libmmgcommon_private.h" /** * \param mesh pointer toward the mesh diff --git a/src/common/mettools.c b/src/common/mettools.c index 6e6573718..f894267df 100644 --- a/src/common/mettools.c +++ b/src/common/mettools.c @@ -32,8 +32,8 @@ * \copyright GNU Lesser General Public License. */ -#include "mmgcommon.h" -#include "inlined_functions.h" +#include "libmmgcommon_private.h" +#include "inlined_functions_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/common/mmg2.c b/src/common/mmg2.c index 9299225fd..83272c75f 100644 --- a/src/common/mmg2.c +++ b/src/common/mmg2.c @@ -33,8 +33,8 @@ * */ -#include "mmgcommon.h" -#include "mmgexterns.h" +#include "libmmgcommon_private.h" +#include "mmgexterns_private.h" /** * \param pim multimaterials inverse data table. diff --git a/src/common/mmg2s.c b/src/common/mmg2s.c index 7245bb702..98e768133 100644 --- a/src/common/mmg2s.c +++ b/src/common/mmg2s.c @@ -30,8 +30,8 @@ * \version 5 * \copyright GNU Lesser General Public License. */ -#include "mmgcommon.h" -#include "mmgexterns.h" +#include "libmmgcommon_private.h" +#include "mmgexterns_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/common/mmg3.c b/src/common/mmg3.c index 02913e5e0..c0fb0d522 100644 --- a/src/common/mmg3.c +++ b/src/common/mmg3.c @@ -31,7 +31,7 @@ * \copyright GNU Lesser General Public License. */ -#include "mmgcommon.h" +#include "libmmgcommon_private.h" /** * \param mesh pointer toward the mesh structure diff --git a/src/common/mmg_core_export.h b/src/common/mmg_core_export_private.h similarity index 100% rename from src/common/mmg_core_export.h rename to src/common/mmg_core_export_private.h diff --git a/src/common/mmgexterns.c b/src/common/mmgexterns.c index 7a92b95fb..529ab2a6b 100644 --- a/src/common/mmgexterns.c +++ b/src/common/mmgexterns.c @@ -21,9 +21,9 @@ ** ============================================================================= */ -#include "mmgcommon.h" +#include "libmmgcommon_private.h" #define MMG_EXTERN #define MMG_ASSIGN_NULL =NULL -#include "mmgexterns.h" +#include "mmgexterns_private.h" diff --git a/src/common/mmgexterns.h b/src/common/mmgexterns_private.h similarity index 98% rename from src/common/mmgexterns.h rename to src/common/mmgexterns_private.h index 7402abb76..5c69e4cf3 100644 --- a/src/common/mmgexterns.h +++ b/src/common/mmgexterns_private.h @@ -24,7 +24,7 @@ #ifndef MMGEXTERNS_H #define MMGEXTERNS_H -#include "mmgcommon.h" +#include "libmmgcommon_private.h" #ifndef MMG_EXTERN #define MMG_EXTERN extern diff --git a/src/common/quality.c b/src/common/quality.c index c71ea0d57..38362db8d 100644 --- a/src/common/quality.c +++ b/src/common/quality.c @@ -32,7 +32,7 @@ * \copyright GNU Lesser General Public License. */ -#include "mmgcommon.h" +#include "libmmgcommon_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/common/scalem.c b/src/common/scalem.c index 6a489a619..da998d87b 100644 --- a/src/common/scalem.c +++ b/src/common/scalem.c @@ -32,8 +32,8 @@ * \copyright GNU Lesser General Public License. */ -#include "mmgcommon.h" -#include "mmgexterns.h" +#include "libmmgcommon_private.h" +#include "mmgexterns_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/common/tools.c b/src/common/tools.c index 10ca7489d..dfaea3b4d 100644 --- a/src/common/tools.c +++ b/src/common/tools.c @@ -33,7 +33,7 @@ * \todo doxygen documentation. */ -#include "mmgcommon.h" +#include "libmmgcommon_private.h" /** * \param n array size diff --git a/src/common/vtkparser.hpp b/src/common/vtkparser.hpp index 2926f43fc..b73be208d 100644 --- a/src/common/vtkparser.hpp +++ b/src/common/vtkparser.hpp @@ -26,7 +26,7 @@ #ifdef USE_VTK -#include "mmgcommon.h" +#include "libmmgcommon_private.h" #include #include diff --git a/src/mmg2d/anisomovpt_2d.c b/src/mmg2d/anisomovpt_2d.c index 0ee6f7f8b..bdc323ed0 100644 --- a/src/mmg2d/anisomovpt_2d.c +++ b/src/mmg2d/anisomovpt_2d.c @@ -32,7 +32,7 @@ * \copyright GNU Lesser General Public License. **/ #include "libmmg2d_private.h" -#include "mmg2dexterns.h" +#include "mmg2dexterns_private.h" /* Relocate internal vertex whose ball is passed */ int MMG2D_movintpt_ani(MMG5_pMesh mesh,MMG5_pSol met,int ilist,MMG5_int *list,int8_t improve) { diff --git a/src/mmg2d/anisosiz_2d.c b/src/mmg2d/anisosiz_2d.c index 035408795..9e95cb5ef 100644 --- a/src/mmg2d/anisosiz_2d.c +++ b/src/mmg2d/anisosiz_2d.c @@ -33,7 +33,7 @@ **/ #include "libmmg2d_private.h" #include "libmmg2d.h" -#include "mmg2dexterns.h" +#include "mmg2dexterns_private.h" /** * \param mesh pointer toward the mesh diff --git a/src/mmg2d/colver_2d.c b/src/mmg2d/colver_2d.c index 26df63524..e179b5c28 100644 --- a/src/mmg2d/colver_2d.c +++ b/src/mmg2d/colver_2d.c @@ -21,7 +21,7 @@ ** ============================================================================= */ #include "libmmg2d_private.h" -#include "mmg2dexterns.h" +#include "mmg2dexterns_private.h" extern uint8_t ddb; diff --git a/src/mmg2d/isosiz_2d.c b/src/mmg2d/isosiz_2d.c index 686234501..88111d5c3 100644 --- a/src/mmg2d/isosiz_2d.c +++ b/src/mmg2d/isosiz_2d.c @@ -33,8 +33,8 @@ **/ #include "libmmg2d_private.h" #include "libmmg2d.h" -#include "mmg2dexterns.h" -#include "mmgexterns.h" +#include "mmg2dexterns_private.h" +#include "mmgexterns_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/mmg2d/length_2d.c b/src/mmg2d/length_2d.c index a869a77ad..e3e891098 100644 --- a/src/mmg2d/length_2d.c +++ b/src/mmg2d/length_2d.c @@ -21,7 +21,7 @@ ** ============================================================================= */ #include "libmmg2d_private.h" -#include "mmg2dexterns.h" +#include "mmg2dexterns_private.h" /* Compute isotropic edge length */ double long_iso(double *ca,double *cb,double *ma,double *mb) { diff --git a/src/mmg2d/libmmg2d.c b/src/mmg2d/libmmg2d.c index a7ac09829..7fe003a50 100644 --- a/src/mmg2d/libmmg2d.c +++ b/src/mmg2d/libmmg2d.c @@ -23,8 +23,8 @@ #include "libmmg2d.h" #include "libmmg2d_private.h" -#include "mmg2dexterns.h" -#include "mmgexterns.h" +#include "mmg2dexterns_private.h" +#include "mmgexterns_private.h" /** * Pack the mesh \a mesh and its associated metric \a met and/or solution \a sol diff --git a/src/mmg2d/libmmg2d_tools.c b/src/mmg2d/libmmg2d_tools.c index 68a90d411..47592efcf 100644 --- a/src/mmg2d/libmmg2d_tools.c +++ b/src/mmg2d/libmmg2d_tools.c @@ -32,8 +32,8 @@ #include "libmmg2d.h" #include "libmmg2d_private.h" -#include "mmg2dexterns.h" -#include "mmgexterns.h" +#include "mmg2dexterns_private.h" +#include "mmgexterns_private.h" void MMG2D_setfunc(MMG5_pMesh mesh,MMG5_pSol met) { if ( mesh->info.ani || (met && met->size==3 ) ) { diff --git a/src/mmg2d/libmmg2df.c b/src/mmg2d/libmmg2df.c index 877afb6db..55d221831 100644 --- a/src/mmg2d/libmmg2df.c +++ b/src/mmg2d/libmmg2df.c @@ -42,7 +42,7 @@ */ #include "libmmg2d.h" -#include "mmgcommon.h" +#include "libmmgcommon_private.h" /** * See \ref MMG2D_mmg2dlib function in \ref mmg2d/liblibmmg2d_private.h file. diff --git a/src/mmg2d/mmg2d1.c b/src/mmg2d/mmg2d1.c index bd9b471cf..691376960 100644 --- a/src/mmg2d/mmg2d1.c +++ b/src/mmg2d/mmg2d1.c @@ -31,7 +31,7 @@ * \copyright GNU Lesser General Public License. */ #include "libmmg2d_private.h" -#include "mmg2dexterns.h" +#include "mmg2dexterns_private.h" /* Mesh adaptation routine for the first stages of the algorithm: intertwine splitting based on patterns, collapses and swaps. diff --git a/src/mmg2d/mmg2d2.c b/src/mmg2d/mmg2d2.c index b85ba6668..37d063fd2 100644 --- a/src/mmg2d/mmg2d2.c +++ b/src/mmg2d/mmg2d2.c @@ -31,7 +31,7 @@ * \copyright GNU Lesser General Public License. */ #include "libmmg2d_private.h" -#include "mmgexterns.h" +#include "mmgexterns_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/mmg2d/mmg2d6.c b/src/mmg2d/mmg2d6.c index 1c345153e..2dd7d938a 100644 --- a/src/mmg2d/mmg2d6.c +++ b/src/mmg2d/mmg2d6.c @@ -31,8 +31,8 @@ * \copyright GNU Lesser General Public License. */ #include "libmmg2d_private.h" -#include "mmgexterns.h" -#include "mmg2dexterns.h" +#include "mmgexterns_private.h" +#include "mmg2dexterns_private.h" /** * \param mesh pointer toward the mesh diff --git a/src/mmg2d/mmg2dexterns.c b/src/mmg2d/mmg2dexterns.c index c82c2ef83..87b896a5a 100644 --- a/src/mmg2d/mmg2dexterns.c +++ b/src/mmg2d/mmg2dexterns.c @@ -4,6 +4,6 @@ #define MMG_EXTERN #define MMG_ASSIGN_NULL =NULL -#include "mmg2dexterns.h" +#include "mmg2dexterns_private.h" LIBMMG2D_EXPORT int (*MMG2D_doSol)(MMG5_pMesh ,MMG5_pSol )=NULL; diff --git a/src/mmg2d/mmg2dexterns.h b/src/mmg2d/mmg2dexterns_private.h similarity index 95% rename from src/mmg2d/mmg2dexterns.h rename to src/mmg2d/mmg2dexterns_private.h index 9d96bbc2f..2a1adf038 100644 --- a/src/mmg2d/mmg2dexterns.h +++ b/src/mmg2d/mmg2dexterns_private.h @@ -2,7 +2,7 @@ #define MMG2DEXTERNS_H #include "libmmgtypes.h" -#include "mmgcommon.h" +#include "libmmgcommon_private.h" #ifndef MMG_EXTERN #define MMG_EXTERN extern diff --git a/src/mmg2d/movpt_2d.c b/src/mmg2d/movpt_2d.c index 3703ed429..1aca97baa 100644 --- a/src/mmg2d/movpt_2d.c +++ b/src/mmg2d/movpt_2d.c @@ -32,7 +32,7 @@ * \copyright GNU Lesser General Public License. **/ #include "libmmg2d_private.h" -#include "mmg2dexterns.h" +#include "mmg2dexterns_private.h" //extern int8_t ddb; diff --git a/src/mmg2d/quality_2d.c b/src/mmg2d/quality_2d.c index 7cea01216..c252b6c39 100644 --- a/src/mmg2d/quality_2d.c +++ b/src/mmg2d/quality_2d.c @@ -32,7 +32,7 @@ */ #include "libmmg2d_private.h" -#include "mmg2dexterns.h" +#include "mmg2dexterns_private.h" /** * \param mesh pointer toward the mesh diff --git a/src/mmg2d/solmap_2d.c b/src/mmg2d/solmap_2d.c index 081810999..24ca8a1ce 100644 --- a/src/mmg2d/solmap_2d.c +++ b/src/mmg2d/solmap_2d.c @@ -34,8 +34,8 @@ #include "libmmg2d.h" #include "libmmg2d_private.h" -#include "mmg2dexterns.h" -#include "mmgexterns.h" +#include "mmg2dexterns_private.h" +#include "mmgexterns_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/mmg2d/split_2d.c b/src/mmg2d/split_2d.c index 622effea7..03edb2319 100644 --- a/src/mmg2d/split_2d.c +++ b/src/mmg2d/split_2d.c @@ -32,7 +32,7 @@ */ #include "libmmg2d_private.h" -#include "mmg2dexterns.h" +#include "mmg2dexterns_private.h" extern uint8_t ddb; diff --git a/src/mmg2d/variadic_2d.c b/src/mmg2d/variadic_2d.c index 027fcbbdf..3d6eabc76 100644 --- a/src/mmg2d/variadic_2d.c +++ b/src/mmg2d/variadic_2d.c @@ -39,7 +39,7 @@ #include "libmmg2d_private.h" #include "libmmg2d.h" -#include "mmg2dexterns.h" +#include "mmg2dexterns_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/mmg3d/API_functions_3d.c b/src/mmg3d/API_functions_3d.c index 08b19d4c6..a04d55b9b 100644 --- a/src/mmg3d/API_functions_3d.c +++ b/src/mmg3d/API_functions_3d.c @@ -41,7 +41,7 @@ #include "libmmg3d.h" #include "libmmg3d_private.h" #include "inlined_functions_3d.h" -#include "PRoctree_3d.h" +#include "PRoctree_3d_private.h" int MMG3D_Init_mesh(const int starter,...) { va_list argptr; diff --git a/src/mmg3d/PRoctree_3d.c b/src/mmg3d/PRoctree_3d.c index 894534da5..c70d229d4 100644 --- a/src/mmg3d/PRoctree_3d.c +++ b/src/mmg3d/PRoctree_3d.c @@ -35,8 +35,8 @@ */ #include "libmmgtypes.h" -#include "mmgcommon.h" -#include "PRoctree_3d.h" +#include "libmmgcommon_private.h" +#include "PRoctree_3d_private.h" #include /** diff --git a/src/mmg3d/PRoctree_3d.h b/src/mmg3d/PRoctree_3d_private.h similarity index 100% rename from src/mmg3d/PRoctree_3d.h rename to src/mmg3d/PRoctree_3d_private.h diff --git a/src/mmg3d/anisomovpt_3d.c b/src/mmg3d/anisomovpt_3d.c index ab616a5dc..cf283f6c8 100644 --- a/src/mmg3d/anisomovpt_3d.c +++ b/src/mmg3d/anisomovpt_3d.c @@ -35,8 +35,8 @@ #include "libmmg3d.h" #include "inlined_functions_3d.h" -#include "mmg3dexterns.h" -#include "mmgexterns.h" +#include "mmg3dexterns_private.h" +#include "mmgexterns_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/mmg3d/anisosiz_3d.c b/src/mmg3d/anisosiz_3d.c index 262c3d54b..f59035810 100644 --- a/src/mmg3d/anisosiz_3d.c +++ b/src/mmg3d/anisosiz_3d.c @@ -35,8 +35,8 @@ #include "libmmg3d.h" #include "inlined_functions_3d.h" -#include "mmg3dexterns.h" -#include "mmgexterns.h" +#include "mmg3dexterns_private.h" +#include "mmgexterns_private.h" /** * \param dm matrix eigenvalues (1x3 array). diff --git a/src/mmg3d/colver_3d.c b/src/mmg3d/colver_3d.c index a6aef7eae..797b75b45 100644 --- a/src/mmg3d/colver_3d.c +++ b/src/mmg3d/colver_3d.c @@ -34,7 +34,7 @@ */ #include "inlined_functions_3d.h" -#include "mmg3dexterns.h" +#include "mmg3dexterns_private.h" extern int8_t ddb; diff --git a/src/mmg3d/inlined_functions_3d.h b/src/mmg3d/inlined_functions_3d.h index 1a17ac8b9..3667218e5 100644 --- a/src/mmg3d/inlined_functions_3d.h +++ b/src/mmg3d/inlined_functions_3d.h @@ -33,8 +33,8 @@ */ #include "libmmg3d_private.h" -#include "inlined_functions.h" -#include "mmg3dexterns.h" +#include "inlined_functions_private.h" +#include "mmg3dexterns_private.h" #ifndef _INLINED_FUNCT_3D_H #define _INLINED_FUNCT_3D_H diff --git a/src/mmg3d/isosiz_3d.c b/src/mmg3d/isosiz_3d.c index f97ad034b..15065e52c 100644 --- a/src/mmg3d/isosiz_3d.c +++ b/src/mmg3d/isosiz_3d.c @@ -34,8 +34,8 @@ #include "libmmg3d.h" #include "libmmg3d_private.h" -#include "inlined_functions.h" -#include "mmgexterns.h" +#include "inlined_functions_private.h" +#include "mmgexterns_private.h" extern int8_t ddb; diff --git a/src/mmg3d/libmmg3d.c b/src/mmg3d/libmmg3d.c index f45be44bd..306e5d65f 100644 --- a/src/mmg3d/libmmg3d.c +++ b/src/mmg3d/libmmg3d.c @@ -41,8 +41,8 @@ #include "libmmg3d.h" #include "inlined_functions_3d.h" -#include "mmg3dexterns.h" -#include "mmgexterns.h" +#include "mmg3dexterns_private.h" +#include "mmgexterns_private.h" /** * Pack the mesh \a mesh and its associated metric \a met and/or solution \a sol diff --git a/src/mmg3d/libmmg3d_private.h b/src/mmg3d/libmmg3d_private.h index 5968674dd..9fc4088a5 100644 --- a/src/mmg3d/libmmg3d_private.h +++ b/src/mmg3d/libmmg3d_private.h @@ -25,7 +25,7 @@ #define LIBMMG3D_PRIVATE_H #include "libmmgcommon.h" -#include "PRoctree_3d.h" +#include "PRoctree_3d_private.h" #ifdef __cplusplus extern "C" { diff --git a/src/mmg3d/libmmg3d_tools.c b/src/mmg3d/libmmg3d_tools.c index 0acad8c78..f3b987cc3 100644 --- a/src/mmg3d/libmmg3d_tools.c +++ b/src/mmg3d/libmmg3d_tools.c @@ -31,11 +31,11 @@ **/ #include "libmmg3d.h" -#include "mmgcommon.h" +#include "libmmgcommon_private.h" #include "inlined_functions_3d.h" #include "mmgversion.h" -#include "mmg3dexterns.h" -#include "mmgexterns.h" +#include "mmg3dexterns_private.h" +#include "mmgexterns_private.h" void MMG3D_setfunc(MMG5_pMesh mesh,MMG5_pSol met) { diff --git a/src/mmg3d/libmmg3df.c b/src/mmg3d/libmmg3df.c index 900c2734d..910347ffe 100644 --- a/src/mmg3d/libmmg3df.c +++ b/src/mmg3d/libmmg3df.c @@ -42,7 +42,7 @@ */ #include "libmmg3d.h" -#include "mmgcommon.h" +#include "libmmgcommon_private.h" /** * See \ref MMG3D_mmg3dlib function in \ref mmg3d/libmmg3d.h file. diff --git a/src/mmg3d/mmg3d1.c b/src/mmg3d/mmg3d1.c index 9ab1e9659..e6e9d9096 100644 --- a/src/mmg3d/mmg3d1.c +++ b/src/mmg3d/mmg3d1.c @@ -38,8 +38,8 @@ #include "libmmg3d.h" #include "inlined_functions_3d.h" -#include "mmgexterns.h" -#include "mmg3dexterns.h" +#include "mmgexterns_private.h" +#include "mmg3dexterns_private.h" extern int8_t ddb; diff --git a/src/mmg3d/mmg3d1_delone.c b/src/mmg3d/mmg3d1_delone.c index 5539d8eb0..4752cc462 100644 --- a/src/mmg3d/mmg3d1_delone.c +++ b/src/mmg3d/mmg3d1_delone.c @@ -35,7 +35,7 @@ #include "libmmg3d.h" #include "libmmg3d_private.h" -#include "mmg3dexterns.h" +#include "mmg3dexterns_private.h" #ifndef MMG_PATTERN diff --git a/src/mmg3d/mmg3d1_pattern.c b/src/mmg3d/mmg3d1_pattern.c index 10ff4b50b..d73a06a7e 100644 --- a/src/mmg3d/mmg3d1_pattern.c +++ b/src/mmg3d/mmg3d1_pattern.c @@ -38,7 +38,7 @@ #include "libmmg3d.h" #include "inlined_functions_3d.h" -#include "mmg3dexterns.h" +#include "mmg3dexterns_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/mmg3d/mmg3d2.c b/src/mmg3d/mmg3d2.c index d54525971..799f552e8 100644 --- a/src/mmg3d/mmg3d2.c +++ b/src/mmg3d/mmg3d2.c @@ -35,7 +35,7 @@ #include "libmmg3d.h" #include "libmmg3d_private.h" -#include "mmg3dexterns.h" +#include "mmg3dexterns_private.h" extern int8_t ddb; diff --git a/src/mmg3d/mmg3d3.c b/src/mmg3d/mmg3d3.c index adad18655..25e100ae4 100644 --- a/src/mmg3d/mmg3d3.c +++ b/src/mmg3d/mmg3d3.c @@ -36,7 +36,7 @@ #include "libmmg3d.h" #include "libmmg3d_private.h" #include "inlined_functions_3d.h" -#include "mmg3dexterns.h" +#include "mmg3dexterns_private.h" #define MMG5_DEGTOL 1.e-1 diff --git a/src/mmg3d/mmg3dexterns.c b/src/mmg3d/mmg3dexterns.c index 5a8e886e4..93dc5b003 100644 --- a/src/mmg3d/mmg3dexterns.c +++ b/src/mmg3d/mmg3dexterns.c @@ -5,7 +5,7 @@ #define MMG_EXTERN #define MMG_ASSIGN_NULL =NULL -#include "mmg3dexterns.h" +#include "mmg3dexterns_private.h" LIBMMG3D_EXPORT double (*MMG3D_lenedgCoor)(double *ca,double *cb,double *sa,double *sb)=NULL; LIBMMG3D_EXPORT int (*MMG3D_doSol)(MMG5_pMesh mesh,MMG5_pSol met)=NULL; diff --git a/src/mmg3d/mmg3dexterns.h b/src/mmg3d/mmg3dexterns_private.h similarity index 96% rename from src/mmg3d/mmg3dexterns.h rename to src/mmg3d/mmg3dexterns_private.h index a66f6138e..c45125fe4 100644 --- a/src/mmg3d/mmg3dexterns.h +++ b/src/mmg3d/mmg3dexterns_private.h @@ -2,8 +2,8 @@ #define MMG3DEXTERNS_H #include "libmmgtypes.h" -#include "PRoctree_3d.h" -#include "mmgcommon.h" +#include "PRoctree_3d_private.h" +#include "libmmgcommon_private.h" #ifndef MMG_EXTERN #define MMG_EXTERN extern diff --git a/src/mmg3d/movpt_3d.c b/src/mmg3d/movpt_3d.c index 5554fc491..05c311b36 100644 --- a/src/mmg3d/movpt_3d.c +++ b/src/mmg3d/movpt_3d.c @@ -35,8 +35,8 @@ #include "libmmg3d.h" #include "inlined_functions_3d.h" -#include "mmg3dexterns.h" -#include "mmgexterns.h" +#include "mmg3dexterns_private.h" +#include "mmgexterns_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/mmg3d/optbdry_3d.c b/src/mmg3d/optbdry_3d.c index ada981c87..ada48ff46 100644 --- a/src/mmg3d/optbdry_3d.c +++ b/src/mmg3d/optbdry_3d.c @@ -32,7 +32,7 @@ #include "libmmg3d.h" #include "libmmg3d_private.h" -#include "mmg3dexterns.h" +#include "mmg3dexterns_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/mmg3d/optlap_3d.c b/src/mmg3d/optlap_3d.c index c96326874..32214389e 100644 --- a/src/mmg3d/optlap_3d.c +++ b/src/mmg3d/optlap_3d.c @@ -33,7 +33,7 @@ #include "libmmg3d.h" #include "inlined_functions_3d.h" -#include "mmg3dexterns.h" +#include "mmg3dexterns_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/mmg3d/quality_3d.c b/src/mmg3d/quality_3d.c index f25bcf1a7..6ad5b796e 100644 --- a/src/mmg3d/quality_3d.c +++ b/src/mmg3d/quality_3d.c @@ -34,7 +34,7 @@ #include "libmmg3d.h" #include "inlined_functions_3d.h" -#include "mmg3dexterns.h" +#include "mmg3dexterns_private.h" extern int8_t ddb; diff --git a/src/mmg3d/split_3d.c b/src/mmg3d/split_3d.c index 528e89018..2b98b2157 100644 --- a/src/mmg3d/split_3d.c +++ b/src/mmg3d/split_3d.c @@ -35,7 +35,7 @@ #include "libmmg3d.h" #include "inlined_functions_3d.h" -#include "mmg3dexterns.h" +#include "mmg3dexterns_private.h" extern int8_t ddb; diff --git a/src/mmg3d/swap_3d.c b/src/mmg3d/swap_3d.c index be42aab1c..d426af319 100644 --- a/src/mmg3d/swap_3d.c +++ b/src/mmg3d/swap_3d.c @@ -34,7 +34,7 @@ #include "libmmg3d.h" #include "inlined_functions_3d.h" -#include "mmg3dexterns.h" +#include "mmg3dexterns_private.h" extern int8_t ddb; diff --git a/src/mmg3d/swapgen_3d.c b/src/mmg3d/swapgen_3d.c index 86e3c5767..e53631b81 100644 --- a/src/mmg3d/swapgen_3d.c +++ b/src/mmg3d/swapgen_3d.c @@ -34,7 +34,7 @@ #include "libmmg3d.h" #include "inlined_functions_3d.h" -#include "mmg3dexterns.h" +#include "mmg3dexterns_private.h" /** * \param mesh pointer toward the mesh structure diff --git a/src/mmg3d/variadic_3d.c b/src/mmg3d/variadic_3d.c index f520e89f7..1254ab089 100644 --- a/src/mmg3d/variadic_3d.c +++ b/src/mmg3d/variadic_3d.c @@ -40,7 +40,7 @@ #include "libmmg3d_private.h" #include "libmmg3d.h" -#include "mmg3dexterns.h" +#include "mmg3dexterns_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/mmgs/analys_s.c b/src/mmgs/analys_s.c index 6e27c7307..70a4c6dd1 100644 --- a/src/mmgs/analys_s.c +++ b/src/mmgs/analys_s.c @@ -34,7 +34,7 @@ */ #include "libmmgs_private.h" -#include "mmgcommon.h" +#include "libmmgcommon_private.h" /** * \param mesh pointer toward the mesh diff --git a/src/mmgs/anisomovpt_s.c b/src/mmgs/anisomovpt_s.c index 3c9c5b46b..932315cb3 100644 --- a/src/mmgs/anisomovpt_s.c +++ b/src/mmgs/anisomovpt_s.c @@ -34,7 +34,7 @@ */ #include "libmmgs_private.h" -#include "mmgexterns.h" +#include "mmgexterns_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/mmgs/anisosiz_s.c b/src/mmgs/anisosiz_s.c index 1173f4668..b501af2f0 100644 --- a/src/mmgs/anisosiz_s.c +++ b/src/mmgs/anisosiz_s.c @@ -35,9 +35,9 @@ #include "libmmgs_private.h" #include "libmmgs.h" -#include "inlined_functions.h" -#include "mmgsexterns.h" -#include "mmgexterns.h" +#include "inlined_functions_private.h" +#include "mmgsexterns_private.h" +#include "mmgexterns_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/mmgs/colver_s.c b/src/mmgs/colver_s.c index 0077d68af..9df97831c 100644 --- a/src/mmgs/colver_s.c +++ b/src/mmgs/colver_s.c @@ -34,8 +34,8 @@ */ #include "libmmgs_private.h" -#include "mmgexterns.h" -#include "inlined_functions.h" +#include "mmgexterns_private.h" +#include "inlined_functions_private.h" /** * \param mesh pointer toward the mesh diff --git a/src/mmgs/isosiz_s.c b/src/mmgs/isosiz_s.c index 4baf9cf71..c5ba29ca8 100644 --- a/src/mmgs/isosiz_s.c +++ b/src/mmgs/isosiz_s.c @@ -36,8 +36,8 @@ #include "libmmgs_private.h" #include "libmmgs.h" #include -#include "mmgsexterns.h" -#include "mmgexterns.h" +#include "mmgsexterns_private.h" +#include "mmgexterns_private.h" #define MAXLEN 1.0e+3 diff --git a/src/mmgs/libmmgs.c b/src/mmgs/libmmgs.c index f078481de..5d8a4febb 100644 --- a/src/mmgs/libmmgs.c +++ b/src/mmgs/libmmgs.c @@ -40,8 +40,8 @@ #include "libmmgs.h" #include "libmmgs_private.h" -#include "mmgsexterns.h" -#include "mmgexterns.h" +#include "mmgsexterns_private.h" +#include "mmgexterns_private.h" /** * Pack the mesh \a mesh and its associated metric \a met and return \a val. diff --git a/src/mmgs/libmmgs_tools.c b/src/mmgs/libmmgs_tools.c index 890d2b7e8..bcdc131c2 100644 --- a/src/mmgs/libmmgs_tools.c +++ b/src/mmgs/libmmgs_tools.c @@ -35,9 +35,9 @@ #include "libmmgs.h" #include "libmmgs_private.h" -#include "inlined_functions.h" -#include "mmgsexterns.h" -#include "mmgexterns.h" +#include "inlined_functions_private.h" +#include "mmgsexterns_private.h" +#include "mmgexterns_private.h" void MMGS_setfunc(MMG5_pMesh mesh,MMG5_pSol met) { diff --git a/src/mmgs/libmmgsf.c b/src/mmgs/libmmgsf.c index 8442d54c8..7bb85e2ca 100644 --- a/src/mmgs/libmmgsf.c +++ b/src/mmgs/libmmgsf.c @@ -42,7 +42,7 @@ */ #include "libmmgs.h" -#include "mmgcommon.h" +#include "libmmgcommon_private.h" /** * See \ref MMGS_mmgslib function in \ref mmgs/libmmgs.h file. diff --git a/src/mmgs/mmgs1.c b/src/mmgs/mmgs1.c index 9aa55c30d..4de5506fc 100644 --- a/src/mmgs/mmgs1.c +++ b/src/mmgs/mmgs1.c @@ -33,9 +33,9 @@ */ #include "libmmgs_private.h" -#include "mmgsexterns.h" -#include "mmgexterns.h" -#include "inlined_functions.h" +#include "mmgsexterns_private.h" +#include "mmgexterns_private.h" +#include "inlined_functions_private.h" extern int8_t ddb; diff --git a/src/mmgs/mmgs2.c b/src/mmgs/mmgs2.c index cf1f415f8..52e8dcd27 100644 --- a/src/mmgs/mmgs2.c +++ b/src/mmgs/mmgs2.c @@ -33,7 +33,7 @@ */ #include "libmmgs_private.h" -#include "mmgexterns.h" +#include "mmgexterns_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/mmgs/mmgs_export.h b/src/mmgs/mmgs_export.h index e9196fdf7..06a8b1dc9 100644 --- a/src/mmgs/mmgs_export.h +++ b/src/mmgs/mmgs_export.h @@ -24,7 +24,7 @@ #ifndef MMGS_EXPORT_H #define MMGS_EXPORT_H -#include ""mmg_export.h"" +#include "mmg_export.h" #if defined(libmmg_so_EXPORTS) || defined(libmmgs_so_EXPORTS) # define LIBMMGS_EXPORT MMG_DECL_EXPORT #else diff --git a/src/mmgs/mmgsexterns.c b/src/mmgs/mmgsexterns.c index 241d63c80..c66c72b04 100644 --- a/src/mmgs/mmgsexterns.c +++ b/src/mmgs/mmgsexterns.c @@ -4,6 +4,6 @@ #define MMG_EXTERN #define MMG_ASSIGN_NULL =NULL -#include "mmgsexterns.h" +#include "mmgsexterns_private.h" LIBMMGS_EXPORT int (*MMGS_doSol)(MMG5_pMesh mesh,MMG5_pSol met)=NULL; diff --git a/src/mmgs/mmgsexterns.h b/src/mmgs/mmgsexterns_private.h similarity index 96% rename from src/mmgs/mmgsexterns.h rename to src/mmgs/mmgsexterns_private.h index 887dc048d..63aaf6f38 100644 --- a/src/mmgs/mmgsexterns.h +++ b/src/mmgs/mmgsexterns_private.h @@ -2,7 +2,7 @@ #define MMGSEXTERNS_H #include "libmmgtypes.h" -#include "mmgcommon.h" +#include "libmmgcommon_private.h" #ifndef MMG_EXTERN #define MMG_EXTERN extern diff --git a/src/mmgs/movpt_s.c b/src/mmgs/movpt_s.c index 741254d10..331d9066a 100644 --- a/src/mmgs/movpt_s.c +++ b/src/mmgs/movpt_s.c @@ -36,7 +36,7 @@ #include #include "libmmgs_private.h" -#include "mmgexterns.h" +#include "mmgexterns_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/mmgs/quality_s.c b/src/mmgs/quality_s.c index 1f41b2100..3df84b8ac 100644 --- a/src/mmgs/quality_s.c +++ b/src/mmgs/quality_s.c @@ -34,9 +34,9 @@ */ #include "libmmgs_private.h" -#include "inlined_functions.h" -#include "mmgsexterns.h" -#include "mmgexterns.h" +#include "inlined_functions_private.h" +#include "mmgsexterns_private.h" +#include "mmgexterns_private.h" extern int8_t ddb; diff --git a/src/mmgs/split_s.c b/src/mmgs/split_s.c index f8e4382ec..add7f1740 100644 --- a/src/mmgs/split_s.c +++ b/src/mmgs/split_s.c @@ -33,8 +33,8 @@ */ #include "libmmgs_private.h" -#include "mmgsexterns.h" -#include "mmgexterns.h" +#include "mmgsexterns_private.h" +#include "mmgexterns_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/mmgs/swapar_s.c b/src/mmgs/swapar_s.c index 61a0c31c1..cc42814af 100644 --- a/src/mmgs/swapar_s.c +++ b/src/mmgs/swapar_s.c @@ -34,9 +34,9 @@ */ #include "libmmgs_private.h" -#include "mmgsexterns.h" -#include "mmgexterns.h" -#include "inlined_functions.h" +#include "mmgsexterns_private.h" +#include "mmgexterns_private.h" +#include "inlined_functions_private.h" /** * \param mesh pointer toward the mesh diff --git a/src/mmgs/variadic_s.c b/src/mmgs/variadic_s.c index 1b88155e2..6c46fe41d 100644 --- a/src/mmgs/variadic_s.c +++ b/src/mmgs/variadic_s.c @@ -39,7 +39,7 @@ #include "libmmgs_private.h" #include "libmmgs.h" -#include "mmgsexterns.h" +#include "mmgsexterns_private.h" /** * \param mesh pointer toward the mesh structure. From 042ab4c47879395c0dee81e36e5f003021a9b06b Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Fri, 9 Dec 2022 22:22:37 +0100 Subject: [PATCH 816/838] Rename COMMON_*_DIR variable into MMGCOMMON_*_DIR. --- CMakeLists.txt | 16 +++++++-------- cmake/modules/macros.cmake | 28 +++++++++++++------------- cmake/modules/mmg.cmake | 40 +++++++++++++++++++------------------- cmake/modules/mmg2d.cmake | 24 +++++++++++------------ cmake/modules/mmg3d.cmake | 24 +++++++++++------------ cmake/modules/mmgs.cmake | 24 +++++++++++------------ 6 files changed, 78 insertions(+), 78 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d2fb965d..2985dae66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,10 +39,10 @@ INCLUDE(macros) # Executable path SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) -SET(COMMON_SOURCE_DIR ${PROJECT_SOURCE_DIR}/src/common) -SET(COMMON_BINARY_DIR ${PROJECT_BINARY_DIR}/src/common) +SET(MMGCOMMON_SOURCE_DIR ${PROJECT_SOURCE_DIR}/src/common) +SET(MMGCOMMON_BINARY_DIR ${PROJECT_BINARY_DIR}/src/common) -FILE(MAKE_DIRECTORY ${COMMON_BINARY_DIR}) +FILE(MAKE_DIRECTORY ${MMGCOMMON_BINARY_DIR}) # Path toward the continuous integration directory SET ( CI_DIR ${PROJECT_SOURCE_DIR}/ci_tests @@ -124,10 +124,10 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/src/common/mmgversion.h.in IF (NOT WIN32 OR MINGW) ADD_CUSTOM_TARGET(GenerateGitHash - COMMAND ./git_log_mmg.sh ${PROJECT_SOURCE_DIR} ${COMMON_BINARY_DIR} + COMMAND ./git_log_mmg.sh ${PROJECT_SOURCE_DIR} ${MMGCOMMON_BINARY_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/scripts/ COMMENT "Getting git commit hash" - BYPRODUCTS ${COMMON_BINARY_DIR}/git_log_mmg.h + BYPRODUCTS ${MMGCOMMON_BINARY_DIR}/git_log_mmg.h ) ENDIF () @@ -222,9 +222,9 @@ ADD_EXECUTABLE(genheader ${PROJECT_SOURCE_DIR}/scripts/genheader.c) TARGET_LINK_LIBRARIES ( genheader PRIVATE ${LIBRARIES} ) IF (PERL_FOUND) GENERATE_FORTRAN_HEADER ( mmg - ${COMMON_SOURCE_DIR} libmmgtypes.h - ${COMMON_BINARY_DIR} - ${COMMON_BINARY_DIR} libmmgtypesf.h + ${MMGCOMMON_SOURCE_DIR} libmmgtypes.h + ${MMGCOMMON_BINARY_DIR} + ${MMGCOMMON_BINARY_DIR} libmmgtypesf.h ) ENDIF (PERL_FOUND) diff --git a/cmake/modules/macros.cmake b/cmake/modules/macros.cmake index 1158b300c..005ffd8cb 100644 --- a/cmake/modules/macros.cmake +++ b/cmake/modules/macros.cmake @@ -65,15 +65,15 @@ MACRO ( COPY_HEADERS_AND_CREATE_TARGET ADD_CUSTOM_TARGET(mmg${target_identifier}types_header ALL DEPENDS - ${COMMON_SOURCE_DIR}/libmmgtypes.h ) + ${MMGCOMMON_SOURCE_DIR}/libmmgtypes.h ) ADD_CUSTOM_TARGET(mmg${target_identifier}cmakedefines_header ALL DEPENDS - ${COMMON_BINARY_DIR}/mmgcmakedefines.h ${COMMON_BINARY_DIR}/mmgcmakedefinesf.h ) + ${MMGCOMMON_BINARY_DIR}/mmgcmakedefines.h ${MMGCOMMON_BINARY_DIR}/mmgcmakedefinesf.h ) ADD_CUSTOM_TARGET(mmg${target_identifier}version_header ALL DEPENDS - ${COMMON_BINARY_DIR}/mmgversion.h ) + ${MMGCOMMON_BINARY_DIR}/mmgversion.h ) ADD_CUSTOM_TARGET(mmg${target_identifier}_header ALL DEPENDS @@ -84,22 +84,22 @@ MACRO ( COPY_HEADERS_AND_CREATE_TARGET ${source_dir}/mmg${target_identifier}_export.h ) COPY_HEADER ( - ${COMMON_SOURCE_DIR} libmmgtypes.h + ${MMGCOMMON_SOURCE_DIR} libmmgtypes.h ${include_dir} libmmgtypes.h mmg${target_identifier}types_header copy${target_identifier}_libmmgtypes ) COPY_HEADER ( - ${COMMON_BINARY_DIR} mmgcmakedefines.h + ${MMGCOMMON_BINARY_DIR} mmgcmakedefines.h ${include_dir} mmgcmakedefines.h mmg${target_identifier}cmakedefines_header copy${target_identifier}_mmgcmakedefines ) COPY_HEADER ( - ${COMMON_BINARY_DIR} mmgcmakedefinesf.h + ${MMGCOMMON_BINARY_DIR} mmgcmakedefinesf.h ${include_dir} mmgcmakedefinesf.h mmg${target_identifier}cmakedefines_header copy${target_identifier}_mmgcmakedefinesf ) COPY_HEADER ( - ${COMMON_BINARY_DIR} mmgversion.h + ${MMGCOMMON_BINARY_DIR} mmgversion.h ${include_dir} mmgversion.h mmg${target_identifier}version_header copy${target_identifier}_mmgversion ) @@ -115,7 +115,7 @@ MACRO ( COPY_HEADERS_AND_CREATE_TARGET if (PERL_FOUND) COPY_HEADER ( - ${COMMON_BINARY_DIR} libmmgtypesf.h + ${MMGCOMMON_BINARY_DIR} libmmgtypesf.h ${include_dir} libmmgtypesf.h mmg_fortran_header copy${target_identifier}_libmmgtypesf ) @@ -133,7 +133,7 @@ MACRO ( COPY_HEADERS_AND_CREATE_TARGET IF (NOT WIN32 OR MINGW) COPY_HEADER ( - ${COMMON_BINARY_DIR} git_log_mmg.h + ${MMGCOMMON_BINARY_DIR} git_log_mmg.h ${include_dir} git_log_mmg.h GenerateGitHash copy${target_identifier}_mmggithash ) @@ -171,13 +171,13 @@ MACRO ( ADD_AND_INSTALL_LIBRARY IF ( CMAKE_VERSION VERSION_LESS 2.8.12 ) INCLUDE_DIRECTORIES ( BEFORE - ${COMMON_BINARY_DIR} ${COMMON_SOURCE_DIR} ${PROJECT_BINARY_DIR}/include ${PROJECT_BINARY_DIR}) + ${MMGCOMMON_BINARY_DIR} ${MMGCOMMON_SOURCE_DIR} ${PROJECT_BINARY_DIR}/include ${PROJECT_BINARY_DIR}) ELSE ( ) target_include_directories( ${target_name} BEFORE PUBLIC $ $ - $ - $ + $ + $ $ $ $ @@ -264,7 +264,7 @@ MACRO ( ADD_AND_INSTALL_EXECUTABLE IF ( CMAKE_VERSION VERSION_LESS 2.8.12 ) INCLUDE_DIRECTORIES ( BEFORE - ${COMMON_BINARY_DIR} ${COMMON_SOURCE_DIR} ${PROJECT_BINARY_DIR}/include ${PROJECT_BINARY_DIR} ) + ${MMGCOMMON_BINARY_DIR} ${MMGCOMMON_SOURCE_DIR} ${PROJECT_BINARY_DIR}/include ${PROJECT_BINARY_DIR} ) if ( SCOTCH_FOUND AND NOT USE_SCOTCH MATCHES OFF ) message(STATUS "[mmg] add include scotch directories ${SCOTCH_INCLUDE_DIRS}") INCLUDE_DIRECTORIES ( AFTER ${SCOTCH_INCLUDE_DIRS} ) @@ -272,7 +272,7 @@ MACRO ( ADD_AND_INSTALL_EXECUTABLE ELSE ( ) TARGET_INCLUDE_DIRECTORIES ( ${exec_name} BEFORE PUBLIC - ${COMMON_BINARY_DIR} ${COMMON_SOURCE_DIR} ${PROJECT_BINARY_DIR}/include ${PROJECT_BINARY_DIR} ) + ${MMGCOMMON_BINARY_DIR} ${MMGCOMMON_SOURCE_DIR} ${PROJECT_BINARY_DIR}/include ${PROJECT_BINARY_DIR} ) if ( SCOTCH_FOUND AND NOT USE_SCOTCH MATCHES OFF ) message(STATUS "[mmg] add include scotch directories ${SCOTCH_INCLUDE_DIRS}") target_include_directories( ${exec_name} BEFORE PUBLIC ${SCOTCH_INCLUDE_DIRS} ) diff --git a/cmake/modules/mmg.cmake b/cmake/modules/mmg.cmake index a682790df..374d6927d 100644 --- a/cmake/modules/mmg.cmake +++ b/cmake/modules/mmg.cmake @@ -45,11 +45,11 @@ FILE( ${MMG2D_SOURCE_DIR}/*.c ${MMG3D_SOURCE_DIR}/*.c ${MMGS_SOURCE_DIR}/*.c - ${COMMON_SOURCE_DIR}/*.c + ${MMGCOMMON_SOURCE_DIR}/*.c ${MMG2D_SOURCE_DIR}/*.h ${MMG3D_SOURCE_DIR}/*.h ${MMGS_SOURCE_DIR}/*.h - ${COMMON_SOURCE_DIR}/*.h + ${MMGCOMMON_SOURCE_DIR}/*.h ) LIST(REMOVE_ITEM mmg_library_files ${MMG2D_SOURCE_DIR}/mmg2d.c @@ -59,7 +59,7 @@ LIST(REMOVE_ITEM mmg_library_files IF ( VTK_FOUND AND NOT USE_VTK MATCHES OFF) LIST(APPEND mmg_library_files - ${COMMON_SOURCE_DIR}/vtkparser.cpp ) + ${MMGCOMMON_SOURCE_DIR}/vtkparser.cpp ) ENDIF ( ) IF ( LIBMMG_STATIC ) @@ -90,35 +90,35 @@ IF ( LIBMMG_STATIC OR LIBMMG_SHARED ) ${MMG2D_SOURCE_DIR}/mmg2d_export.h ${MMG2D_SOURCE_DIR}/libmmg2d.h ${MMG2D_BINARY_DIR}/libmmg2df.h - ${COMMON_SOURCE_DIR}/mmg_export.h - ${COMMON_SOURCE_DIR}/libmmgtypes.h - ${COMMON_BINARY_DIR}/libmmgtypesf.h - ${COMMON_BINARY_DIR}/mmgcmakedefines.h - ${COMMON_BINARY_DIR}/mmgcmakedefinesf.h + ${MMGCOMMON_SOURCE_DIR}/mmg_export.h + ${MMGCOMMON_SOURCE_DIR}/libmmgtypes.h + ${MMGCOMMON_BINARY_DIR}/libmmgtypesf.h + ${MMGCOMMON_BINARY_DIR}/mmgcmakedefines.h + ${MMGCOMMON_BINARY_DIR}/mmgcmakedefinesf.h ) SET( mmg3d_headers ${MMG3D_SOURCE_DIR}/mmg3d_export.h ${MMG3D_SOURCE_DIR}/libmmg3d.h ${MMG3D_BINARY_DIR}/libmmg3df.h - ${COMMON_SOURCE_DIR}/mmg_export.h - ${COMMON_SOURCE_DIR}/libmmgtypes.h - ${COMMON_BINARY_DIR}/libmmgtypesf.h - ${COMMON_BINARY_DIR}/mmgcmakedefines.h - ${COMMON_BINARY_DIR}/mmgcmakedefinesf.h + ${MMGCOMMON_SOURCE_DIR}/mmg_export.h + ${MMGCOMMON_SOURCE_DIR}/libmmgtypes.h + ${MMGCOMMON_BINARY_DIR}/libmmgtypesf.h + ${MMGCOMMON_BINARY_DIR}/mmgcmakedefines.h + ${MMGCOMMON_BINARY_DIR}/mmgcmakedefinesf.h ) SET( mmgs_headers ${MMGS_SOURCE_DIR}/mmgs_export.h ${MMGS_SOURCE_DIR}/libmmgs.h ${MMGS_BINARY_DIR}/libmmgsf.h - ${COMMON_SOURCE_DIR}/mmg_export.h - ${COMMON_SOURCE_DIR}/libmmgtypes.h - ${COMMON_BINARY_DIR}/libmmgtypesf.h - ${COMMON_BINARY_DIR}/mmgcmakedefines.h - ${COMMON_BINARY_DIR}/mmgcmakedefinesf.h + ${MMGCOMMON_SOURCE_DIR}/mmg_export.h + ${MMGCOMMON_SOURCE_DIR}/libmmgtypes.h + ${MMGCOMMON_BINARY_DIR}/libmmgtypesf.h + ${MMGCOMMON_BINARY_DIR}/mmgcmakedefines.h + ${MMGCOMMON_BINARY_DIR}/mmgcmakedefinesf.h ) SET( mmg_headers - ${COMMON_SOURCE_DIR}/mmg_export.h - ${COMMON_BINARY_DIR}/mmgcmakedefines.h + ${MMGCOMMON_SOURCE_DIR}/mmg_export.h + ${MMGCOMMON_BINARY_DIR}/mmgcmakedefines.h # ${PROJECT_SOURCE_DIR}/src/common/mmg_core_export.h ${PROJECT_SOURCE_DIR}/src/mmg/libmmg.h ${PROJECT_SOURCE_DIR}/src/mmg/libmmgf.h diff --git a/cmake/modules/mmg2d.cmake b/cmake/modules/mmg2d.cmake index c4628a790..9cc26292d 100644 --- a/cmake/modules/mmg2d.cmake +++ b/cmake/modules/mmg2d.cmake @@ -57,27 +57,27 @@ FILE( GLOB mmg2d_library_files ${MMG2D_SOURCE_DIR}/*.c - ${COMMON_SOURCE_DIR}/*.c + ${MMGCOMMON_SOURCE_DIR}/*.c ${MMG2D_SOURCE_DIR}/*.h - ${COMMON_SOURCE_DIR}/*.h + ${MMGCOMMON_SOURCE_DIR}/*.h ${MMG2D_SOURCE_DIR}/inoutcpp_2d.cpp ) LIST(REMOVE_ITEM mmg2d_library_files ${MMG2D_SOURCE_DIR}/mmg2d.c - ${COMMON_SOURCE_DIR}/apptools.c + ${MMGCOMMON_SOURCE_DIR}/apptools.c ${REMOVE_FILE} ) IF ( VTK_FOUND AND NOT USE_VTK MATCHES OFF ) LIST(APPEND mmg2d_library_files - ${COMMON_SOURCE_DIR}/vtkparser.cpp ) + ${MMGCOMMON_SOURCE_DIR}/vtkparser.cpp ) ENDIF ( ) FILE( GLOB mmg2d_main_file ${MMG2D_SOURCE_DIR}/mmg2d.c - ${COMMON_SOURCE_DIR}/apptools.c + ${MMGCOMMON_SOURCE_DIR}/apptools.c ) ############################################################################ @@ -118,15 +118,15 @@ SET( mmg2d_headers ${MMG2D_SOURCE_DIR}/mmg2d_export.h ${MMG2D_SOURCE_DIR}/libmmg2d.h ${MMG2D_BINARY_DIR}/libmmg2df.h - ${COMMON_SOURCE_DIR}/mmg_export.h - ${COMMON_SOURCE_DIR}/libmmgtypes.h - ${COMMON_BINARY_DIR}/libmmgtypesf.h - ${COMMON_BINARY_DIR}/mmgcmakedefines.h - ${COMMON_BINARY_DIR}/mmgcmakedefinesf.h - ${COMMON_BINARY_DIR}/mmgversion.h + ${MMGCOMMON_SOURCE_DIR}/mmg_export.h + ${MMGCOMMON_SOURCE_DIR}/libmmgtypes.h + ${MMGCOMMON_BINARY_DIR}/libmmgtypesf.h + ${MMGCOMMON_BINARY_DIR}/mmgcmakedefines.h + ${MMGCOMMON_BINARY_DIR}/mmgcmakedefinesf.h + ${MMGCOMMON_BINARY_DIR}/mmgversion.h ) IF (NOT WIN32 OR MINGW) - LIST(APPEND mmg2d_headers ${COMMON_BINARY_DIR}/git_log_mmg.h ) + LIST(APPEND mmg2d_headers ${MMGCOMMON_BINARY_DIR}/git_log_mmg.h ) ENDIF() # install man pages diff --git a/cmake/modules/mmg3d.cmake b/cmake/modules/mmg3d.cmake index b957c2a2d..69e476039 100644 --- a/cmake/modules/mmg3d.cmake +++ b/cmake/modules/mmg3d.cmake @@ -72,26 +72,26 @@ FILE( GLOB mmg3d_library_files ${MMG3D_SOURCE_DIR}/*.c - ${COMMON_SOURCE_DIR}/*.c + ${MMGCOMMON_SOURCE_DIR}/*.c ${MMG3D_SOURCE_DIR}/*.h - ${COMMON_SOURCE_DIR}/*.h + ${MMGCOMMON_SOURCE_DIR}/*.h ${MMG3D_SOURCE_DIR}/inoutcpp_3d.cpp ) LIST(REMOVE_ITEM mmg3d_library_files ${MMG3D_SOURCE_DIR}/mmg3d.c - ${COMMON_SOURCE_DIR}/apptools.c + ${MMGCOMMON_SOURCE_DIR}/apptools.c ) IF ( VTK_FOUND AND NOT USE_VTK MATCHES OFF ) LIST(APPEND mmg3d_library_files - ${COMMON_SOURCE_DIR}/vtkparser.cpp) + ${MMGCOMMON_SOURCE_DIR}/vtkparser.cpp) ENDIF ( ) FILE( GLOB mmg3d_main_file ${MMG3D_SOURCE_DIR}/mmg3d.c - ${COMMON_SOURCE_DIR}/apptools.c + ${MMGCOMMON_SOURCE_DIR}/apptools.c ) ############################################################################ @@ -145,15 +145,15 @@ SET( mmg3d_headers ${MMG3D_SOURCE_DIR}/mmg3d_export.h ${MMG3D_SOURCE_DIR}/libmmg3d.h ${MMG3D_BINARY_DIR}/libmmg3df.h - ${COMMON_SOURCE_DIR}/mmg_export.h - ${COMMON_SOURCE_DIR}/libmmgtypes.h - ${COMMON_BINARY_DIR}/libmmgtypesf.h - ${COMMON_BINARY_DIR}/mmgcmakedefines.h - ${COMMON_BINARY_DIR}/mmgcmakedefinesf.h - ${COMMON_BINARY_DIR}/mmgversion.h + ${MMGCOMMON_SOURCE_DIR}/mmg_export.h + ${MMGCOMMON_SOURCE_DIR}/libmmgtypes.h + ${MMGCOMMON_BINARY_DIR}/libmmgtypesf.h + ${MMGCOMMON_BINARY_DIR}/mmgcmakedefines.h + ${MMGCOMMON_BINARY_DIR}/mmgcmakedefinesf.h + ${MMGCOMMON_BINARY_DIR}/mmgversion.h ) IF (NOT WIN32 OR MINGW) - LIST(APPEND mmg3d_headers ${COMMON_BINARY_DIR}/git_log_mmg.h ) + LIST(APPEND mmg3d_headers ${MMGCOMMON_BINARY_DIR}/git_log_mmg.h ) ENDIF() # install man pages diff --git a/cmake/modules/mmgs.cmake b/cmake/modules/mmgs.cmake index 16b4ebf7a..29bf4572a 100644 --- a/cmake/modules/mmgs.cmake +++ b/cmake/modules/mmgs.cmake @@ -58,26 +58,26 @@ FILE( GLOB mmgs_library_files ${MMGS_SOURCE_DIR}/*.c - ${COMMON_SOURCE_DIR}/*.c + ${MMGCOMMON_SOURCE_DIR}/*.c ${MMGS_SOURCE_DIR}/*.h - ${COMMON_SOURCE_DIR}/*.h + ${MMGCOMMON_SOURCE_DIR}/*.h ${MMGS_SOURCE_DIR}/inoutcpp_s.cpp ) LIST(REMOVE_ITEM mmgs_library_files ${MMGS_SOURCE_DIR}/mmgs.c - ${COMMON_SOURCE_DIR}/apptools.c + ${MMGCOMMON_SOURCE_DIR}/apptools.c ${REMOVE_FILE} ) IF ( VTK_FOUND ) LIST(APPEND mmgs_library_files - ${COMMON_SOURCE_DIR}/vtkparser.cpp ) + ${MMGCOMMON_SOURCE_DIR}/vtkparser.cpp ) ENDIF ( ) FILE( GLOB mmgs_main_file ${MMGS_SOURCE_DIR}/mmgs.c - ${COMMON_SOURCE_DIR}/apptools.c + ${MMGCOMMON_SOURCE_DIR}/apptools.c ) ############################################################################ @@ -110,15 +110,15 @@ SET( mmgs_headers ${MMGS_SOURCE_DIR}/mmgs_export.h ${MMGS_SOURCE_DIR}/libmmgs.h ${MMGS_BINARY_DIR}/libmmgsf.h - ${COMMON_SOURCE_DIR}/mmg_export.h - ${COMMON_SOURCE_DIR}/libmmgtypes.h - ${COMMON_BINARY_DIR}/libmmgtypesf.h - ${COMMON_BINARY_DIR}/mmgcmakedefines.h - ${COMMON_BINARY_DIR}/mmgcmakedefinesf.h - ${COMMON_BINARY_DIR}/mmgversion.h + ${MMGCOMMON_SOURCE_DIR}/mmg_export.h + ${MMGCOMMON_SOURCE_DIR}/libmmgtypes.h + ${MMGCOMMON_BINARY_DIR}/libmmgtypesf.h + ${MMGCOMMON_BINARY_DIR}/mmgcmakedefines.h + ${MMGCOMMON_BINARY_DIR}/mmgcmakedefinesf.h + ${MMGCOMMON_BINARY_DIR}/mmgversion.h ) IF (NOT WIN32 OR MINGW) - LIST(APPEND mmgs_headers ${COMMON_BINARY_DIR}/git_log_mmg.h ) + LIST(APPEND mmgs_headers ${MMGCOMMON_BINARY_DIR}/git_log_mmg.h ) ENDIF() # install man pages From 3259055ea4c226b4f800f68899df2f84885e3683 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Fri, 9 Dec 2022 22:49:22 +0100 Subject: [PATCH 817/838] CMake refactoring. --- cmake/modules/macros.cmake | 73 ++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 39 deletions(-) diff --git a/cmake/modules/macros.cmake b/cmake/modules/macros.cmake index 005ffd8cb..2fc440a1e 100644 --- a/cmake/modules/macros.cmake +++ b/cmake/modules/macros.cmake @@ -60,58 +60,53 @@ ENDMACRO ( ) ##### and create the associated target ##### ############################################################################### -MACRO ( COPY_HEADERS_AND_CREATE_TARGET - source_dir binary_dir include_dir target_identifier ) +MACRO ( COPY_1_HEADER_AND_CREATE_TARGET + source_dir name include_dir target_identifier ) - ADD_CUSTOM_TARGET(mmg${target_identifier}types_header ALL + ADD_CUSTOM_TARGET(mmg${target_identifier}${name}_header ALL DEPENDS - ${MMGCOMMON_SOURCE_DIR}/libmmgtypes.h ) + ${source_dir}/${name}.h ) - ADD_CUSTOM_TARGET(mmg${target_identifier}cmakedefines_header ALL - DEPENDS - ${MMGCOMMON_BINARY_DIR}/mmgcmakedefines.h ${MMGCOMMON_BINARY_DIR}/mmgcmakedefinesf.h ) + COPY_HEADER ( + ${source_dir} ${name}.h + ${include_dir} ${name}.h + mmg${target_identifier}${name}_header copy${target_identifier}_${name} ) - ADD_CUSTOM_TARGET(mmg${target_identifier}version_header ALL - DEPENDS - ${MMGCOMMON_BINARY_DIR}/mmgversion.h ) - ADD_CUSTOM_TARGET(mmg${target_identifier}_header ALL - DEPENDS - ${source_dir}/libmmg${target_identifier}.h ) +ENDMACRO() - ADD_CUSTOM_TARGET(mmg${target_identifier}_export_header ALL - DEPENDS - ${source_dir}/mmg${target_identifier}_export.h ) +############################################################################### +##### +##### Copy an automatically generated header file to another place +##### and create the associated target +##### +############################################################################### +MACRO ( COPY_HEADERS_AND_CREATE_TARGET + source_dir binary_dir include_dir target_identifier ) - COPY_HEADER ( - ${MMGCOMMON_SOURCE_DIR} libmmgtypes.h - ${include_dir} libmmgtypes.h - mmg${target_identifier}types_header copy${target_identifier}_libmmgtypes ) + COPY_1_HEADER_AND_CREATE_TARGET( + ${MMGCOMMON_SOURCE_DIR} libmmgtypes ${include_dir} ${target_identifier}) - COPY_HEADER ( - ${MMGCOMMON_BINARY_DIR} mmgcmakedefines.h - ${include_dir} mmgcmakedefines.h - mmg${target_identifier}cmakedefines_header copy${target_identifier}_mmgcmakedefines ) + COPY_1_HEADER_AND_CREATE_TARGET( + ${MMGCOMMON_BINARY_DIR} mmgcmakedefines ${include_dir} ${target_identifier}) + # Fortran generation COPY_HEADER ( ${MMGCOMMON_BINARY_DIR} mmgcmakedefinesf.h ${include_dir} mmgcmakedefinesf.h - mmg${target_identifier}cmakedefines_header copy${target_identifier}_mmgcmakedefinesf ) + mmg${target_identifier}mmgcmakedefines_header copy${target_identifier}_mmgcmakedefinesf ) - COPY_HEADER ( - ${MMGCOMMON_BINARY_DIR} mmgversion.h - ${include_dir} mmgversion.h - mmg${target_identifier}version_header copy${target_identifier}_mmgversion ) + COPY_1_HEADER_AND_CREATE_TARGET( + ${MMGCOMMON_BINARY_DIR} mmgversion ${include_dir} ${target_identifier}) - COPY_HEADER ( - ${source_dir} libmmg${target_identifier}.h - ${include_dir} libmmg${target_identifier}.h - mmg${target_identifier}_header copy_libmmg${target_identifier} ) + COPY_1_HEADER_AND_CREATE_TARGET( + ${source_dir} libmmg${target_identifier} + ${include_dir} ${target_identifier}) + + COPY_1_HEADER_AND_CREATE_TARGET( + ${source_dir} mmg${target_identifier}_export + ${include_dir} ${target_identifier}) - COPY_HEADER ( - ${source_dir} mmg${target_identifier}_export.h - ${include_dir} mmg${target_identifier}_export.h - mmg${target_identifier}_export_header copy_mmg${target_identifier}_export ) if (PERL_FOUND) COPY_HEADER ( @@ -125,10 +120,10 @@ MACRO ( COPY_HEADERS_AND_CREATE_TARGET mmg${target_identifier}_fortran_header copy_libmmg${target_identifier}f ) SET ( tgt_list copy_libmmg${target_identifier}f copy${target_identifier}_libmmgtypesf - copy_libmmg${target_identifier} copy${target_identifier}_libmmgtypes + copy${target_identifier}_libmmg${target_identifier} copy${target_identifier}_libmmgtypes copy${target_identifier}_mmgcmakedefines copy${target_identifier}_mmgcmakedefinesf copy${target_identifier}_mmgversion - copy_mmg${target_identifier}_export ) + copy${target_identifier}_mmg${target_identifier}_export ) endif (PERL_FOUND) IF (NOT WIN32 OR MINGW) From 2e4270966ed0ba586b1c36f559429b900482b21a Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Fri, 9 Dec 2022 23:52:01 +0100 Subject: [PATCH 818/838] Do not copy common header files in all mmg directories anymore. --- cmake/modules/build-targets.cmake | 2 + cmake/modules/macros.cmake | 53 +++++------------ cmake/modules/mmg.cmake | 22 +------ cmake/modules/mmg2d.cmake | 9 --- cmake/modules/mmg3d.cmake | 9 --- cmake/modules/mmgcommon.cmake | 96 +++++++++++++++++++++++++++++++ cmake/modules/mmgs.cmake | 9 --- src/mmg2d/libmmg2d.h | 2 +- src/mmg2d/mmg2d_export.h | 2 +- src/mmg3d/libmmg3d.h | 2 +- src/mmg3d/mmg3d_export.h | 2 +- src/mmgs/libmmgs.h | 2 +- src/mmgs/mmgs_export.h | 2 +- 13 files changed, 118 insertions(+), 94 deletions(-) create mode 100644 cmake/modules/mmgcommon.cmake diff --git a/cmake/modules/build-targets.cmake b/cmake/modules/build-targets.cmake index 5259b54ce..279be47ec 100644 --- a/cmake/modules/build-targets.cmake +++ b/cmake/modules/build-targets.cmake @@ -33,6 +33,8 @@ IF( BUILD_TESTING ) FILE ( MAKE_DIRECTORY ${CTEST_OUTPUT_DIR} ) ENDIF ( ) +INCLUDE(mmgcommon) + IF ( BUILD_MMG2D ) INCLUDE(mmg2d) ENDIF ( ) diff --git a/cmake/modules/macros.cmake b/cmake/modules/macros.cmake index 2fc440a1e..1c21813ab 100644 --- a/cmake/modules/macros.cmake +++ b/cmake/modules/macros.cmake @@ -63,14 +63,14 @@ ENDMACRO ( ) MACRO ( COPY_1_HEADER_AND_CREATE_TARGET source_dir name include_dir target_identifier ) - ADD_CUSTOM_TARGET(mmg${target_identifier}${name}_header ALL + ADD_CUSTOM_TARGET(mmg${target_identifier}_${name}_header ALL DEPENDS ${source_dir}/${name}.h ) COPY_HEADER ( ${source_dir} ${name}.h ${include_dir} ${name}.h - mmg${target_identifier}${name}_header copy${target_identifier}_${name} ) + mmg${target_identifier}_${name}_header copy${target_identifier}_${name} ) ENDMACRO() @@ -84,21 +84,6 @@ ENDMACRO() MACRO ( COPY_HEADERS_AND_CREATE_TARGET source_dir binary_dir include_dir target_identifier ) - COPY_1_HEADER_AND_CREATE_TARGET( - ${MMGCOMMON_SOURCE_DIR} libmmgtypes ${include_dir} ${target_identifier}) - - COPY_1_HEADER_AND_CREATE_TARGET( - ${MMGCOMMON_BINARY_DIR} mmgcmakedefines ${include_dir} ${target_identifier}) - - # Fortran generation - COPY_HEADER ( - ${MMGCOMMON_BINARY_DIR} mmgcmakedefinesf.h - ${include_dir} mmgcmakedefinesf.h - mmg${target_identifier}mmgcmakedefines_header copy${target_identifier}_mmgcmakedefinesf ) - - COPY_1_HEADER_AND_CREATE_TARGET( - ${MMGCOMMON_BINARY_DIR} mmgversion ${include_dir} ${target_identifier}) - COPY_1_HEADER_AND_CREATE_TARGET( ${source_dir} libmmg${target_identifier} ${include_dir} ${target_identifier}) @@ -109,31 +94,19 @@ MACRO ( COPY_HEADERS_AND_CREATE_TARGET if (PERL_FOUND) - COPY_HEADER ( - ${MMGCOMMON_BINARY_DIR} libmmgtypesf.h - ${include_dir} libmmgtypesf.h - mmg_fortran_header copy${target_identifier}_libmmgtypesf ) - - COPY_HEADER ( - ${binary_dir} libmmg${target_identifier}f.h - ${include_dir} libmmg${target_identifier}f.h - mmg${target_identifier}_fortran_header copy_libmmg${target_identifier}f ) - - SET ( tgt_list copy_libmmg${target_identifier}f copy${target_identifier}_libmmgtypesf - copy${target_identifier}_libmmg${target_identifier} copy${target_identifier}_libmmgtypes - copy${target_identifier}_mmgcmakedefines copy${target_identifier}_mmgcmakedefinesf - copy${target_identifier}_mmgversion - copy${target_identifier}_mmg${target_identifier}_export ) - endif (PERL_FOUND) - - IF (NOT WIN32 OR MINGW) COPY_HEADER ( - ${MMGCOMMON_BINARY_DIR} git_log_mmg.h - ${include_dir} git_log_mmg.h - GenerateGitHash copy${target_identifier}_mmggithash ) + ${binary_dir} libmmg${target_identifier}f.h + ${include_dir} libmmg${target_identifier}f.h + mmg${target_identifier}_fortran_header copy_libmmg${target_identifier}f ) + + SET ( tgt_list copy_libmmg${target_identifier}f copymmgcommon_libmmgtypesf + copy${target_identifier}_libmmg${target_identifier} copymmgcommon_libmmgtypes + copy${target_identifier}_mmg${target_identifier}_export + copymmgcommon_mmgcmakedefines copymmgcommon_mmgcmakedefinesf + copymmgcommon_mmgversion + copymmgcommon_mmg_export ) + endif (PERL_FOUND) - LIST ( APPEND tgt_list copy${target_identifier}_mmggithash) - ENDIF () ADD_CUSTOM_TARGET (copy_${target_identifier}_headers ALL DEPENDS ${tgt_list} ) diff --git a/cmake/modules/mmg.cmake b/cmake/modules/mmg.cmake index 374d6927d..709ab1cdf 100644 --- a/cmake/modules/mmg.cmake +++ b/cmake/modules/mmg.cmake @@ -90,36 +90,19 @@ IF ( LIBMMG_STATIC OR LIBMMG_SHARED ) ${MMG2D_SOURCE_DIR}/mmg2d_export.h ${MMG2D_SOURCE_DIR}/libmmg2d.h ${MMG2D_BINARY_DIR}/libmmg2df.h - ${MMGCOMMON_SOURCE_DIR}/mmg_export.h - ${MMGCOMMON_SOURCE_DIR}/libmmgtypes.h - ${MMGCOMMON_BINARY_DIR}/libmmgtypesf.h - ${MMGCOMMON_BINARY_DIR}/mmgcmakedefines.h - ${MMGCOMMON_BINARY_DIR}/mmgcmakedefinesf.h ) SET( mmg3d_headers ${MMG3D_SOURCE_DIR}/mmg3d_export.h ${MMG3D_SOURCE_DIR}/libmmg3d.h ${MMG3D_BINARY_DIR}/libmmg3df.h - ${MMGCOMMON_SOURCE_DIR}/mmg_export.h - ${MMGCOMMON_SOURCE_DIR}/libmmgtypes.h - ${MMGCOMMON_BINARY_DIR}/libmmgtypesf.h - ${MMGCOMMON_BINARY_DIR}/mmgcmakedefines.h - ${MMGCOMMON_BINARY_DIR}/mmgcmakedefinesf.h ) SET( mmgs_headers ${MMGS_SOURCE_DIR}/mmgs_export.h ${MMGS_SOURCE_DIR}/libmmgs.h ${MMGS_BINARY_DIR}/libmmgsf.h - ${MMGCOMMON_SOURCE_DIR}/mmg_export.h - ${MMGCOMMON_SOURCE_DIR}/libmmgtypes.h - ${MMGCOMMON_BINARY_DIR}/libmmgtypesf.h - ${MMGCOMMON_BINARY_DIR}/mmgcmakedefines.h - ${MMGCOMMON_BINARY_DIR}/mmgcmakedefinesf.h ) SET( mmg_headers - ${MMGCOMMON_SOURCE_DIR}/mmg_export.h - ${MMGCOMMON_BINARY_DIR}/mmgcmakedefines.h - # ${PROJECT_SOURCE_DIR}/src/common/mmg_core_export.h + # ${PROJECT_SOURCE_DIR}/src/common/mmg_core_export.h ${PROJECT_SOURCE_DIR}/src/mmg/libmmg.h ${PROJECT_SOURCE_DIR}/src/mmg/libmmgf.h ) @@ -161,9 +144,6 @@ IF ( LIBMMG_STATIC OR LIBMMG_SHARED ) copy_2d_headers copy_s_headers copy_3d_headers ${PROJECT_BINARY_DIR}/include/mmg/libmmgf.h ${PROJECT_BINARY_DIR}/include/mmg/libmmg.h - ${PROJECT_BINARY_DIR}/include/mmg/mmg3d/libmmgtypes.h - ${PROJECT_BINARY_DIR}/include/mmg/mmg3d/mmgcmakedefines.h - ${PROJECT_BINARY_DIR}/include/mmg/mmg3d/mmgcmakedefinesf.h ) ENDIF() diff --git a/cmake/modules/mmg2d.cmake b/cmake/modules/mmg2d.cmake index 9cc26292d..a922c8673 100644 --- a/cmake/modules/mmg2d.cmake +++ b/cmake/modules/mmg2d.cmake @@ -118,16 +118,7 @@ SET( mmg2d_headers ${MMG2D_SOURCE_DIR}/mmg2d_export.h ${MMG2D_SOURCE_DIR}/libmmg2d.h ${MMG2D_BINARY_DIR}/libmmg2df.h - ${MMGCOMMON_SOURCE_DIR}/mmg_export.h - ${MMGCOMMON_SOURCE_DIR}/libmmgtypes.h - ${MMGCOMMON_BINARY_DIR}/libmmgtypesf.h - ${MMGCOMMON_BINARY_DIR}/mmgcmakedefines.h - ${MMGCOMMON_BINARY_DIR}/mmgcmakedefinesf.h - ${MMGCOMMON_BINARY_DIR}/mmgversion.h ) -IF (NOT WIN32 OR MINGW) - LIST(APPEND mmg2d_headers ${MMGCOMMON_BINARY_DIR}/git_log_mmg.h ) -ENDIF() # install man pages INSTALL(FILES ${PROJECT_SOURCE_DIR}/doc/man/mmg2d.1.gz DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) diff --git a/cmake/modules/mmg3d.cmake b/cmake/modules/mmg3d.cmake index 69e476039..38f6a52ac 100644 --- a/cmake/modules/mmg3d.cmake +++ b/cmake/modules/mmg3d.cmake @@ -145,16 +145,7 @@ SET( mmg3d_headers ${MMG3D_SOURCE_DIR}/mmg3d_export.h ${MMG3D_SOURCE_DIR}/libmmg3d.h ${MMG3D_BINARY_DIR}/libmmg3df.h - ${MMGCOMMON_SOURCE_DIR}/mmg_export.h - ${MMGCOMMON_SOURCE_DIR}/libmmgtypes.h - ${MMGCOMMON_BINARY_DIR}/libmmgtypesf.h - ${MMGCOMMON_BINARY_DIR}/mmgcmakedefines.h - ${MMGCOMMON_BINARY_DIR}/mmgcmakedefinesf.h - ${MMGCOMMON_BINARY_DIR}/mmgversion.h ) -IF (NOT WIN32 OR MINGW) - LIST(APPEND mmg3d_headers ${MMGCOMMON_BINARY_DIR}/git_log_mmg.h ) -ENDIF() # install man pages INSTALL(FILES ${PROJECT_SOURCE_DIR}/doc/man/mmg3d.1.gz DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) diff --git a/cmake/modules/mmgcommon.cmake b/cmake/modules/mmgcommon.cmake new file mode 100644 index 000000000..ae7e905c3 --- /dev/null +++ b/cmake/modules/mmgcommon.cmake @@ -0,0 +1,96 @@ +## ============================================================================= +## This file is part of the mmg software package for the tetrahedral +## mesh modification. +##** Copyright (c) Bx INP/Inria/UBordeaux/UPMC, 2004- . +## +## mmg is free software: you can redistribute it and/or modify it +## under the terms of the GNU Lesser General Public License as published +## by the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## mmg is distributed in the hope that it will be useful, but WITHOUT +## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +## FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +## License for more details. +## +## You should have received a copy of the GNU Lesser General Public +## License and of the GNU General Public License along with mmg (in +## files COPYING.LESSER and COPYING). If not, see +## . Please read their terms carefully and +## use this copy of the mmg distribution only if you accept them. +## ============================================================================= + +## ============================================================================= +## +## Installation and copy of common headers +## +## ============================================================================= + +SET(MMGCOMMON_SHRT_INCLUDE mmg/common ) +SET(MMGCOMMON_INCLUDE ${PROJECT_BINARY_DIR}/include/${MMGCOMMON_SHRT_INCLUDE} ) + + +############################################################################ +##### +##### Headers +##### +############################################################################ + +# common header files needed for mmg libraries +# +# Remark: header installation would need to be cleaned, for now, to allow +# independent build of each project and because mmgs and mmg2d have been added +# to mmg3d without rethinking the install architecture, the header files that +# are common between codes are copied in all include directories (mmg/, +# mmg/mmg3d/, mmg/mmgs/, mmg/mmg2d/). they are also copied in build directory +# to enable library call without installation. +SET( mmgcommon_headers + ${MMGCOMMON_SOURCE_DIR}/mmg_export.h + ${MMGCOMMON_SOURCE_DIR}/libmmgtypes.h + ${MMGCOMMON_BINARY_DIR}/libmmgtypesf.h + ${MMGCOMMON_BINARY_DIR}/mmgcmakedefines.h + ${MMGCOMMON_BINARY_DIR}/mmgcmakedefinesf.h + ${MMGCOMMON_BINARY_DIR}/mmgversion.h + ) +IF (NOT WIN32 OR MINGW) + LIST(APPEND mmgcommon_headers ${MMGCOMMON_BINARY_DIR}/git_log_mmg.h ) +ENDIF() + +# Install header files in /usr/local or equivalent +INSTALL(FILES ${mmgcommon_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mmg/common COMPONENT headers) + +# Copy header files in project directory at build step +COPY_1_HEADER_AND_CREATE_TARGET( + ${MMGCOMMON_SOURCE_DIR} libmmgtypes ${MMGCOMMON_INCLUDE} "mmgcommon") + +COPY_1_HEADER_AND_CREATE_TARGET( + ${MMGCOMMON_BINARY_DIR} mmgcmakedefines ${MMGCOMMON_INCLUDE} "mmgcommon") + +COPY_1_HEADER_AND_CREATE_TARGET( + ${MMGCOMMON_SOURCE_DIR} mmg_export + ${MMGCOMMON_INCLUDE} "mmgcommon") + +# Fortran generation +COPY_HEADER ( + ${MMGCOMMON_BINARY_DIR} mmgcmakedefinesf.h + ${MMGCOMMON_INCLUDE} mmgcmakedefinesf.h + mmgmmgcommon_mmgcmakedefines_header copymmgcommon_mmgcmakedefinesf ) + +COPY_1_HEADER_AND_CREATE_TARGET( + ${MMGCOMMON_BINARY_DIR} mmgversion ${MMGCOMMON_INCLUDE} "mmgcommon") + +if (PERL_FOUND) + COPY_HEADER ( + ${MMGCOMMON_BINARY_DIR} libmmgtypesf.h + ${MMGCOMMON_INCLUDE} libmmgtypesf.h + mmg_fortran_header copymmgcommon_libmmgtypesf ) +endif() + +IF (NOT WIN32 OR MINGW) + COPY_HEADER ( + ${MMGCOMMON_BINARY_DIR} git_log_mmg.h + ${MMGCOMMON_INCLUDE} git_log_mmg.h + GenerateGitHash copymmgcommon_mmggithash ) + + LIST ( APPEND tgt_list copymmgcommon_mmggithash) +ENDIF () diff --git a/cmake/modules/mmgs.cmake b/cmake/modules/mmgs.cmake index 29bf4572a..da4265986 100644 --- a/cmake/modules/mmgs.cmake +++ b/cmake/modules/mmgs.cmake @@ -110,16 +110,7 @@ SET( mmgs_headers ${MMGS_SOURCE_DIR}/mmgs_export.h ${MMGS_SOURCE_DIR}/libmmgs.h ${MMGS_BINARY_DIR}/libmmgsf.h - ${MMGCOMMON_SOURCE_DIR}/mmg_export.h - ${MMGCOMMON_SOURCE_DIR}/libmmgtypes.h - ${MMGCOMMON_BINARY_DIR}/libmmgtypesf.h - ${MMGCOMMON_BINARY_DIR}/mmgcmakedefines.h - ${MMGCOMMON_BINARY_DIR}/mmgcmakedefinesf.h - ${MMGCOMMON_BINARY_DIR}/mmgversion.h ) -IF (NOT WIN32 OR MINGW) - LIST(APPEND mmgs_headers ${MMGCOMMON_BINARY_DIR}/git_log_mmg.h ) -ENDIF() # install man pages INSTALL(FILES ${PROJECT_SOURCE_DIR}/doc/man/mmgs.1.gz DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) diff --git a/src/mmg2d/libmmg2d.h b/src/mmg2d/libmmg2d.h index e0349d624..b5254e535 100644 --- a/src/mmg2d/libmmg2d.h +++ b/src/mmg2d/libmmg2d.h @@ -38,7 +38,7 @@ extern "C" { #endif -#include "mmg/mmg2d/libmmgtypes.h" +#include "../common/libmmgtypes.h" #include "mmg2d_export.h" /** diff --git a/src/mmg2d/mmg2d_export.h b/src/mmg2d/mmg2d_export.h index 1549e22d4..d7535ccb2 100644 --- a/src/mmg2d/mmg2d_export.h +++ b/src/mmg2d/mmg2d_export.h @@ -24,7 +24,7 @@ #ifndef MMG2D_EXPORT_H #define MMG2D_EXPORT_H -#include "mmg_export.h" +#include "../common/mmg_export.h" #if defined(libmmg_so_EXPORTS) || defined(libmmg2d_so_EXPORTS) # define LIBMMG2D_EXPORT MMG_DECL_EXPORT #else diff --git a/src/mmg3d/libmmg3d.h b/src/mmg3d/libmmg3d.h index f0c34eef2..56a880d2a 100644 --- a/src/mmg3d/libmmg3d.h +++ b/src/mmg3d/libmmg3d.h @@ -49,7 +49,7 @@ extern "C" { #endif -#include "mmg/mmg3d/libmmgtypes.h" +#include "../common/libmmgtypes.h" #include "mmg3d_export.h" /** diff --git a/src/mmg3d/mmg3d_export.h b/src/mmg3d/mmg3d_export.h index 08a3ac05f..7aeb5d975 100644 --- a/src/mmg3d/mmg3d_export.h +++ b/src/mmg3d/mmg3d_export.h @@ -24,7 +24,7 @@ #ifndef MMG3D_EXPORT_H #define MMG3D_EXPORT_H -#include "mmg_export.h" +#include "../common/mmg_export.h" #if defined(libmmg_so_EXPORTS) || defined(libmmg3d_so_EXPORTS) # define LIBMMG3D_EXPORT MMG_DECL_EXPORT #else diff --git a/src/mmgs/libmmgs.h b/src/mmgs/libmmgs.h index b95aeb1cf..635b211c8 100644 --- a/src/mmgs/libmmgs.h +++ b/src/mmgs/libmmgs.h @@ -42,7 +42,7 @@ extern "C" { #endif #include "mmgs_export.h" -#include "mmg/mmgs/libmmgtypes.h" +#include "../common/libmmgtypes.h" /** * Maximum array size when storing adjacent points (or ball) of a vertex. diff --git a/src/mmgs/mmgs_export.h b/src/mmgs/mmgs_export.h index 06a8b1dc9..7610c15ba 100644 --- a/src/mmgs/mmgs_export.h +++ b/src/mmgs/mmgs_export.h @@ -24,7 +24,7 @@ #ifndef MMGS_EXPORT_H #define MMGS_EXPORT_H -#include "mmg_export.h" +#include "../common/mmg_export.h" #if defined(libmmg_so_EXPORTS) || defined(libmmgs_so_EXPORTS) # define LIBMMGS_EXPORT MMG_DECL_EXPORT #else From 6de3826e9200874608d13ea833062245544c6f9c Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Sat, 10 Dec 2022 00:06:46 +0100 Subject: [PATCH 819/838] Comments. --- cmake/modules/macros.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/modules/macros.cmake b/cmake/modules/macros.cmake index 1c21813ab..ce0c2c00a 100644 --- a/cmake/modules/macros.cmake +++ b/cmake/modules/macros.cmake @@ -29,7 +29,7 @@ ENDMACRO ( ) ############################################################################### ##### -##### Copy an automatically generated header file to another place +##### Copy a header file to another place ##### ############################################################################### MACRO ( COPY_HEADER @@ -56,7 +56,7 @@ ENDMACRO ( ) ############################################################################### ##### -##### Copy an automatically generated header file to another place +##### Copy a header file to another place ##### and create the associated target ##### ############################################################################### From d69d272d46b9b686037567285bb43525dc388405 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Sat, 10 Dec 2022 00:08:44 +0100 Subject: [PATCH 820/838] Fix issue with librnbg header. --- src/common/librnbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/librnbg.c b/src/common/librnbg.c index 8a704d482..f003c6eec 100644 --- a/src/common/librnbg.c +++ b/src/common/librnbg.c @@ -36,7 +36,7 @@ #ifdef USE_SCOTCH -#include "librnbg.h" +#include "librnbg_private.h" /** * \param graf pointer toward the input graph structure. From 9f8dd0b09705a8fd81bab85b5c9089dbad567e1b Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Sat, 10 Dec 2022 00:40:37 +0100 Subject: [PATCH 821/838] Fix issue with librnbg header. --- src/mmg3d/librnbg_3d.c | 2 +- src/mmgs/librnbg_s.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mmg3d/librnbg_3d.c b/src/mmg3d/librnbg_3d.c index dc189930c..4b40c6f43 100644 --- a/src/mmg3d/librnbg_3d.c +++ b/src/mmg3d/librnbg_3d.c @@ -36,7 +36,7 @@ #ifdef USE_SCOTCH -#include "librnbg.h" +#include "librnbg_private.h" /** * \param tetras pointer toward a table containing the tetra structures. diff --git a/src/mmgs/librnbg_s.c b/src/mmgs/librnbg_s.c index 8afd72daf..63bdcdc62 100644 --- a/src/mmgs/librnbg_s.c +++ b/src/mmgs/librnbg_s.c @@ -35,7 +35,7 @@ #ifdef USE_SCOTCH -#include "librnbg.h" +#include "librnbg_private.h" /** * \param trias pointer toward a table containing the tetra structures. From 7e5a59e013be6e862499eaa9b6a6c76654c43dad Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Sat, 10 Dec 2022 14:55:48 +0100 Subject: [PATCH 822/838] Modif of delauney kernel Before commit, we were skipping an edge if she belongs to a tetra with a xtetra but not to a boundary face (because it is not possible to say if the edge is boundary or not from only this tet). Now, edge shell is computed and the edge is skipped only if she is boundary, which is consistent with pattern kernel impelmentation. It also makes sense to have an edge treatment that doesn't depend to the data structure. --- src/mmg2d/analys_2d.c | 2 +- src/mmg3d/mmg3d1_delone.c | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/mmg2d/analys_2d.c b/src/mmg2d/analys_2d.c index 03c433ad8..e99daabcf 100644 --- a/src/mmg2d/analys_2d.c +++ b/src/mmg2d/analys_2d.c @@ -852,7 +852,7 @@ int MMG2D_regver(MMG5_pMesh mesh) { double *tmp,lm1,lm2,cx,cy,res,res0,c[2],co[3][3],vol; MMG5_int k,kt,iel,ip1,ip2,nn,list[MMG5_LMAX]; int it,maxit,j,ilist,noupdate; - int8_t i,ier; + int8_t i; it = 0; maxit=10; diff --git a/src/mmg3d/mmg3d1_delone.c b/src/mmg3d/mmg3d1_delone.c index eb872b62a..c0e6729f6 100644 --- a/src/mmg3d/mmg3d1_delone.c +++ b/src/mmg3d/mmg3d1_delone.c @@ -193,13 +193,6 @@ int MMG3D_mmg3d1_delone_split(MMG5_pMesh mesh, MMG5_pSol met, return 2; /* End of case of a bdy face */ } - else if(pt->xt){ - /** Tetra has a xtetra but the longest edge do not belong to a bdy face: - * do nothing to avoid splitting of a bdy edge from a non bdy face (due - * to collapses, a tetra with no bdy faces may have a xtetra and - * boundary tags or no tags on boundary edge). */ - return 0; - } else { /** Case of a tetra without xtetra (no boundary faces): split non-bdy * edges with Delauney kernel. */ From 78bfdfab617b69d160b2dc5a051b6047f98bde1b Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Sat, 10 Dec 2022 15:53:12 +0100 Subject: [PATCH 823/838] Continue to fix header issues. Compilation / installation and link of public libraries and headers should be ok now. --- cmake/modules/macros.cmake | 8 +- cmake/modules/mmg2d.cmake | 2 +- cmake/modules/mmg3d.cmake | 2 +- cmake/modules/mmgs.cmake | 2 +- cmake/testing/code/test_met2d.c | 2 +- cmake/testing/code/test_met3d.c | 2 +- scripts/genheader.c | 4 +- src/common/API_functions.c | 2 +- src/common/API_functionsf.c | 2 +- src/common/analys.c | 2 +- src/common/anisomovpt.c | 2 +- src/common/anisosiz.c | 2 +- src/common/apptools.c | 2 +- src/common/bezier.c | 2 +- src/common/boulep.c | 2 +- src/common/chrono_private.h | 2 +- src/common/eigenv.c | 2 +- src/common/hash.c | 2 +- src/common/inlined_functions_private.h | 2 +- src/common/inout.c | 2 +- src/common/intmet.c | 2 +- src/common/isosiz.c | 2 +- src/common/libmmgcommon.h | 422 --------- src/common/libmmgcommon_private.h | 1080 ++++++++---------------- src/common/libmmgtypes.h | 4 +- src/common/librnbg.c | 2 +- src/common/libtools.c | 2 +- src/common/mettools.c | 2 +- src/common/mmg2.c | 2 +- src/common/mmg2s.c | 2 +- src/common/mmg3.c | 2 +- src/common/mmg_export.h | 2 +- src/common/mmgcommon_private.h | 834 ++++++++++++++++++ src/common/mmgexterns.c | 2 +- src/common/mmgexterns_private.h | 2 +- src/common/mmgversion.h.in | 2 +- src/common/quality.c | 2 +- src/common/scalem.c | 2 +- src/common/tools.c | 2 +- src/common/vtkparser.hpp | 2 +- src/mmg2d/inoutcpp_2d.cpp | 2 +- src/mmg2d/libmmg2d.h | 4 +- src/mmg2d/libmmg2d_private.h | 2 +- src/mmg2d/libmmg2df.c | 2 +- src/mmg2d/mmg2d_export.h | 2 +- src/mmg2d/mmg2dexterns_private.h | 2 +- src/mmg3d/PRoctree_3d.c | 2 +- src/mmg3d/inoutcpp_3d.cpp | 2 +- src/mmg3d/libmmg3d.h | 4 +- src/mmg3d/libmmg3d_private.h | 2 +- src/mmg3d/libmmg3d_tools.c | 2 +- src/mmg3d/libmmg3df.c | 2 +- src/mmg3d/mmg3d_export.h | 2 +- src/mmg3d/mmg3dexterns_private.h | 2 +- src/mmgs/analys_s.c | 2 +- src/mmgs/inoutcpp_s.cpp | 2 +- src/mmgs/libmmgs.h | 4 +- src/mmgs/libmmgs_private.h | 2 +- src/mmgs/libmmgsf.c | 2 +- src/mmgs/mmgs_export.h | 2 +- src/mmgs/mmgsexterns_private.h | 2 +- 61 files changed, 1232 insertions(+), 1236 deletions(-) delete mode 100644 src/common/libmmgcommon.h create mode 100644 src/common/mmgcommon_private.h diff --git a/cmake/modules/macros.cmake b/cmake/modules/macros.cmake index ce0c2c00a..7b282f91d 100644 --- a/cmake/modules/macros.cmake +++ b/cmake/modules/macros.cmake @@ -143,16 +143,12 @@ MACRO ( ADD_AND_INSTALL_LIBRARY ELSE ( ) target_include_directories( ${target_name} BEFORE PUBLIC $ - $ $ $ $ $ - $ - $ - $ - $ - $ ) + $ + ) ENDIF ( ) diff --git a/cmake/modules/mmg2d.cmake b/cmake/modules/mmg2d.cmake index a922c8673..f9e8b4ca9 100644 --- a/cmake/modules/mmg2d.cmake +++ b/cmake/modules/mmg2d.cmake @@ -42,7 +42,7 @@ FILE(MAKE_DIRECTORY ${MMG2D_BINARY_DIR}) if (PERL_FOUND) GENERATE_FORTRAN_HEADER ( mmg2d ${MMG2D_SOURCE_DIR} libmmg2d.h - ${MMG2D_SHRT_INCLUDE} + mmg/common ${MMG2D_BINARY_DIR} libmmg2df.h ) endif(PERL_FOUND) diff --git a/cmake/modules/mmg3d.cmake b/cmake/modules/mmg3d.cmake index 38f6a52ac..bd53bede8 100644 --- a/cmake/modules/mmg3d.cmake +++ b/cmake/modules/mmg3d.cmake @@ -43,7 +43,7 @@ FILE(MAKE_DIRECTORY ${MMG3D_BINARY_DIR}) if (PERL_FOUND) GENERATE_FORTRAN_HEADER ( mmg3d ${MMG3D_SOURCE_DIR} libmmg3d.h - ${MMG3D_SHRT_INCLUDE} + mmg/common ${MMG3D_BINARY_DIR} libmmg3df.h ) endif (PERL_FOUND) diff --git a/cmake/modules/mmgs.cmake b/cmake/modules/mmgs.cmake index da4265986..fc3f85293 100644 --- a/cmake/modules/mmgs.cmake +++ b/cmake/modules/mmgs.cmake @@ -42,7 +42,7 @@ FILE(MAKE_DIRECTORY ${MMGS_BINARY_DIR}) if (PERL_FOUND) GENERATE_FORTRAN_HEADER ( mmgs ${MMGS_SOURCE_DIR} libmmgs.h - ${MMGS_SHRT_INCLUDE} + mmg/common ${MMGS_BINARY_DIR} libmmgsf.h ) endif (PERL_FOUND) diff --git a/cmake/testing/code/test_met2d.c b/cmake/testing/code/test_met2d.c index bace0a577..daccb93c3 100644 --- a/cmake/testing/code/test_met2d.c +++ b/cmake/testing/code/test_met2d.c @@ -20,7 +20,7 @@ // #include "libmmg2d.h" // if the header file is in "include/mmg/mmg2d" #include "mmg/mmg2d/libmmg2d.h" -#include "mmgcommon.h" +#include "mmgcommon_private.h" int main(int argc,char *argv[]) { MMG5_pMesh mmgMesh; diff --git a/cmake/testing/code/test_met3d.c b/cmake/testing/code/test_met3d.c index 055babb0d..c5ca460ff 100644 --- a/cmake/testing/code/test_met3d.c +++ b/cmake/testing/code/test_met3d.c @@ -20,7 +20,7 @@ // #include "libmmg3d.h" // if the header file is in "include/mmg/mmg3d" #include "mmg/mmg3d/libmmg3d.h" -#include "mmgcommon.h" +#include "mmgcommon_private.h" int main(int argc,char *argv[]) { MMG5_pMesh mmgMesh; diff --git a/scripts/genheader.c b/scripts/genheader.c index 4e21d52d3..37a759028 100644 --- a/scripts/genheader.c +++ b/scripts/genheader.c @@ -98,8 +98,8 @@ int main (int argc, char ** argv) /* Compute the size of the C pointer for the Fortran programm */ fprintf(file, "#define MMG5_DATA_PTR_T INTEGER(kind=%d)\n", (int)sizeof(void*)); - fprintf(file, "#include \"mmgversion.h\"\n"); - fprintf(file, "#include \"mmgcmakedefinesf.h\"\n\n"); + fprintf(file, "#include \"mmg/common/mmgversion.h\"\n"); + fprintf(file, "#include \"mmg/common/mmgcmakedefinesf.h\"\n\n"); } fclose(file); diff --git a/src/common/API_functions.c b/src/common/API_functions.c index 4d3b21aaa..92872ee2c 100644 --- a/src/common/API_functions.c +++ b/src/common/API_functions.c @@ -40,7 +40,7 @@ * */ -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/common/API_functionsf.c b/src/common/API_functionsf.c index 2e8059a3b..3ca9f97d7 100644 --- a/src/common/API_functionsf.c +++ b/src/common/API_functionsf.c @@ -38,7 +38,7 @@ * */ -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" /** diff --git a/src/common/analys.c b/src/common/analys.c index b9c6b636b..6ad2eebe8 100644 --- a/src/common/analys.c +++ b/src/common/analys.c @@ -33,7 +33,7 @@ * \todo doxygen documentation. */ -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" /** diff --git a/src/common/anisomovpt.c b/src/common/anisomovpt.c index cdd28e7ed..6259ad2cb 100644 --- a/src/common/anisomovpt.c +++ b/src/common/anisomovpt.c @@ -33,7 +33,7 @@ * \todo Doxygen documentation */ -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/common/anisosiz.c b/src/common/anisosiz.c index 0c5087ad0..72e4ba76c 100644 --- a/src/common/anisosiz.c +++ b/src/common/anisosiz.c @@ -32,7 +32,7 @@ * \copyright GNU Lesser General Public License. */ -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" #include "mmgexterns_private.h" #include "inlined_functions_private.h" diff --git a/src/common/apptools.c b/src/common/apptools.c index f0e62ce6d..3347f836f 100644 --- a/src/common/apptools.c +++ b/src/common/apptools.c @@ -32,7 +32,7 @@ * \copyright GNU Lesser General Public License. **/ -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" /** * \param mesh pointer toward the mesh structure (for count of used memory). diff --git a/src/common/bezier.c b/src/common/bezier.c index 89a94ef63..bf5f6d009 100644 --- a/src/common/bezier.c +++ b/src/common/bezier.c @@ -33,7 +33,7 @@ * \todo doxygen documentation. */ -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/common/boulep.c b/src/common/boulep.c index be7bbbeac..104d2c3c4 100644 --- a/src/common/boulep.c +++ b/src/common/boulep.c @@ -32,7 +32,7 @@ * \copyright GNU Lesser General Public License. */ -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" extern MMG5_Info info; diff --git a/src/common/chrono_private.h b/src/common/chrono_private.h index 58abf3580..c495597bd 100644 --- a/src/common/chrono_private.h +++ b/src/common/chrono_private.h @@ -25,7 +25,7 @@ #define CHRONO_H #include -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" #ifndef MMG_POSIX #include diff --git a/src/common/eigenv.c b/src/common/eigenv.c index 95aef0967..68ea53f50 100644 --- a/src/common/eigenv.c +++ b/src/common/eigenv.c @@ -40,7 +40,7 @@ #include #include #include "eigenv_private.h" -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" /* seeking at least 1.e-05 accuracy, more if not sufficient */ #define MG_EIGENV_EPS27 1.e-27 diff --git a/src/common/hash.c b/src/common/hash.c index 8fa7dc0a2..9a422571d 100644 --- a/src/common/hash.c +++ b/src/common/hash.c @@ -32,7 +32,7 @@ * \copyright GNU Lesser General Public License. */ -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/common/inlined_functions_private.h b/src/common/inlined_functions_private.h index c7a96199a..e613f8e15 100644 --- a/src/common/inlined_functions_private.h +++ b/src/common/inlined_functions_private.h @@ -32,7 +32,7 @@ * \copyright GNU Lesser General Public License. */ -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" #ifndef _INLINED_FUNC_H #define _INLINED_FUNC_H diff --git a/src/common/inout.c b/src/common/inout.c index bb2d2d5b0..655e1b0f0 100644 --- a/src/common/inout.c +++ b/src/common/inout.c @@ -33,7 +33,7 @@ * \todo doxygen documentation. */ -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" /** * swap bytes if needed (conversion from big/little endian toward little/big diff --git a/src/common/intmet.c b/src/common/intmet.c index df7ba95f5..153b93545 100644 --- a/src/common/intmet.c +++ b/src/common/intmet.c @@ -32,7 +32,7 @@ * \copyright GNU Lesser General Public License. */ -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" #include "mmgexterns_private.h" /** diff --git a/src/common/isosiz.c b/src/common/isosiz.c index ce4e9c466..22af4dbd4 100644 --- a/src/common/isosiz.c +++ b/src/common/isosiz.c @@ -27,7 +27,7 @@ * \copyright GNU Lesser General Public License. */ -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/common/libmmgcommon.h b/src/common/libmmgcommon.h deleted file mode 100644 index d881f0d6c..000000000 --- a/src/common/libmmgcommon.h +++ /dev/null @@ -1,422 +0,0 @@ -/* ============================================================================= -** This file is part of the mmg software package for the tetrahedral -** mesh modification. -** Copyright (c) Bx INP/CNRS/Inria/UBordeaux/UPMC, 2004- -** -** mmg is free software: you can redistribute it and/or modify it -** under the terms of the GNU Lesser General Public License as published -** by the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** mmg is distributed in the hope that it will be useful, but WITHOUT -** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -** FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public -** License for more details. -** -** You should have received a copy of the GNU Lesser General Public -** License and of the GNU General Public License along with mmg (in -** files COPYING.LESSER and COPYING). If not, see -** . Please read their terms carefully and -** use this copy of the mmg distribution only if you accept them. -** ============================================================================= -*/ - -/** - * \file common/libmmgcommon.h - * \brief API header for the common part of the MMG libraries. - * \author Algiane Froehly (Inria/UBordeaux) - * \version 5 - * \date 01 2014 - * \copyright GNU Lesser General Public License. - * \warning To keep the genheader working, don't break line between the enum - * name and the opening brace (it creates errors under windows) - */ - -#ifndef MMGLIBCOMMON_H -#define MMGLIBCOMMON_H - -#include - -#include "libmmgtypes.h" - -#include "chrono_private.h" - -#include "mmg_core_export_private.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define MMG5_VOLFRAC 1.e-5 - -/*----------------------------- functions header -----------------------------*/ -/* Initialization functions */ -/** - * \param mesh pointer toward the mesh structure. - * \param sol pointer toward the sol structure. - * - * Initialize file names to their default values. - * - * \remark Fortran interface: - * > SUBROUTINE MMG5_INIT_FILENAMES(mesh,sol)\n - * > MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh,sol\n - * > END SUBROUTINE\n - * - */ -LIBMMG_CORE_EXPORT void MMG5_Init_fileNames(MMG5_pMesh mesh, MMG5_pSol sol); - -/** - * \param mesh pointer toward the mesh structure. - * - * Initialization of the input parameters (stored in the Info structure). - * - * \remark Fortran interface: - * > SUBROUTINE MMG5_INIT_PARAMETERS(mesh)\n - * > MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh\n - * > END SUBROUTINE\n - * - */ -LIBMMG_CORE_EXPORT void (MMG5_Init_parameters)(MMG5_pMesh mesh); - -/* init file names */ -/** - * \param mesh pointer toward the mesh structure. - * \param meshin input mesh name. - * \return 1. - * - * Set the name of input mesh. - * - * \remark Fortran interface: - * > SUBROUTINE MMG5_SET_INPUTMESHNAME(mesh,meshin,strlen,retval)\n - * > MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh\n - * > CHARACTER(LEN=*), INTENT(IN) :: meshin\n - * > INTEGER, INTENT(IN) :: strlen\n - * > INTEGER, INTENT(OUT) :: retval\n - * > END SUBROUTINE\n - * - */ -LIBMMG_CORE_EXPORT int MMG5_Set_inputMeshName(MMG5_pMesh mesh, const char* meshin); -/** - * \param mesh pointer toward the mesh structure. - * \param meshout name of the output mesh file. - * \return 1. - * - * Set the name of output mesh file. - * - * \remark Fortran interface: - * > SUBROUTINE MMG5_SET_OUTPUTMESHNAME(mesh,meshout,strlen,retval)\n - * > MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh\n - * > CHARACTER(LEN=*), INTENT(IN) :: meshout\n - * > INTEGER, INTENT(IN) :: strlen\n - * > INTEGER, INTENT(OUT) :: retval\n - * > END SUBROUTINE\n - * - */ -LIBMMG_CORE_EXPORT int MMG5_Set_outputMeshName(MMG5_pMesh mesh, const char* meshout); -/** - * \param mesh pointer toward the mesh structure. - * \param sol pointer toward the sol structure. - * \param solin name of the input solution file. - * \return 1. - * - * Set the name of input solution file. - * - * \remark Fortran interface: - * > SUBROUTINE MMG5_SET_INPUTSOLNAME(mesh,sol,solin,strlen,retval)\n - * > MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol\n - * > CHARACTER(LEN=*), INTENT(IN) :: solin\n - * > INTEGER, INTENT(IN) :: strlen\n - * > INTEGER, INTENT(OUT) :: retval\n - * > END SUBROUTINE\n - * - */ -LIBMMG_CORE_EXPORT int MMG5_Set_inputSolName(MMG5_pMesh mesh,MMG5_pSol sol, const char* solin); -/** - * \param mesh pointer toward the mesh structure. - * \param sol pointer toward the sol structure. - * \param solout name of the output solution file. - * \return 0 if failed, 1 otherwise. - * - * Set the name of output solution file. - * - * \remark Fortran interface: - * > SUBROUTINE MMG5_SET_OUTPUTSOLNAME(mesh,sol,solout,strlen,retval)\n - * > MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol\n - * > CHARACTER(LEN=*), INTENT(IN) :: solout\n - * > INTEGER, INTENT(IN) :: strlen\n - * > INTEGER, INTENT(OUT) :: retval\n - * > END SUBROUTINE\n - * - */ - LIBMMG_CORE_EXPORT int MMG5_Set_outputSolName(MMG5_pMesh mesh,MMG5_pSol sol, const char* solout); - -/** - * \param mesh pointer toward the mesh structure. - * \param met pointer toward the metric structure. - * \param ls pointer toward a solution structure (level-set or displacement). - * - * \return 1 if success, 0 if fail (computed bounding box too small - * or one af the anisotropic input metric is not valid). - * - * Scale the mesh and the size informations between 0 and 1. - * Compute a default value for the hmin/hmax parameters if needed. - * - * - * \remark Fortran interface: - * > SUBROUTINE MMG5_SCALEMESH(mesh,met,ls,retval)\n - * > MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,met,ls\n - * > INTEGER, INTENT(OUT) :: retval\n - * > END SUBROUTINE\n - * - */ - LIBMMG_CORE_EXPORT int MMG5_scaleMesh(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pSol ls); - -/** - * \param mesh pointer toward the mesh structure. - * \param met pointer toward a metric. - * \param sol pointer toward a solution structure (level-set or displacement). - * - * \return 1. - * - * Unscale the mesh and the size informations to their initial sizes. - * - * - * \remark Fortran interface: - * > SUBROUTINE MMG5_UNSCALEMESH(mesh,met,ls,retval)\n - * > MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,met,ls\n - * > INTEGER, INTENT(OUT) :: retval\n - * > END SUBROUTINE\n - * - */ - LIBMMG_CORE_EXPORT int MMG5_unscaleMesh(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pSol ls); - -/** - * \param mesh pointer toward the mesh structure. - * \param met pointer toward the sol structure. - * \param hsiz wanted edge size - * - * fill the metric field with the size \a hsiz - * - * \Remark not for extern users. - * - */ -LIBMMG_CORE_EXPORT void MMG5_Set_constantSize(MMG5_pMesh mesh,MMG5_pSol met,double hsiz); - -/** - * \param mesh pointer toward the mesh structure. - * \param sol pointer toward the sol structure. - * \param ref input tetra reference. - * \param split MMG5_MMAT_NoSplit if the entity must not be splitted, MMG5_MMAT_Split otherwise - * \param rin internal reference after ls discretization - * \param rex external reference after ls discretization - * \return 0 if failed, 1 otherwise. - * - * Set the reference mapping for the elements of ref \a ref in ls discretization mode. - * - */ -LIBMMG_CORE_EXPORT int MMG5_Set_multiMat(MMG5_pMesh mesh, MMG5_pSol sol,MMG5_int ref,int split, - MMG5_int rin, MMG5_int rex); - - -/** - * \param mesh pointer toward the mesh structure. - * \param sol pointer toward the sol structure. - * \param br new level-set base reference. - * \return 0 if failed, 1 otherwise. - * - * Set a new level-set base reference of ref \a br in ls discretization - * mode. Base references are boundary conditions to which implicit domain can - * be attached. All implicit volumes that are not attached to listed based - * references are deleted as spurious volumes by the \a rmc option. - * - */ -LIBMMG_CORE_EXPORT int MMG5_Set_lsBaseReference(MMG5_pMesh mesh, MMG5_pSol sol,MMG5_int br); - -/* deallocations */ -LIBMMG_CORE_EXPORT void MMG5_Free_structures(MMG5_pMesh mesh,MMG5_pSol sol); - -/** - * \param mesh pointer toward the mesh structure. - * \param met pointer toward the sol structure. - * - * File name deallocations before return. - * - * \remark Fortran interface: - * > SUBROUTINE MMG5_SETMMGFREE_NAMES(mesh,met)\n - * > MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,met\n - * > END SUBROUTINE\n - * - */ -LIBMMG_CORE_EXPORT void MMG5_mmgFree_names(MMG5_pMesh mesh, MMG5_pSol met); - -/** - * \param mesh pointer toward the mesh structure. - * \param sethmin 1 if hmin is already setted (>0.) - * \param sethmax 1 if hmax is already setted (>0.) - * - * \return 1 if success, 0 if we detect mismatch parameters - * - * Set default values for hmin and hmax from the bounding box. - * - * \Remark not for extern users. - * - */ -LIBMMG_CORE_EXPORT extern int MMG5_Set_defaultTruncatureSizes(MMG5_pMesh mesh,int8_t sethmin,int8_t sethmax); - -/** - * \param mesh pointer toward the mesh structure. - * \param met pointer toward the metric. - * \param hsiz computed constant size to impose. - * - * \return 1 if success, 0 if fail - * - * Compute the constant size to impose according to hmin and hmax and store it in \a hsiz. - * Fill hmin and hamx if they are not setted by the user. - * - */ -LIBMMG_CORE_EXPORT int MMG5_Compute_constantSize(MMG5_pMesh mesh,MMG5_pSol met,double *hsize); - -/** - * \param tag input entity tag - * - * \return the list of the flags contained in \a tag - * - * Print the name associated to the \a typ value in the \a MMG5_type enum. - * - * \warning for debug purpose, no thread safe. - */ -const char* MMG5_Get_tagName(int tag); - -/** - * \param mesh pointer toward the mesh structure. - * \param sol pointer toward an array of solution structure (that stores solution fields). - * \return 1 - * - * Deallocation of an array of solution fields - * - */ -LIBMMG_CORE_EXPORT int MMG5_Free_allSols(MMG5_pMesh mesh,MMG5_pSol *sol); - -/** - * \param mesh pointer toward the mesh structure. - * \param filename name of file. - * - * \return 1 if success, 0 if fail. - * - * Save node list at .node file format (Tetgen/Triangle). - */ -LIBMMG_CORE_EXPORT int MMG5_saveNode(MMG5_pMesh mesh,const char *filename); - -/** - * \param mesh pointer toward the mesh structure. - * \param filename name of file. - * \param ext file extension (.poly or .edge) - * - * \return 1 if success, 0 if fail. - * - * Save edge list at .edge file format (Tetgen/Triangle). - */ -LIBMMG_CORE_EXPORT int MMG5_saveEdge(MMG5_pMesh mesh,const char *filename,const char *ext); - -/* Useful tools to manage C strings */ -/** - * \param path string containing a filename and its path - * - * \return a pointer toward the allocated string that contains the file basename. - * - * Extract basename from a path (allocate a string to store it). - * - */ -LIBMMG_CORE_EXPORT char *MMG5_Get_basename(char *path); - -/** - * \param ptr pointer toward the file extension (dot included) - * \param fmt default file format. - * - * \return and index associated to the file format detected from the extension. - * - * Get the wanted file format from the mesh extension. If \a fmt is provided, it - * is used as default file format (\a ptr==NULL), otherwise, the default file - * format is the medit one. - * - */ -LIBMMG_CORE_EXPORT int MMG5_Get_format( char *ptr, int fmt ); - -/** - * \param filename string containing a filename - * - * \return pointer toward the filename extension or toward the end of the string - * if no extension have been founded - * - * Get the extension of the filename string. Do not consider '.o' as an extension. - * - */ -LIBMMG_CORE_EXPORT char *MMG5_Get_filenameExt( char *filename ); - -/** - * \param path string containing a filename and its path - * - * \return a pointer toward the path allocated here - * - * Remove filename from a path and return the path in a newly allocated string. - * - */ -LIBMMG_CORE_EXPORT char *MMG5_Get_path(char *path); - -/** - * \param path path from which we want to remove the extension. - * - * \return allocated string or NULL if the allocation fail. - * - * Allocate a new string and copy \a path without extension in it. - * - */ -LIBMMG_CORE_EXPORT char *MMG5_Remove_ext (char* path,char *ext); - -/* Enum utilities: print enum fields under a string form */ -/** - * \param fmt file format. - * - * \return The name of the file format in a string. - * - * Print the name of the file format associated to \a fmt. - * - */ -LIBMMG_CORE_EXPORT const char* MMG5_Get_formatName(enum MMG5_Format fmt); - -/** - * \param ent MMG5_entities enum - * - * \return the name of the enum field - * - * Print the name associated to the \a ent value in the \a MMG5_entities enum. - * - */ -LIBMMG_CORE_EXPORT const char* MMG5_Get_entitiesName(enum MMG5_entities ent); - -/** - * \param typ MMG5_type enum - * - * \return the name of the enum field - * - * Print the name associated to the \a typ value in the \a MMG5_type enum. - * - */ -LIBMMG_CORE_EXPORT const char* MMG5_Get_typeName(enum MMG5_type typ); - - -/** - * \param mesh pointer toward mesh - * - * \return 1 if successful, 0 otherwise - * - * Clean non-ridge edges belonging to isosurface. - * - */ -LIBMMG_CORE_EXPORT int MMG5_Clean_isoEdges(MMG5_pMesh mesh); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/common/libmmgcommon_private.h b/src/common/libmmgcommon_private.h index f21dd65e5..d881f0d6c 100644 --- a/src/common/libmmgcommon_private.h +++ b/src/common/libmmgcommon_private.h @@ -1,7 +1,7 @@ /* ============================================================================= ** This file is part of the mmg software package for the tetrahedral ** mesh modification. -** Copyright (c) Bx INP/Inria/UBordeaux/UPMC, 2004- . +** Copyright (c) Bx INP/CNRS/Inria/UBordeaux/UPMC, 2004- ** ** mmg is free software: you can redistribute it and/or modify it ** under the terms of the GNU Lesser General Public License as published @@ -21,811 +21,399 @@ ** ============================================================================= */ -#ifndef MMGCOMMON_H -#define MMGCOMMON_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "mmgcmakedefines.h" - -#if (defined(__APPLE__) && defined(__MACH__)) -#include -#elif defined(__unix__) || defined(__unix) || defined(unix) -#include -#elif defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(__TOS_WIN__) || defined(__WINDOWS__) -#include -#endif +/** + * \file common/libmmgcommon.h + * \brief API header for the common part of the MMG libraries. + * \author Algiane Froehly (Inria/UBordeaux) + * \version 5 + * \date 01 2014 + * \copyright GNU Lesser General Public License. + * \warning To keep the genheader working, don't break line between the enum + * name and the opening brace (it creates errors under windows) + */ + +#ifndef MMGLIBCOMMON_H +#define MMGLIBCOMMON_H + +#include + +#include "libmmgtypes.h" + +#include "chrono_private.h" + +#include "mmg_core_export_private.h" #ifdef __cplusplus extern "C" { #endif -#include "eigenv_private.h" -#include "libmmgcommon.h" - -#define MG_STR "&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&" +#define MMG5_VOLFRAC 1.e-5 +/*----------------------------- functions header -----------------------------*/ +/* Initialization functions */ /** - * Maximum array size when storing list of tria containing a vertex. + * \param mesh pointer toward the mesh structure. + * \param sol pointer toward the sol structure. + * + * Initialize file names to their default values. + * + * \remark Fortran interface: + * > SUBROUTINE MMG5_INIT_FILENAMES(mesh,sol)\n + * > MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh,sol\n + * > END SUBROUTINE\n + * */ -#define MMG5_TRIA_LMAX 1024 +LIBMMG_CORE_EXPORT void MMG5_Init_fileNames(MMG5_pMesh mesh, MMG5_pSol sol); /** - * Maximum array size when calling boulep. + * \param mesh pointer toward the mesh structure. + * + * Initialization of the input parameters (stored in the Info structure). + * + * \remark Fortran interface: + * > SUBROUTINE MMG5_INIT_PARAMETERS(mesh)\n + * > MMG5_DATA_PTR_T,INTENT(INOUT) :: mesh\n + * > END SUBROUTINE\n + * */ -#define MMG5_LMAX 10240 - -/** Maximal number of local parameters */ -#define MMG5_LPARMAX 200 - -/** Check if \a a and \a b have the same sign */ -#define MG_SMSGN(a,b) (((double)(a)*(double)(b) > (0.0)) ? (1) : (0)) +LIBMMG_CORE_EXPORT void (MMG5_Init_parameters)(MMG5_pMesh mesh); -/** size of box for renumbering with scotch. */ -#define MMG5_BOXSIZE 500 - -/** Maximal memory used if available memory compitation fail. */ -#define MMG5_MEMMAX 800 /**< Default mem if unable to compute memMax */ -#define MMG5_BITWIZE_MB_TO_B 20 /**< Bitwise convertion from Mo to O */ -#define MMG5_MEMPERCENT 0.5 /**< Percent of RAM used by default */ - -/* Macro for unset or unititialized mark */ -#define MMG5_UNSET -1 - -/* reference of the boundary that moves in lagrangian mode */ -#define MMG5_DISPREF 10 +/* init file names */ +/** + * \param mesh pointer toward the mesh structure. + * \param meshin input mesh name. + * \return 1. + * + * Set the name of input mesh. + * + * \remark Fortran interface: + * > SUBROUTINE MMG5_SET_INPUTMESHNAME(mesh,meshin,strlen,retval)\n + * > MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh\n + * > CHARACTER(LEN=*), INTENT(IN) :: meshin\n + * > INTEGER, INTENT(IN) :: strlen\n + * > INTEGER, INTENT(OUT) :: retval\n + * > END SUBROUTINE\n + * + */ +LIBMMG_CORE_EXPORT int MMG5_Set_inputMeshName(MMG5_pMesh mesh, const char* meshin); +/** + * \param mesh pointer toward the mesh structure. + * \param meshout name of the output mesh file. + * \return 1. + * + * Set the name of output mesh file. + * + * \remark Fortran interface: + * > SUBROUTINE MMG5_SET_OUTPUTMESHNAME(mesh,meshout,strlen,retval)\n + * > MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh\n + * > CHARACTER(LEN=*), INTENT(IN) :: meshout\n + * > INTEGER, INTENT(IN) :: strlen\n + * > INTEGER, INTENT(OUT) :: retval\n + * > END SUBROUTINE\n + * + */ +LIBMMG_CORE_EXPORT int MMG5_Set_outputMeshName(MMG5_pMesh mesh, const char* meshout); +/** + * \param mesh pointer toward the mesh structure. + * \param sol pointer toward the sol structure. + * \param solin name of the input solution file. + * \return 1. + * + * Set the name of input solution file. + * + * \remark Fortran interface: + * > SUBROUTINE MMG5_SET_INPUTSOLNAME(mesh,sol,solin,strlen,retval)\n + * > MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol\n + * > CHARACTER(LEN=*), INTENT(IN) :: solin\n + * > INTEGER, INTENT(IN) :: strlen\n + * > INTEGER, INTENT(OUT) :: retval\n + * > END SUBROUTINE\n + * + */ +LIBMMG_CORE_EXPORT int MMG5_Set_inputSolName(MMG5_pMesh mesh,MMG5_pSol sol, const char* solin); +/** + * \param mesh pointer toward the mesh structure. + * \param sol pointer toward the sol structure. + * \param solout name of the output solution file. + * \return 0 if failed, 1 otherwise. + * + * Set the name of output solution file. + * + * \remark Fortran interface: + * > SUBROUTINE MMG5_SET_OUTPUTSOLNAME(mesh,sol,solout,strlen,retval)\n + * > MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol\n + * > CHARACTER(LEN=*), INTENT(IN) :: solout\n + * > INTEGER, INTENT(IN) :: strlen\n + * > INTEGER, INTENT(OUT) :: retval\n + * > END SUBROUTINE\n + * + */ + LIBMMG_CORE_EXPORT int MMG5_Set_outputSolName(MMG5_pMesh mesh,MMG5_pSol sol, const char* solout); -/* million */ -#define MMG5_MILLION 1048576 +/** + * \param mesh pointer toward the mesh structure. + * \param met pointer toward the metric structure. + * \param ls pointer toward a solution structure (level-set or displacement). + * + * \return 1 if success, 0 if fail (computed bounding box too small + * or one af the anisotropic input metric is not valid). + * + * Scale the mesh and the size informations between 0 and 1. + * Compute a default value for the hmin/hmax parameters if needed. + * + * + * \remark Fortran interface: + * > SUBROUTINE MMG5_SCALEMESH(mesh,met,ls,retval)\n + * > MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,met,ls\n + * > INTEGER, INTENT(OUT) :: retval\n + * > END SUBROUTINE\n + * + */ + LIBMMG_CORE_EXPORT int MMG5_scaleMesh(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pSol ls); -/* numerical accuracy */ -#define MMG5_ANGEDG 0.707106781186548 /*0.573576436351046 */ -#define MMG5_ANGLIM -0.999999 -#define MMG5_ATHIRD 0.333333333333333 +/** + * \param mesh pointer toward the mesh structure. + * \param met pointer toward a metric. + * \param sol pointer toward a solution structure (level-set or displacement). + * + * \return 1. + * + * Unscale the mesh and the size informations to their initial sizes. + * + * + * \remark Fortran interface: + * > SUBROUTINE MMG5_UNSCALEMESH(mesh,met,ls,retval)\n + * > MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,met,ls\n + * > INTEGER, INTENT(OUT) :: retval\n + * > END SUBROUTINE\n + * + */ + LIBMMG_CORE_EXPORT int MMG5_unscaleMesh(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pSol ls); -#define MMG5_EPSD 1.e-30 -#define MMG5_EPSD2 1.0e-200 -#define MMG5_EPS 1.e-06 -#define MMG5_EPSOK 1.e-15 -#define MMG5_NULKAL 1.e-30 +/** + * \param mesh pointer toward the mesh structure. + * \param met pointer toward the sol structure. + * \param hsiz wanted edge size + * + * fill the metric field with the size \a hsiz + * + * \Remark not for extern users. + * + */ +LIBMMG_CORE_EXPORT void MMG5_Set_constantSize(MMG5_pMesh mesh,MMG5_pSol met,double hsiz); -#define MMG5_SQR32 0.866025403784439 +/** + * \param mesh pointer toward the mesh structure. + * \param sol pointer toward the sol structure. + * \param ref input tetra reference. + * \param split MMG5_MMAT_NoSplit if the entity must not be splitted, MMG5_MMAT_Split otherwise + * \param rin internal reference after ls discretization + * \param rex external reference after ls discretization + * \return 0 if failed, 1 otherwise. + * + * Set the reference mapping for the elements of ref \a ref in ls discretization mode. + * + */ +LIBMMG_CORE_EXPORT int MMG5_Set_multiMat(MMG5_pMesh mesh, MMG5_pSol sol,MMG5_int ref,int split, + MMG5_int rin, MMG5_int rex); -#ifndef M_PI -#define M_PI 3.14159265358979323846 /**< pi */ -#define M_PI_2 1.57079632679489661923 /**< pi/2 */ -#endif -#define A64TH 0.015625 -#define A16TH 0.0625 -#define A32TH 0.03125 - -#define MMG5_MEMMIN 38 /**< minimal memory needed to store the mesh/sol names */ - -#define MMG5_PATHSEP '/' - -/* Variables for option initialization */ -#define MMG5_NONSET_MEM -1 /**< mem value for unspecified max memory */ -#define MMG5_NONSET_HMIN -1 /**< hmin value for unspecified hmin size */ -#define MMG5_NONSET_HMAX -1 /**< hmax value for unspecified hmax size */ -#define MMG5_NONSET_HSIZ -1 /**< hsiz value for unspecified hsiz map */ -#define MMG5_NONSET -1 -#define MMG5_HAUSD 0.01 /**< default value for hausdorff param */ -#define MMG5_HGRAD 0.26236426446 /**< default value for gradation (1.3) */ -#define MMG5_HGRADREQ 0.83290912294 /**< default value for required gradation (2.3) */ -#define MMG5_NOHGRAD -1 /**< disable gradation */ -#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_PROCTREE 32 /**< default size of the PROctree */ -#define MMG5_OFF 0 /**< 0 */ -#define MMG5_ON 1 /**< 1 */ -#define MMG5_GAP 0.2 /**< gap value for reallocation */ -#define MMG5_HMINCOE 0.001 /**< coefficient to compute the default hmin value */ -#define MMG5_HMAXCOE 2 /**< coefficient to compute the default hmax value */ -#define MMG5_HMINMAXGAP 5 /**< imposed gap between hmin and hmax if hmax (b)) ? (a) : (b)) -#define MG_MIN(a,b) (((a) < (b)) ? (a) : (b)) - -/* tags */ -#define MG_NOTAG (0) -#define MG_REF (1 << 0) /**< 1 edge reference */ -#define MG_GEO (1 << 1) /**< 2 geometric ridge */ -#define MG_REQ (1 << 2) /**< 4 required entity */ -#define MG_NOM (1 << 3) /**< 8 non manifold */ -#define MG_BDY (1 << 4) /**< 16 boundary entity */ -#define MG_CRN (1 << 5) /**< 32 corner */ -#define MG_NOSURF (1 << 6) /**< 64 freezed boundary */ -#define MG_OPNBDY (1 << 7) /**< 128 open boundary */ -#define MG_OLDPARBDY (1 << 11) /**< 2048 old parallel boundary */ -#define MG_PARBDYBDY (1 << 12) /**< 4096 parallel boundary over a boundary */ -#define MG_PARBDY (1 << 13) /**< 8192 parallel boundary */ -#define MG_NUL (1 << 14) /**< 16384 vertex removed */ - -/* binary tags for local parameters */ -#define MG_Vert (1 << 0 ) /**< 1 local parameter applied over vertex */ -#define MG_Tria (1 << 1 ) /**< 2 local parameter applied over triangle */ -#define MG_Tetra (1 << 2 ) /**< 4 local parameter applied over tetrahedron */ -#define MG_Edge (1 << 3 ) /**< 8 local parameter applied over edge */ - - -#define MG_VOK(ppt) (ppt && ((ppt)->tag < MG_NUL)) /**< Vertex OK */ -#define MG_EOK(pt) (pt && ((pt)->v[0] > 0)) /**< Element OK */ - -#define MG_SIN(tag) ((tag & MG_CRN) || (tag & MG_REQ)) /**< Corner or Required */ -#define MG_SIN_OR_NOM(tag) ( MG_SIN(tag) || (tag & MG_NOM) ) /**< Corner, Required or non-manifold */ -#define MG_RID(tag) ( ( !( MG_SIN_OR_NOM(tag)) ) && ( tag & MG_GEO ) ) /**< Non-singular ridge point (so ridge metric in aniso mode) */ - -#define MG_EDG(tag) ((tag & MG_GEO) || (tag & MG_REF)) /**< Edge or Ridge */ -#define MG_GEO_OR_NOM(tag) (( tag & MG_GEO ) || ( tag & MG_NOM )) /**< Ridge or non-manifold */ -#define MG_EDG_OR_NOM(tag) ( MG_EDG(tag) || (tag & MG_NOM ) ) /**< Edge, ridge or non-manifold */ - - - -#define MG_SET(flag,bit) ((flag) |= (1 << (bit))) /**< bit number bit is set to 1 */ -#define MG_CLR(flag,bit) ((flag) &= ~(1 << (bit))) /**< bit number bit is set to 0 */ -#define MG_GET(flag,bit) ((flag) & (1 << (bit))) /**< return bit number bit value */ - -#define MMG5_KA 7 /*!< Key for hash tables. */ -#define MMG5_KB 11 /*!< Key for hash tables. */ - -/* file reading */ -#define MMG5_SW 4 -#define MMG5_SD 8 - -/** Reset the customized signals and set the internal counters of points, edges, - * tria and tetra to the suitable value (needed by users to recover their mesh - * using the API) */ -#define _LIBMMG5_RETURN(mesh,sol,met,val)do \ - { \ - signal(SIGABRT,SIG_DFL); \ - signal(SIGFPE,SIG_DFL); \ - signal(SIGILL,SIG_DFL); \ - signal(SIGSEGV,SIG_DFL); \ - signal(SIGTERM,SIG_DFL); \ - signal(SIGINT,SIG_DFL); \ - mesh->npi = mesh->np; \ - mesh->nti = mesh->nt; \ - mesh->nai = mesh->na; \ - mesh->nei = mesh->ne; \ - mesh->xt = 0; \ - if ( sol ) { sol->npi = sol->np; } \ - if ( met ) { met->npi = met->np; } \ - return val; \ - }while(0) - -/* Macros for memory management */ -/** Check if used memory overflow maximal authorized memory. - Execute the command law if lack of memory. */ -#define MMG5_CHK_MEM(mesh,size,string,law) do \ - { \ - if ( (mesh)->memCur > (mesh)->memMax ) { \ - fprintf(stderr," ## Error:"); \ - fprintf(stderr," unable to allocate %s.\n",string); \ - fprintf(stderr," ## Check the mesh size or "); \ - fprintf(stderr,"increase maximal authorized memory with the -m option.\n"); \ - (mesh)->memCur -= (size); \ - law; \ - } \ - }while(0) - -static inline -void * mycalloc(size_t c, size_t s) { - char *ptr; - ptr = (char *)calloc(c*s+sizeof(size_t),1); - if (ptr == NULL) - return NULL; - else { - *((size_t*)ptr)=c*s; - ptr+=sizeof(size_t); - return (void*)ptr; - } -} +/** + * \param mesh pointer toward the mesh structure. + * \param sol pointer toward the sol structure. + * \param br new level-set base reference. + * \return 0 if failed, 1 otherwise. + * + * Set a new level-set base reference of ref \a br in ls discretization + * mode. Base references are boundary conditions to which implicit domain can + * be attached. All implicit volumes that are not attached to listed based + * references are deleted as spurious volumes by the \a rmc option. + * + */ +LIBMMG_CORE_EXPORT int MMG5_Set_lsBaseReference(MMG5_pMesh mesh, MMG5_pSol sol,MMG5_int br); -static inline -void * mymalloc(size_t s) { - char *ptr; - ptr = (char *)malloc(s+sizeof(size_t)); - if (ptr == NULL) - return NULL; - else { - *((size_t*)ptr)=s; - ptr+=sizeof(size_t); - return (void*)ptr; - } -} +/* deallocations */ +LIBMMG_CORE_EXPORT void MMG5_Free_structures(MMG5_pMesh mesh,MMG5_pSol sol); -static inline -void * myrealloc(void * ptr_in, size_t s, size_t oldsize) { - char *ptr; - char *ptr_in_c = (char*)ptr_in; - - if ( !ptr_in ) { - assert ( !oldsize ); - return mymalloc( s ); - } - - ptr_in_c -= sizeof(size_t); - if (oldsize != *((size_t*)ptr_in_c)) { - fprintf(stderr, "myrealloc: Error: freed memory mismatch\n"); - assert(0); - } - ptr = (char *)realloc(ptr_in_c, s+sizeof(size_t)); - if (ptr == NULL) - return NULL; - else { - *((size_t*)ptr)=s; - ptr+=sizeof(size_t); - return (void*)ptr; - } -} +/** + * \param mesh pointer toward the mesh structure. + * \param met pointer toward the sol structure. + * + * File name deallocations before return. + * + * \remark Fortran interface: + * > SUBROUTINE MMG5_SETMMGFREE_NAMES(mesh,met)\n + * > MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,met\n + * > END SUBROUTINE\n + * + */ +LIBMMG_CORE_EXPORT void MMG5_mmgFree_names(MMG5_pMesh mesh, MMG5_pSol met); -static inline -size_t myfree(void *ptr) { - size_t s; - char * ptr_c = (char*)ptr; +/** + * \param mesh pointer toward the mesh structure. + * \param sethmin 1 if hmin is already setted (>0.) + * \param sethmax 1 if hmax is already setted (>0.) + * + * \return 1 if success, 0 if we detect mismatch parameters + * + * Set default values for hmin and hmax from the bounding box. + * + * \Remark not for extern users. + * + */ +LIBMMG_CORE_EXPORT extern int MMG5_Set_defaultTruncatureSizes(MMG5_pMesh mesh,int8_t sethmin,int8_t sethmax); - if ( !ptr ) return 0; +/** + * \param mesh pointer toward the mesh structure. + * \param met pointer toward the metric. + * \param hsiz computed constant size to impose. + * + * \return 1 if success, 0 if fail + * + * Compute the constant size to impose according to hmin and hmax and store it in \a hsiz. + * Fill hmin and hamx if they are not setted by the user. + * + */ +LIBMMG_CORE_EXPORT int MMG5_Compute_constantSize(MMG5_pMesh mesh,MMG5_pSol met,double *hsize); - ptr_c = ptr_c-sizeof(size_t); - s = *((size_t*)ptr_c); - free(ptr_c); +/** + * \param tag input entity tag + * + * \return the list of the flags contained in \a tag + * + * Print the name associated to the \a typ value in the \a MMG5_type enum. + * + * \warning for debug purpose, no thread safe. + */ +const char* MMG5_Get_tagName(int tag); - return s; -} +/** + * \param mesh pointer toward the mesh structure. + * \param sol pointer toward an array of solution structure (that stores solution fields). + * \return 1 + * + * Deallocation of an array of solution fields + * + */ +LIBMMG_CORE_EXPORT int MMG5_Free_allSols(MMG5_pMesh mesh,MMG5_pSol *sol); -/** Free pointer ptr of mesh structure and compute the new used memory. */ -#define MMG5_DEL_MEM(mesh,ptr) do \ - { \ - size_t size_to_free = myfree(ptr); \ - (mesh)->memCur -= size_to_free; \ - ptr = NULL; \ - }while(0) - -/** Increment memory counter memCur and check if we don't overflow - the maximum authorizied memory memMax. */ -#define MMG5_ADD_MEM(mesh,size,message,law) do \ - { \ - (mesh)->memCur += (size); \ - MMG5_CHK_MEM(mesh,size,message,law); \ - }while(0) - -/** Safe deallocation */ -#define MMG5_SAFE_FREE(ptr) do \ - { \ - myfree(ptr); \ - ptr = NULL; \ - }while(0) - -/** Safe allocation with calloc */ -#define MMG5_SAFE_CALLOC(ptr,size,type,law) do \ - { \ - ptr = (type*)mycalloc(size,sizeof(type)); \ - if ( !ptr ) { \ - perror(" ## Memory problem: calloc"); \ - law; \ - } \ - }while(0) - -/** Safe allocation with malloc */ -#define MMG5_SAFE_MALLOC(ptr,size,type,law) do \ - { \ - size_t size_to_allocate = (size)*sizeof(type); \ - ptr = (type*)mymalloc(size_to_allocate); \ - if ( !ptr ) { \ - perror(" ## Memory problem: malloc"); \ - law; \ - } \ - }while(0) - -/** Safe reallocation */ -#define MMG5_SAFE_REALLOC(ptr,prevSize,newSize,type,message,law) do \ - { \ - type* tmp; \ - size_t size_to_allocate = (newSize)*sizeof(type); \ - \ - tmp = (type *)myrealloc((ptr),size_to_allocate,(prevSize)*sizeof(type)); \ - if ( !tmp ) { \ - MMG5_SAFE_FREE(ptr); \ - perror(" ## Memory problem: realloc"); \ - law; \ - } \ - \ - (ptr) = tmp; \ - }while(0) - -/** Check for int32 overflow when trying to reallocate coef*oldSiz+shift array */ -#define MMG5_CHK_INT32_OVERFLOW(wantedGap,oldSiz,coef,shift,law) do \ - { \ - /* Check for int32 overflow */ \ - if ( sizeof(MMG5_int) == sizeof(int32_t) ) { \ - MMG5_int gap_loc = (MMG5_int)((wantedGap) * (oldSiz)); \ - if ( !gap_loc ) gap_loc = 1; \ - \ - int32_t max_ne = (INT32_MAX-(shift))/(coef); \ - if ( max_ne < (oldSiz)+gap_loc ) { \ - /* Detected overflow, target maximal possible size */ \ - gap_loc = max_ne-(oldSiz); \ - if ( gap_loc <=0 ) { \ - /* No possibe realloc without int overflow */ \ - fprintf(stderr," ## Error: %s: %d: Unable to reallocate adja array" \ - " without int overflow.\n",__func__,__LINE__); \ - gap_loc = 0; \ - law; \ - } \ - else { \ - wantedGap = (float)gap_loc/(float)oldSiz; \ - printf("wantGap has been modified %15f\n",wantedGap); \ - wantedGap = (double)gap_loc/(double)oldSiz; \ - printf("DwantGap has been modified %15fl\n",wantedGap); \ - } \ - } \ - } \ - }while(0) - - -/** safe reallocation with memset at 0 for the new values of tab */ -#define MMG5_SAFE_RECALLOC(ptr,prevSize,newSize,type,message,law) do \ - { \ - type* tmp; \ - size_t size_to_allocate = (newSize)*sizeof(type); \ - \ - tmp = (type *)myrealloc((ptr),size_to_allocate,(prevSize)*sizeof(type)); \ - if ( !tmp ) { \ - MMG5_SAFE_FREE(ptr); \ - perror(" ## Memory problem: realloc"); \ - law; \ - } \ - else { \ - (ptr) = tmp; \ - assert(ptr); \ - if ( newSize > prevSize ) { \ - memset(&((ptr)[prevSize]),0,((newSize)-(prevSize))*sizeof(type)); \ - } \ - } \ - }while(0) - -/** Reallocation of ptr of type type at size (initSize+wantedGap*initSize) - if possible or at maximum available size if not. Execute the command law - if reallocation failed. Memset to 0 for the new values of table. */ -#define MMG5_TAB_RECALLOC(mesh,ptr,initSize,wantedGap,type,message,law) do \ - { \ - MMG5_int gap; \ - \ - assert ( mesh->memCur < mesh->memMax ); \ - \ - gap = (MMG5_int)(floor(wantedGap * initSize)); \ - if ( !gap ) gap = 1; \ - \ - if ( mesh->memMax < mesh->memCur + gap*sizeof(type) ) { \ - gap = (MMG5_int)((mesh->memMax-mesh->memCur)/sizeof(type)); \ - if(gap<1) { \ - fprintf(stderr," ## Error:"); \ - fprintf(stderr," unable to allocate %s.\n",message); \ - fprintf(stderr," ## Check the mesh size or "); \ - fprintf(stderr,"increase maximal authorized memory with the -m option.\n"); \ - law; \ - } \ - } \ - \ - MMG5_ADD_MEM(mesh,gap*sizeof(type),message,law); \ - MMG5_SAFE_RECALLOC((ptr),initSize+1,initSize+gap+1,type,message,law); \ - initSize = initSize+gap; \ - }while(0); - -/** Error message when lack of memory */ -#define MMG5_INCREASE_MEM_MESSAGE() do \ - { \ - printf(" ## Check the mesh size or increase maximal"); \ - printf(" authorized memory with the -m option.\n"); \ - } while(0) - -#define MMG5_SAFELL2LCAST(longlongval) (((longlongval) > (LONG_MAX)) ? 0 : ((long)(longlongval))) -#define MMG5_SAFELL2ICAST(longlongval) (((longlongval) > (INT_MAX)) ? 0 : ((int)(longlongval))) - -/** check the return value of fread */ -#define MMG_FREAD(ptr,size,count,stream) do \ - { \ - \ - if ( count != fread(ptr,size,count,stream) ) { \ - fputs ( "Reading error", stderr ); \ - return -1; \ - } \ - } while(0); - -/** macro to help to count the number of variadic arguments */ -#define CV_VA_NUM_ARGS_HELPER(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N - -/** count the number of variadic arguments provided to the macro */ -#define CV_VA_NUM_ARGS(...) CV_VA_NUM_ARGS_HELPER(__VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) +/** + * \param mesh pointer toward the mesh structure. + * \param filename name of file. + * + * \return 1 if success, 0 if fail. + * + * Save node list at .node file format (Tetgen/Triangle). + */ +LIBMMG_CORE_EXPORT int MMG5_saveNode(MMG5_pMesh mesh,const char *filename); /** - * check the return value of fscanf + * \param mesh pointer toward the mesh structure. + * \param filename name of file. + * \param ext file extension (.poly or .edge) + * + * \return 1 if success, 0 if fail. * - * \remark don't work without any variadic arg - * \remark don't work on MSVC because variadic args are not expanded + * Save edge list at .edge file format (Tetgen/Triangle). */ -#ifdef MMG_POSIX -#define MMG_FSCANF(stream,format,...) do \ - { \ - int io_count = fscanf(stream,format,__VA_ARGS__); \ - int args_count = CV_VA_NUM_ARGS(__VA_ARGS__); \ - if ( args_count != io_count ) { \ - fprintf (stderr, "Reading error: fscanf counts %d args while %d provided\n",io_count,args_count ); \ - return -1; \ - } \ - } while(0); -#else -#define MMG_FSCANF(stream,format,...) do \ - { \ - int io_count = fscanf(stream,format,__VA_ARGS__); \ - int args_count = CV_VA_NUM_ARGS(__VA_ARGS__); \ - if ( 0 > io_count ) { \ - fprintf (stderr, "Reading error: fscanf counts %d args\n",io_count); \ - return -1; \ - } \ - } while(0); -#endif +LIBMMG_CORE_EXPORT int MMG5_saveEdge(MMG5_pMesh mesh,const char *filename,const char *ext); -/** Inlined functions for libraries and executables */ -#ifdef USE_SCOTCH -/** Warn user that we overflow asked memory during scotch call */ -static inline -void MMG5_warnScotch(MMG5_pMesh mesh) { - if ( mesh->info.imprim > 4 || mesh->info.ddebug ) { - if ( mesh->info.mem >= 0 ) { - fprintf(stdout," ## Warning: we will overflow the memory asked with \"-m\""); - fprintf(stdout," option during Scotch call.\n" ); - } - } -} -#endif +/* Useful tools to manage C strings */ /** - * \param sigid signal number. + * \param path string containing a filename and its path + * + * \return a pointer toward the allocated string that contains the file basename. * - * Signal handling: specify error messages depending from catched signal. + * Extract basename from a path (allocate a string to store it). * */ -static inline -void MMG5_excfun(int sigid) { - fprintf(stdout,"\n Unexpected error:"); fflush(stdout); - switch(sigid) { - case SIGABRT: - fprintf(stdout," *** potential lack of memory.\n"); break; - case SIGFPE: - fprintf(stdout," *** Floating-point exception\n"); break; - case SIGILL: - fprintf(stdout," *** Illegal instruction\n"); break; - case SIGSEGV: - fprintf(stdout," *** Segmentation fault\n"); break; - case SIGTERM: - case SIGINT: - fprintf(stdout," *** Program killed\n"); break; - } - exit(EXIT_FAILURE); -} +LIBMMG_CORE_EXPORT char *MMG5_Get_basename(char *path); /** - * \param fproto function prototype + * \param ptr pointer toward the file extension (dot included) + * \param fmt default file format. + * + * \return and index associated to the file format detected from the extension. + * + * Get the wanted file format from the mesh extension. If \a fmt is provided, it + * is used as default file format (\a ptr==NULL), otherwise, the default file + * format is the medit one. * - * Expand automatically prototype of function pointer in .h/.c files depending - * on the definition of the MMG_EXTERN and MMG_ASSIGN_NULL preprocessor - * variables: - * - MMG_EXTERN is setted to "extern" in the .h file and empty in the .c one; - * - MMG_ASSIGN_NULL is empty in .h file and setted to =NULL in .c one. */ -#define FUNCTION_POINTER(fproto)\ - MMG_EXTERN fproto MMG_ASSIGN_NULL +LIBMMG_CORE_EXPORT int MMG5_Get_format( char *ptr, int fmt ); +/** + * \param filename string containing a filename + * + * \return pointer toward the filename extension or toward the end of the string + * if no extension have been founded + * + * Get the extension of the filename string. Do not consider '.o' as an extension. + * + */ +LIBMMG_CORE_EXPORT char *MMG5_Get_filenameExt( char *filename ); +/** + * \param path string containing a filename and its path + * + * \return a pointer toward the path allocated here + * + * Remove filename from a path and return the path in a newly allocated string. + * + */ +LIBMMG_CORE_EXPORT char *MMG5_Get_path(char *path); -/* Macro for fortran function generation */ /** - * \def FORTRAN_NAME(nu,nl,pl,pc) - * \brief Adds function definitions. - * \param nu function name in upper case. - * \param nl function name in lower case. - * \param pl type of arguments. - * \param pc name of arguments. - * \note Macro coming from Scotch library. + * \param path path from which we want to remove the extension. + * + * \return allocated string or NULL if the allocation fail. * - * Adds function definitions with upcase, underscore and double - * underscore to match any fortran compiler. + * Allocate a new string and copy \a path without extension in it. * */ -#define FORTRAN_NAME(nu,nl,pl,pc) \ - void nu pl; \ - void nl pl \ - { nu pc; } \ - void nl##_ pl \ - { nu pc; } \ - void nl##__ pl \ - { nu pc; } \ - void nu pl +LIBMMG_CORE_EXPORT char *MMG5_Remove_ext (char* path,char *ext); +/* Enum utilities: print enum fields under a string form */ /** - * \def FORTRAN_VARIADIC(nu,nl,pl,body) - * \brief Adds function definitions. - * \param nu function name in upper case. - * \param nl function name in lower case. - * \param pl type of arguments. - * \param body body of the function. + * \param fmt file format. * - * Adds function definitions with upcase, underscore and double - * underscore to match any fortran compiler. + * \return The name of the file format in a string. + * + * Print the name of the file format associated to \a fmt. * */ -#define FORTRAN_VARIADIC(nu,nl,pl,body) \ - void nu pl \ - { body } \ - void nl pl \ - { body } \ - void nl##_ pl \ - { body } \ - void nl##__ pl \ - { body } \ - - -/* Global variables */ - static const uint8_t MMG5_inxt2[6] = {1,2,0,1,2}; /*!< next vertex of triangle: {1,2,0} */ - static const uint8_t MMG5_iprv2[3] = {2,0,1}; /*!< previous vertex of triangle: {2,0,1} */ - -/* Private structures */ +LIBMMG_CORE_EXPORT const char* MMG5_Get_formatName(enum MMG5_Format fmt); + /** - * \struct MMG5_Bezier + * \param ent MMG5_entities enum * - * Store the Bezier definition of a surface triangle. + * \return the name of the enum field * - * \remark Numbering convention for high order points (b) - * \verbatim + * Print the name associated to the \a ent value in the \a MMG5_entities enum. * - * 2 * - * |`\ * - * | `\ * - * 5 `4 * - * | `\ * - * | `\ * - * 6 `3 * - * | `\ * - * | `\ * - * 0 --- 7 --- 8 --- 1 * + */ +LIBMMG_CORE_EXPORT const char* MMG5_Get_entitiesName(enum MMG5_entities ent); + +/** + * \param typ MMG5_type enum + * + * \return the name of the enum field * - * \endverbatim + * Print the name associated to the \a typ value in the \a MMG5_type enum. * */ -typedef struct { - double b[10][3];/*!< Bezier basis functions */ - double n[6][3]; /*!< Normals at points */ - double t[6][3]; /*!< Tangents at points */ - MMG5_pPoint p[3]; /*!< Triangle vertices */ -} MMG5_Bezier; -typedef MMG5_Bezier * MMG5_pBezier; +LIBMMG_CORE_EXPORT const char* MMG5_Get_typeName(enum MMG5_type typ); + /** - * \struct MMG5_iNode - * \brief Cell for linked list of integer value. + * \param mesh pointer toward mesh + * + * \return 1 if successful, 0 otherwise + * + * Clean non-ridge edges belonging to isosurface. + * */ -typedef struct MMG5_iNode_s { - MMG5_int val; - struct MMG5_iNode_s *nxt; -} MMG5_iNode; - -/* Functions declarations */ - void MMG5_version(MMG5_pMesh,char*); - extern void MMG5_nsort(int8_t ,double *,int8_t *); - extern void MMG5_nperm(int8_t n,int8_t shift,int8_t stride,double *val,double *oldval,int8_t *perm); - extern double MMG5_det3pt1vec(double c0[3],double c1[3],double c2[3],double v[3]); - extern double MMG5_det4pt(double c0[3],double c1[3],double c2[3],double c3[3]); - int MMG5_devangle(double* n1, double *n2, double crit); - extern double MMG5_orvol(MMG5_pPoint point,MMG5_int *v); - int MMG5_Add_inode( MMG5_pMesh mesh, MMG5_iNode **liLi, int val ); - int MMG5_eigenvmatsym2d(MMG5_pMesh mesh,double m[],double lambda[],double v[][2]); - int MMG5_eigenvmatsym3d(MMG5_pMesh mesh,double m[],double lambda[],double v[][3]); - int MMG5_eigenvmatnonsym2d(MMG5_pMesh mesh,double m[],double lambda[],double v[][2]); - int MMG5_eigenvmatnonsym3d(MMG5_pMesh mesh,double m[],double lambda[],double v[][3]); - extern void MMG5_bezierEdge(MMG5_pMesh, MMG5_int, MMG5_int, double*, double*, int8_t,double*); - int MMG5_buildridmet(MMG5_pMesh,MMG5_pSol,MMG5_int,double,double,double,double*,double[3][3]); - extern int MMG5_buildridmetfic(MMG5_pMesh,double*,double*,double,double,double,double*); - int MMG5_buildridmetnor(MMG5_pMesh, MMG5_pSol, MMG5_int,double*, double*,double[3][3]); - void MMG5_check_hminhmax(MMG5_pMesh mesh, int8_t sethmin, int8_t sethmax); - int MMG5_paratmet(double c0[3],double n0[3],double m[6],double c1[3],double n1[3],double mt[6]); - void MMG5_transpose3d(double m[3][3]); - void MMG5_dotprod(int8_t dim,double *a,double *b,double *result); - void MMG5_crossprod3d(double *a,double *b,double *result); - void MMG5_mn(double m[6], double n[6], double mn[9] ); - extern int MMG5_rmtr(double r[3][3],double m[6], double mr[6]); - int MMG5_boundingBox(MMG5_pMesh mesh); - int MMG5_boulep(MMG5_pMesh mesh,MMG5_int start,int ip,MMG5_int*,MMG5_int *list, MMG5_int *tlist); - int MMG5_boulec(MMG5_pMesh, MMG5_int*, MMG5_int,int ip,double *tt); - int MMG5_boulen(MMG5_pMesh, MMG5_int*, MMG5_int,int ip,double *nn); - int MMG5_bouler(MMG5_pMesh, MMG5_int*, MMG5_int,int ip,MMG5_int *,MMG5_int *,int *, int*, int); - int MMG5_boulet(MMG5_pMesh mesh,MMG5_int start,int ip,MMG5_int *list,int8_t s,int8_t *opn); - double MMG5_caltri33_ani(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTria pt); - extern double MMG5_caltri_ani(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTria ptt); - extern double MMG5_caltri_iso(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTria ptt); - void MMG5_defUninitSize(MMG5_pMesh mesh,MMG5_pSol met,int8_t ismet); - void MMG5_displayLengthHisto(MMG5_pMesh,MMG5_int,double*,MMG5_int,MMG5_int,double, - MMG5_int,MMG5_int,double,int,double*,MMG5_int*,int8_t); - void MMG5_displayLengthHisto_internal( MMG5_int,MMG5_int,MMG5_int,double, - MMG5_int,MMG5_int,double, MMG5_int,double*, - MMG5_int*,int8_t,int); - short MMG5_dikmov(MMG5_pMesh,MMG5_pSol,short*,short, - MMG5_int chkmovmesh(MMG5_pMesh,MMG5_pSol,short,MMG5_int*)); - int MMG5_minQualCheck ( MMG5_int iel, double minqual, double alpha ); - int MMG5_elementWeight(MMG5_pMesh,MMG5_pSol,MMG5_pTria,MMG5_pPoint, - MMG5_Bezier*,double r[3][3],double gv[2]); - void MMG5_fillDefmetregSys( MMG5_int, MMG5_pPoint, int, MMG5_Bezier,double r[3][3], - double *, double *, double *, double *); - void MMG5_Free_ilinkedList( MMG5_pMesh mesh, MMG5_iNode *liLi ); - MMG5_int MMG5_grad2metSurf(MMG5_pMesh,MMG5_pSol,MMG5_pTria,MMG5_int,MMG5_int); - int MMG5_grad2metSurfreq(MMG5_pMesh,MMG5_pSol,MMG5_pTria,MMG5_int,MMG5_int); - MMG5_int MMG5_hashFace(MMG5_pMesh,MMG5_Hash*,MMG5_int,MMG5_int,MMG5_int,MMG5_int); - int MMG5_hashEdge(MMG5_pMesh mesh,MMG5_Hash *hash,MMG5_int a,MMG5_int b,MMG5_int k); - int MMG5_hashUpdate(MMG5_Hash *hash,MMG5_int a,MMG5_int b,MMG5_int k); - int MMG5_hashEdgeTag(MMG5_pMesh mesh,MMG5_Hash *hash,MMG5_int a,MMG5_int b,int16_t k); - MMG5_int MMG5_hashGet(MMG5_Hash *hash,MMG5_int a,MMG5_int b); - int MMG5_hashNew(MMG5_pMesh mesh, MMG5_Hash *hash,MMG5_int hsiz,MMG5_int hmax); - int MMG5_intmetsavedir(MMG5_pMesh mesh, double *m,double *n,double *mr); - int MMG5_intridmet(MMG5_pMesh,MMG5_pSol,MMG5_int,MMG5_int,double,double*,double*); - int MMG5_mmgIntmet33_ani(double*,double*,double*,double); - int MMG5_ismaniball(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_int start, int8_t istart); - int MMG5_mmgIntextmet(MMG5_pMesh,MMG5_pSol,MMG5_int,double *,double *); - size_t MMG5_memSize(void); - void MMG5_memOption_memSet(MMG5_pMesh mesh); - void MMG5_mmgDefaultValues(MMG5_pMesh mesh); - int MMG5_mmgHashTria(MMG5_pMesh mesh, MMG5_int *adja, MMG5_Hash*, int chkISO); - void MMG5_mmgInit_parameters(MMG5_pMesh mesh); - void MMG5_mmgUsage(char *prog); - void MMG5_paramUsage1(void); - void MMG5_paramUsage2(void); - void MMG5_2d3dUsage(void); - void MMG5_lagUsage(void); - void MMG5_advancedUsage(void); - extern int MMG5_nonUnitNorPts(MMG5_pMesh,MMG5_int,MMG5_int,MMG5_int,double*); - extern double MMG5_nonorsurf(MMG5_pMesh mesh,MMG5_pTria pt); - extern int MMG5_norpts(MMG5_pMesh,MMG5_int,MMG5_int,MMG5_int,double *); - extern int MMG5_nortri(MMG5_pMesh mesh,MMG5_pTria pt,double *n); - void MMG5_printTria(MMG5_pMesh mesh,char* fileName); - extern int MMG5_rotmatrix(double n[3],double r[3][3]); - int MMG5_invmat(double *m,double *mi); - int MMG5_invmatg(double m[9],double mi[9]); - int MMG5_invmat33(double m[3][3],double mi[3][3]); - int MMG5_invmat22(double m[2][2],double mi[2][2]); - int MMG5_regnor(MMG5_pMesh mesh); - double MMG5_ridSizeInNormalDir(MMG5_pMesh,int,double*,MMG5_pBezier,double,double); - double MMG5_ridSizeInTangentDir(MMG5_pMesh, MMG5_pPoint,MMG5_int,MMG5_int*,double,double); - int MMG5_scale_meshAndSol(MMG5_pMesh,MMG5_pSol,MMG5_pSol,double*); - int MMG5_scale_scalarMetric(MMG5_pMesh, MMG5_pSol,double); - int MMG5_scotchCall(MMG5_pMesh mesh, MMG5_pSol sol,MMG5_pSol fields,MMG5_int*); - int MMG5_check_setted_hminhmax(MMG5_pMesh mesh); - int MMG5_solTruncature_iso(MMG5_pMesh mesh, MMG5_pSol met); - int MMG5_2dSolTruncature_ani(MMG5_pMesh mesh, MMG5_pSol met); - int MMG5_3dSolTruncature_ani(MMG5_pMesh mesh, MMG5_pSol met); - int MMG5_truncate_met3d(MMG5_pSol met, MMG5_int ip, double isqhmin, double isqhmax); - int MMG5_solveDefmetregSys( MMG5_pMesh, double r[3][3], double *, double *, - double *, double *, double, double, double); - int MMG5_solveDefmetrefSys( MMG5_pMesh,MMG5_pPoint,MMG5_int*, double r[3][3], - double *, double *, double *, double *, - double, double, double); - double MMG5_surftri_ani(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTria ptt); - double MMG5_surftri33_ani(MMG5_pMesh,MMG5_pTria,double*,double*,double*); - double MMG5_surftri_iso(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTria ptt); - extern int MMG5_sys33sym(double a[6], double b[3], double r[3]); - int MMG5_interpreg_ani(MMG5_pMesh,MMG5_pSol,MMG5_pTria,int8_t,double,double *mr); - int MMG5_interp_iso(double *ma,double *mb,double *mp,double t); - int MMG5_intersecmet22(MMG5_pMesh mesh, double *m,double *n,double *mr); - int MMG5_countLocalParamAtTri( MMG5_pMesh,MMG5_iNode **); - int MMG5_writeLocalParamAtTri( MMG5_pMesh,MMG5_iNode *,FILE*); - double MMG2D_quickarea(double a[2],double b[2],double c[2]); - void MMG5_build3DMetric(MMG5_pMesh mesh,MMG5_pSol sol,MMG5_int ip,double dbuf[6]); - int MMG5_loadVtuMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); - int MMG5_loadMshMesh_part1(MMG5_pMesh mesh,const char *filename, - FILE **inm,long *posNodes, long *posElts, - long **posNodeData, int *bin, int *iswp, - MMG5_int *nelts,int *nsols); - int MMG5_check_readedMesh(MMG5_pMesh mesh,MMG5_int nref); - int MMG5_loadMshMesh_part2(MMG5_pMesh mesh,MMG5_pSol *sol,FILE **inm, - const long posNodes,const long posElts, - const long *posNodeData,const int bin, - const int iswp,const MMG5_int nelts, - const int nsols); -int MMG5_saveMshMesh(MMG5_pMesh,MMG5_pSol*,const char*, int); -int MMG5_saveDisp(MMG5_pMesh ,MMG5_pSol ); -int MMG5_loadSolHeader(const char*,int,FILE**,int*,int*,int*,MMG5_int*, - int*,int*,int**,long*,int); -int MMG5_chkMetricType(MMG5_pMesh mesh,int *type,int*, FILE *inm); -int MMG5_readFloatSol3D(MMG5_pSol,FILE*,int,int,int); -int MMG5_readDoubleSol3D(MMG5_pSol,FILE*,int,int,MMG5_int); -int MMG5_saveSolHeader( MMG5_pMesh,const char*,FILE**,int,int*,MMG5_int*,MMG5_int, - int,int,int*,int*,int*); -int MMG5_saveSolAtTrianglesHeader( MMG5_pMesh,FILE *,int,int,MMG5_int*,int, - int,int*,int*,int*); -int MMG5_saveSolAtTetrahedraHeader( MMG5_pMesh,FILE *,int,int,MMG5_int*,int, - int,int*,int*,int*); -void MMG5_writeDoubleSol3D(MMG5_pMesh,MMG5_pSol,FILE*,int,MMG5_int,int); -void MMG5_printMetStats(MMG5_pMesh mesh,MMG5_pSol met); -void MMG5_printSolStats(MMG5_pMesh mesh,MMG5_pSol *sol); - -int MMG5_defsiz_startingMessage (MMG5_pMesh,MMG5_pSol,const char * funcname ); -void MMG5_gradation_info ( MMG5_pMesh ); -int MMG5_sum_reqEdgeLengthsAtPoint ( MMG5_pMesh,MMG5_pSol,MMG5_int ip0,MMG5_int ip1 ); -int MMG5_compute_meanMetricAtMarkedPoints_iso ( MMG5_pMesh mesh,MMG5_pSol met); -int MMG5_compute_meanMetricAtMarkedPoints_ani ( MMG5_pMesh mesh,MMG5_pSol met); - -int MMG5_reset_metricAtReqEdges_surf ( MMG5_pMesh,MMG5_pSol,int8_t ); -void MMG5_mark_pointsOnReqEdge_fromTria ( MMG5_pMesh mesh ); -int MMG5_gradsiz_iso ( MMG5_pMesh mesh,MMG5_pSol met ); -int MMG5_gradsizreq_iso(MMG5_pMesh ,MMG5_pSol ); -MMG5_int MMG5_gradsiz_ani(MMG5_pMesh mesh,MMG5_pSol met,int *it); -int MMG5_gradsizreq_ani(MMG5_pMesh mesh,MMG5_pSol met); -int MMG5_simred2d(MMG5_pMesh,double*,double*,double dm[2],double dn[2],double vp[2][2]); -int MMG5_simred3d(MMG5_pMesh mesh,double *m,double *n,double dm[3],double dn[3],double vp[3][3]); -extern int MMG5_updatemet2d_ani(double *m,double *n,double dm[2],double dn[2],double vp[2][2],int8_t ier ); -int MMG5_updatemet3d_ani(double *m,double *n,double dm[3],double dn[3],double vp[3][3],int8_t ier ); -void MMG5_gradEigenvreq(double *dm,double *dn,double,int8_t,int8_t *); -int MMG5_updatemetreq_ani(double *n,double dn[2],double vp[2][2]); -int MMG5_swapbin(int sbin); -MMG5_int MMG5_swapbin_int(MMG5_int sbin); -float MMG5_swapf(float sbin); -double MMG5_swapd(double sbin); -int MMG5_MultiMat_init(MMG5_pMesh); -int MMG5_isLevelSet(MMG5_pMesh,MMG5_int,MMG5_int); -int MMG5_isSplit(MMG5_pMesh ,MMG5_int ,MMG5_int *,MMG5_int *); -int MMG5_isNotSplit(MMG5_pMesh ,MMG5_int); -int MMG5_getStartRef(MMG5_pMesh ,MMG5_int, MMG5_int *); -int MMG5_snpval_ls(MMG5_pMesh mesh,MMG5_pSol sol); -int MMG5_snpval_lssurf(MMG5_pMesh mesh,MMG5_pSol sol); -int MMG5_rmc(MMG5_pMesh ,MMG5_pSol ); -int MMG5_resetRef_ls(MMG5_pMesh ); -int MMG5_resetRef_lssurf(MMG5_pMesh ); -int MMG5_setref_ls(MMG5_pMesh mesh, MMG5_pSol sol); -int MMG5_setref_lssurf(MMG5_pMesh mesh, MMG5_pSol sol); -int MMG5_chkmaniball(MMG5_pMesh mesh, MMG5_int start, int8_t istart); -int MMG5_chkmanimesh(MMG5_pMesh mesh); - -/* test functions */ -extern double MMG5_test_mat_error( int8_t nelem,double m1[],double m2[] ); -int MMG5_test_invmat22(); -int MMG5_test_invmat33(); -int MMG5_test_eigenvmatsym2d(MMG5_pMesh mesh,double *mex,double lambdaex[], - double vpex[][2]); -int MMG5_test_eigenvmatnonsym2d(MMG5_pMesh mesh,double *mex,double lambdaex[], - double vpex[][2],double ivpex[][2]); -int MMG5_test_eigenvmatsym3d(MMG5_pMesh mesh,double *mex,double lambdaex[], - double vpex[][3]); -int MMG5_test_eigenvmatnonsym3d(MMG5_pMesh mesh,double *mex,double lambdaex[], - double vpex[][3],double ivpex[][3]); -int MMG5_test_transpose3d(); -int MMG5_test_dotprod(); -int MMG5_test_crossprod3d(); -int MMG5_test_mn(); -extern int MMG5_test_rmtr(); -int MMG5_test_rotmatrix(); -int MMG5_test_simred2d(MMG5_pMesh mesh,double *mex,double *nex,double *dmex,double *dnex,double vpex[][2]); -int MMG5_test_simred3d(MMG5_pMesh mesh,double *mex,double *nex,double *dmex,double *dnex,double vpex[][3]); -int MMG5_test_updatemet2d_ani(); -int MMG5_test_updatemet3d_ani(); -int MMG5_test_intersecmet22(MMG5_pMesh mesh); -int MMG5_test_intersecmet33(MMG5_pMesh mesh); - -/* tools */ -void MMG5_mark_verticesAsUnused ( MMG5_pMesh mesh ); -void MMG5_mark_usedVertices ( MMG5_pMesh mesh,void (*delPt)(MMG5_pMesh,MMG5_int) ); -void MMG5_keep_subdomainElts ( MMG5_pMesh,int,int (*delElt)(MMG5_pMesh,MMG5_int) ); - -void MMG5_Set_commonFunc(void); +LIBMMG_CORE_EXPORT int MMG5_Clean_isoEdges(MMG5_pMesh mesh); #ifdef __cplusplus } diff --git a/src/common/libmmgtypes.h b/src/common/libmmgtypes.h index 8a2614d3f..6d96e4577 100644 --- a/src/common/libmmgtypes.h +++ b/src/common/libmmgtypes.h @@ -28,8 +28,8 @@ #include #include -#include "mmgcmakedefines.h" -#include "mmgversion.h" +#include "mmg/common/mmgcmakedefines.h" +#include "mmg/common/mmgversion.h" #ifndef _LIBMMGTYPES_H #define _LIBMMGTYPES_H diff --git a/src/common/librnbg.c b/src/common/librnbg.c index f003c6eec..fdbece76c 100644 --- a/src/common/librnbg.c +++ b/src/common/librnbg.c @@ -31,7 +31,7 @@ * \copyright GNU Lesser General Public License. */ -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" #include "mmgexterns_private.h" #ifdef USE_SCOTCH diff --git a/src/common/libtools.c b/src/common/libtools.c index 7816d7f42..1bb9a5504 100644 --- a/src/common/libtools.c +++ b/src/common/libtools.c @@ -32,7 +32,7 @@ * \copyright GNU Lesser General Public License. **/ -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" /** * \param mesh pointer toward the mesh diff --git a/src/common/mettools.c b/src/common/mettools.c index f894267df..63aa91325 100644 --- a/src/common/mettools.c +++ b/src/common/mettools.c @@ -32,7 +32,7 @@ * \copyright GNU Lesser General Public License. */ -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" #include "inlined_functions_private.h" /** diff --git a/src/common/mmg2.c b/src/common/mmg2.c index 83272c75f..0cdec4ba3 100644 --- a/src/common/mmg2.c +++ b/src/common/mmg2.c @@ -33,7 +33,7 @@ * */ -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" #include "mmgexterns_private.h" /** diff --git a/src/common/mmg2s.c b/src/common/mmg2s.c index 98e768133..e35acd2a9 100644 --- a/src/common/mmg2s.c +++ b/src/common/mmg2s.c @@ -30,7 +30,7 @@ * \version 5 * \copyright GNU Lesser General Public License. */ -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" #include "mmgexterns_private.h" /** diff --git a/src/common/mmg3.c b/src/common/mmg3.c index c0fb0d522..26a77282a 100644 --- a/src/common/mmg3.c +++ b/src/common/mmg3.c @@ -31,7 +31,7 @@ * \copyright GNU Lesser General Public License. */ -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" /** * \param mesh pointer toward the mesh structure diff --git a/src/common/mmg_export.h b/src/common/mmg_export.h index 2b17c70f3..689919355 100644 --- a/src/common/mmg_export.h +++ b/src/common/mmg_export.h @@ -24,7 +24,7 @@ #ifndef MMG_EXPORT_H #define MMG_EXPORT_H -#include "mmgcmakedefines.h" +#include "mmg/common/mmgcmakedefines.h" #if(MMG_DYN_LIB) # if defined(_WIN32) || defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(__TOS_WIN__) || defined(__WINDOWS__) diff --git a/src/common/mmgcommon_private.h b/src/common/mmgcommon_private.h new file mode 100644 index 000000000..a9d9e1670 --- /dev/null +++ b/src/common/mmgcommon_private.h @@ -0,0 +1,834 @@ +/* ============================================================================= +** This file is part of the mmg software package for the tetrahedral +** mesh modification. +** Copyright (c) Bx INP/Inria/UBordeaux/UPMC, 2004- . +** +** mmg is free software: you can redistribute it and/or modify it +** under the terms of the GNU Lesser General Public License as published +** by the Free Software Foundation, either version 3 of the License, or +** (at your option) any later version. +** +** mmg is distributed in the hope that it will be useful, but WITHOUT +** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +** FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +** License for more details. +** +** You should have received a copy of the GNU Lesser General Public +** License and of the GNU General Public License along with mmg (in +** files COPYING.LESSER and COPYING). If not, see +** . Please read their terms carefully and +** use this copy of the mmg distribution only if you accept them. +** ============================================================================= +*/ + +#ifndef MMGCOMMON_H +#define MMGCOMMON_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "mmg/common/mmgcmakedefines.h" + +#if (defined(__APPLE__) && defined(__MACH__)) +#include +#elif defined(__unix__) || defined(__unix) || defined(unix) +#include +#elif defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(__TOS_WIN__) || defined(__WINDOWS__) +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#include "eigenv_private.h" +#include "libmmgcommon_private.h" + +#define MG_STR "&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&" + +/** + * Maximum array size when storing list of tria containing a vertex. + */ +#define MMG5_TRIA_LMAX 1024 + +/** + * Maximum array size when calling boulep. + */ +#define MMG5_LMAX 10240 + +/** Maximal number of local parameters */ +#define MMG5_LPARMAX 200 + +/** Check if \a a and \a b have the same sign */ +#define MG_SMSGN(a,b) (((double)(a)*(double)(b) > (0.0)) ? (1) : (0)) + +/** size of box for renumbering with scotch. */ +#define MMG5_BOXSIZE 500 + +/** Maximal memory used if available memory compitation fail. */ +#define MMG5_MEMMAX 800 /**< Default mem if unable to compute memMax */ +#define MMG5_BITWIZE_MB_TO_B 20 /**< Bitwise convertion from Mo to O */ +#define MMG5_MEMPERCENT 0.5 /**< Percent of RAM used by default */ + +/* Macro for unset or unititialized mark */ +#define MMG5_UNSET -1 + +/* reference of the boundary that moves in lagrangian mode */ +#define MMG5_DISPREF 10 + +/* million */ +#define MMG5_MILLION 1048576 + +/* numerical accuracy */ +#define MMG5_ANGEDG 0.707106781186548 /*0.573576436351046 */ +#define MMG5_ANGLIM -0.999999 +#define MMG5_ATHIRD 0.333333333333333 + +#define MMG5_EPSD 1.e-30 +#define MMG5_EPSD2 1.0e-200 +#define MMG5_EPS 1.e-06 +#define MMG5_EPSOK 1.e-15 +#define MMG5_NULKAL 1.e-30 + +#define MMG5_SQR32 0.866025403784439 + +#ifndef M_PI +#define M_PI 3.14159265358979323846 /**< pi */ +#define M_PI_2 1.57079632679489661923 /**< pi/2 */ +#endif + +#define A64TH 0.015625 +#define A16TH 0.0625 +#define A32TH 0.03125 + +#define MMG5_MEMMIN 38 /**< minimal memory needed to store the mesh/sol names */ + +#define MMG5_PATHSEP '/' + +/* Variables for option initialization */ +#define MMG5_NONSET_MEM -1 /**< mem value for unspecified max memory */ +#define MMG5_NONSET_HMIN -1 /**< hmin value for unspecified hmin size */ +#define MMG5_NONSET_HMAX -1 /**< hmax value for unspecified hmax size */ +#define MMG5_NONSET_HSIZ -1 /**< hsiz value for unspecified hsiz map */ +#define MMG5_NONSET -1 +#define MMG5_HAUSD 0.01 /**< default value for hausdorff param */ +#define MMG5_HGRAD 0.26236426446 /**< default value for gradation (1.3) */ +#define MMG5_HGRADREQ 0.83290912294 /**< default value for required gradation (2.3) */ +#define MMG5_NOHGRAD -1 /**< disable gradation */ +#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_PROCTREE 32 /**< default size of the PROctree */ +#define MMG5_OFF 0 /**< 0 */ +#define MMG5_ON 1 /**< 1 */ +#define MMG5_GAP 0.2 /**< gap value for reallocation */ +#define MMG5_HMINCOE 0.001 /**< coefficient to compute the default hmin value */ +#define MMG5_HMAXCOE 2 /**< coefficient to compute the default hmax value */ +#define MMG5_HMINMAXGAP 5 /**< imposed gap between hmin and hmax if hmax (b)) ? (a) : (b)) +#define MG_MIN(a,b) (((a) < (b)) ? (a) : (b)) + +/* tags */ +#define MG_NOTAG (0) +#define MG_REF (1 << 0) /**< 1 edge reference */ +#define MG_GEO (1 << 1) /**< 2 geometric ridge */ +#define MG_REQ (1 << 2) /**< 4 required entity */ +#define MG_NOM (1 << 3) /**< 8 non manifold */ +#define MG_BDY (1 << 4) /**< 16 boundary entity */ +#define MG_CRN (1 << 5) /**< 32 corner */ +#define MG_NOSURF (1 << 6) /**< 64 freezed boundary */ +#define MG_OPNBDY (1 << 7) /**< 128 open boundary */ +#define MG_OLDPARBDY (1 << 11) /**< 2048 old parallel boundary */ +#define MG_PARBDYBDY (1 << 12) /**< 4096 parallel boundary over a boundary */ +#define MG_PARBDY (1 << 13) /**< 8192 parallel boundary */ +#define MG_NUL (1 << 14) /**< 16384 vertex removed */ + +/* binary tags for local parameters */ +#define MG_Vert (1 << 0 ) /**< 1 local parameter applied over vertex */ +#define MG_Tria (1 << 1 ) /**< 2 local parameter applied over triangle */ +#define MG_Tetra (1 << 2 ) /**< 4 local parameter applied over tetrahedron */ +#define MG_Edge (1 << 3 ) /**< 8 local parameter applied over edge */ + + +#define MG_VOK(ppt) (ppt && ((ppt)->tag < MG_NUL)) /**< Vertex OK */ +#define MG_EOK(pt) (pt && ((pt)->v[0] > 0)) /**< Element OK */ + +#define MG_SIN(tag) ((tag & MG_CRN) || (tag & MG_REQ)) /**< Corner or Required */ +#define MG_SIN_OR_NOM(tag) ( MG_SIN(tag) || (tag & MG_NOM) ) /**< Corner, Required or non-manifold */ +#define MG_RID(tag) ( ( !( MG_SIN_OR_NOM(tag)) ) && ( tag & MG_GEO ) ) /**< Non-singular ridge point (so ridge metric in aniso mode) */ + +#define MG_EDG(tag) ((tag & MG_GEO) || (tag & MG_REF)) /**< Edge or Ridge */ +#define MG_GEO_OR_NOM(tag) (( tag & MG_GEO ) || ( tag & MG_NOM )) /**< Ridge or non-manifold */ +#define MG_EDG_OR_NOM(tag) ( MG_EDG(tag) || (tag & MG_NOM ) ) /**< Edge, ridge or non-manifold */ + + + +#define MG_SET(flag,bit) ((flag) |= (1 << (bit))) /**< bit number bit is set to 1 */ +#define MG_CLR(flag,bit) ((flag) &= ~(1 << (bit))) /**< bit number bit is set to 0 */ +#define MG_GET(flag,bit) ((flag) & (1 << (bit))) /**< return bit number bit value */ + +#define MMG5_KA 7 /*!< Key for hash tables. */ +#define MMG5_KB 11 /*!< Key for hash tables. */ + +/* file reading */ +#define MMG5_SW 4 +#define MMG5_SD 8 + +/** Reset the customized signals and set the internal counters of points, edges, + * tria and tetra to the suitable value (needed by users to recover their mesh + * using the API) */ +#define _LIBMMG5_RETURN(mesh,sol,met,val)do \ + { \ + signal(SIGABRT,SIG_DFL); \ + signal(SIGFPE,SIG_DFL); \ + signal(SIGILL,SIG_DFL); \ + signal(SIGSEGV,SIG_DFL); \ + signal(SIGTERM,SIG_DFL); \ + signal(SIGINT,SIG_DFL); \ + mesh->npi = mesh->np; \ + mesh->nti = mesh->nt; \ + mesh->nai = mesh->na; \ + mesh->nei = mesh->ne; \ + mesh->xt = 0; \ + if ( sol ) { sol->npi = sol->np; } \ + if ( met ) { met->npi = met->np; } \ + return val; \ + }while(0) + +/* Macros for memory management */ +/** Check if used memory overflow maximal authorized memory. + Execute the command law if lack of memory. */ +#define MMG5_CHK_MEM(mesh,size,string,law) do \ + { \ + if ( (mesh)->memCur > (mesh)->memMax ) { \ + fprintf(stderr," ## Error:"); \ + fprintf(stderr," unable to allocate %s.\n",string); \ + fprintf(stderr," ## Check the mesh size or "); \ + fprintf(stderr,"increase maximal authorized memory with the -m option.\n"); \ + (mesh)->memCur -= (size); \ + law; \ + } \ + }while(0) + +static inline +void * mycalloc(size_t c, size_t s) { + char *ptr; + ptr = (char *)calloc(c*s+sizeof(size_t),1); + if (ptr == NULL) + return NULL; + else { + *((size_t*)ptr)=c*s; + ptr+=sizeof(size_t); + return (void*)ptr; + } +} + +static inline +void * mymalloc(size_t s) { + char *ptr; + ptr = (char *)malloc(s+sizeof(size_t)); + if (ptr == NULL) + return NULL; + else { + *((size_t*)ptr)=s; + ptr+=sizeof(size_t); + return (void*)ptr; + } +} + +static inline +void * myrealloc(void * ptr_in, size_t s, size_t oldsize) { + char *ptr; + char *ptr_in_c = (char*)ptr_in; + + if ( !ptr_in ) { + assert ( !oldsize ); + return mymalloc( s ); + } + + ptr_in_c -= sizeof(size_t); + if (oldsize != *((size_t*)ptr_in_c)) { + fprintf(stderr, "myrealloc: Error: freed memory mismatch\n"); + assert(0); + } + ptr = (char *)realloc(ptr_in_c, s+sizeof(size_t)); + if (ptr == NULL) + return NULL; + else { + *((size_t*)ptr)=s; + ptr+=sizeof(size_t); + return (void*)ptr; + } +} + +static inline +size_t myfree(void *ptr) { + size_t s; + char * ptr_c = (char*)ptr; + + if ( !ptr ) return 0; + + ptr_c = ptr_c-sizeof(size_t); + s = *((size_t*)ptr_c); + free(ptr_c); + + return s; +} + +/** Free pointer ptr of mesh structure and compute the new used memory. */ +#define MMG5_DEL_MEM(mesh,ptr) do \ + { \ + size_t size_to_free = myfree(ptr); \ + (mesh)->memCur -= size_to_free; \ + ptr = NULL; \ + }while(0) + +/** Increment memory counter memCur and check if we don't overflow + the maximum authorizied memory memMax. */ +#define MMG5_ADD_MEM(mesh,size,message,law) do \ + { \ + (mesh)->memCur += (size); \ + MMG5_CHK_MEM(mesh,size,message,law); \ + }while(0) + +/** Safe deallocation */ +#define MMG5_SAFE_FREE(ptr) do \ + { \ + myfree(ptr); \ + ptr = NULL; \ + }while(0) + +/** Safe allocation with calloc */ +#define MMG5_SAFE_CALLOC(ptr,size,type,law) do \ + { \ + ptr = (type*)mycalloc(size,sizeof(type)); \ + if ( !ptr ) { \ + perror(" ## Memory problem: calloc"); \ + law; \ + } \ + }while(0) + +/** Safe allocation with malloc */ +#define MMG5_SAFE_MALLOC(ptr,size,type,law) do \ + { \ + size_t size_to_allocate = (size)*sizeof(type); \ + ptr = (type*)mymalloc(size_to_allocate); \ + if ( !ptr ) { \ + perror(" ## Memory problem: malloc"); \ + law; \ + } \ + }while(0) + +/** Safe reallocation */ +#define MMG5_SAFE_REALLOC(ptr,prevSize,newSize,type,message,law) do \ + { \ + type* tmp; \ + size_t size_to_allocate = (newSize)*sizeof(type); \ + \ + tmp = (type *)myrealloc((ptr),size_to_allocate,(prevSize)*sizeof(type)); \ + if ( !tmp ) { \ + MMG5_SAFE_FREE(ptr); \ + perror(" ## Memory problem: realloc"); \ + law; \ + } \ + \ + (ptr) = tmp; \ + }while(0) + +/** Check for int32 overflow when trying to reallocate coef*oldSiz+shift array */ +#define MMG5_CHK_INT32_OVERFLOW(wantedGap,oldSiz,coef,shift,law) do \ + { \ + /* Check for int32 overflow */ \ + if ( sizeof(MMG5_int) == sizeof(int32_t) ) { \ + MMG5_int gap_loc = (MMG5_int)((wantedGap) * (oldSiz)); \ + if ( !gap_loc ) gap_loc = 1; \ + \ + int32_t max_ne = (INT32_MAX-(shift))/(coef); \ + if ( max_ne < (oldSiz)+gap_loc ) { \ + /* Detected overflow, target maximal possible size */ \ + gap_loc = max_ne-(oldSiz); \ + if ( gap_loc <=0 ) { \ + /* No possibe realloc without int overflow */ \ + fprintf(stderr," ## Error: %s: %d: Unable to reallocate adja array" \ + " without int overflow.\n",__func__,__LINE__); \ + gap_loc = 0; \ + law; \ + } \ + else { \ + wantedGap = (float)gap_loc/(float)oldSiz; \ + printf("wantGap has been modified %15f\n",wantedGap); \ + wantedGap = (double)gap_loc/(double)oldSiz; \ + printf("DwantGap has been modified %15fl\n",wantedGap); \ + } \ + } \ + } \ + }while(0) + + +/** safe reallocation with memset at 0 for the new values of tab */ +#define MMG5_SAFE_RECALLOC(ptr,prevSize,newSize,type,message,law) do \ + { \ + type* tmp; \ + size_t size_to_allocate = (newSize)*sizeof(type); \ + \ + tmp = (type *)myrealloc((ptr),size_to_allocate,(prevSize)*sizeof(type)); \ + if ( !tmp ) { \ + MMG5_SAFE_FREE(ptr); \ + perror(" ## Memory problem: realloc"); \ + law; \ + } \ + else { \ + (ptr) = tmp; \ + assert(ptr); \ + if ( newSize > prevSize ) { \ + memset(&((ptr)[prevSize]),0,((newSize)-(prevSize))*sizeof(type)); \ + } \ + } \ + }while(0) + +/** Reallocation of ptr of type type at size (initSize+wantedGap*initSize) + if possible or at maximum available size if not. Execute the command law + if reallocation failed. Memset to 0 for the new values of table. */ +#define MMG5_TAB_RECALLOC(mesh,ptr,initSize,wantedGap,type,message,law) do \ + { \ + MMG5_int gap; \ + \ + assert ( mesh->memCur < mesh->memMax ); \ + \ + gap = (MMG5_int)(floor(wantedGap * initSize)); \ + if ( !gap ) gap = 1; \ + \ + if ( mesh->memMax < mesh->memCur + gap*sizeof(type) ) { \ + gap = (MMG5_int)((mesh->memMax-mesh->memCur)/sizeof(type)); \ + if(gap<1) { \ + fprintf(stderr," ## Error:"); \ + fprintf(stderr," unable to allocate %s.\n",message); \ + fprintf(stderr," ## Check the mesh size or "); \ + fprintf(stderr,"increase maximal authorized memory with the -m option.\n"); \ + law; \ + } \ + } \ + \ + MMG5_ADD_MEM(mesh,gap*sizeof(type),message,law); \ + MMG5_SAFE_RECALLOC((ptr),initSize+1,initSize+gap+1,type,message,law); \ + initSize = initSize+gap; \ + }while(0); + +/** Error message when lack of memory */ +#define MMG5_INCREASE_MEM_MESSAGE() do \ + { \ + printf(" ## Check the mesh size or increase maximal"); \ + printf(" authorized memory with the -m option.\n"); \ + } while(0) + +#define MMG5_SAFELL2LCAST(longlongval) (((longlongval) > (LONG_MAX)) ? 0 : ((long)(longlongval))) +#define MMG5_SAFELL2ICAST(longlongval) (((longlongval) > (INT_MAX)) ? 0 : ((int)(longlongval))) + +/** check the return value of fread */ +#define MMG_FREAD(ptr,size,count,stream) do \ + { \ + \ + if ( count != fread(ptr,size,count,stream) ) { \ + fputs ( "Reading error", stderr ); \ + return -1; \ + } \ + } while(0); + +/** macro to help to count the number of variadic arguments */ +#define CV_VA_NUM_ARGS_HELPER(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N + +/** count the number of variadic arguments provided to the macro */ +#define CV_VA_NUM_ARGS(...) CV_VA_NUM_ARGS_HELPER(__VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) + +/** + * check the return value of fscanf + * + * \remark don't work without any variadic arg + * \remark don't work on MSVC because variadic args are not expanded + */ +#ifdef MMG_POSIX +#define MMG_FSCANF(stream,format,...) do \ + { \ + int io_count = fscanf(stream,format,__VA_ARGS__); \ + int args_count = CV_VA_NUM_ARGS(__VA_ARGS__); \ + if ( args_count != io_count ) { \ + fprintf (stderr, "Reading error: fscanf counts %d args while %d provided\n",io_count,args_count ); \ + return -1; \ + } \ + } while(0); +#else +#define MMG_FSCANF(stream,format,...) do \ + { \ + int io_count = fscanf(stream,format,__VA_ARGS__); \ + int args_count = CV_VA_NUM_ARGS(__VA_ARGS__); \ + if ( 0 > io_count ) { \ + fprintf (stderr, "Reading error: fscanf counts %d args\n",io_count); \ + return -1; \ + } \ + } while(0); +#endif + +/** Inlined functions for libraries and executables */ +#ifdef USE_SCOTCH +/** Warn user that we overflow asked memory during scotch call */ +static inline +void MMG5_warnScotch(MMG5_pMesh mesh) { + if ( mesh->info.imprim > 4 || mesh->info.ddebug ) { + if ( mesh->info.mem >= 0 ) { + fprintf(stdout," ## Warning: we will overflow the memory asked with \"-m\""); + fprintf(stdout," option during Scotch call.\n" ); + } + } +} +#endif +/** + * \param sigid signal number. + * + * Signal handling: specify error messages depending from catched signal. + * + */ +static inline +void MMG5_excfun(int sigid) { + fprintf(stdout,"\n Unexpected error:"); fflush(stdout); + switch(sigid) { + case SIGABRT: + fprintf(stdout," *** potential lack of memory.\n"); break; + case SIGFPE: + fprintf(stdout," *** Floating-point exception\n"); break; + case SIGILL: + fprintf(stdout," *** Illegal instruction\n"); break; + case SIGSEGV: + fprintf(stdout," *** Segmentation fault\n"); break; + case SIGTERM: + case SIGINT: + fprintf(stdout," *** Program killed\n"); break; + } + exit(EXIT_FAILURE); +} + +/** + * \param fproto function prototype + * + * Expand automatically prototype of function pointer in .h/.c files depending + * on the definition of the MMG_EXTERN and MMG_ASSIGN_NULL preprocessor + * variables: + * - MMG_EXTERN is setted to "extern" in the .h file and empty in the .c one; + * - MMG_ASSIGN_NULL is empty in .h file and setted to =NULL in .c one. + */ +#define FUNCTION_POINTER(fproto)\ + MMG_EXTERN fproto MMG_ASSIGN_NULL + + + +/* Macro for fortran function generation */ +/** + * \def FORTRAN_NAME(nu,nl,pl,pc) + * \brief Adds function definitions. + * \param nu function name in upper case. + * \param nl function name in lower case. + * \param pl type of arguments. + * \param pc name of arguments. + * \note Macro coming from Scotch library. + * + * Adds function definitions with upcase, underscore and double + * underscore to match any fortran compiler. + * + */ +#define FORTRAN_NAME(nu,nl,pl,pc) \ + void nu pl; \ + void nl pl \ + { nu pc; } \ + void nl##_ pl \ + { nu pc; } \ + void nl##__ pl \ + { nu pc; } \ + void nu pl + +/** + * \def FORTRAN_VARIADIC(nu,nl,pl,body) + * \brief Adds function definitions. + * \param nu function name in upper case. + * \param nl function name in lower case. + * \param pl type of arguments. + * \param body body of the function. + * + * Adds function definitions with upcase, underscore and double + * underscore to match any fortran compiler. + * + */ +#define FORTRAN_VARIADIC(nu,nl,pl,body) \ + void nu pl \ + { body } \ + void nl pl \ + { body } \ + void nl##_ pl \ + { body } \ + void nl##__ pl \ + { body } \ + + +/* Global variables */ + static const uint8_t MMG5_inxt2[6] = {1,2,0,1,2}; /*!< next vertex of triangle: {1,2,0} */ + static const uint8_t MMG5_iprv2[3] = {2,0,1}; /*!< previous vertex of triangle: {2,0,1} */ + +/* Private structures */ +/** + * \struct MMG5_Bezier + * + * Store the Bezier definition of a surface triangle. + * + * \remark Numbering convention for high order points (b) + * \verbatim + * + * 2 * + * |`\ * + * | `\ * + * 5 `4 * + * | `\ * + * | `\ * + * 6 `3 * + * | `\ * + * | `\ * + * 0 --- 7 --- 8 --- 1 * + * + * \endverbatim + * + */ +typedef struct { + double b[10][3];/*!< Bezier basis functions */ + double n[6][3]; /*!< Normals at points */ + double t[6][3]; /*!< Tangents at points */ + MMG5_pPoint p[3]; /*!< Triangle vertices */ +} MMG5_Bezier; +typedef MMG5_Bezier * MMG5_pBezier; + +/** + * \struct MMG5_iNode + * \brief Cell for linked list of integer value. + */ +typedef struct MMG5_iNode_s { + MMG5_int val; + struct MMG5_iNode_s *nxt; +} MMG5_iNode; + +/* Functions declarations */ + void MMG5_version(MMG5_pMesh,char*); + extern void MMG5_nsort(int8_t ,double *,int8_t *); + extern void MMG5_nperm(int8_t n,int8_t shift,int8_t stride,double *val,double *oldval,int8_t *perm); + extern double MMG5_det3pt1vec(double c0[3],double c1[3],double c2[3],double v[3]); + extern double MMG5_det4pt(double c0[3],double c1[3],double c2[3],double c3[3]); + int MMG5_devangle(double* n1, double *n2, double crit); + extern double MMG5_orvol(MMG5_pPoint point,MMG5_int *v); + int MMG5_Add_inode( MMG5_pMesh mesh, MMG5_iNode **liLi, int val ); + int MMG5_eigenvmatsym2d(MMG5_pMesh mesh,double m[],double lambda[],double v[][2]); + int MMG5_eigenvmatsym3d(MMG5_pMesh mesh,double m[],double lambda[],double v[][3]); + int MMG5_eigenvmatnonsym2d(MMG5_pMesh mesh,double m[],double lambda[],double v[][2]); + int MMG5_eigenvmatnonsym3d(MMG5_pMesh mesh,double m[],double lambda[],double v[][3]); + extern void MMG5_bezierEdge(MMG5_pMesh, MMG5_int, MMG5_int, double*, double*, int8_t,double*); + int MMG5_buildridmet(MMG5_pMesh,MMG5_pSol,MMG5_int,double,double,double,double*,double[3][3]); + extern int MMG5_buildridmetfic(MMG5_pMesh,double*,double*,double,double,double,double*); + int MMG5_buildridmetnor(MMG5_pMesh, MMG5_pSol, MMG5_int,double*, double*,double[3][3]); + void MMG5_check_hminhmax(MMG5_pMesh mesh, int8_t sethmin, int8_t sethmax); + int MMG5_paratmet(double c0[3],double n0[3],double m[6],double c1[3],double n1[3],double mt[6]); + void MMG5_transpose3d(double m[3][3]); + void MMG5_dotprod(int8_t dim,double *a,double *b,double *result); + void MMG5_crossprod3d(double *a,double *b,double *result); + void MMG5_mn(double m[6], double n[6], double mn[9] ); + extern int MMG5_rmtr(double r[3][3],double m[6], double mr[6]); + int MMG5_boundingBox(MMG5_pMesh mesh); + int MMG5_boulep(MMG5_pMesh mesh,MMG5_int start,int ip,MMG5_int*,MMG5_int *list, MMG5_int *tlist); + int MMG5_boulec(MMG5_pMesh, MMG5_int*, MMG5_int,int ip,double *tt); + int MMG5_boulen(MMG5_pMesh, MMG5_int*, MMG5_int,int ip,double *nn); + int MMG5_bouler(MMG5_pMesh, MMG5_int*, MMG5_int,int ip,MMG5_int *,MMG5_int *,int *, int*, int); + int MMG5_boulet(MMG5_pMesh mesh,MMG5_int start,int ip,MMG5_int *list,int8_t s,int8_t *opn); + double MMG5_caltri33_ani(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTria pt); + extern double MMG5_caltri_ani(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTria ptt); + extern double MMG5_caltri_iso(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTria ptt); + void MMG5_defUninitSize(MMG5_pMesh mesh,MMG5_pSol met,int8_t ismet); + void MMG5_displayLengthHisto(MMG5_pMesh,MMG5_int,double*,MMG5_int,MMG5_int,double, + MMG5_int,MMG5_int,double,int,double*,MMG5_int*,int8_t); + void MMG5_displayLengthHisto_internal( MMG5_int,MMG5_int,MMG5_int,double, + MMG5_int,MMG5_int,double, MMG5_int,double*, + MMG5_int*,int8_t,int); + short MMG5_dikmov(MMG5_pMesh,MMG5_pSol,short*,short, + MMG5_int chkmovmesh(MMG5_pMesh,MMG5_pSol,short,MMG5_int*)); + int MMG5_minQualCheck ( MMG5_int iel, double minqual, double alpha ); + int MMG5_elementWeight(MMG5_pMesh,MMG5_pSol,MMG5_pTria,MMG5_pPoint, + MMG5_Bezier*,double r[3][3],double gv[2]); + void MMG5_fillDefmetregSys( MMG5_int, MMG5_pPoint, int, MMG5_Bezier,double r[3][3], + double *, double *, double *, double *); + void MMG5_Free_ilinkedList( MMG5_pMesh mesh, MMG5_iNode *liLi ); + MMG5_int MMG5_grad2metSurf(MMG5_pMesh,MMG5_pSol,MMG5_pTria,MMG5_int,MMG5_int); + int MMG5_grad2metSurfreq(MMG5_pMesh,MMG5_pSol,MMG5_pTria,MMG5_int,MMG5_int); + MMG5_int MMG5_hashFace(MMG5_pMesh,MMG5_Hash*,MMG5_int,MMG5_int,MMG5_int,MMG5_int); + int MMG5_hashEdge(MMG5_pMesh mesh,MMG5_Hash *hash,MMG5_int a,MMG5_int b,MMG5_int k); + int MMG5_hashUpdate(MMG5_Hash *hash,MMG5_int a,MMG5_int b,MMG5_int k); + int MMG5_hashEdgeTag(MMG5_pMesh mesh,MMG5_Hash *hash,MMG5_int a,MMG5_int b,int16_t k); + MMG5_int MMG5_hashGet(MMG5_Hash *hash,MMG5_int a,MMG5_int b); + int MMG5_hashNew(MMG5_pMesh mesh, MMG5_Hash *hash,MMG5_int hsiz,MMG5_int hmax); + int MMG5_intmetsavedir(MMG5_pMesh mesh, double *m,double *n,double *mr); + int MMG5_intridmet(MMG5_pMesh,MMG5_pSol,MMG5_int,MMG5_int,double,double*,double*); + int MMG5_mmgIntmet33_ani(double*,double*,double*,double); + int MMG5_ismaniball(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_int start, int8_t istart); + int MMG5_mmgIntextmet(MMG5_pMesh,MMG5_pSol,MMG5_int,double *,double *); + size_t MMG5_memSize(void); + void MMG5_memOption_memSet(MMG5_pMesh mesh); + void MMG5_mmgDefaultValues(MMG5_pMesh mesh); + int MMG5_mmgHashTria(MMG5_pMesh mesh, MMG5_int *adja, MMG5_Hash*, int chkISO); + void MMG5_mmgInit_parameters(MMG5_pMesh mesh); + void MMG5_mmgUsage(char *prog); + void MMG5_paramUsage1(void); + void MMG5_paramUsage2(void); + void MMG5_2d3dUsage(void); + void MMG5_lagUsage(void); + void MMG5_advancedUsage(void); + extern int MMG5_nonUnitNorPts(MMG5_pMesh,MMG5_int,MMG5_int,MMG5_int,double*); + extern double MMG5_nonorsurf(MMG5_pMesh mesh,MMG5_pTria pt); + extern int MMG5_norpts(MMG5_pMesh,MMG5_int,MMG5_int,MMG5_int,double *); + extern int MMG5_nortri(MMG5_pMesh mesh,MMG5_pTria pt,double *n); + void MMG5_printTria(MMG5_pMesh mesh,char* fileName); + extern int MMG5_rotmatrix(double n[3],double r[3][3]); + int MMG5_invmat(double *m,double *mi); + int MMG5_invmatg(double m[9],double mi[9]); + int MMG5_invmat33(double m[3][3],double mi[3][3]); + int MMG5_invmat22(double m[2][2],double mi[2][2]); + int MMG5_regnor(MMG5_pMesh mesh); + double MMG5_ridSizeInNormalDir(MMG5_pMesh,int,double*,MMG5_pBezier,double,double); + double MMG5_ridSizeInTangentDir(MMG5_pMesh, MMG5_pPoint,MMG5_int,MMG5_int*,double,double); + int MMG5_scale_meshAndSol(MMG5_pMesh,MMG5_pSol,MMG5_pSol,double*); + int MMG5_scale_scalarMetric(MMG5_pMesh, MMG5_pSol,double); + int MMG5_scotchCall(MMG5_pMesh mesh, MMG5_pSol sol,MMG5_pSol fields,MMG5_int*); + int MMG5_check_setted_hminhmax(MMG5_pMesh mesh); + int MMG5_solTruncature_iso(MMG5_pMesh mesh, MMG5_pSol met); + int MMG5_2dSolTruncature_ani(MMG5_pMesh mesh, MMG5_pSol met); + int MMG5_3dSolTruncature_ani(MMG5_pMesh mesh, MMG5_pSol met); + int MMG5_truncate_met3d(MMG5_pSol met, MMG5_int ip, double isqhmin, double isqhmax); + int MMG5_solveDefmetregSys( MMG5_pMesh, double r[3][3], double *, double *, + double *, double *, double, double, double); + int MMG5_solveDefmetrefSys( MMG5_pMesh,MMG5_pPoint,MMG5_int*, double r[3][3], + double *, double *, double *, double *, + double, double, double); + double MMG5_surftri_ani(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTria ptt); + double MMG5_surftri33_ani(MMG5_pMesh,MMG5_pTria,double*,double*,double*); + double MMG5_surftri_iso(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pTria ptt); + extern int MMG5_sys33sym(double a[6], double b[3], double r[3]); + int MMG5_interpreg_ani(MMG5_pMesh,MMG5_pSol,MMG5_pTria,int8_t,double,double *mr); + int MMG5_interp_iso(double *ma,double *mb,double *mp,double t); + int MMG5_intersecmet22(MMG5_pMesh mesh, double *m,double *n,double *mr); + int MMG5_countLocalParamAtTri( MMG5_pMesh,MMG5_iNode **); + int MMG5_writeLocalParamAtTri( MMG5_pMesh,MMG5_iNode *,FILE*); + double MMG2D_quickarea(double a[2],double b[2],double c[2]); + void MMG5_build3DMetric(MMG5_pMesh mesh,MMG5_pSol sol,MMG5_int ip,double dbuf[6]); + int MMG5_loadVtuMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename); + int MMG5_loadMshMesh_part1(MMG5_pMesh mesh,const char *filename, + FILE **inm,long *posNodes, long *posElts, + long **posNodeData, int *bin, int *iswp, + MMG5_int *nelts,int *nsols); + int MMG5_check_readedMesh(MMG5_pMesh mesh,MMG5_int nref); + int MMG5_loadMshMesh_part2(MMG5_pMesh mesh,MMG5_pSol *sol,FILE **inm, + const long posNodes,const long posElts, + const long *posNodeData,const int bin, + const int iswp,const MMG5_int nelts, + const int nsols); +int MMG5_saveMshMesh(MMG5_pMesh,MMG5_pSol*,const char*, int); +int MMG5_saveDisp(MMG5_pMesh ,MMG5_pSol ); +int MMG5_loadSolHeader(const char*,int,FILE**,int*,int*,int*,MMG5_int*, + int*,int*,int**,long*,int); +int MMG5_chkMetricType(MMG5_pMesh mesh,int *type,int*, FILE *inm); +int MMG5_readFloatSol3D(MMG5_pSol,FILE*,int,int,int); +int MMG5_readDoubleSol3D(MMG5_pSol,FILE*,int,int,MMG5_int); +int MMG5_saveSolHeader( MMG5_pMesh,const char*,FILE**,int,int*,MMG5_int*,MMG5_int, + int,int,int*,int*,int*); +int MMG5_saveSolAtTrianglesHeader( MMG5_pMesh,FILE *,int,int,MMG5_int*,int, + int,int*,int*,int*); +int MMG5_saveSolAtTetrahedraHeader( MMG5_pMesh,FILE *,int,int,MMG5_int*,int, + int,int*,int*,int*); +void MMG5_writeDoubleSol3D(MMG5_pMesh,MMG5_pSol,FILE*,int,MMG5_int,int); +void MMG5_printMetStats(MMG5_pMesh mesh,MMG5_pSol met); +void MMG5_printSolStats(MMG5_pMesh mesh,MMG5_pSol *sol); + +int MMG5_defsiz_startingMessage (MMG5_pMesh,MMG5_pSol,const char * funcname ); +void MMG5_gradation_info ( MMG5_pMesh ); +int MMG5_sum_reqEdgeLengthsAtPoint ( MMG5_pMesh,MMG5_pSol,MMG5_int ip0,MMG5_int ip1 ); +int MMG5_compute_meanMetricAtMarkedPoints_iso ( MMG5_pMesh mesh,MMG5_pSol met); +int MMG5_compute_meanMetricAtMarkedPoints_ani ( MMG5_pMesh mesh,MMG5_pSol met); + +int MMG5_reset_metricAtReqEdges_surf ( MMG5_pMesh,MMG5_pSol,int8_t ); +void MMG5_mark_pointsOnReqEdge_fromTria ( MMG5_pMesh mesh ); +int MMG5_gradsiz_iso ( MMG5_pMesh mesh,MMG5_pSol met ); +int MMG5_gradsizreq_iso(MMG5_pMesh ,MMG5_pSol ); +MMG5_int MMG5_gradsiz_ani(MMG5_pMesh mesh,MMG5_pSol met,int *it); +int MMG5_gradsizreq_ani(MMG5_pMesh mesh,MMG5_pSol met); +int MMG5_simred2d(MMG5_pMesh,double*,double*,double dm[2],double dn[2],double vp[2][2]); +int MMG5_simred3d(MMG5_pMesh mesh,double *m,double *n,double dm[3],double dn[3],double vp[3][3]); +extern int MMG5_updatemet2d_ani(double *m,double *n,double dm[2],double dn[2],double vp[2][2],int8_t ier ); +int MMG5_updatemet3d_ani(double *m,double *n,double dm[3],double dn[3],double vp[3][3],int8_t ier ); +void MMG5_gradEigenvreq(double *dm,double *dn,double,int8_t,int8_t *); +int MMG5_updatemetreq_ani(double *n,double dn[2],double vp[2][2]); +int MMG5_swapbin(int sbin); +MMG5_int MMG5_swapbin_int(MMG5_int sbin); +float MMG5_swapf(float sbin); +double MMG5_swapd(double sbin); +int MMG5_MultiMat_init(MMG5_pMesh); +int MMG5_isLevelSet(MMG5_pMesh,MMG5_int,MMG5_int); +int MMG5_isSplit(MMG5_pMesh ,MMG5_int ,MMG5_int *,MMG5_int *); +int MMG5_isNotSplit(MMG5_pMesh ,MMG5_int); +int MMG5_getStartRef(MMG5_pMesh ,MMG5_int, MMG5_int *); +int MMG5_snpval_ls(MMG5_pMesh mesh,MMG5_pSol sol); +int MMG5_snpval_lssurf(MMG5_pMesh mesh,MMG5_pSol sol); +int MMG5_rmc(MMG5_pMesh ,MMG5_pSol ); +int MMG5_resetRef_ls(MMG5_pMesh ); +int MMG5_resetRef_lssurf(MMG5_pMesh ); +int MMG5_setref_ls(MMG5_pMesh mesh, MMG5_pSol sol); +int MMG5_setref_lssurf(MMG5_pMesh mesh, MMG5_pSol sol); +int MMG5_chkmaniball(MMG5_pMesh mesh, MMG5_int start, int8_t istart); +int MMG5_chkmanimesh(MMG5_pMesh mesh); + +/* test functions */ +extern double MMG5_test_mat_error( int8_t nelem,double m1[],double m2[] ); +int MMG5_test_invmat22(); +int MMG5_test_invmat33(); +int MMG5_test_eigenvmatsym2d(MMG5_pMesh mesh,double *mex,double lambdaex[], + double vpex[][2]); +int MMG5_test_eigenvmatnonsym2d(MMG5_pMesh mesh,double *mex,double lambdaex[], + double vpex[][2],double ivpex[][2]); +int MMG5_test_eigenvmatsym3d(MMG5_pMesh mesh,double *mex,double lambdaex[], + double vpex[][3]); +int MMG5_test_eigenvmatnonsym3d(MMG5_pMesh mesh,double *mex,double lambdaex[], + double vpex[][3],double ivpex[][3]); +int MMG5_test_transpose3d(); +int MMG5_test_dotprod(); +int MMG5_test_crossprod3d(); +int MMG5_test_mn(); +extern int MMG5_test_rmtr(); +int MMG5_test_rotmatrix(); +int MMG5_test_simred2d(MMG5_pMesh mesh,double *mex,double *nex,double *dmex,double *dnex,double vpex[][2]); +int MMG5_test_simred3d(MMG5_pMesh mesh,double *mex,double *nex,double *dmex,double *dnex,double vpex[][3]); +int MMG5_test_updatemet2d_ani(); +int MMG5_test_updatemet3d_ani(); +int MMG5_test_intersecmet22(MMG5_pMesh mesh); +int MMG5_test_intersecmet33(MMG5_pMesh mesh); + +/* tools */ +void MMG5_mark_verticesAsUnused ( MMG5_pMesh mesh ); +void MMG5_mark_usedVertices ( MMG5_pMesh mesh,void (*delPt)(MMG5_pMesh,MMG5_int) ); +void MMG5_keep_subdomainElts ( MMG5_pMesh,int,int (*delElt)(MMG5_pMesh,MMG5_int) ); + +void MMG5_Set_commonFunc(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/common/mmgexterns.c b/src/common/mmgexterns.c index 529ab2a6b..dc8fb0d91 100644 --- a/src/common/mmgexterns.c +++ b/src/common/mmgexterns.c @@ -21,7 +21,7 @@ ** ============================================================================= */ -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" #define MMG_EXTERN #define MMG_ASSIGN_NULL =NULL diff --git a/src/common/mmgexterns_private.h b/src/common/mmgexterns_private.h index 5c69e4cf3..4f9cf6c46 100644 --- a/src/common/mmgexterns_private.h +++ b/src/common/mmgexterns_private.h @@ -24,7 +24,7 @@ #ifndef MMGEXTERNS_H #define MMGEXTERNS_H -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" #ifndef MMG_EXTERN #define MMG_EXTERN extern diff --git a/src/common/mmgversion.h.in b/src/common/mmgversion.h.in index 8c7f3ddd6..d10e16ee0 100644 --- a/src/common/mmgversion.h.in +++ b/src/common/mmgversion.h.in @@ -21,7 +21,7 @@ ** ============================================================================= */ #ifndef _WIN32 -#include "git_log_mmg.h" +#include "mmg/common/git_log_mmg.h" #endif #ifndef MMGVERSION_H diff --git a/src/common/quality.c b/src/common/quality.c index 38362db8d..656480089 100644 --- a/src/common/quality.c +++ b/src/common/quality.c @@ -32,7 +32,7 @@ * \copyright GNU Lesser General Public License. */ -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/common/scalem.c b/src/common/scalem.c index da998d87b..0d6053490 100644 --- a/src/common/scalem.c +++ b/src/common/scalem.c @@ -32,7 +32,7 @@ * \copyright GNU Lesser General Public License. */ -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" #include "mmgexterns_private.h" /** diff --git a/src/common/tools.c b/src/common/tools.c index dfaea3b4d..0faf1891c 100644 --- a/src/common/tools.c +++ b/src/common/tools.c @@ -33,7 +33,7 @@ * \todo doxygen documentation. */ -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" /** * \param n array size diff --git a/src/common/vtkparser.hpp b/src/common/vtkparser.hpp index b73be208d..bb547409d 100644 --- a/src/common/vtkparser.hpp +++ b/src/common/vtkparser.hpp @@ -26,7 +26,7 @@ #ifdef USE_VTK -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" #include #include diff --git a/src/mmg2d/inoutcpp_2d.cpp b/src/mmg2d/inoutcpp_2d.cpp index 32a7aaf3c..ddbc2e77b 100644 --- a/src/mmg2d/inoutcpp_2d.cpp +++ b/src/mmg2d/inoutcpp_2d.cpp @@ -31,7 +31,7 @@ * \copyright GNU Lesser General Public License. */ -#include +#include "vtkparser.hpp" #include "libmmg2d.h" #include "libmmg2d_private.h" diff --git a/src/mmg2d/libmmg2d.h b/src/mmg2d/libmmg2d.h index b5254e535..e5d56dcc6 100644 --- a/src/mmg2d/libmmg2d.h +++ b/src/mmg2d/libmmg2d.h @@ -38,8 +38,8 @@ extern "C" { #endif -#include "../common/libmmgtypes.h" -#include "mmg2d_export.h" +#include "mmg/common/libmmgtypes.h" +#include "mmg/mmg2d/mmg2d_export.h" /** * Maximum array size when storing adjacent points (or ball) of a vertex. diff --git a/src/mmg2d/libmmg2d_private.h b/src/mmg2d/libmmg2d_private.h index 39dc6f2dc..c301f5855 100644 --- a/src/mmg2d/libmmg2d_private.h +++ b/src/mmg2d/libmmg2d_private.h @@ -34,7 +34,7 @@ #include -#include "libmmgcommon.h" +#include "libmmgcommon_private.h" #ifdef __cplusplus extern "C" { diff --git a/src/mmg2d/libmmg2df.c b/src/mmg2d/libmmg2df.c index 55d221831..955ccf4c7 100644 --- a/src/mmg2d/libmmg2df.c +++ b/src/mmg2d/libmmg2df.c @@ -42,7 +42,7 @@ */ #include "libmmg2d.h" -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" /** * See \ref MMG2D_mmg2dlib function in \ref mmg2d/liblibmmg2d_private.h file. diff --git a/src/mmg2d/mmg2d_export.h b/src/mmg2d/mmg2d_export.h index d7535ccb2..a497e0c62 100644 --- a/src/mmg2d/mmg2d_export.h +++ b/src/mmg2d/mmg2d_export.h @@ -24,7 +24,7 @@ #ifndef MMG2D_EXPORT_H #define MMG2D_EXPORT_H -#include "../common/mmg_export.h" +#include "mmg/common/mmg_export.h" #if defined(libmmg_so_EXPORTS) || defined(libmmg2d_so_EXPORTS) # define LIBMMG2D_EXPORT MMG_DECL_EXPORT #else diff --git a/src/mmg2d/mmg2dexterns_private.h b/src/mmg2d/mmg2dexterns_private.h index 2a1adf038..6eab8dd01 100644 --- a/src/mmg2d/mmg2dexterns_private.h +++ b/src/mmg2d/mmg2dexterns_private.h @@ -2,7 +2,7 @@ #define MMG2DEXTERNS_H #include "libmmgtypes.h" -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" #ifndef MMG_EXTERN #define MMG_EXTERN extern diff --git a/src/mmg3d/PRoctree_3d.c b/src/mmg3d/PRoctree_3d.c index c70d229d4..a9c2f874e 100644 --- a/src/mmg3d/PRoctree_3d.c +++ b/src/mmg3d/PRoctree_3d.c @@ -35,7 +35,7 @@ */ #include "libmmgtypes.h" -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" #include "PRoctree_3d_private.h" #include diff --git a/src/mmg3d/inoutcpp_3d.cpp b/src/mmg3d/inoutcpp_3d.cpp index b6d496131..0167e8e6f 100644 --- a/src/mmg3d/inoutcpp_3d.cpp +++ b/src/mmg3d/inoutcpp_3d.cpp @@ -32,7 +32,7 @@ * \copyright GNU Lesser General Public License. */ -#include +#include "vtkparser.hpp" #include "libmmg3d.h" #include "libmmg3d_private.h" diff --git a/src/mmg3d/libmmg3d.h b/src/mmg3d/libmmg3d.h index 56a880d2a..952237852 100644 --- a/src/mmg3d/libmmg3d.h +++ b/src/mmg3d/libmmg3d.h @@ -49,8 +49,8 @@ extern "C" { #endif -#include "../common/libmmgtypes.h" -#include "mmg3d_export.h" +#include "mmg/common/libmmgtypes.h" +#include "mmg/mmg3d/mmg3d_export.h" /** * Maximum array size when storing adjacent points (or ball) of a vertex. diff --git a/src/mmg3d/libmmg3d_private.h b/src/mmg3d/libmmg3d_private.h index 9fc4088a5..991ed234c 100644 --- a/src/mmg3d/libmmg3d_private.h +++ b/src/mmg3d/libmmg3d_private.h @@ -24,7 +24,7 @@ #ifndef LIBMMG3D_PRIVATE_H #define LIBMMG3D_PRIVATE_H -#include "libmmgcommon.h" +#include "libmmgcommon_private.h" #include "PRoctree_3d_private.h" #ifdef __cplusplus diff --git a/src/mmg3d/libmmg3d_tools.c b/src/mmg3d/libmmg3d_tools.c index f3b987cc3..7eeba9de7 100644 --- a/src/mmg3d/libmmg3d_tools.c +++ b/src/mmg3d/libmmg3d_tools.c @@ -31,7 +31,7 @@ **/ #include "libmmg3d.h" -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" #include "inlined_functions_3d.h" #include "mmgversion.h" #include "mmg3dexterns_private.h" diff --git a/src/mmg3d/libmmg3df.c b/src/mmg3d/libmmg3df.c index 910347ffe..feb3b572a 100644 --- a/src/mmg3d/libmmg3df.c +++ b/src/mmg3d/libmmg3df.c @@ -42,7 +42,7 @@ */ #include "libmmg3d.h" -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" /** * See \ref MMG3D_mmg3dlib function in \ref mmg3d/libmmg3d.h file. diff --git a/src/mmg3d/mmg3d_export.h b/src/mmg3d/mmg3d_export.h index 7aeb5d975..8c6e18581 100644 --- a/src/mmg3d/mmg3d_export.h +++ b/src/mmg3d/mmg3d_export.h @@ -24,7 +24,7 @@ #ifndef MMG3D_EXPORT_H #define MMG3D_EXPORT_H -#include "../common/mmg_export.h" +#include "mmg/common/mmg_export.h" #if defined(libmmg_so_EXPORTS) || defined(libmmg3d_so_EXPORTS) # define LIBMMG3D_EXPORT MMG_DECL_EXPORT #else diff --git a/src/mmg3d/mmg3dexterns_private.h b/src/mmg3d/mmg3dexterns_private.h index c45125fe4..834a22719 100644 --- a/src/mmg3d/mmg3dexterns_private.h +++ b/src/mmg3d/mmg3dexterns_private.h @@ -3,7 +3,7 @@ #include "libmmgtypes.h" #include "PRoctree_3d_private.h" -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" #ifndef MMG_EXTERN #define MMG_EXTERN extern diff --git a/src/mmgs/analys_s.c b/src/mmgs/analys_s.c index 70a4c6dd1..a618bdf9f 100644 --- a/src/mmgs/analys_s.c +++ b/src/mmgs/analys_s.c @@ -34,7 +34,7 @@ */ #include "libmmgs_private.h" -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" /** * \param mesh pointer toward the mesh diff --git a/src/mmgs/inoutcpp_s.cpp b/src/mmgs/inoutcpp_s.cpp index b329b3353..839a75fc9 100644 --- a/src/mmgs/inoutcpp_s.cpp +++ b/src/mmgs/inoutcpp_s.cpp @@ -31,7 +31,7 @@ * \copyright GNU Lesser General Public License. */ -#include +#include "vtkparser.hpp" #include "libmmgs.h" #include "libmmgs_private.h" diff --git a/src/mmgs/libmmgs.h b/src/mmgs/libmmgs.h index 635b211c8..c08883908 100644 --- a/src/mmgs/libmmgs.h +++ b/src/mmgs/libmmgs.h @@ -41,8 +41,8 @@ extern "C" { #endif -#include "mmgs_export.h" -#include "../common/libmmgtypes.h" +#include "mmg/mmgs/mmgs_export.h" +#include "mmg/common/libmmgtypes.h" /** * Maximum array size when storing adjacent points (or ball) of a vertex. diff --git a/src/mmgs/libmmgs_private.h b/src/mmgs/libmmgs_private.h index b73aa27e8..5334a9814 100644 --- a/src/mmgs/libmmgs_private.h +++ b/src/mmgs/libmmgs_private.h @@ -24,7 +24,7 @@ #ifndef LIBMMGS_PRIVATE_H #define LIBMMGS_PRIVATE_H -#include "libmmgcommon.h" +#include "libmmgcommon_private.h" #ifdef __cplusplus extern "C" { diff --git a/src/mmgs/libmmgsf.c b/src/mmgs/libmmgsf.c index 7bb85e2ca..0f175b2c8 100644 --- a/src/mmgs/libmmgsf.c +++ b/src/mmgs/libmmgsf.c @@ -42,7 +42,7 @@ */ #include "libmmgs.h" -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" /** * See \ref MMGS_mmgslib function in \ref mmgs/libmmgs.h file. diff --git a/src/mmgs/mmgs_export.h b/src/mmgs/mmgs_export.h index 7610c15ba..689905285 100644 --- a/src/mmgs/mmgs_export.h +++ b/src/mmgs/mmgs_export.h @@ -24,7 +24,7 @@ #ifndef MMGS_EXPORT_H #define MMGS_EXPORT_H -#include "../common/mmg_export.h" +#include "mmg/common/mmg_export.h" #if defined(libmmg_so_EXPORTS) || defined(libmmgs_so_EXPORTS) # define LIBMMGS_EXPORT MMG_DECL_EXPORT #else diff --git a/src/mmgs/mmgsexterns_private.h b/src/mmgs/mmgsexterns_private.h index 63aaf6f38..94bcae677 100644 --- a/src/mmgs/mmgsexterns_private.h +++ b/src/mmgs/mmgsexterns_private.h @@ -2,7 +2,7 @@ #define MMGSEXTERNS_H #include "libmmgtypes.h" -#include "libmmgcommon_private.h" +#include "mmgcommon_private.h" #ifndef MMG_EXTERN #define MMG_EXTERN extern From 89ebdd0a0d8bab4be91ad7e18ebcb36516a956d9 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Sat, 10 Dec 2022 16:18:55 +0100 Subject: [PATCH 824/838] Add _private prostfix to inlined_3d header file. --- src/common/inlined_functions_private.h | 1 - src/common/libmmgcommon_private.h | 1 - src/common/librnbg_private.h | 1 - src/mmg3d/API_functions_3d.c | 2 +- src/mmg3d/anisomovpt_3d.c | 2 +- src/mmg3d/anisosiz_3d.c | 2 +- src/mmg3d/colver_3d.c | 2 +- src/mmg3d/delaunay_3d.c | 2 +- .../{inlined_functions_3d.h => inlined_functions_3d_private.h} | 1 - src/mmg3d/libmmg3d.c | 2 +- src/mmg3d/libmmg3d_tools.c | 2 +- src/mmg3d/mmg3d1.c | 2 +- src/mmg3d/mmg3d1_pattern.c | 2 +- src/mmg3d/mmg3d3.c | 2 +- src/mmg3d/movpt_3d.c | 2 +- src/mmg3d/optlap_3d.c | 2 +- src/mmg3d/opttyp_3d.c | 2 +- src/mmg3d/quality_3d.c | 2 +- src/mmg3d/split_3d.c | 2 +- src/mmg3d/swap_3d.c | 2 +- src/mmg3d/swapgen_3d.c | 2 +- 21 files changed, 17 insertions(+), 21 deletions(-) rename src/mmg3d/{inlined_functions_3d.h => inlined_functions_3d_private.h} (99%) diff --git a/src/common/inlined_functions_private.h b/src/common/inlined_functions_private.h index e613f8e15..dfc4ab7d1 100644 --- a/src/common/inlined_functions_private.h +++ b/src/common/inlined_functions_private.h @@ -22,7 +22,6 @@ */ /** - * \file common/inlined_functions.h * \brief inlined Functions * \author Charles Dapogny (UPMC) * \author Cécile Dobrzynski (Bx INP/Inria/UBordeaux) diff --git a/src/common/libmmgcommon_private.h b/src/common/libmmgcommon_private.h index d881f0d6c..88990733f 100644 --- a/src/common/libmmgcommon_private.h +++ b/src/common/libmmgcommon_private.h @@ -22,7 +22,6 @@ */ /** - * \file common/libmmgcommon.h * \brief API header for the common part of the MMG libraries. * \author Algiane Froehly (Inria/UBordeaux) * \version 5 diff --git a/src/common/librnbg_private.h b/src/common/librnbg_private.h index a069236b4..c7db0f606 100644 --- a/src/common/librnbg_private.h +++ b/src/common/librnbg_private.h @@ -21,7 +21,6 @@ ** ============================================================================= */ /** - * \file common/librnbg.h * \brief header file for the librnbg.c librnbg_s.c librnbg_3d.c files * \author Cedric Lachat (Inria/UBordeaux) * \version 5 diff --git a/src/mmg3d/API_functions_3d.c b/src/mmg3d/API_functions_3d.c index a04d55b9b..351ed86e1 100644 --- a/src/mmg3d/API_functions_3d.c +++ b/src/mmg3d/API_functions_3d.c @@ -40,7 +40,7 @@ #include "libmmg3d.h" #include "libmmg3d_private.h" -#include "inlined_functions_3d.h" +#include "inlined_functions_3d_private.h" #include "PRoctree_3d_private.h" int MMG3D_Init_mesh(const int starter,...) { diff --git a/src/mmg3d/anisomovpt_3d.c b/src/mmg3d/anisomovpt_3d.c index cf283f6c8..a101fe717 100644 --- a/src/mmg3d/anisomovpt_3d.c +++ b/src/mmg3d/anisomovpt_3d.c @@ -34,7 +34,7 @@ */ #include "libmmg3d.h" -#include "inlined_functions_3d.h" +#include "inlined_functions_3d_private.h" #include "mmg3dexterns_private.h" #include "mmgexterns_private.h" diff --git a/src/mmg3d/anisosiz_3d.c b/src/mmg3d/anisosiz_3d.c index f59035810..2fb074420 100644 --- a/src/mmg3d/anisosiz_3d.c +++ b/src/mmg3d/anisosiz_3d.c @@ -34,7 +34,7 @@ */ #include "libmmg3d.h" -#include "inlined_functions_3d.h" +#include "inlined_functions_3d_private.h" #include "mmg3dexterns_private.h" #include "mmgexterns_private.h" diff --git a/src/mmg3d/colver_3d.c b/src/mmg3d/colver_3d.c index 797b75b45..402ca4f0e 100644 --- a/src/mmg3d/colver_3d.c +++ b/src/mmg3d/colver_3d.c @@ -33,7 +33,7 @@ * \todo doxygen documentation. */ -#include "inlined_functions_3d.h" +#include "inlined_functions_3d_private.h" #include "mmg3dexterns_private.h" extern int8_t ddb; diff --git a/src/mmg3d/delaunay_3d.c b/src/mmg3d/delaunay_3d.c index 2116de014..5db5c0391 100644 --- a/src/mmg3d/delaunay_3d.c +++ b/src/mmg3d/delaunay_3d.c @@ -32,7 +32,7 @@ * \todo doxygen documentation. */ -#include "inlined_functions_3d.h" +#include "inlined_functions_3d_private.h" #ifndef MMG_PATTERN diff --git a/src/mmg3d/inlined_functions_3d.h b/src/mmg3d/inlined_functions_3d_private.h similarity index 99% rename from src/mmg3d/inlined_functions_3d.h rename to src/mmg3d/inlined_functions_3d_private.h index 3667218e5..3c4cbf948 100644 --- a/src/mmg3d/inlined_functions_3d.h +++ b/src/mmg3d/inlined_functions_3d_private.h @@ -22,7 +22,6 @@ */ /** - * \file mmg3d/inlined_functions_3d.h * \brief inlined Functions * \author Charles Dapogny (UPMC) * \author Cécile Dobrzynski (Bx INP/Inria/UBordeaux) diff --git a/src/mmg3d/libmmg3d.c b/src/mmg3d/libmmg3d.c index 306e5d65f..a90366d2d 100644 --- a/src/mmg3d/libmmg3d.c +++ b/src/mmg3d/libmmg3d.c @@ -40,7 +40,7 @@ */ #include "libmmg3d.h" -#include "inlined_functions_3d.h" +#include "inlined_functions_3d_private.h" #include "mmg3dexterns_private.h" #include "mmgexterns_private.h" diff --git a/src/mmg3d/libmmg3d_tools.c b/src/mmg3d/libmmg3d_tools.c index 7eeba9de7..c62836eef 100644 --- a/src/mmg3d/libmmg3d_tools.c +++ b/src/mmg3d/libmmg3d_tools.c @@ -32,7 +32,7 @@ #include "libmmg3d.h" #include "mmgcommon_private.h" -#include "inlined_functions_3d.h" +#include "inlined_functions_3d_private.h" #include "mmgversion.h" #include "mmg3dexterns_private.h" #include "mmgexterns_private.h" diff --git a/src/mmg3d/mmg3d1.c b/src/mmg3d/mmg3d1.c index e6e9d9096..376b76747 100644 --- a/src/mmg3d/mmg3d1.c +++ b/src/mmg3d/mmg3d1.c @@ -37,7 +37,7 @@ */ #include "libmmg3d.h" -#include "inlined_functions_3d.h" +#include "inlined_functions_3d_private.h" #include "mmgexterns_private.h" #include "mmg3dexterns_private.h" diff --git a/src/mmg3d/mmg3d1_pattern.c b/src/mmg3d/mmg3d1_pattern.c index d73a06a7e..41b676887 100644 --- a/src/mmg3d/mmg3d1_pattern.c +++ b/src/mmg3d/mmg3d1_pattern.c @@ -37,7 +37,7 @@ */ #include "libmmg3d.h" -#include "inlined_functions_3d.h" +#include "inlined_functions_3d_private.h" #include "mmg3dexterns_private.h" /** diff --git a/src/mmg3d/mmg3d3.c b/src/mmg3d/mmg3d3.c index 25e100ae4..369c1abbe 100644 --- a/src/mmg3d/mmg3d3.c +++ b/src/mmg3d/mmg3d3.c @@ -35,7 +35,7 @@ #include "libmmg3d.h" #include "libmmg3d_private.h" -#include "inlined_functions_3d.h" +#include "inlined_functions_3d_private.h" #include "mmg3dexterns_private.h" #define MMG5_DEGTOL 1.e-1 diff --git a/src/mmg3d/movpt_3d.c b/src/mmg3d/movpt_3d.c index 05c311b36..5e7bcda9d 100644 --- a/src/mmg3d/movpt_3d.c +++ b/src/mmg3d/movpt_3d.c @@ -34,7 +34,7 @@ */ #include "libmmg3d.h" -#include "inlined_functions_3d.h" +#include "inlined_functions_3d_private.h" #include "mmg3dexterns_private.h" #include "mmgexterns_private.h" diff --git a/src/mmg3d/optlap_3d.c b/src/mmg3d/optlap_3d.c index 32214389e..c6f5bbff5 100644 --- a/src/mmg3d/optlap_3d.c +++ b/src/mmg3d/optlap_3d.c @@ -32,7 +32,7 @@ */ #include "libmmg3d.h" -#include "inlined_functions_3d.h" +#include "inlined_functions_3d_private.h" #include "mmg3dexterns_private.h" /** diff --git a/src/mmg3d/opttyp_3d.c b/src/mmg3d/opttyp_3d.c index 60611f3be..f0aabbb6b 100644 --- a/src/mmg3d/opttyp_3d.c +++ b/src/mmg3d/opttyp_3d.c @@ -31,7 +31,7 @@ */ #include "libmmg3d.h" -#include "inlined_functions_3d.h" +#include "inlined_functions_3d_private.h" /** * \param mesh pointer toward the mesh structure. diff --git a/src/mmg3d/quality_3d.c b/src/mmg3d/quality_3d.c index 6ad5b796e..35d2e42d9 100644 --- a/src/mmg3d/quality_3d.c +++ b/src/mmg3d/quality_3d.c @@ -33,7 +33,7 @@ */ #include "libmmg3d.h" -#include "inlined_functions_3d.h" +#include "inlined_functions_3d_private.h" #include "mmg3dexterns_private.h" extern int8_t ddb; diff --git a/src/mmg3d/split_3d.c b/src/mmg3d/split_3d.c index 2b98b2157..67fc08fa6 100644 --- a/src/mmg3d/split_3d.c +++ b/src/mmg3d/split_3d.c @@ -34,7 +34,7 @@ */ #include "libmmg3d.h" -#include "inlined_functions_3d.h" +#include "inlined_functions_3d_private.h" #include "mmg3dexterns_private.h" extern int8_t ddb; diff --git a/src/mmg3d/swap_3d.c b/src/mmg3d/swap_3d.c index d426af319..4b9335d1b 100644 --- a/src/mmg3d/swap_3d.c +++ b/src/mmg3d/swap_3d.c @@ -33,7 +33,7 @@ */ #include "libmmg3d.h" -#include "inlined_functions_3d.h" +#include "inlined_functions_3d_private.h" #include "mmg3dexterns_private.h" extern int8_t ddb; diff --git a/src/mmg3d/swapgen_3d.c b/src/mmg3d/swapgen_3d.c index e53631b81..26329b7bc 100644 --- a/src/mmg3d/swapgen_3d.c +++ b/src/mmg3d/swapgen_3d.c @@ -33,7 +33,7 @@ */ #include "libmmg3d.h" -#include "inlined_functions_3d.h" +#include "inlined_functions_3d_private.h" #include "mmg3dexterns_private.h" /** From 971161009d58c770a5cb68b34d71c26693e3b763 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Sat, 10 Dec 2022 16:59:10 +0100 Subject: [PATCH 825/838] Fix probable broken parallel compilation if perl not found (not tested). --- cmake/modules/macros.cmake | 12 +++++------- cmake/modules/mmgcommon.cmake | 9 +++++++++ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/cmake/modules/macros.cmake b/cmake/modules/macros.cmake index 7b282f91d..4855344b9 100644 --- a/cmake/modules/macros.cmake +++ b/cmake/modules/macros.cmake @@ -92,6 +92,9 @@ MACRO ( COPY_HEADERS_AND_CREATE_TARGET ${source_dir} mmg${target_identifier}_export ${include_dir} ${target_identifier}) + SET ( tgt_list + copy${target_identifier}_libmmg${target_identifier} + copy${target_identifier}_mmg${target_identifier}_export ) if (PERL_FOUND) COPY_HEADER ( @@ -99,17 +102,12 @@ MACRO ( COPY_HEADERS_AND_CREATE_TARGET ${include_dir} libmmg${target_identifier}f.h mmg${target_identifier}_fortran_header copy_libmmg${target_identifier}f ) - SET ( tgt_list copy_libmmg${target_identifier}f copymmgcommon_libmmgtypesf - copy${target_identifier}_libmmg${target_identifier} copymmgcommon_libmmgtypes - copy${target_identifier}_mmg${target_identifier}_export - copymmgcommon_mmgcmakedefines copymmgcommon_mmgcmakedefinesf - copymmgcommon_mmgversion - copymmgcommon_mmg_export ) + LIST ( APPEND tgt_list copy_libmmg${target_identifier}f ) endif (PERL_FOUND) ADD_CUSTOM_TARGET (copy_${target_identifier}_headers ALL - DEPENDS ${tgt_list} ) + DEPENDS ${tgt_list} copy_mmgcommon_headers) ENDMACRO ( ) diff --git a/cmake/modules/mmgcommon.cmake b/cmake/modules/mmgcommon.cmake index ae7e905c3..c3d988b4d 100644 --- a/cmake/modules/mmgcommon.cmake +++ b/cmake/modules/mmgcommon.cmake @@ -79,11 +79,17 @@ COPY_HEADER ( COPY_1_HEADER_AND_CREATE_TARGET( ${MMGCOMMON_BINARY_DIR} mmgversion ${MMGCOMMON_INCLUDE} "mmgcommon") +SET ( tgt_list copymmgcommon_libmmgtypes copymmgcommon_mmgcmakedefines + copymmgcommon_mmg_export copymmgcommon_mmgcmakedefinesf + copymmgcommon_mmgversion ) + if (PERL_FOUND) COPY_HEADER ( ${MMGCOMMON_BINARY_DIR} libmmgtypesf.h ${MMGCOMMON_INCLUDE} libmmgtypesf.h mmg_fortran_header copymmgcommon_libmmgtypesf ) + + LIST ( APPEND tgt_list copymmgcommon_libmmgtypesf ) endif() IF (NOT WIN32 OR MINGW) @@ -94,3 +100,6 @@ IF (NOT WIN32 OR MINGW) LIST ( APPEND tgt_list copymmgcommon_mmggithash) ENDIF () + +ADD_CUSTOM_TARGET (copy_mmgcommon_headers ALL + DEPENDS ${tgt_list} ) From 9f98ef4050a59b56e651e1641e07b2b1253917c0 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Sat, 10 Dec 2022 17:30:29 +0100 Subject: [PATCH 826/838] Add MMG_INSTALL_PRIVATE_HEADERS option to install private headers of Mmg. --- CMakeLists.txt | 2 +- cmake/modules/add-mmg-options.cmake | 4 +++ cmake/modules/macros.cmake | 14 ++++++++- cmake/modules/mmg2d.cmake | 7 +++++ cmake/modules/mmg3d.cmake | 21 +++++++++++++ cmake/modules/mmgcommon.cmake | 47 +++++++++++++++++++++++++++++ cmake/modules/mmgs.cmake | 7 +++++ 7 files changed, 100 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2985dae66..bfb3df3ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -273,7 +273,7 @@ SET(CMAKE_MACOSX_RPATH 1) ############################################################################### ##### -##### Add dependent options +##### Add Mmg options ##### ############################################################################### diff --git a/cmake/modules/add-mmg-options.cmake b/cmake/modules/add-mmg-options.cmake index 09b5d8b9e..11b379217 100644 --- a/cmake/modules/add-mmg-options.cmake +++ b/cmake/modules/add-mmg-options.cmake @@ -116,3 +116,7 @@ CMAKE_DEPENDENT_OPTION ( CMAKE_DEPENDENT_OPTION( MMG_CI "Enable/Disable test execution for mmg library" ON "BUILD_TESTING;BUILD_MMG" OFF) + +#---------------------- install provate headers for library built on top of Mmg +OPTION ( MMG_INSTALL_PRIVATE_HEADERS + "Install private headers of Mmg (use at your own risk)" OFF ) diff --git a/cmake/modules/macros.cmake b/cmake/modules/macros.cmake index 4855344b9..f19ab090c 100644 --- a/cmake/modules/macros.cmake +++ b/cmake/modules/macros.cmake @@ -105,9 +105,21 @@ MACRO ( COPY_HEADERS_AND_CREATE_TARGET LIST ( APPEND tgt_list copy_libmmg${target_identifier}f ) endif (PERL_FOUND) + IF ( MMG_INSTALL_PRIVATE_HEADERS ) + COPY_1_HEADER_AND_CREATE_TARGET( + ${source_dir} libmmg${target_identifier}_private + ${include_dir} ${target_identifier}) + COPY_1_HEADER_AND_CREATE_TARGET( + ${source_dir} mmg${target_identifier}externs_private + ${include_dir} ${target_identifier}) + + LIST ( APPEND tgt_list copy${target_identifier}_libmmg${target_identifier}_private + copy${target_identifier}_mmg${target_identifier}externs_private + ) + ENDIF() ADD_CUSTOM_TARGET (copy_${target_identifier}_headers ALL - DEPENDS ${tgt_list} copy_mmgcommon_headers) + DEPENDS ${tgt_list} ${tgt_opt_list} copy_mmgcommon_headers) ENDMACRO ( ) diff --git a/cmake/modules/mmg2d.cmake b/cmake/modules/mmg2d.cmake index f9e8b4ca9..b4c6b1e8c 100644 --- a/cmake/modules/mmg2d.cmake +++ b/cmake/modules/mmg2d.cmake @@ -120,6 +120,13 @@ SET( mmg2d_headers ${MMG2D_BINARY_DIR}/libmmg2df.h ) +IF ( MMG_INSTALL_PRIVATE_HEADERS ) + LIST ( APPEND mmg2d_headers + ${MMG2D_SOURCE_DIR}/libmmg2d_private.h + ${MMG2D_SOURCE_DIR}/mmg2dexterns_private.h + ) +ENDIF() + # install man pages INSTALL(FILES ${PROJECT_SOURCE_DIR}/doc/man/mmg2d.1.gz DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) diff --git a/cmake/modules/mmg3d.cmake b/cmake/modules/mmg3d.cmake index bd53bede8..0adab9aa7 100644 --- a/cmake/modules/mmg3d.cmake +++ b/cmake/modules/mmg3d.cmake @@ -147,12 +147,33 @@ SET( mmg3d_headers ${MMG3D_BINARY_DIR}/libmmg3df.h ) +IF ( MMG_INSTALL_PRIVATE_HEADERS ) + LIST ( APPEND mmg3d_headers + ${MMG3D_SOURCE_DIR}/libmmg3d_private.h + ${MMG3D_SOURCE_DIR}/inlined_functions_3d_private.h + ${MMG3D_SOURCE_DIR}/mmg3dexterns_private.h + ${MMG3D_SOURCE_DIR}/PRoctree_3d_private.h + ) +ENDIF() + # install man pages INSTALL(FILES ${PROJECT_SOURCE_DIR}/doc/man/mmg3d.1.gz DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) # Install header files in /usr/local or equivalent INSTALL(FILES ${mmg3d_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mmg/mmg3d COMPONENT headers) +IF ( MMG_INSTALL_PRIVATE_HEADERS ) + COPY_1_HEADER_AND_CREATE_TARGET( + ${MMG3D_SOURCE_DIR} inlined_functions_3d_private ${MMG3D_INCLUDE} 3d) + + COPY_1_HEADER_AND_CREATE_TARGET( + ${MMG3D_SOURCE_DIR} PRoctree_3d_private ${MMG3D_INCLUDE} 3d) + + LIST ( APPEND tgt_opt_list copy3d_inlined_functions_3d_private + copy3d_PRoctree_3d_private ) + +ENDIF() + # Copy header files in project directory at build step COPY_HEADERS_AND_CREATE_TARGET ( ${MMG3D_SOURCE_DIR} ${MMG3D_BINARY_DIR} ${MMG3D_INCLUDE} 3d ) diff --git a/cmake/modules/mmgcommon.cmake b/cmake/modules/mmgcommon.cmake index c3d988b4d..00176b8fb 100644 --- a/cmake/modules/mmgcommon.cmake +++ b/cmake/modules/mmgcommon.cmake @@ -52,6 +52,20 @@ SET( mmgcommon_headers ${MMGCOMMON_BINARY_DIR}/mmgcmakedefinesf.h ${MMGCOMMON_BINARY_DIR}/mmgversion.h ) +IF ( MMG_INSTALL_PRIVATE_HEADERS ) + LIST ( APPEND mmgcommon_headers + ${MMGCOMMON_SOURCE_DIR}/libmmgcommon_private.h + ${MMGCOMMON_SOURCE_DIR}/mmgcommon_private.h + ${MMGCOMMON_SOURCE_DIR}/mmg_core_export_private.h + ${MMGCOMMON_SOURCE_DIR}/inlined_functions_private.h + ${MMGCOMMON_SOURCE_DIR}/mmgexterns_private.h + ${MMGCOMMON_SOURCE_DIR}/librnbg_private.h + ${MMGCOMMON_SOURCE_DIR}/chrono_private.h + ${MMGCOMMON_SOURCE_DIR}/eigenv_private.h + ) +ENDIF() + + IF (NOT WIN32 OR MINGW) LIST(APPEND mmgcommon_headers ${MMGCOMMON_BINARY_DIR}/git_log_mmg.h ) ENDIF() @@ -101,5 +115,38 @@ IF (NOT WIN32 OR MINGW) LIST ( APPEND tgt_list copymmgcommon_mmggithash) ENDIF () +IF ( MMG_INSTALL_PRIVATE_HEADERS ) + COPY_1_HEADER_AND_CREATE_TARGET( + ${MMGCOMMON_SOURCE_DIR} libmmgcommon_private ${MMGCOMMON_INCLUDE} "mmgcommon") + + COPY_1_HEADER_AND_CREATE_TARGET( + ${MMGCOMMON_SOURCE_DIR} mmgcommon_private ${MMGCOMMON_INCLUDE} "mmgcommon") + + COPY_1_HEADER_AND_CREATE_TARGET( + ${MMGCOMMON_SOURCE_DIR} mmg_core_export_private ${MMGCOMMON_INCLUDE} "mmgcommon") + + COPY_1_HEADER_AND_CREATE_TARGET( + ${MMGCOMMON_SOURCE_DIR} inlined_functions_private ${MMGCOMMON_INCLUDE} "mmgcommon") + + COPY_1_HEADER_AND_CREATE_TARGET( + ${MMGCOMMON_SOURCE_DIR} mmgexterns_private ${MMGCOMMON_INCLUDE} "mmgcommon") + + COPY_1_HEADER_AND_CREATE_TARGET( + ${MMGCOMMON_SOURCE_DIR} librnbg_private ${MMGCOMMON_INCLUDE} "mmgcommon") + + COPY_1_HEADER_AND_CREATE_TARGET( + ${MMGCOMMON_SOURCE_DIR} chrono_private ${MMGCOMMON_INCLUDE} "mmgcommon") + + COPY_1_HEADER_AND_CREATE_TARGET( + ${MMGCOMMON_SOURCE_DIR} eigenv_private ${MMGCOMMON_INCLUDE} "mmgcommon") + + LIST ( APPEND tgt_list copymmgcommon_libmmgcommon_private + copymmgcommon_mmgcommon_private copymmgcommon_mmg_core_export_private + copymmgcommon_inlined_functions_private copymmgcommon_mmgexterns_private + copymmgcommon_librnbg_private copymmgcommon_chrono_private + copymmgcommon_eigenv_private ) + +ENDIF() + ADD_CUSTOM_TARGET (copy_mmgcommon_headers ALL DEPENDS ${tgt_list} ) diff --git a/cmake/modules/mmgs.cmake b/cmake/modules/mmgs.cmake index fc3f85293..bc8957fc6 100644 --- a/cmake/modules/mmgs.cmake +++ b/cmake/modules/mmgs.cmake @@ -112,6 +112,13 @@ SET( mmgs_headers ${MMGS_BINARY_DIR}/libmmgsf.h ) +IF ( MMG_INSTALL_PRIVATE_HEADERS ) + LIST ( APPEND mmgs_headers + ${MMGS_SOURCE_DIR}/libmmgs_private.h + ${MMGS_SOURCE_DIR}/mmgsexterns_private.h + ) +ENDIF() + # install man pages INSTALL(FILES ${PROJECT_SOURCE_DIR}/doc/man/mmgs.1.gz DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) From f3c20cb1b8e638208880efc99ff3597c747f39ee Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Sun, 11 Dec 2022 15:22:52 +0100 Subject: [PATCH 827/838] CMake/Compilation improvement. - Add missing copy of vtkparser.hpp file in private headers. - update FindMmg*.cmake tips files - rename githash targets. --- CMakeLists.txt | 2 +- cmake/modules/macros.cmake | 4 ++-- cmake/modules/mmgcommon.cmake | 15 +++++++++++++-- cmake/tools/FindMMG.cmake | 10 +++++----- cmake/tools/FindMMG2D.cmake | 12 +++++++----- cmake/tools/FindMMG3D.cmake | 10 +++++----- cmake/tools/FindMMGS.cmake | 10 +++++----- 7 files changed, 38 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bfb3df3ac..eafa8a4fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -123,7 +123,7 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/src/common/mmgversion.h.in # Print git hash to source file IF (NOT WIN32 OR MINGW) - ADD_CUSTOM_TARGET(GenerateGitHash + ADD_CUSTOM_TARGET(GenerateGitHashMmg COMMAND ./git_log_mmg.sh ${PROJECT_SOURCE_DIR} ${MMGCOMMON_BINARY_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/scripts/ COMMENT "Getting git commit hash" diff --git a/cmake/modules/macros.cmake b/cmake/modules/macros.cmake index f19ab090c..07c0c7d6b 100644 --- a/cmake/modules/macros.cmake +++ b/cmake/modules/macros.cmake @@ -143,7 +143,7 @@ MACRO ( ADD_AND_INSTALL_LIBRARY ENDIF() IF (NOT WIN32 OR MINGW) - ADD_DEPENDENCIES(${target_name} GenerateGitHash) + ADD_DEPENDENCIES(${target_name} GenerateGitHashMmg) ENDIF() ADD_DEPENDENCIES( ${target_name} ${target_dependencies}) @@ -228,7 +228,7 @@ MACRO ( ADD_AND_INSTALL_EXECUTABLE ENDIF ( ) IF (NOT WIN32 OR MINGW) - ADD_DEPENDENCIES(${exec_name} GenerateGitHash) + ADD_DEPENDENCIES(${exec_name} GenerateGitHashMmg) endif() ADD_DEPENDENCIES(${exec_name} ${target_dependencies}) diff --git a/cmake/modules/mmgcommon.cmake b/cmake/modules/mmgcommon.cmake index 00176b8fb..9cac9fa4e 100644 --- a/cmake/modules/mmgcommon.cmake +++ b/cmake/modules/mmgcommon.cmake @@ -62,6 +62,7 @@ IF ( MMG_INSTALL_PRIVATE_HEADERS ) ${MMGCOMMON_SOURCE_DIR}/librnbg_private.h ${MMGCOMMON_SOURCE_DIR}/chrono_private.h ${MMGCOMMON_SOURCE_DIR}/eigenv_private.h + ${MMGCOMMON_SOURCE_DIR}/vtkparser.hpp ) ENDIF() @@ -110,7 +111,7 @@ IF (NOT WIN32 OR MINGW) COPY_HEADER ( ${MMGCOMMON_BINARY_DIR} git_log_mmg.h ${MMGCOMMON_INCLUDE} git_log_mmg.h - GenerateGitHash copymmgcommon_mmggithash ) + GenerateGitHashMmg copymmgcommon_mmggithash ) LIST ( APPEND tgt_list copymmgcommon_mmggithash) ENDIF () @@ -140,11 +141,21 @@ IF ( MMG_INSTALL_PRIVATE_HEADERS ) COPY_1_HEADER_AND_CREATE_TARGET( ${MMGCOMMON_SOURCE_DIR} eigenv_private ${MMGCOMMON_INCLUDE} "mmgcommon") + ADD_CUSTOM_TARGET(mmgcommon_vtkparser_header ALL + DEPENDS + ${MMGCOMMON_SOURCE_DIR}/vtkparser.hpp ) + + COPY_HEADER ( + ${MMGCOMMON_SOURCE_DIR} vtkparser.hpp + ${MMGCOMMON_INCLUDE} vtkparser.hpp + mmgcommon_vtkparser_header copymmgcommon_vtkparser ) + + LIST ( APPEND tgt_list copymmgcommon_libmmgcommon_private copymmgcommon_mmgcommon_private copymmgcommon_mmg_core_export_private copymmgcommon_inlined_functions_private copymmgcommon_mmgexterns_private copymmgcommon_librnbg_private copymmgcommon_chrono_private - copymmgcommon_eigenv_private ) + copymmgcommon_eigenv_private copymmgcommon_vtkparser) ENDIF() diff --git a/cmake/tools/FindMMG.cmake b/cmake/tools/FindMMG.cmake index d4dfb2d66..68de238be 100644 --- a/cmake/tools/FindMMG.cmake +++ b/cmake/tools/FindMMG.cmake @@ -122,7 +122,7 @@ if(MMG_INCDIR) find_path(MMG_libmmgtypes.h_DIRS NAMES libmmgtypes.h HINTS ${MMG_INCDIR} - PATH_SUFFIXES "mmg" "mmg/mmg2d" "mmg/mmgs" "mmg/mmg3d" "mmg2d" + PATH_SUFFIXES "mmg" "mmg/mmg2d" "mmg/mmgs" "mmg/mmg3d" "mmg/common" "mmg2d" "mmgs" "mmg3d") elseif(MMG_BUILDDIR) set(MMG_libmmgtypes.h_DIRS "MMG_libmmgtypes.h_DIRS-NOTFOUND") @@ -130,7 +130,7 @@ elseif(MMG_BUILDDIR) NAMES libmmgtypes.h HINTS ${MMG_BUILDDIR} PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg2d" - "include/mmg/mmgs" "include/mmg/mmg3d") + "include/mmg/mmgs" "include/mmg/mmg3d" "include/mmg/common") else() if(MMG_DIR) set(MMG_libmmgtypes.h_DIRS "MMG_libmmgtypes.h_DIRS-NOTFOUND") @@ -139,13 +139,13 @@ else() NAMES */libmmgtypes.h HINTS ${MMG_BUILDDIR} PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg2d" - "include/mmg/mmgs" "include/mmg/mmg3d") + "include/mmg/mmgs" "include/mmg/mmg3d" "include/mmg/common") else() find_path(MMG_libmmgtypes.h_DIRS NAMES libmmgtypes.h HINTS ${MMG_DIR} ${MMG_BUILDDIR_INTERNAL} PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg2d" - "include/mmg/mmgs" "include/mmg/mmg3d") + "include/mmg/mmgs" "include/mmg/mmg3d" "include/mmg/common") endif() else() @@ -157,7 +157,7 @@ else() "mmgs" "mmg3d") endif() endif() -STRING(REGEX REPLACE "(mmg/mmg2d)|(mmg/mmgs)|(mmg/mmg3d)" "" +STRING(REGEX REPLACE "(mmg/mmg2d)|(mmg/mmgs)|(mmg/mmg3d)|(mmg/common)" "" MMG_libmmgtypes.h_DIRS ${MMG_libmmgtypes.h_DIRS}) mark_as_advanced(MMG_libmmgtypes.h_DIRS) diff --git a/cmake/tools/FindMMG2D.cmake b/cmake/tools/FindMMG2D.cmake index 67adc47f8..eb80c3cd7 100644 --- a/cmake/tools/FindMMG2D.cmake +++ b/cmake/tools/FindMMG2D.cmake @@ -128,7 +128,8 @@ elseif(MMG_BUILDDIR) find_path(MMG2D_libmmgtypes.h_DIRS NAMES libmmgtypes.h HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg2d") + PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg2d" + "mmg/common" "mmg" "mmg/mmg2d") else() if(MMG_DIR) set(MMG2D_libmmgtypes.h_DIRS "MMG2D_libmmgtypes.h_DIRS-NOTFOUND") @@ -136,12 +137,13 @@ else() find_path(MMG2D_libmmgtypes.h_DIRS NAMES */libmmgtypes.h HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg2d") + PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg2d" + "include/mmg/common") else() find_path(MMG2D_libmmgtypes.h_DIRS NAMES libmmgtypes.h HINTS ${MMG_DIR} ${MMG_BUILDDIR_INTERNAL} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg2d") + PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg2d" "include/mmg/common") endif() else() @@ -149,10 +151,10 @@ else() find_path(MMG2D_libmmgtypes.h_DIRS NAMES libmmgtypes.h HINTS ${_inc_env} - PATH_SUFFIXES "include/mmg" "include/mmg/mmg2d") + PATH_SUFFIXES "include/mmg" "include/mmg/mmg2d" "include/mmg/common") endif() endif() -STRING(REGEX REPLACE "(mmg/mmg2d)" "" +STRING(REGEX REPLACE "(mmg/mmg2d)|(mmg/common)" "" MMG2D_libmmgtypes.h_DIRS ${MMG2D_libmmgtypes.h_DIRS} ) mark_as_advanced(MMG2D_libmmgtypes.h_DIRS) diff --git a/cmake/tools/FindMMG3D.cmake b/cmake/tools/FindMMG3D.cmake index 1f6256b91..cf949a028 100644 --- a/cmake/tools/FindMMG3D.cmake +++ b/cmake/tools/FindMMG3D.cmake @@ -128,7 +128,7 @@ elseif(MMG_BUILDDIR) find_path(MMG3D_libmmgtypes.h_DIRS NAMES libmmgtypes.h HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg3d") + PATH_SUFFIXES "include" "include/mmg" "include/common" "include/mmg/mmg3d") else() if(MMG_DIR) set(MMG3D_libmmgtypes.h_DIRS "MMG3D_libmmgtypes.h_DIRS-NOTFOUND") @@ -136,12 +136,12 @@ else() find_path(MMG3D_libmmgtypes.h_DIRS NAMES */libmmgtypes.h HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg3d") + PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg3d" "include/mmg/common") else() find_path(MMG3D_libmmgtypes.h_DIRS NAMES libmmgtypes.h HINTS ${MMG_DIR} ${MMG_BUILDDIR_INTERNAL} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg3d") + PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg3d" "include/mmg/common") endif() else() @@ -149,10 +149,10 @@ else() find_path(MMG3D_libmmgtypes.h_DIRS NAMES libmmgtypes.h HINTS ${_inc_env} - PATH_SUFFIXES "include/mmg" "include/mmg/mmg3d") + PATH_SUFFIXES "include/mmg" "include/mmg/mmg3d" "mmg" "mmg/common" "mmg/mmg3d" ) endif() endif() -STRING(REGEX REPLACE "(mmg/mmg3d)" "" +STRING(REGEX REPLACE "(mmg/mmg3d)|(mmg/common)" "" MMG3D_libmmgtypes.h_DIRS ${MMG3D_libmmgtypes.h_DIRS} ) mark_as_advanced(MMG3D_libmmgtypes.h_DIRS) diff --git a/cmake/tools/FindMMGS.cmake b/cmake/tools/FindMMGS.cmake index f8fe09b12..5c17436ff 100644 --- a/cmake/tools/FindMMGS.cmake +++ b/cmake/tools/FindMMGS.cmake @@ -128,7 +128,7 @@ elseif(MMG_BUILDDIR) find_path(MMGS_libmmgtypes.h_DIRS NAMES libmmgtypes.h HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmgs") + PATH_SUFFIXES "include" "include/mmg" "include/common" "include/mmg/mmgs") else() if(MMG_DIR) set(MMGS_libmmgtypes.h_DIRS "MMGS_libmmgtypes.h_DIRS-NOTFOUND") @@ -136,12 +136,12 @@ else() find_path(MMGS_libmmgtypes.h_DIRS NAMES */libmmgtypes.h HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmgs") + PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmgs" "include/mmg/common") else() find_path(MMGS_libmmgtypes.h_DIRS NAMES libmmgtypes.h HINTS ${MMG_DIR} ${MMG_BUILDDIR_INTERNAL} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmgs") + PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmgs" "include/mmg/common") endif() else() @@ -149,10 +149,10 @@ else() find_path(MMGS_libmmgtypes.h_DIRS NAMES libmmgtypes.h HINTS ${_inc_env} - PATH_SUFFIXES "include/mmg" "include/mmg/mmgs") + PATH_SUFFIXES "include/mmg" "include/mmg/mmgs" "mmg" "mmg/common" "mmg/mmgs" ) endif() endif() -STRING(REGEX REPLACE "(mmg/mmgs)" "" +STRING(REGEX REPLACE "(mmg/mmgs)|(mmg/common)" "" MMGS_libmmgtypes.h_DIRS ${MMGS_libmmgtypes.h_DIRS} ) mark_as_advanced(MMGS_libmmgtypes.h_DIRS) From c6ecaabff5266b9d329fd71407192fadd633ba22 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Sun, 11 Dec 2022 18:27:04 +0100 Subject: [PATCH 828/838] Update FindMMG.cmake tips files. --- cmake/tools/FindMMG.cmake | 101 ++++++---------------------------- cmake/tools/FindMMG2D.cmake | 104 +++++++----------------------------- cmake/tools/FindMMG3D.cmake | 102 +++++++---------------------------- cmake/tools/FindMMGS.cmake | 102 +++++++---------------------------- 4 files changed, 74 insertions(+), 335 deletions(-) diff --git a/cmake/tools/FindMMG.cmake b/cmake/tools/FindMMG.cmake index 68de238be..147e7e8bc 100644 --- a/cmake/tools/FindMMG.cmake +++ b/cmake/tools/FindMMG.cmake @@ -34,13 +34,12 @@ # MMG_LIBRARIES - mmg component libraries to be linked # # The user can give specific paths where to find the libraries adding cmake -# options at configure (ex: cmake path/to/project -DMMG_DIR=path/to/mmg): +# options at configure (ex: cmake path/to/project -DMMG_DIR=path/to/mmg/install): # MMG_DIR - Where to find the base directory of mmg -# MMG_INCDIR - Where to find the header files +# MMG_INCDIR - Path toward Mmg installation (should at least contains mmg/common filder) # MMG_LIBDIR - Where to find the library files -# MMG_BUILDDIR - Where to find the build directory of Mmg # The module can also look for the following environment variables if paths -# are not given as cmake variable: MMG_DIR, MMG_INCDIR, MMG_LIBDIR, MMG_BUILDDIR +# are not given as cmake variable: MMG_DIR, MMG_INCDIR, MMG_LIBDIR if (NOT MMG_FOUND) set(MMG_DIR "" CACHE PATH "Installation directory of MMG library") @@ -49,25 +48,6 @@ if (NOT MMG_FOUND) endif() endif() -# Looking for the Mmg build directory -# ----------------------------------- -set(ENV_MMG_BUILDDIR "$ENV{MMG_BUILDDIR}") - -if ( NOT MMG_BUILDDIR ) - FIND_PATH(MMG_BUILDDIR_INTERNAL - NAMES src/common/mmgcmakedefines.h - HINTS ${ENV_MMG_BUILDDIR} ${MMG_DIR} ${ENV_MMG_DIR} - PATH_SUFFIXES build Build BUILD builds Builds BUILDS - DOC "The mmg build directory" - ) -else () - set(MMG_BUILDDIR_INTERNAL "${MMG_BUILDDIR}") -endif() - -if ( NOT MMG_BUILDDIR AND MMG_BUILDDIR_INTERNAL ) - SET ( MMG_BUILDDIR "${MMG_BUILDDIR_INTERNAL}" ) -endif ( ) - # Looking for include # ------------------- @@ -79,22 +59,10 @@ set(ENV_MMG_INCDIR "$ENV{MMG_INCDIR}") if(ENV_MMG_INCDIR) list(APPEND _inc_env "${ENV_MMG_INCDIR}") -elseif(ENV_MMG_BUILDDIR) - list(APPEND _inc_env "${ENV_MMG_BUILDDIR}/include") - list(APPEND _inc_env "${ENV_MMG_BUILDDIR}/include/mmg") elseif(ENV_MMG_DIR) - if ( MMG_BUILDDIR ) - list(APPEND _inc_env "${MMG_BUILDDIR}/include") - list(APPEND _inc_env "${MMG_BUILDDIR}/include/mmg") - else ( ) - list(APPEND _inc_env "${ENV_MMG_DIR}") - list(APPEND _inc_env "${ENV_MMG_DIR}/include") - list(APPEND _inc_env "${ENV_MMG_DIR}/include/mmg") - if ( MMG_BUILDDIR_INTERNAL ) - list(APPEND _inc_env "${MMG_BUILDDIR_INTERNAL}/include") - list(APPEND _inc_env "${MMG_BUILDDIR_INTERNAL}/include/mmg") - endif() - endif() + list(APPEND _inc_env "${ENV_MMG_DIR}") + list(APPEND _inc_env "${ENV_MMG_DIR}/include") + list(APPEND _inc_env "${ENV_MMG_DIR}/include/mmg") else() if(WIN32) string(REPLACE ":" ";" _inc_env "$ENV{INCLUDE}") @@ -124,37 +92,19 @@ if(MMG_INCDIR) HINTS ${MMG_INCDIR} PATH_SUFFIXES "mmg" "mmg/mmg2d" "mmg/mmgs" "mmg/mmg3d" "mmg/common" "mmg2d" "mmgs" "mmg3d") -elseif(MMG_BUILDDIR) - set(MMG_libmmgtypes.h_DIRS "MMG_libmmgtypes.h_DIRS-NOTFOUND") - find_path(MMG_libmmgtypes.h_DIRS - NAMES libmmgtypes.h - HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg2d" - "include/mmg/mmgs" "include/mmg/mmg3d" "include/mmg/common") else() if(MMG_DIR) set(MMG_libmmgtypes.h_DIRS "MMG_libmmgtypes.h_DIRS-NOTFOUND") - if ( MMG_BUILDDIR ) - find_path(MMG_libmmgtypes.h_DIRS - NAMES */libmmgtypes.h - HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg2d" - "include/mmg/mmgs" "include/mmg/mmg3d" "include/mmg/common") - else() - find_path(MMG_libmmgtypes.h_DIRS - NAMES libmmgtypes.h - HINTS ${MMG_DIR} ${MMG_BUILDDIR_INTERNAL} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg2d" - "include/mmg/mmgs" "include/mmg/mmg3d" "include/mmg/common") - endif() - + find_path(MMG_libmmgtypes.h_DIRS + NAMES libmmgtypes.h + HINTS ${MMG_DIR}/include + PATH_SUFFIXES "mmg" "mmg/common") else() set(MMG_libmmgtypes.h_DIRS "MMG_libmmgtypes.h_DIRS-NOTFOUND") find_path(MMG_libmmgtypes.h_DIRS NAMES libmmgtypes.h HINTS ${_inc_env} - PATH_SUFFIXES "mmg" "mmg/mmg2d" "mmg/mmgs" "mmg/mmg3d" "mmg2d" - "mmgs" "mmg3d") + PATH_SUFFIXES "mmg" "mmg/common") endif() endif() STRING(REGEX REPLACE "(mmg/mmg2d)|(mmg/mmgs)|(mmg/mmg3d)|(mmg/common)" "" @@ -184,19 +134,9 @@ unset(_lib_env) set(ENV_MMG_LIBDIR "$ENV{MMG_LIBDIR}") if(ENV_MMG_LIBDIR) list(APPEND _lib_env "${ENV_MMG_LIBDIR}") -elseif(ENV_MMG_BUILDDIR) - list(APPEND _lib_env "${ENV_MMG_BUILDDIR}") - list(APPEND _lib_env "${ENV_MMG_BUILDDIR}/lib") elseif(ENV_MMG_DIR) - if ( MMG_BUILDDIR ) - list(APPEND _lib_env "${MMG_BUILDDIR}/lib") - else ( ) - list(APPEND _lib_env "${ENV_MMG_DIR}") - list(APPEND _lib_env "${ENV_MMG_DIR}/lib") - if ( MMG_BUILDDIR_INTERNAL ) - list(APPEND _lib_env "${MMG_BUILDDIR_INTERNAL}/lib") - endif() - endif() + list(APPEND _lib_env "${ENV_MMG_DIR}") + list(APPEND _lib_env "${ENV_MMG_DIR}/lib") else() if(WIN32) string(REPLACE ":" ";" _lib_env "$ENV{LIB}") @@ -224,17 +164,10 @@ else() if(MMG_DIR) set(MMG_mmg_LIBRARY "MMG_mmg_LIBRARY-NOTFOUND") - if ( MMG_BUILDDIR ) - find_library(MMG_mmg_LIBRARY - NAMES mmg - HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES lib lib32 lib64) - else () - find_library(MMG_mmg_LIBRARY - NAMES mmg - HINTS ${MMG_DIR} ${MMG_BUILDDIR_INTERNAL} - PATH_SUFFIXES lib lib32 lib64) - endif() + find_library(MMG_mmg_LIBRARY + NAMES mmg + HINTS ${MMG_DIR} + PATH_SUFFIXES "lib" "lib32" "lib64") else() set(MMG_mmg_LIBRARY "MMG_mmg_LIBRARY-NOTFOUND") find_library(MMG_mmg_LIBRARY diff --git a/cmake/tools/FindMMG2D.cmake b/cmake/tools/FindMMG2D.cmake index eb80c3cd7..9b03da8f0 100644 --- a/cmake/tools/FindMMG2D.cmake +++ b/cmake/tools/FindMMG2D.cmake @@ -34,13 +34,12 @@ # MMG2D_LIBRARIES - mmg component libraries to be linked # # The user can give specific paths where to find the libraries adding cmake -# options at configure (ex: cmake path/to/project -DMMG_DIR=path/to/mmg): -# MMG_DIR - Where to find the base directory of mmg -# MMG_INCDIR - Where to find the header files -# MMG_LIBDIR - Where to find the library files -# MMG_BUILDDIR - Where to find the build directory of Mmg +# options at configure (ex: cmake path/to/project -DMMG_DIR=path/to/mmg/install): +# MMG_DIR - Where to find the base directory of mmg +# MMG_INCDIR - Path toward Mmg installation (should at least contains mmg/common filder) +# MMG_LIBDIR - Where to find the library files # The module can also look for the following environment variables if paths -# are not given as cmake variable: MMG_DIR, MMG_INCDIR, MMG_LIBDIR, MMG_BUILDDIR +# are not given as cmake variable: MMG_DIR, MMG_INCDIR, MMG_LIBDIR if (NOT MMG2D_FOUND) set(MMG_DIR "" CACHE PATH "Installation directory of MMG library") @@ -49,25 +48,6 @@ if (NOT MMG2D_FOUND) endif() endif() -# Looking for the Mmg build directory -# ----------------------------------- -set(ENV_MMG_BUILDDIR "$ENV{MMG_BUILDDIR}") - -if ( NOT MMG_BUILDDIR ) - FIND_PATH(MMG_BUILDDIR_INTERNAL - NAMES src/common/mmgcmakedefines.h - HINTS ${ENV_MMG_BUILDDIR} ${MMG_DIR} ${ENV_MMG_DIR} - PATH_SUFFIXES build Build BUILD builds Builds BUILDS - DOC "The mmg build directory" - ) -else () - set(MMG_BUILDDIR_INTERNAL "${MMG_BUILDDIR}") -endif() - -if ( NOT MMG_BUILDDIR AND MMG_BUILDDIR_INTERNAL ) - SET ( MMG_BUILDDIR "${MMG_BUILDDIR_INTERNAL}" ) -endif ( ) - # Looking for include # ------------------- @@ -79,22 +59,10 @@ set(ENV_MMG_INCDIR "$ENV{MMG_INCDIR}") if(ENV_MMG_INCDIR) list(APPEND _inc_env "${ENV_MMG_INCDIR}") -elseif(ENV_MMG_BUILDDIR) - list(APPEND _inc_env "${ENV_MMG_BUILDDIR}/include") - list(APPEND _inc_env "${ENV_MMG_BUILDDIR}/include/mmg") elseif(ENV_MMG_DIR) - if ( MMG_BUILDDIR ) - list(APPEND _inc_env "${MMG_BUILDDIR}/include") - list(APPEND _inc_env "${MMG_BUILDDIR}/include/mmg") - else ( ) - list(APPEND _inc_env "${ENV_MMG_DIR}") - list(APPEND _inc_env "${ENV_MMG_DIR}/include") - list(APPEND _inc_env "${ENV_MMG_DIR}/include/mmg") - if ( MMG_BUILDDIR_INTERNAL ) - list(APPEND _inc_env "${MMG_BUILDDIR_INTERNAL}/include") - list(APPEND _inc_env "${MMG_BUILDDIR_INTERNAL}/include/mmg") - endif() - endif() + list(APPEND _inc_env "${ENV_MMG_DIR}") + list(APPEND _inc_env "${ENV_MMG_DIR}/include") + list(APPEND _inc_env "${ENV_MMG_DIR}/include/mmg") else() if(WIN32) string(REPLACE ":" ";" _inc_env "$ENV{INCLUDE}") @@ -123,35 +91,18 @@ if(MMG_INCDIR) NAMES libmmgtypes.h HINTS ${MMG_INCDIR} PATH_SUFFIXES "mmg/mmg2d" "mmg2d") -elseif(MMG_BUILDDIR) - set(MMG2D_libmmgtypes.h_DIRS "MMG2D_libmmgtypes.h_DIRS-NOTFOUND") - find_path(MMG2D_libmmgtypes.h_DIRS - NAMES libmmgtypes.h - HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg2d" - "mmg/common" "mmg" "mmg/mmg2d") -else() if(MMG_DIR) set(MMG2D_libmmgtypes.h_DIRS "MMG2D_libmmgtypes.h_DIRS-NOTFOUND") - if ( MMG_BUILDDIR ) - find_path(MMG2D_libmmgtypes.h_DIRS - NAMES */libmmgtypes.h - HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg2d" - "include/mmg/common") - else() - find_path(MMG2D_libmmgtypes.h_DIRS - NAMES libmmgtypes.h - HINTS ${MMG_DIR} ${MMG_BUILDDIR_INTERNAL} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg2d" "include/mmg/common") - endif() - + find_path(MMG2D_libmmgtypes.h_DIRS + NAMES libmmgtypes.h + HINTS ${MMG_DIR}/include + PATH_SUFFIXES "mmg" "mmg/common") else() set(MMG2D_libmmgtypes.h_DIRS "MMG2D_libmmgtypes.h_DIRS-NOTFOUND") find_path(MMG2D_libmmgtypes.h_DIRS NAMES libmmgtypes.h HINTS ${_inc_env} - PATH_SUFFIXES "include/mmg" "include/mmg/mmg2d" "include/mmg/common") + PATH_SUFFIXES "mmg" "mmg/common") endif() endif() STRING(REGEX REPLACE "(mmg/mmg2d)|(mmg/common)" "" @@ -181,19 +132,9 @@ unset(_lib_env) set(ENV_MMG_LIBDIR "$ENV{MMG_LIBDIR}") if(ENV_MMG_LIBDIR) list(APPEND _lib_env "${ENV_MMG_LIBDIR}") -elseif(ENV_MMG_BUILDDIR) - list(APPEND _lib_env "${ENV_MMG_BUILDDIR}") - list(APPEND _lib_env "${ENV_MMG_BUILDDIR}/lib") elseif(ENV_MMG_DIR) - if ( MMG_BUILDDIR ) - list(APPEND _lib_env "${MMG_BUILDDIR}/lib") - else ( ) - list(APPEND _lib_env "${ENV_MMG_DIR}") - list(APPEND _lib_env "${ENV_MMG_DIR}/lib") - if ( MMG_BUILDDIR_INTERNAL ) - list(APPEND _lib_env "${MMG_BUILDDIR_INTERNAL}/lib") - endif() - endif() + list(APPEND _lib_env "${ENV_MMG_DIR}") + list(APPEND _lib_env "${ENV_MMG_DIR}/lib") else() if(WIN32) string(REPLACE ":" ";" _lib_env "$ENV{LIB}") @@ -221,17 +162,10 @@ else() if(MMG_DIR) set(MMG2D_mmg2d_LIBRARY "MMG2D_mmg2d_LIBRARY-NOTFOUND") - if ( MMG_BUILDDIR ) - find_library(MMG2D_mmg2d_LIBRARY - NAMES mmg2d - HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES lib lib32 lib64) - else () - find_library(MMG2D_mmg2d_LIBRARY - NAMES mmg2d - HINTS ${MMG_DIR} ${MMG_BUILDDIR_INTERNAL} - PATH_SUFFIXES lib lib32 lib64) - endif() + find_library(MMG2D_mmg2d_LIBRARY + NAMES mmg2d + HINTS ${MMG_DIR} + PATH_SUFFIXES lib lib32 lib64) else() set(MMG2D_mmg2d_LIBRARY "MMG2D_mmg2d_LIBRARY-NOTFOUND") find_library(MMG2D_mmg2d_LIBRARY diff --git a/cmake/tools/FindMMG3D.cmake b/cmake/tools/FindMMG3D.cmake index cf949a028..da1341221 100644 --- a/cmake/tools/FindMMG3D.cmake +++ b/cmake/tools/FindMMG3D.cmake @@ -34,13 +34,12 @@ # MMG3D_LIBRARIES - mmg component libraries to be linked # # The user can give specific paths where to find the libraries adding cmake -# options at configure (ex: cmake path/to/project -DMMG_DIR=path/to/mmg): -# MMG_DIR - Where to find the base directory of mmg -# MMG_INCDIR - Where to find the header files -# MMG_LIBDIR - Where to find the library files -# MMG_BUILDDIR - Where to find the build directory of Mmg +# options at configure (ex: cmake path/to/project -DMMG_DIR=path/to/mmg/install): +# MMG_DIR - Where to find the base directory of mmg +# MMG_INCDIR - Path toward Mmg installation (should at least contains mmg/common filder) +# MMG_LIBDIR - Where to find the library files # The module can also look for the following environment variables if paths -# are not given as cmake variable: MMG_DIR, MMG_INCDIR, MMG_LIBDIR, MMG_BUILDDIR +# are not given as cmake variable: MMG_DIR, MMG_INCDIR, MMG_LIBDIR if (NOT MMG3D_FOUND) set(MMG_DIR "" CACHE PATH "Installation directory of MMG library") @@ -49,25 +48,6 @@ if (NOT MMG3D_FOUND) endif() endif() -# Looking for the Mmg build directory -# ----------------------------------- -set(ENV_MMG_BUILDDIR "$ENV{MMG_BUILDDIR}") - -if ( NOT MMG_BUILDDIR ) - FIND_PATH(MMG_BUILDDIR_INTERNAL - NAMES src/common/mmgcmakedefines.h - HINTS ${ENV_MMG_BUILDDIR} ${MMG_DIR} ${ENV_MMG_DIR} - PATH_SUFFIXES build Build BUILD builds Builds BUILDS - DOC "The mmg build directory" - ) -else () - set(MMG_BUILDDIR_INTERNAL "${MMG_BUILDDIR}") -endif() - -if ( NOT MMG_BUILDDIR AND MMG_BUILDDIR_INTERNAL ) - SET ( MMG_BUILDDIR "${MMG_BUILDDIR_INTERNAL}" ) -endif ( ) - # Looking for include # ------------------- @@ -79,22 +59,10 @@ set(ENV_MMG_INCDIR "$ENV{MMG_INCDIR}") if(ENV_MMG_INCDIR) list(APPEND _inc_env "${ENV_MMG_INCDIR}") -elseif(ENV_MMG_BUILDDIR) - list(APPEND _inc_env "${ENV_MMG_BUILDDIR}/include") - list(APPEND _inc_env "${ENV_MMG_BUILDDIR}/include/mmg") elseif(ENV_MMG_DIR) - if ( MMG_BUILDDIR ) - list(APPEND _inc_env "${MMG_BUILDDIR}/include") - list(APPEND _inc_env "${MMG_BUILDDIR}/include/mmg") - else ( ) - list(APPEND _inc_env "${ENV_MMG_DIR}") - list(APPEND _inc_env "${ENV_MMG_DIR}/include") - list(APPEND _inc_env "${ENV_MMG_DIR}/include/mmg") - if ( MMG_BUILDDIR_INTERNAL ) - list(APPEND _inc_env "${MMG_BUILDDIR_INTERNAL}/include") - list(APPEND _inc_env "${MMG_BUILDDIR_INTERNAL}/include/mmg") - endif() - endif() + list(APPEND _inc_env "${ENV_MMG_DIR}") + list(APPEND _inc_env "${ENV_MMG_DIR}/include") + list(APPEND _inc_env "${ENV_MMG_DIR}/include/mmg") else() if(WIN32) string(REPLACE ":" ";" _inc_env "$ENV{INCLUDE}") @@ -123,33 +91,18 @@ if(MMG_INCDIR) NAMES libmmgtypes.h HINTS ${MMG_INCDIR} PATH_SUFFIXES "mmg/mmg3d" "mmg3d") -elseif(MMG_BUILDDIR) - set(MMG3D_libmmgtypes.h_DIRS "MMG3D_libmmgtypes.h_DIRS-NOTFOUND") - find_path(MMG3D_libmmgtypes.h_DIRS - NAMES libmmgtypes.h - HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES "include" "include/mmg" "include/common" "include/mmg/mmg3d") -else() if(MMG_DIR) set(MMG3D_libmmgtypes.h_DIRS "MMG3D_libmmgtypes.h_DIRS-NOTFOUND") - if ( MMG_BUILDDIR ) - find_path(MMG3D_libmmgtypes.h_DIRS - NAMES */libmmgtypes.h - HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg3d" "include/mmg/common") - else() - find_path(MMG3D_libmmgtypes.h_DIRS - NAMES libmmgtypes.h - HINTS ${MMG_DIR} ${MMG_BUILDDIR_INTERNAL} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmg3d" "include/mmg/common") - endif() - + find_path(MMG3D_libmmgtypes.h_DIRS + NAMES libmmgtypes.h + HINTS ${MMG_DIR}/include + PATH_SUFFIXES "mmg" "mmg/common") else() set(MMG3D_libmmgtypes.h_DIRS "MMG3D_libmmgtypes.h_DIRS-NOTFOUND") find_path(MMG3D_libmmgtypes.h_DIRS NAMES libmmgtypes.h HINTS ${_inc_env} - PATH_SUFFIXES "include/mmg" "include/mmg/mmg3d" "mmg" "mmg/common" "mmg/mmg3d" ) + PATH_SUFFIXES "mmg" "mmg/common") endif() endif() STRING(REGEX REPLACE "(mmg/mmg3d)|(mmg/common)" "" @@ -179,19 +132,9 @@ unset(_lib_env) set(ENV_MMG_LIBDIR "$ENV{MMG_LIBDIR}") if(ENV_MMG_LIBDIR) list(APPEND _lib_env "${ENV_MMG_LIBDIR}") -elseif(ENV_MMG_BUILDDIR) - list(APPEND _lib_env "${ENV_MMG_BUILDDIR}") - list(APPEND _lib_env "${ENV_MMG_BUILDDIR}/lib") elseif(ENV_MMG_DIR) - if ( MMG_BUILDDIR ) - list(APPEND _lib_env "${MMG_BUILDDIR}/lib") - else ( ) - list(APPEND _lib_env "${ENV_MMG_DIR}") - list(APPEND _lib_env "${ENV_MMG_DIR}/lib") - if ( MMG_BUILDDIR_INTERNAL ) - list(APPEND _lib_env "${MMG_BUILDDIR_INTERNAL}/lib") - endif() - endif() + list(APPEND _lib_env "${ENV_MMG_DIR}") + list(APPEND _lib_env "${ENV_MMG_DIR}/lib") else() if(WIN32) string(REPLACE ":" ";" _lib_env "$ENV{LIB}") @@ -219,17 +162,10 @@ else() if(MMG_DIR) set(MMG3D_mmg3d_LIBRARY "MMG3D_mmg3d_LIBRARY-NOTFOUND") - if ( MMG_BUILDDIR ) - find_library(MMG3D_mmg3d_LIBRARY - NAMES mmg3d - HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES lib lib32 lib64) - else () - find_library(MMG3D_mmg3d_LIBRARY - NAMES mmg3d - HINTS ${MMG_DIR} ${MMG_BUILDDIR_INTERNAL} - PATH_SUFFIXES lib lib32 lib64) - endif() + find_library(MMG3D_mmg3d_LIBRARY + NAMES mmg3d + HINTS ${MMG_DIR} + PATH_SUFFIXES lib lib32 lib64) else() set(MMG3D_mmg3d_LIBRARY "MMG3D_mmg3d_LIBRARY-NOTFOUND") find_library(MMG3D_mmg3d_LIBRARY diff --git a/cmake/tools/FindMMGS.cmake b/cmake/tools/FindMMGS.cmake index 5c17436ff..c45c46324 100644 --- a/cmake/tools/FindMMGS.cmake +++ b/cmake/tools/FindMMGS.cmake @@ -34,13 +34,12 @@ # MMGS_LIBRARIES - mmg component libraries to be linked # # The user can give specific paths where to find the libraries adding cmake -# options at configure (ex: cmake path/to/project -DMMG_DIR=path/to/mmg): -# MMG_DIR - Where to find the base directory of mmg -# MMG_INCDIR - Where to find the header files -# MMG_LIBDIR - Where to find the library files -# MMG_BUILDDIR - Where to find the build directory of Mmg +# options at configure (ex: cmake path/to/project -DMMG_DIR=path/to/mmg/install): +# MMG_DIR - Where to find the base directory of mmg +# MMG_INCDIR - Path toward Mmg installation (should at least contains mmg/common filder) +# MMG_LIBDIR - Where to find the library files # The module can also look for the following environment variables if paths -# are not given as cmake variable: MMG_DIR, MMG_INCDIR, MMG_LIBDIR, MMG_BUILDDIR +# are not given as cmake variable: MMG_DIR, MMG_INCDIR, MMG_LIBDIR if (NOT MMGS_FOUND) set(MMG_DIR "" CACHE PATH "Installation directory of MMG library") @@ -49,25 +48,6 @@ if (NOT MMGS_FOUND) endif() endif() -# Looking for the Mmg build directory -# ----------------------------------- -set(ENV_MMG_BUILDDIR "$ENV{MMG_BUILDDIR}") - -if ( NOT MMG_BUILDDIR ) - FIND_PATH(MMG_BUILDDIR_INTERNAL - NAMES src/common/mmgcmakedefines.h - HINTS ${ENV_MMG_BUILDDIR} ${MMG_DIR} ${ENV_MMG_DIR} - PATH_SUFFIXES build Build BUILD builds Builds BUILDS - DOC "The mmg build directory" - ) -else () - set(MMG_BUILDDIR_INTERNAL "${MMG_BUILDDIR}") -endif() - -if ( NOT MMG_BUILDDIR AND MMG_BUILDDIR_INTERNAL ) - SET ( MMG_BUILDDIR "${MMG_BUILDDIR_INTERNAL}" ) -endif ( ) - # Looking for include # ------------------- @@ -79,22 +59,10 @@ set(ENV_MMG_INCDIR "$ENV{MMG_INCDIR}") if(ENV_MMG_INCDIR) list(APPEND _inc_env "${ENV_MMG_INCDIR}") -elseif(ENV_MMG_BUILDDIR) - list(APPEND _inc_env "${ENV_MMG_BUILDDIR}/include") - list(APPEND _inc_env "${ENV_MMG_BUILDDIR}/include/mmg") elseif(ENV_MMG_DIR) - if ( MMG_BUILDDIR ) - list(APPEND _inc_env "${MMG_BUILDDIR}/include") - list(APPEND _inc_env "${MMG_BUILDDIR}/include/mmg") - else ( ) - list(APPEND _inc_env "${ENV_MMG_DIR}") - list(APPEND _inc_env "${ENV_MMG_DIR}/include") - list(APPEND _inc_env "${ENV_MMG_DIR}/include/mmg") - if ( MMG_BUILDDIR_INTERNAL ) - list(APPEND _inc_env "${MMG_BUILDDIR_INTERNAL}/include") - list(APPEND _inc_env "${MMG_BUILDDIR_INTERNAL}/include/mmg") - endif() - endif() + list(APPEND _inc_env "${ENV_MMG_DIR}") + list(APPEND _inc_env "${ENV_MMG_DIR}/include") + list(APPEND _inc_env "${ENV_MMG_DIR}/include/mmg") else() if(WIN32) string(REPLACE ":" ";" _inc_env "$ENV{INCLUDE}") @@ -123,33 +91,18 @@ if(MMG_INCDIR) NAMES libmmgtypes.h HINTS ${MMG_INCDIR} PATH_SUFFIXES "mmg/mmgs" "mmgs") -elseif(MMG_BUILDDIR) - set(MMGS_libmmgtypes.h_DIRS "MMGS_libmmgtypes.h_DIRS-NOTFOUND") - find_path(MMGS_libmmgtypes.h_DIRS - NAMES libmmgtypes.h - HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES "include" "include/mmg" "include/common" "include/mmg/mmgs") -else() if(MMG_DIR) set(MMGS_libmmgtypes.h_DIRS "MMGS_libmmgtypes.h_DIRS-NOTFOUND") - if ( MMG_BUILDDIR ) - find_path(MMGS_libmmgtypes.h_DIRS - NAMES */libmmgtypes.h - HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmgs" "include/mmg/common") - else() - find_path(MMGS_libmmgtypes.h_DIRS - NAMES libmmgtypes.h - HINTS ${MMG_DIR} ${MMG_BUILDDIR_INTERNAL} - PATH_SUFFIXES "include" "include/mmg" "include/mmg/mmgs" "include/mmg/common") - endif() - + find_path(MMGS_libmmgtypes.h_DIRS + NAMES libmmgtypes.h + HINTS ${MMG_DIR}/include + PATH_SUFFIXES "mmg" "mmg/common") else() set(MMGS_libmmgtypes.h_DIRS "MMGS_libmmgtypes.h_DIRS-NOTFOUND") find_path(MMGS_libmmgtypes.h_DIRS NAMES libmmgtypes.h HINTS ${_inc_env} - PATH_SUFFIXES "include/mmg" "include/mmg/mmgs" "mmg" "mmg/common" "mmg/mmgs" ) + PATH_SUFFIXES "mmg" "mmg/common") endif() endif() STRING(REGEX REPLACE "(mmg/mmgs)|(mmg/common)" "" @@ -179,19 +132,9 @@ unset(_lib_env) set(ENV_MMG_LIBDIR "$ENV{MMG_LIBDIR}") if(ENV_MMG_LIBDIR) list(APPEND _lib_env "${ENV_MMG_LIBDIR}") -elseif(ENV_MMG_BUILDDIR) - list(APPEND _lib_env "${ENV_MMG_BUILDDIR}") - list(APPEND _lib_env "${ENV_MMG_BUILDDIR}/lib") elseif(ENV_MMG_DIR) - if ( MMG_BUILDDIR ) - list(APPEND _lib_env "${MMG_BUILDDIR}/lib") - else ( ) - list(APPEND _lib_env "${ENV_MMG_DIR}") - list(APPEND _lib_env "${ENV_MMG_DIR}/lib") - if ( MMG_BUILDDIR_INTERNAL ) - list(APPEND _lib_env "${MMG_BUILDDIR_INTERNAL}/lib") - endif() - endif() + list(APPEND _lib_env "${ENV_MMG_DIR}") + list(APPEND _lib_env "${ENV_MMG_DIR}/lib") else() if(WIN32) string(REPLACE ":" ";" _lib_env "$ENV{LIB}") @@ -219,17 +162,10 @@ else() if(MMG_DIR) set(MMGS_mmgs_LIBRARY "MMGS_mmgs_LIBRARY-NOTFOUND") - if ( MMG_BUILDDIR ) - find_library(MMGS_mmgs_LIBRARY - NAMES mmgs - HINTS ${MMG_BUILDDIR} - PATH_SUFFIXES lib lib32 lib64) - else () - find_library(MMGS_mmgs_LIBRARY - NAMES mmgs - HINTS ${MMG_DIR} ${MMG_BUILDDIR_INTERNAL} - PATH_SUFFIXES lib lib32 lib64) - endif() + find_library(MMGS_mmgs_LIBRARY + NAMES mmgs + HINTS ${MMG_DIR} + PATH_SUFFIXES lib lib32 lib64) else() set(MMGS_mmgs_LIBRARY "MMGS_mmgs_LIBRARY-NOTFOUND") find_library(MMGS_mmgs_LIBRARY From 8db557892d4305c3e5e81bf41943eab5876b1659 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Sun, 11 Dec 2022 22:15:11 +0100 Subject: [PATCH 829/838] Add comment and debug things. --- src/common/mmgcommon.h | 1 + src/mmg3d/PRoctree_3d.c | 2 ++ src/mmg3d/mmg3d1.c | 2 ++ src/mmg3d/mmg3d1_pattern.c | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 37 insertions(+) diff --git a/src/common/mmgcommon.h b/src/common/mmgcommon.h index 4a247f76b..52d8f5fc9 100644 --- a/src/common/mmgcommon.h +++ b/src/common/mmgcommon.h @@ -171,6 +171,7 @@ extern "C" { #define MG_EDG(tag) ((tag & MG_GEO) || (tag & MG_REF)) /**< Edge or Ridge */ #define MG_GEO_OR_NOM(tag) (( tag & MG_GEO ) || ( tag & MG_NOM )) /**< Ridge or non-manifold */ #define MG_EDG_OR_NOM(tag) ( MG_EDG(tag) || (tag & MG_NOM ) ) /**< Edge, ridge or non-manifold */ +#define MG_TRUE_BDY(tag) ( (tag & MG_BDY) && !(tag & MG_PARBDY) ) /**< Non parbdy boundary point (true bdy) */ diff --git a/src/mmg3d/PRoctree_3d.c b/src/mmg3d/PRoctree_3d.c index 894534da5..66ebf080e 100644 --- a/src/mmg3d/PRoctree_3d.c +++ b/src/mmg3d/PRoctree_3d.c @@ -1131,6 +1131,7 @@ int* MMG3D_sizeArbre(MMG3D_pPROctree q,int dim) * \param sol pointer toward the solution structure. * \param PROctree pointer toward the PROctree structure. * \param ip index of point to check. + * \param lmax threshold to check minimal distance between points. * * \return 1 if we can insert \a ip, 0 if we cannot insert the point * \return -1 if fail because of memory. @@ -1212,6 +1213,7 @@ int MMG3D_PROctreein_iso(MMG5_pMesh mesh,MMG5_pSol sol,MMG3D_pPROctree PROctree, * \param sol pointer toward the solution structure. * \param PROctree pointer toward the PROctree structure. * \param ip index of point to check. + * \param lmax threshold to check minimal distance between points. * * \return 1 if we can insert \a ip, 0 otherwise * \return -1 if fail due to lack of memory. diff --git a/src/mmg3d/mmg3d1.c b/src/mmg3d/mmg3d1.c index 6d96c85da..e5f57f0dc 100644 --- a/src/mmg3d/mmg3d1.c +++ b/src/mmg3d/mmg3d1.c @@ -1393,7 +1393,9 @@ MMG5_anatetv(MMG5_pMesh mesh,MMG5_pSol met,int8_t typchk) { if ( pxt->tag[i] & MG_REQ ) continue; } else pxt = 0; + if ( (p1->tag & MG_BDY) && (p2->tag & MG_BDY) ) { + /* Split internal edges connecting bdy points */ ip = MMG5_hashGet(&hash,ip1,ip2); } else { diff --git a/src/mmg3d/mmg3d1_pattern.c b/src/mmg3d/mmg3d1_pattern.c index 066d9f65d..13c1fe0dd 100644 --- a/src/mmg3d/mmg3d1_pattern.c +++ b/src/mmg3d/mmg3d1_pattern.c @@ -444,6 +444,14 @@ int MMG5_mmg3d1_pattern(MMG5_pMesh mesh,MMG5_pSol met,MMG5_int *permNodGlob) { return 0; } + /* Debug: export variable MMG_SAVE_ANATET1 to save adapted mesh at the end of + * anatet wave */ + if ( getenv("MMG_SAVE_ANATET1") ) { + printf(" ## WARNING: EXIT AFTER ANATET-1." + " (MMG_SAVE_ANATET1 env variable is exported).\n"); + return 1; + } + /* renumbering if available */ if ( !MMG5_scotchCall(mesh,met,NULL,permNodGlob) ) return 0; @@ -458,8 +466,24 @@ int MMG5_mmg3d1_pattern(MMG5_pMesh mesh,MMG5_pSol met,MMG5_int *permNodGlob) { return 0; } + /* Debug: export variable MMG_SAVE_DEFSIZ to save adapted mesh at the end of + * anatet wave */ + if ( getenv("MMG_SAVE_DEFSIZ") ) { + printf(" ## WARNING: EXIT AFTER DEFSIZ." + " (MMG_SAVE_DEFSIZ env variable is exported).\n"); + return 1; + } + MMG5_gradation_info(mesh); + /* Debug: export variable MMG_SAVE_GRADSIZ to save adapted mesh at the end of + * anatet wave */ + if ( getenv("MMG_SAVE_GRADSIZ") ) { + printf(" ## WARNING: EXIT AFTER GRADSIZ." + " (MMG_SAVE_GRADSIZ env variable is exported).\n"); + return 1; + } + if ( mesh->info.hgrad > 0. ) { if ( !MMG3D_gradsiz(mesh,met) ) { fprintf(stderr,"\n ## Gradation problem. Exit program.\n"); @@ -478,6 +502,14 @@ int MMG5_mmg3d1_pattern(MMG5_pMesh mesh,MMG5_pSol met,MMG5_int *permNodGlob) { return 0; } + /* Debug: export variable MMG_SAVE_ANATET2 to save adapted mesh at the end of + * anatet wave */ + if ( getenv("MMG_SAVE_ANATET2") ) { + printf(" ## WARNING: EXIT AFTER ANATET-2." + " (MMG_SAVE_ANATET2 env variable is exported).\n"); + return 1; + } + /* renumbering if available */ if ( !MMG5_scotchCall(mesh,met,NULL,permNodGlob) ) return 0; From 98536f2d9fe6207af5441fbbb208f2e93ecba3d5 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Mon, 12 Dec 2022 07:31:44 +0100 Subject: [PATCH 830/838] Force splitting of internal edges connecting bdy points in delaunay kernel. --- src/mmg3d/mmg3d1_delone.c | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/src/mmg3d/mmg3d1_delone.c b/src/mmg3d/mmg3d1_delone.c index c0e6729f6..e9e85258c 100644 --- a/src/mmg3d/mmg3d1_delone.c +++ b/src/mmg3d/mmg3d1_delone.c @@ -94,18 +94,20 @@ int MMG3D_mmg3d1_delone_split(MMG5_pMesh mesh, MMG5_pSol met, int ilist; int8_t j,i,i1,i2; - if ( lmax < MMG3D_LOPTL_DEL ) { - /* Edge is small enough: nothing to do */ - return 3; - } - - /** Edge is too long: try to split it */ + /** Get edge infos */ pt = &mesh->tetra[k]; pxt = pt->xt ? &mesh->xtetra[pt->xt] : 0; MMG3D_find_bdyface_from_edge(mesh,pt,imax,&i,&j,&i1,&i2,&ip1,&ip2,&p0,&p1); if ( pxt && (pxt->ftag[i] & MG_BDY) ) { + + /** Check edge length */ + if ( lmax < MMG3D_LOPTL_DEL ) { + /* Edge is small enough: nothing to do */ + return 3; + } + /** Edge belongs to a boundary face: try to split using patterns */ /* Construction of bezier edge */ double to[3],no1[3],no2[3]; @@ -198,10 +200,25 @@ int MMG3D_mmg3d1_delone_split(MMG5_pMesh mesh, MMG5_pSol met, * edges with Delauney kernel. */ /* Note that it is possible that non bdy tetra contains a bdy edge, here * only non bdy edge are considered */ + + int8_t force_splt = 0; + const int8_t fem_mode = 2; // value of info.fem in case of fem mode + + if ( mesh->info.fem == fem_mode ) { + /* Force splitting of internal edges connecting bdy points */ + if ( MG_TRUE_BDY(p0->tag) && MG_TRUE_BDY(p1->tag) ) { + force_splt = 1; + } + } + + if ( (!force_splt) && lmax < MMG3D_LOPTL_DEL ) { + /* Edge is small enough: nothing to do */ + return 3; + } + int8_t isbdy; ilist = MMG5_coquil(mesh,k,imax,list,&isbdy); - if ( !ilist ){ /* Unable to compute edge shell: treat next element */ return 0; @@ -250,6 +267,12 @@ int MMG3D_mmg3d1_delone_split(MMG5_pMesh mesh, MMG5_pSol met, lfilt = MMG3D_LFILTL_DEL; } + /* No filter for internal edges connecting boundary points: we want to force + * splitting */ + if ( force_splt ) { + lfilt = 0; + } + ier = 1; if ( *PROctree ) { ier = MMG3D_PROctreein(mesh,met,*PROctree,ip,lfilt); From 1cf6f386d8333b01dddcbd4db90bdb2e3e6af204 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Mon, 12 Dec 2022 09:58:42 +0100 Subject: [PATCH 831/838] Fix dimension issue in 2D coor regularization. --- src/mmg2d/analys_2d.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mmg2d/analys_2d.c b/src/mmg2d/analys_2d.c index 03c433ad8..78e9f73b2 100644 --- a/src/mmg2d/analys_2d.c +++ b/src/mmg2d/analys_2d.c @@ -783,7 +783,7 @@ int MMG2D_regnor(MMG5_pMesh mesh) { static inline int MMG2D_dichotomy(MMG5_pMesh mesh, MMG5_pTria pt, MMG5_int k, double *c) { MMG5_pPoint ppt; - double p[2],co[3][3],vol,to,tp,t; + double p[2],co[3][2],vol,to,tp,t; int it,maxit,pos,i,j; it = 0; @@ -796,7 +796,7 @@ static inline int MMG2D_dichotomy(MMG5_pMesh mesh, MMG5_pTria pt, MMG5_int k, do ppt = &mesh->point[k]; for ( i=0 ; i<3 ; i++ ) { - for ( j=0 ; j<3 ; j++ ) { + for ( j=0 ; j<2 ; j++ ) { co[i][j] = mesh->point[pt->v[i]].c[j]; } } @@ -849,10 +849,10 @@ static inline int MMG2D_dichotomy(MMG5_pMesh mesh, MMG5_pTria pt, MMG5_int k, do int MMG2D_regver(MMG5_pMesh mesh) { MMG5_pTria pt; MMG5_pPoint ppt,p1,p2; - double *tmp,lm1,lm2,cx,cy,res,res0,c[2],co[3][3],vol; + double *tmp,lm1,lm2,cx,cy,res,res0,c[2],co[3][2],vol; MMG5_int k,kt,iel,ip1,ip2,nn,list[MMG5_LMAX]; int it,maxit,j,ilist,noupdate; - int8_t i,ier; + int8_t i; it = 0; maxit=10; @@ -964,7 +964,7 @@ int MMG2D_regver(MMG5_pMesh mesh) { if ( !MG_EOK(pt) ) continue; for ( i=0 ; i<3 ; i++ ) { - for ( j=0 ; j<3 ; j++ ) { + for ( j=0 ; j<2 ; j++ ) { co[i][j] = mesh->point[pt->v[i]].c[j]; } } @@ -973,7 +973,7 @@ int MMG2D_regver(MMG5_pMesh mesh) { if ( pt->v[1] == k ) i = 1; if ( pt->v[2] == k ) i = 2; - for ( j=0 ; j<3 ; j++ ) { + for ( j=0 ; j<2 ; j++ ) { co[i][j] = c[j]; } From 1733e5c52e2067f9eb1fac318b8838cd03e56b2e Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Mon, 12 Dec 2022 11:11:45 +0100 Subject: [PATCH 832/838] Raise a warning for non-bijective multi-materials map instead of an error. --- src/common/mmg2.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/common/mmg2.c b/src/common/mmg2.c index 0cdec4ba3..034381442 100644 --- a/src/common/mmg2.c +++ b/src/common/mmg2.c @@ -109,11 +109,14 @@ static int MMG5_InvMat_check(MMG5_pInvMat pim,int key) { * lookup table. */ static void MMG5_InvMat_error(MMG5_pInvMat pim,int ref,int k) { - fprintf(stderr,"\n ## Error: Trying to overwrite material reference %d" + fprintf(stderr,"\n ## Warning: Overwrite material reference %d" " (from LSReferences line %d) with another entry from LSReferences line %d." ,ref,MMG5_InvMat_getIndex(pim,ref)+1,k+1); - fprintf(stderr,"\n Check your LSReferences table: each material" - " reference should be unique!\n"); + fprintf(stderr,"\n Check your LSReferences table: if possible," + " each material reference should be unique,\n" + " if not possible, you may" + " encounter unexpected issues (wrong domain mapping or erroneous" + " detection of non-manifold level-set)!\n"); } /** @@ -132,12 +135,10 @@ static int MMG5_InvMat_set(MMG5_pMesh mesh,MMG5_pInvMat pim,int k) { /** Store the dosplit attribute of the parent material */ key = MMG5_InvMat_key(pim,pm->ref); - if( MMG5_InvMat_check(pim,key) ) { - pim->lookup[key] = MMG5_InvMat_code(k,pm->dospl); - } else { + if( !MMG5_InvMat_check(pim,key) ) { MMG5_InvMat_error(pim,pm->ref,k); - return 0; } + pim->lookup[key] = MMG5_InvMat_code(k,pm->dospl); /** Store the child material sign with the parent material index (in the * lookup table). @@ -148,19 +149,16 @@ static int MMG5_InvMat_set(MMG5_pMesh mesh,MMG5_pInvMat pim,int k) { * and this must have already been checked. */ if( pm->dospl ) { key = MMG5_InvMat_key(pim,pm->rin); - if( MMG5_InvMat_check(pim,key) ) { - pim->lookup[key] = MMG5_InvMat_code(k,MG_MINUS); - } else { + if( !MMG5_InvMat_check(pim,key) ) { MMG5_InvMat_error(pim,pm->rin,k); - return 0; } + pim->lookup[key] = MMG5_InvMat_code(k,MG_MINUS); + key = MMG5_InvMat_key(pim,pm->rex); - if( MMG5_InvMat_check(pim,key) ) { - pim->lookup[key] = MMG5_InvMat_code(k,MG_PLUS); - } else { + if( !MMG5_InvMat_check(pim,key) ) { MMG5_InvMat_error(pim,pm->rex,k); - return 0; } + pim->lookup[key] = MMG5_InvMat_code(k,MG_PLUS); } return 1; From 7ab8cc17d440b2a474d2984311d939153581fea8 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Mon, 12 Dec 2022 21:40:05 +0100 Subject: [PATCH 833/838] Update release version, badges and fix some SQ bugs. --- CMakeLists.txt | 4 ++-- README.md | 8 ++++---- libexamples/mmg2d/adaptation_example2/main.c | 5 +++++ src/mmg2d/analys_2d.c | 3 --- src/mmg2d/chkmsh_2d.c | 1 - src/mmg2d/solmap_2d.c | 1 - src/mmg3d/analys_3d.c | 8 ++++---- src/mmg3d/anisosiz_3d.c | 6 +----- src/mmg3d/colver_3d.c | 1 - src/mmg3d/libmmg3d_tools.c | 1 - src/mmg3d/mmg3d1.c | 1 - src/mmg3d/mmg3d1_delone.c | 1 - src/mmgs/analys_s.c | 6 +++--- src/mmgs/libmmgs_tools.c | 1 - 14 files changed, 19 insertions(+), 28 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eafa8a4fc..b50615a4d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,9 +62,9 @@ include(GNUInstallDirs) ############################################################################### SET (CMAKE_RELEASE_VERSION_MAJOR "5" ) -SET (CMAKE_RELEASE_VERSION_MINOR "6" ) +SET (CMAKE_RELEASE_VERSION_MINOR "7" ) SET (CMAKE_RELEASE_VERSION_PATCH "0" ) -SET (CMAKE_RELEASE_DATE "Nov. 05, 2021" ) +SET (CMAKE_RELEASE_DATE "Dec. 13, 2023" ) SET (CMAKE_RELEASE_VERSION "${CMAKE_RELEASE_VERSION_MAJOR}.${CMAKE_RELEASE_VERSION_MINOR}.${CMAKE_RELEASE_VERSION_PATCH}") diff --git a/README.md b/README.md index 0ce61dc23..9c2f4ec65 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,8 @@ |**develop branch**|[![Build Status][dev-build]][dev-sq-build]|[![Quality Gate][dev-qual-gate]][dev-sq-qual-gate]|[![Vulnerabilities][dev-vulnerabilities]][dev-sq-vulnerabilities]|[![Coverage][dev-coverage]][dev-sq-coverage]|[![Duplication (%)][dev-code-dpl]][dev-sq-code-dpl]| -[master-build]: https://github.com/MmgTools/mmg/actions/workflows/standard-tests.yml/badge.svg?branch=master -[master-sq-build]: https://github.com/MmgTools/mmg/actions/workflows/standard-tests.yml?query=branch%3Amaster +[master-build]: https://github.com/MmgTools/mmg/actions/workflows/long-tests.yml/badge.svg?branch=master +[master-sq-build]: https://github.com/MmgTools/mmg/actions/workflows/long-tests.yml?query=branch%3Amaster [master-qual-gate]: https://sonarqube.inria.fr/sonarqube/api/badges/gate?key=cardamom%3Ammg%3Agithub%3Amaster [master-sq-qual-gate]: https://sonarqube.inria.fr/sonarqube/dashboard?id=cardamom%3Ammg%3Agithub%3Amaster @@ -42,8 +42,8 @@ [master-sq-code-dpl]:https://sonarqube.inria.fr/sonarqube/component_measures?id=cardamom%3Ammg%3Agithub%3Amaster&metric=duplications -[dev-build]: https://github.com/MmgTools/mmg/actions/workflows/standard-tests.yml/badge.svg?branch=develop -[dev-sq-build]: https://github.com/MmgTools/mmg/actions/workflows/standard-tests.yml?query=branch%3Adevelop +[dev-build]: https://github.com/MmgTools/mmg/actions/workflows/long-tests.yml/badge.svg?branch=develop +[dev-sq-build]: https://github.com/MmgTools/mmg/actions/workflows/long-tests.yml?query=branch%3Adevelop [dev-qual-gate]: https://sonarqube.inria.fr/sonarqube/api/badges/gate?key=cardamom%3Ammg%3Agithub%3Adevelop [dev-sq-qual-gate]: https://sonarqube.inria.fr/sonarqube/dashboard?id=cardamom%3Ammg%3Agithub%3Adevelop diff --git a/libexamples/mmg2d/adaptation_example2/main.c b/libexamples/mmg2d/adaptation_example2/main.c index 510364e1e..744edd424 100644 --- a/libexamples/mmg2d/adaptation_example2/main.c +++ b/libexamples/mmg2d/adaptation_example2/main.c @@ -119,6 +119,11 @@ int main(int argc,char *argv[]) { MMG2D_Free_solutions(mmgMesh,mmgSol); ier = MMG2D_mmg2dlib(mmgMesh,mmgSol); + if ( ier == MMG5_STRONGFAILURE ) { + fprintf(stdout,"BAD ENDING OF MMG2DLIB: UNABLE TO SAVE MESH\n"); + return(ier); + } else if ( ier == MMG5_LOWFAILURE ) + fprintf(stdout,"BAD ENDING OF MMG2DLIB\n"); /*save result*/ if ( MMG2D_saveMesh(mmgMesh,outname2) != 1 ) exit(EXIT_FAILURE); diff --git a/src/mmg2d/analys_2d.c b/src/mmg2d/analys_2d.c index 78e9f73b2..fefea293c 100644 --- a/src/mmg2d/analys_2d.c +++ b/src/mmg2d/analys_2d.c @@ -941,9 +941,6 @@ int MMG2D_regver(MMG5_pMesh mesh) { return 0; } - p1 = &mesh->point[ip1]; - p2 = &mesh->point[ip2]; - cx += tmp[2*(ip1-1)+1]; cy += tmp[2*(ip1-1)+2]; diff --git a/src/mmg2d/chkmsh_2d.c b/src/mmg2d/chkmsh_2d.c index cb59baea8..1725b2c15 100644 --- a/src/mmg2d/chkmsh_2d.c +++ b/src/mmg2d/chkmsh_2d.c @@ -190,7 +190,6 @@ int MMG5_mmg2dChkmsh(MMG5_pMesh mesh, int severe,MMG5_int base) { int i2 = MMG5_iprv2[i]; MMG5_int jel = adja[i] / 3; - j = adja[i] % 3; if ( base ) { if ( !jel ) { diff --git a/src/mmg2d/solmap_2d.c b/src/mmg2d/solmap_2d.c index 24ca8a1ce..b651e9c82 100644 --- a/src/mmg2d/solmap_2d.c +++ b/src/mmg2d/solmap_2d.c @@ -142,7 +142,6 @@ int MMG2D_doSol_iso(MMG5_pMesh mesh,MMG5_pSol sol) { /* vertex size */ for (k=1; k<=mesh->np; k++) { - p1 = &mesh->point[k]; if ( !mark[k] ) { continue; } diff --git a/src/mmg3d/analys_3d.c b/src/mmg3d/analys_3d.c index b76f82173..702942653 100644 --- a/src/mmg3d/analys_3d.c +++ b/src/mmg3d/analys_3d.c @@ -855,7 +855,7 @@ static inline int MMG3D_dichotomytria(MMG5_pMesh mesh, MMG5_pTria pt, MMG5_int k mesh->point[0].c[1] = o[1] + t*(p[1] - o[1]); mesh->point[0].c[2] = o[2] + t*(p[2] - o[2]); - ier = MMG5_nortri(mesh, pt, nnew); + MMG5_nortri(mesh, pt, nnew); MMG5_dotprod(3,n,nnew,&result); if ( result <= 0.0 ) { @@ -959,7 +959,7 @@ int MMG3D_regver(MMG5_pMesh mesh) { MMG5_pPoint ppt,p0; MMG5_Tria tnew; double *tabl,c[3],n[3],nnew[3],*cptr,lm1,lm2,cx,cy,cz,res0,res,result; - int i,ii,it,nit,ilist,noupdate,ier; + int i,ii,it,nit,ilist,noupdate; MMG5_int k,kt,nn,iel,list[MMG5_LMAX],tlist[MMG5_LMAX],*adja,iad,v[4]; int64_t tetlist[MMG5_LMAX]; @@ -1091,7 +1091,7 @@ int MMG3D_regver(MMG5_pMesh mesh) { if ( !MG_EOK(pt) ) continue; - ier = MMG5_nortri(mesh, pt, n); + MMG5_nortri(mesh, pt, n); for (i=0;i<3;i++) { tnew.v[i] = pt->v[i]; @@ -1103,7 +1103,7 @@ int MMG3D_regver(MMG5_pMesh mesh) { tnew.v[i] = 0; - ier = MMG5_nortri(mesh, &tnew, nnew); + MMG5_nortri(mesh, &tnew, nnew); MMG5_dotprod(3,n,nnew,&result); if ( result < 0.0 ) { if (!MMG3D_dichotomytria(mesh,&tnew,k,c,n)) diff --git a/src/mmg3d/anisosiz_3d.c b/src/mmg3d/anisosiz_3d.c index 2fb074420..a28d78523 100644 --- a/src/mmg3d/anisosiz_3d.c +++ b/src/mmg3d/anisosiz_3d.c @@ -1471,10 +1471,7 @@ int MMG5_grad2metVol_getmet(MMG5_pMesh mesh,MMG5_pSol met,MMG5_int ip,double ux, } else if( ppt->tag & MG_BDY ) { - - pxp = &mesh->xpoint[ppt->xp]; memcpy(m,mm,6*sizeof(double)); - } else { @@ -1730,13 +1727,12 @@ void MMG5_grad2metVol_setmet(MMG5_pMesh mesh,MMG5_pSol met,int ip,double *m,int8 mm = &met->m[6*ip]; if ( MG_RID(ppt->tag) ) { - MMG5_pxPoint pxp = &mesh->xpoint[ppt->xp]; double mr[6]; double u[3],r[3][3],*t,*n; /* Compute ridge orthonormal basis (t, n x t, n) */ t = ppt->n; - pxp = &mesh->xpoint[ppt->xp]; + MMG5_pxPoint pxp = &mesh->xpoint[ppt->xp]; if( ridgedir ) n = pxp->n2; else diff --git a/src/mmg3d/colver_3d.c b/src/mmg3d/colver_3d.c index 4a3182d76..1b14746c1 100644 --- a/src/mmg3d/colver_3d.c +++ b/src/mmg3d/colver_3d.c @@ -76,7 +76,6 @@ int MMG5_chkcol_int(MMG5_pMesh mesh,MMG5_pSol met,MMG5_int k,int8_t iface, /* Update edges tag for pt0 (needed by lenedg). */ /* prevent from recreating internal edge between boundaries */ - p0 = &mesh->point[nq]; if ( mesh->info.fem==typchk ) { p0 = &mesh->point[nq]; if ( (p0->tag & MG_BDY) && !(p0->tag & MG_PARBDY) ) { diff --git a/src/mmg3d/libmmg3d_tools.c b/src/mmg3d/libmmg3d_tools.c index c62836eef..0156e5643 100644 --- a/src/mmg3d/libmmg3d_tools.c +++ b/src/mmg3d/libmmg3d_tools.c @@ -1442,7 +1442,6 @@ int MMG3D_doSol_ani(MMG5_pMesh mesh,MMG5_pSol met) { } for (k=1; k<=mesh->np; k++) { - p1 = &mesh->point[k]; if ( !mark[k] ) { continue; } diff --git a/src/mmg3d/mmg3d1.c b/src/mmg3d/mmg3d1.c index 25d3091d3..1ebab2f10 100644 --- a/src/mmg3d/mmg3d1.c +++ b/src/mmg3d/mmg3d1.c @@ -2015,7 +2015,6 @@ int MMG3D_splsurfedge( MMG5_pMesh mesh,MMG5_pSol met,MMG5_int k, /* if we realloc memory in MMG5_split1b pt and pxt pointers are not valid */ pt = &mesh->tetra[k]; - pxt = pt->xt ? &mesh->xtetra[pt->xt] : 0; if ( ier < 0 ) { fprintf(stderr,"\n ## Error: %s: unable to split.\n",__func__); diff --git a/src/mmg3d/mmg3d1_delone.c b/src/mmg3d/mmg3d1_delone.c index 68d44750f..b30684aff 100644 --- a/src/mmg3d/mmg3d1_delone.c +++ b/src/mmg3d/mmg3d1_delone.c @@ -178,7 +178,6 @@ int MMG3D_mmg3d1_delone_split(MMG5_pMesh mesh, MMG5_pSol met, /* if we realloc memory in MMG5_split1b pt and pxt pointers are not valid */ pt = &mesh->tetra[k]; - pxt = pt->xt ? &mesh->xtetra[pt->xt] : 0; if ( ier < 0 ) { fprintf(stderr,"\n ## Error: %s: unable to split.\n",__func__); diff --git a/src/mmgs/analys_s.c b/src/mmgs/analys_s.c index a618bdf9f..384002ca7 100644 --- a/src/mmgs/analys_s.c +++ b/src/mmgs/analys_s.c @@ -781,7 +781,7 @@ static inline int MMGS_dichotomy(MMG5_pMesh mesh, MMG5_pTria pt, MMG5_int k, dou mesh->point[0].c[1] = o[1] + t*(p[1] - o[1]); mesh->point[0].c[2] = o[2] + t*(p[2] - o[2]); - ier = MMG5_nortri(mesh, pt, nnew); + MMG5_nortri(mesh, pt, nnew); MMG5_dotprod(3,n,nnew,&result); if ( result <= 0.0 ) { @@ -935,7 +935,7 @@ int MMGS_regver(MMG5_pMesh mesh) { if ( !MG_EOK(pt) ) continue; - ier = MMG5_nortri(mesh, pt, n); + MMG5_nortri(mesh, pt, n); for (i=0;i<3;i++) { tnew.v[i] = pt->v[i]; @@ -947,7 +947,7 @@ int MMGS_regver(MMG5_pMesh mesh) { tnew.v[i] = 0; - ier = MMG5_nortri(mesh, &tnew, nnew); + MMG5_nortri(mesh, &tnew, nnew); MMG5_dotprod(3,n,nnew,&result); if ( result < 0.0 ) { if (!MMGS_dichotomy(mesh,&tnew,k,c,n)) diff --git a/src/mmgs/libmmgs_tools.c b/src/mmgs/libmmgs_tools.c index bcdc131c2..c2fbfc7c1 100644 --- a/src/mmgs/libmmgs_tools.c +++ b/src/mmgs/libmmgs_tools.c @@ -1009,7 +1009,6 @@ int MMGS_surfopenballRotation(MMG5_pMesh mesh,MMG5_pPoint p0,MMG5_int k, int i, MMG5_int iel = k; int j = i; do { - ptt = &mesh->tria[iel]; adja = &mesh->adja[3*(iel-1)+1]; i1 = MMG5_iprv2[j]; kold = iel; From 95c84e46c73eda95667c4e7a715d3150da87f52a Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Mon, 12 Dec 2022 22:01:59 +0100 Subject: [PATCH 834/838] Udpate SQ badges. --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9c2f4ec65..9f3dfed6d 100644 --- a/README.md +++ b/README.md @@ -29,32 +29,32 @@ [master-build]: https://github.com/MmgTools/mmg/actions/workflows/long-tests.yml/badge.svg?branch=master [master-sq-build]: https://github.com/MmgTools/mmg/actions/workflows/long-tests.yml?query=branch%3Amaster -[master-qual-gate]: https://sonarqube.inria.fr/sonarqube/api/badges/gate?key=cardamom%3Ammg%3Agithub%3Amaster +[master-qual-gate]: https://sonarqube.inria.fr/sonarqube/api/project_badges/measure?project=cardamom%3Ammg%3Agithub%3Amaster&metric=alert_status [master-sq-qual-gate]: https://sonarqube.inria.fr/sonarqube/dashboard?id=cardamom%3Ammg%3Agithub%3Amaster -[master-vulnerabilities]: https://img.shields.io/sonar/vulnerabilities/cardamom:mmg:github:master?server=https%3A%2F%2Fsonarqube.inria.fr%2Fsonarqube +[master-vulnerabilities]: https://sonarqube.inria.fr/sonarqube/api/project_badges/measure?project=cardamom%3Ammg%3Agithub%3Amaster&metric=vulnerabilities [master-sq-vulnerabilities]: https://sonarqube.inria.fr/sonarqube/component_measures?id=cardamom%3Ammg%3Agithub%3Amaster&metric=vulnerabilities -[master-coverage]:https://img.shields.io/sonar/coverage/cardamom:mmg:github:master?server=https%3A%2F%2Fsonarqube.inria.fr%2Fsonarqube +[master-coverage]:https://sonarqube.inria.fr/sonarqube/api/project_badges/measure?project=cardamom%3Ammg%3Agithub%3Adevelop&metric=coverage [master-sq-coverage]:https://sonarqube.inria.fr/sonarqube/component_measures?id=cardamom%3Ammg%3Agithub%3Amaster&metric=coverage -[master-code-dpl]:https://sonarqube.inria.fr/sonarqube/api/badges/measure?key=cardamom%3Ammg%3Agithub%3Amaster&metric=duplicated_lines_density +[master-code-dpl]:https://sonarqube.inria.fr/sonarqube/api/project_badges/measure?project=cardamom%3Ammg%3Agithub%3Adevelop&metric=duplicated_lines_density [master-sq-code-dpl]:https://sonarqube.inria.fr/sonarqube/component_measures?id=cardamom%3Ammg%3Agithub%3Amaster&metric=duplications [dev-build]: https://github.com/MmgTools/mmg/actions/workflows/long-tests.yml/badge.svg?branch=develop [dev-sq-build]: https://github.com/MmgTools/mmg/actions/workflows/long-tests.yml?query=branch%3Adevelop -[dev-qual-gate]: https://sonarqube.inria.fr/sonarqube/api/badges/gate?key=cardamom%3Ammg%3Agithub%3Adevelop +[dev-qual-gate]: https://sonarqube.inria.fr/sonarqube/api/project_badges/measure?project=cardamom%3Ammg%3Agithub%3Adevelop&metric=alert_status [dev-sq-qual-gate]: https://sonarqube.inria.fr/sonarqube/dashboard?id=cardamom%3Ammg%3Agithub%3Adevelop -[dev-vulnerabilities]: https://img.shields.io/sonar/vulnerabilities/cardamom:mmg:github:develop?server=https%3A%2F%2Fsonarqube.inria.fr%2Fsonarqube +[dev-vulnerabilities]: https://sonarqube.inria.fr/sonarqube/api/project_badges/measure?project=cardamom%3Ammg%3Agithub%3Adevelop&metric=vulnerabilities [dev-sq-vulnerabilities]: https://sonarqube.inria.fr/sonarqube/component_measures?id=cardamom%3Ammg%3Agithub%3Adevelop&metric=vulnerabilities -[dev-coverage]:https://img.shields.io/sonar/coverage/cardamom:mmg:github:develop?server=https%3A%2F%2Fsonarqube.inria.fr%2Fsonarqube +[dev-coverage]:https://sonarqube.inria.fr/sonarqube/api/project_badges/measure?project=cardamom%3Ammg%3Agithub%3Adevelop&metric=coverage [dev-sq-coverage]:https://sonarqube.inria.fr/sonarqube/component_measures?id=cardamom%3Ammg%3Agithub%3Adevelop&metric=coverage -[dev-code-dpl]:https://sonarqube.inria.fr/sonarqube/api/badges/measure?key=cardamom%3Ammg%3Agithub%3Adevelop&metric=duplicated_lines_density +[dev-code-dpl]:https://sonarqube.inria.fr/sonarqube/api/project_badges/measure?project=cardamom%3Ammg%3Agithub%3Adevelop&metric=duplicated_lines_density [dev-sq-code-dpl]:https://sonarqube.inria.fr/sonarqube/component_measures?id=cardamom%3Ammg%3Agithub%3Adevelop&metric=duplications --- From 5acbbc20653cf1257deb5db0ee4ddf10448725aa Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Mon, 12 Dec 2022 22:13:58 +0100 Subject: [PATCH 835/838] Attempt to solve some SQ bugs. --- README.md | 12 ++++++------ libexamples/mmg2d/io_multisols_example0/main.c | 8 ++++++++ libexamples/mmg3d/io_multisols_example6/main.c | 8 ++++++++ 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 9f3dfed6d..8f465ed58 100644 --- a/README.md +++ b/README.md @@ -32,13 +32,13 @@ [master-qual-gate]: https://sonarqube.inria.fr/sonarqube/api/project_badges/measure?project=cardamom%3Ammg%3Agithub%3Amaster&metric=alert_status [master-sq-qual-gate]: https://sonarqube.inria.fr/sonarqube/dashboard?id=cardamom%3Ammg%3Agithub%3Amaster -[master-vulnerabilities]: https://sonarqube.inria.fr/sonarqube/api/project_badges/measure?project=cardamom%3Ammg%3Agithub%3Amaster&metric=vulnerabilities -[master-sq-vulnerabilities]: https://sonarqube.inria.fr/sonarqube/component_measures?id=cardamom%3Ammg%3Agithub%3Amaster&metric=vulnerabilities +[master-vulnerabilities]: https://sonarqube.inria.fr/sonarqube/api/project_badges/measure?project=cardamom%3Ammg%3Agithub%3Amaster&metric=reliability_rating +[master-sq-vulnerabilities]: https://sonarqube.inria.fr/sonarqube/component_measures?id=cardamom%3Ammg%3Agithub%3Amaster&metric=reliability -[master-coverage]:https://sonarqube.inria.fr/sonarqube/api/project_badges/measure?project=cardamom%3Ammg%3Agithub%3Adevelop&metric=coverage +[master-coverage]:https://sonarqube.inria.fr/sonarqube/api/project_badges/measure?project=cardamom%3Ammg%3Agithub%3Amaster&metric=coverage [master-sq-coverage]:https://sonarqube.inria.fr/sonarqube/component_measures?id=cardamom%3Ammg%3Agithub%3Amaster&metric=coverage -[master-code-dpl]:https://sonarqube.inria.fr/sonarqube/api/project_badges/measure?project=cardamom%3Ammg%3Agithub%3Adevelop&metric=duplicated_lines_density +[master-code-dpl]:https://sonarqube.inria.fr/sonarqube/api/project_badges/measure?project=cardamom%3Ammg%3Agithub%3Amaster&metric=duplicated_lines_density [master-sq-code-dpl]:https://sonarqube.inria.fr/sonarqube/component_measures?id=cardamom%3Ammg%3Agithub%3Amaster&metric=duplications @@ -48,8 +48,8 @@ [dev-qual-gate]: https://sonarqube.inria.fr/sonarqube/api/project_badges/measure?project=cardamom%3Ammg%3Agithub%3Adevelop&metric=alert_status [dev-sq-qual-gate]: https://sonarqube.inria.fr/sonarqube/dashboard?id=cardamom%3Ammg%3Agithub%3Adevelop -[dev-vulnerabilities]: https://sonarqube.inria.fr/sonarqube/api/project_badges/measure?project=cardamom%3Ammg%3Agithub%3Adevelop&metric=vulnerabilities -[dev-sq-vulnerabilities]: https://sonarqube.inria.fr/sonarqube/component_measures?id=cardamom%3Ammg%3Agithub%3Adevelop&metric=vulnerabilities +[dev-vulnerabilities]: https://sonarqube.inria.fr/sonarqube/api/project_badges/measure?project=cardamom%3Ammg%3Agithub%3Adevelop&metric=reliability_rating +[dev-sq-vulnerabilities]: https://sonarqube.inria.fr/sonarqube/component_measures?id=cardamom%3Ammg%3Agithub%3Adevelop&metric=reliability [dev-coverage]:https://sonarqube.inria.fr/sonarqube/api/project_badges/measure?project=cardamom%3Ammg%3Agithub%3Adevelop&metric=coverage [dev-sq-coverage]:https://sonarqube.inria.fr/sonarqube/component_measures?id=cardamom%3Ammg%3Agithub%3Adevelop&metric=coverage diff --git a/libexamples/mmg2d/io_multisols_example0/main.c b/libexamples/mmg2d/io_multisols_example0/main.c index 005d9dba1..49c28fcf4 100644 --- a/libexamples/mmg2d/io_multisols_example0/main.c +++ b/libexamples/mmg2d/io_multisols_example0/main.c @@ -116,6 +116,10 @@ int main(int argc,char *argv[]) { sols = (double*) calloc(np*2, sizeof(double)); else if ( typSol[i-1] == MMG5_Tensor ) sols = (double*) calloc(np*3, sizeof(double)); + else { + puts("Unexpected solution type."); + exit(EXIT_FAILURE); + } if ( MMG2D_Get_ithSols_inSolsAtVertices(mmgSol,i,sols) !=1 ) exit(EXIT_FAILURE); @@ -132,6 +136,10 @@ int main(int argc,char *argv[]) { else if ( typSol[i-1] == MMG5_Tensor ) { sols = (double*) calloc(3, sizeof(double)); } + else { + puts("Unexpected solution type."); + exit(EXIT_FAILURE); + } for ( j=1; j<=np; ++j ) { if ( MMG2D_Get_ithSol_inSolsAtVertices(mmgSol,i,sols,j) !=1 ) exit(EXIT_FAILURE); diff --git a/libexamples/mmg3d/io_multisols_example6/main.c b/libexamples/mmg3d/io_multisols_example6/main.c index cb4ee36dd..9b338579c 100644 --- a/libexamples/mmg3d/io_multisols_example6/main.c +++ b/libexamples/mmg3d/io_multisols_example6/main.c @@ -116,6 +116,10 @@ int main(int argc,char *argv[]) { else if ( typSol[i-1] == MMG5_Tensor ) { sols = (double*) calloc(np*6, sizeof(double)); } + else { + puts("Unexpected solution type."); + exit(EXIT_FAILURE); + } if ( MMG3D_Get_ithSols_inSolsAtVertices(mmgSol,i,sols) !=1 ) exit(EXIT_FAILURE); @@ -131,6 +135,10 @@ int main(int argc,char *argv[]) { else if ( typSol[i-1] == MMG5_Tensor ) { sols = (double*) calloc(6, sizeof(double)); } + else { + puts("Unexpected solution type."); + exit(EXIT_FAILURE); + } for ( j=1; j<=np; ++j ) { if ( MMG3D_Get_ithSol_inSolsAtVertices(mmgSol,i,sols,j) !=1 ) exit(EXIT_FAILURE); From 9a1ee132be0e5e1776099d69f5036129539a7d2a Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Mon, 12 Dec 2022 22:18:13 +0100 Subject: [PATCH 836/838] Fix SQ bugs (again). --- src/mmg3d/mmg3d1.c | 2 -- src/mmg3d/mmg3d1_delone.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/mmg3d/mmg3d1.c b/src/mmg3d/mmg3d1.c index 1ebab2f10..2f88cd08b 100644 --- a/src/mmg3d/mmg3d1.c +++ b/src/mmg3d/mmg3d1.c @@ -2014,8 +2014,6 @@ int MMG3D_splsurfedge( MMG5_pMesh mesh,MMG5_pSol met,MMG5_int k, if ( ier == 1 ) { ier = MMG5_split1b(mesh,met,list,ilist,ip,1,typchk-1,chkRidTet); } /* if we realloc memory in MMG5_split1b pt and pxt pointers are not valid */ - pt = &mesh->tetra[k]; - if ( ier < 0 ) { fprintf(stderr,"\n ## Error: %s: unable to split.\n",__func__); return -1; diff --git a/src/mmg3d/mmg3d1_delone.c b/src/mmg3d/mmg3d1_delone.c index b30684aff..ae60993a5 100644 --- a/src/mmg3d/mmg3d1_delone.c +++ b/src/mmg3d/mmg3d1_delone.c @@ -177,8 +177,6 @@ int MMG3D_mmg3d1_delone_split(MMG5_pMesh mesh, MMG5_pSol met, } /* if we realloc memory in MMG5_split1b pt and pxt pointers are not valid */ - pt = &mesh->tetra[k]; - if ( ier < 0 ) { fprintf(stderr,"\n ## Error: %s: unable to split.\n",__func__); MMG3D_delPt(mesh,ip); From 23e7c00131ac1d3dfd5ecdcb69d77ec5b07ff987 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Mon, 12 Dec 2022 22:37:24 +0100 Subject: [PATCH 837/838] Assert message [skip ci] --- src/mmg3d/bezier_3d.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mmg3d/bezier_3d.c b/src/mmg3d/bezier_3d.c index 9b5ccf1d2..71e39a7b9 100644 --- a/src/mmg3d/bezier_3d.c +++ b/src/mmg3d/bezier_3d.c @@ -390,7 +390,8 @@ int MMG5_mmg3dBezierCP(MMG5_pMesh mesh,MMG5_Tria *pt,MMG5_pBezier pb,int8_t ori) * projections may fail but I think that it is not a normal behaviour: * it means that the surface approximation has degenerated. See issue #167 */ - assert ( ps > 0. || ps2 > 0. && "Unexpected case"); + assert ( ps > 0. || ps2 > 0. && + "Negative projection of normal at tria onto normal at point: surface degeneracy"); /* As previous assert may fail in some cases, deal with both cases */ if ( (ps > 0.) || (ps2 >0.) ) { From c12544ae2b5cefb840292fd543757c02ed70c806 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Tue, 13 Dec 2022 00:20:28 +0100 Subject: [PATCH 838/838] Fix few issues with Doxygen doc [skip ci] --- src/common/API_functions.c | 2 +- src/common/API_functionsf.c | 16 ++++++++-------- src/common/anisosiz.c | 2 +- src/mmg2d/API_functionsf_2d.c | 8 ++++---- src/mmg2d/lissmet_2d.c | 2 +- src/mmg3d/API_functionsf_3d.c | 4 ++-- src/mmg3d/anisosiz_3d.c | 2 +- src/mmg3d/bezier_3d.c | 2 +- src/mmgs/API_functionsf_s.c | 8 ++++---- src/mmgs/bezier_s.c | 2 +- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/common/API_functions.c b/src/common/API_functions.c index 92872ee2c..a0ae95337 100644 --- a/src/common/API_functions.c +++ b/src/common/API_functions.c @@ -33,7 +33,7 @@ * \copyright GNU Lesser General Public License. * * \note This file contains some internal functions for the API, see the \a - * common/libmmgcommon.h, \a mmgs/libmmgs.h and \a mmg3d/libmmg3d.h header files + * common/libmmgcommon_private.h, \a mmgs/libmmgs.h and \a mmg3d/libmmg3d.h header files * for the documentation of all the usefull user's API functions. * * C API for MMG library. diff --git a/src/common/API_functionsf.c b/src/common/API_functionsf.c index 3ca9f97d7..6b94a5176 100644 --- a/src/common/API_functionsf.c +++ b/src/common/API_functionsf.c @@ -29,7 +29,7 @@ * \date 01 2014 * \copyright GNU Lesser General Public License. * - * \note Please, refer to the \ref common/libmmgcommon.h, mmgs/libmmgs.h and + * \note Please, refer to the \ref common/libmmgcommon_private.h, mmgs/libmmgs.h and * mmg3d/libmmg3d.h header files for functions documentation. * * Define the Fortran API functions for MMG library: adds function @@ -42,7 +42,7 @@ /** - * See \ref MMG5_Init_fileNames function in \ref common/libmmgcommon.h file. + * See \ref MMG5_Init_fileNames function in \ref common/libmmgcommon_private.h file. */ FORTRAN_NAME(MMG5_INIT_FILENAMES,mmg5_init_filenames,(MMG5_pMesh *mesh,MMG5_pSol *sol),(mesh,sol)) { @@ -51,7 +51,7 @@ FORTRAN_NAME(MMG5_INIT_FILENAMES,mmg5_init_filenames,(MMG5_pMesh *mesh,MMG5_pSol } /** - * See \ref MMG5_Set_inputMeshName function in \ref common/libmmgcommon.h file. + * See \ref MMG5_Set_inputMeshName function in \ref common/libmmgcommon_private.h file. */ FORTRAN_NAME(MMG5_SET_INPUTMESHNAME, mmg5_set_inputmeshname, (MMG5_pMesh *mesh, char *meshin, int *strlen, int *retval), @@ -68,7 +68,7 @@ FORTRAN_NAME(MMG5_SET_INPUTMESHNAME, mmg5_set_inputmeshname, } /** - * See \ref MMG5_Set_inputSolName function in \ref common/libmmgcommon.h file. + * See \ref MMG5_Set_inputSolName function in \ref common/libmmgcommon_private.h file. */ FORTRAN_NAME(MMG5_SET_INPUTSOLNAME, mmg5_set_inputsolname, (MMG5_pMesh *mesh,MMG5_pSol *sol, char* solin, int* strlen, int* retval), @@ -104,7 +104,7 @@ FORTRAN_NAME(MMG5_SET_OUTPUTMESHNAME,mmg5_set_outputmeshname, } /** - * See \ref MMG5_Set_outputSolName function in \ref common/libmmgcommon.h file. + * See \ref MMG5_Set_outputSolName function in \ref common/libmmgcommon_private.h file. */ FORTRAN_NAME(MMG5_SET_OUTPUTSOLNAME,mmg5_set_outputsolname, (MMG5_pMesh *mesh,MMG5_pSol *sol, char* solout,int* strlen, int* retval), @@ -121,7 +121,7 @@ FORTRAN_NAME(MMG5_SET_OUTPUTSOLNAME,mmg5_set_outputsolname, } /** - * See \ref MMG5_scaleMesh function in \ref common/libmmgcommon.h file. + * See \ref MMG5_scaleMesh function in \ref common/libmmgcommon_private.h file. */ FORTRAN_NAME(MMG5_SCALEMESH,mmg5_scalemesh, (MMG5_pMesh *mesh,MMG5_pSol *met,MMG5_pSol *ls,int* retval), @@ -133,7 +133,7 @@ FORTRAN_NAME(MMG5_SCALEMESH,mmg5_scalemesh, } /** - * See \ref MMG5_unscaleMesh function in \ref common/libmmgcommon.h file. + * See \ref MMG5_unscaleMesh function in \ref common/libmmgcommon_private.h file. */ FORTRAN_NAME(MMG5_UNSCALEMESH,mmg5_unscalemesh, (MMG5_pMesh *mesh,MMG5_pSol *met,MMG5_pSol *ls,int* retval), @@ -145,7 +145,7 @@ FORTRAN_NAME(MMG5_UNSCALEMESH,mmg5_unscalemesh, } /** - * See \a MMG5_unscaleMesh function in \ref common/libmmgcommon.h file. + * See \a MMG5_unscaleMesh function in \ref common/libmmgcommon_private.h file. */ FORTRAN_NAME(MMG5_MMGFREE_NAMES,mmg5_mmgfree_names,(MMG5_pMesh *mesh ,MMG5_pSol *met diff --git a/src/common/anisosiz.c b/src/common/anisosiz.c index 72e4ba76c..1ab713af7 100644 --- a/src/common/anisosiz.c +++ b/src/common/anisosiz.c @@ -758,7 +758,7 @@ int MMG5_solveDefmetrefSys( MMG5_pMesh mesh, MMG5_pPoint p0, MMG5_int ipref[2], \left(\frac{d-1}{d} \right)^2. \f] * - * See Theorem 1 of \cite{dapogny2014three}. + * See Theorem 1 of \cite dapogny2014three. * **/ double MMG5_ridSizeInTangentDir(MMG5_pMesh mesh, MMG5_pPoint p0, MMG5_int idp, diff --git a/src/mmg2d/API_functionsf_2d.c b/src/mmg2d/API_functionsf_2d.c index 1057dc4d9..da81f5b47 100644 --- a/src/mmg2d/API_functionsf_2d.c +++ b/src/mmg2d/API_functionsf_2d.c @@ -42,7 +42,7 @@ #include "libmmg2d_private.h" /** - * See \ref MMG2D_Init_mesh function in common/libmmgcommon.h file. + * See \ref MMG2D_Init_mesh function in common/libmmgcommon_private.h file. */ FORTRAN_VARIADIC ( MMG2D_INIT_MESH, mmg2d_init_mesh, (const int starter, ... ), @@ -77,7 +77,7 @@ FORTRAN_NAME(MMG2D_INIT_PARAMETERS, mmg2d_init_parameters,(MMG5_pMesh *mesh), return; } /** - * See \ref MMG2D_Set_inputMeshName function in \ref common/libmmgcommon.h file. + * See \ref MMG2D_Set_inputMeshName function in \ref common/libmmgcommon_private.h file. */ FORTRAN_NAME(MMG2D_SET_INPUTMESHNAME, mmg2d_set_inputmeshname, (MMG5_pMesh *mesh, char* meshin, int *strlen0, int* retval), @@ -94,7 +94,7 @@ FORTRAN_NAME(MMG2D_SET_INPUTMESHNAME, mmg2d_set_inputmeshname, } /** - * See \ref MMG2D_Set_inputSolName function in \ref common/libmmgcommon.h file. + * See \ref MMG2D_Set_inputSolName function in \ref common/libmmgcommon_private.h file. */ FORTRAN_NAME(MMG2D_SET_INPUTSOLNAME, mmg2d_set_inputsolname, (MMG5_pMesh *mesh,MMG5_pSol *sol, char* solin, int* strlen0, int* retval), @@ -130,7 +130,7 @@ FORTRAN_NAME(MMG2D_SET_OUTPUTMESHNAME,mmg2d_set_outputmeshname, } /** - * See \ref MMG2D_Set_outputSolName function in \ref common/libmmgcommon.h file. + * See \ref MMG2D_Set_outputSolName function in \ref common/libmmgcommon_private.h file. */ FORTRAN_NAME(MMG2D_SET_OUTPUTSOLNAME,mmg2d_set_outputsolname, (MMG5_pMesh *mesh,MMG5_pSol *sol, char* solout,int* strlen0, int* retval), diff --git a/src/mmg2d/lissmet_2d.c b/src/mmg2d/lissmet_2d.c index 43284a9db..e4363ac3d 100644 --- a/src/mmg2d/lissmet_2d.c +++ b/src/mmg2d/lissmet_2d.c @@ -40,7 +40,7 @@ * \return 0 if fail, 1 if success * * Anisotropic gradation (h-gradation procedure). See: - * \cite{borouchaki1998mesh}. The Hc-correction method is used (gradation with + * \cite borouchaki1998mesh. The Hc-correction method is used (gradation with * respect to H-shock measure). Skip edges with a required extremity (treated * in lissmetreq_ani). */ diff --git a/src/mmg3d/API_functionsf_3d.c b/src/mmg3d/API_functionsf_3d.c index b6a3e5b1a..dd91422b6 100644 --- a/src/mmg3d/API_functionsf_3d.c +++ b/src/mmg3d/API_functionsf_3d.c @@ -42,7 +42,7 @@ #include "libmmg3d.h" /** - * See \ref MMG3D_Init_mesh function in common/libmmgcommon.h file. + * See \ref MMG3D_Init_mesh function in common/libmmgcommon_private.h file. */ FORTRAN_VARIADIC ( MMG3D_INIT_MESH, mmg3d_init_mesh, (const int starter, ... ), @@ -121,7 +121,7 @@ FORTRAN_NAME(MMG3D_SET_OUTPUTMESHNAME,mmg3d_set_outputmeshname, } /** - * See \ref MMG3D_Set_outputSolName function in \ref common/libmmgcommon.h file. + * See \ref MMG3D_Set_outputSolName function in \ref common/libmmgcommon_private.h file. */ FORTRAN_NAME(MMG3D_SET_OUTPUTSOLNAME,mmg3d_set_outputsolname, (MMG5_pMesh *mesh,MMG5_pSol *sol, char* solout,int* strlen0, int* retval), diff --git a/src/mmg3d/anisosiz_3d.c b/src/mmg3d/anisosiz_3d.c index a28d78523..8695e5eb8 100644 --- a/src/mmg3d/anisosiz_3d.c +++ b/src/mmg3d/anisosiz_3d.c @@ -1432,7 +1432,7 @@ int MMG3D_defsiz_ani(MMG5_pMesh mesh,MMG5_pSol met) { * * Get metric tensor from metric structure (pass from ridge storage to classical * storage on non-singular ridge points, copy metric on all other points). - * See: \cite{borouchaki1998mesh}. The Hv-correction + * See: \cite borouchaki1998mesh. The Hv-correction * is used (gradation with respect to H-variation measure). */ static inline diff --git a/src/mmg3d/bezier_3d.c b/src/mmg3d/bezier_3d.c index 71e39a7b9..3cfebb43e 100644 --- a/src/mmg3d/bezier_3d.c +++ b/src/mmg3d/bezier_3d.c @@ -318,7 +318,7 @@ MMG5_BezierEdge(MMG5_pMesh mesh,MMG5_int ip0,MMG5_int ip1,double b0[3], * \param ori triangle orientation. * \return 1. * - * Compute Bezier control points on triangle \a pt (cf. \cite{vlachos2001curved}) + * Compute Bezier control points on triangle \a pt (cf. \cite vlachos2001curved) * * \todo merge with the MMG5_mmgsBezierCP function and remove the pointer * toward this functions. diff --git a/src/mmgs/API_functionsf_s.c b/src/mmgs/API_functionsf_s.c index 0b3d90df6..1cee170f5 100644 --- a/src/mmgs/API_functionsf_s.c +++ b/src/mmgs/API_functionsf_s.c @@ -41,7 +41,7 @@ #include "libmmgs_private.h" /** - * See \ref MMGS_Init_mesh function in common/libmmgcommon.h file. + * See \ref MMGS_Init_mesh function in common/libmmgcommon_private.h file. */ FORTRAN_VARIADIC ( MMGS_INIT_MESH, mmgs_init_mesh, (const int starter, ... ), @@ -66,7 +66,7 @@ FORTRAN_NAME(MMGS_INIT_PARAMETERS,mmgs_init_parameters,(MMG5_pMesh *mesh),(mesh) return; } /** - * See \ref MMGS_Set_inputMeshName function in \ref common/libmmgcommon.h file. + * See \ref MMGS_Set_inputMeshName function in \ref common/libmmgcommon_private.h file. */ FORTRAN_NAME(MMGS_SET_INPUTMESHNAME, mmgs_set_inputmeshname, (MMG5_pMesh *mesh, char* meshin, int *strlen0, int* retval), @@ -83,7 +83,7 @@ FORTRAN_NAME(MMGS_SET_INPUTMESHNAME, mmgs_set_inputmeshname, } /** - * See \ref MMGS_Set_inputSolName function in \ref common/libmmgcommon.h file. + * See \ref MMGS_Set_inputSolName function in \ref common/libmmgcommon_private.h file. */ FORTRAN_NAME(MMGS_SET_INPUTSOLNAME, mmgs_set_inputsolname, (MMG5_pMesh *mesh,MMG5_pSol *sol, char* solin, int* strlen0, int* retval), @@ -119,7 +119,7 @@ FORTRAN_NAME(MMGS_SET_OUTPUTMESHNAME,mmgs_set_outputmeshname, } /** - * See \ref MMGS_Set_outputSolName function in \ref common/libmmgcommon.h file. + * See \ref MMGS_Set_outputSolName function in \ref common/libmmgcommon_private.h file. */ FORTRAN_NAME(MMGS_SET_OUTPUTSOLNAME,mmgs_set_outputsolname, (MMG5_pMesh *mesh,MMG5_pSol *sol, char* solout,int* strlen0, int* retval), diff --git a/src/mmgs/bezier_s.c b/src/mmgs/bezier_s.c index 5e38db7ec..1509498c7 100644 --- a/src/mmgs/bezier_s.c +++ b/src/mmgs/bezier_s.c @@ -45,7 +45,7 @@ extern int8_t ddb; * with the MMG5_bezierCP interface). * \return 1. * - * Compute Bezier control points on triangle \a pt (cf. \cite{vlachos2001curved}). + * Compute Bezier control points on triangle \a pt (cf. \cite vlachos2001curved). * * \todo merge with the MMG5_mmg3dBezierCP function and remove the pointer * toward this functions.