diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index e69de29bb..a25a72751 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,25 @@ +{ + "configurations": [ + { + "name": "Linux", + "includePath": [ + "${workspaceFolder}/**", + "/usr/lib/x86_64-linux-gnu/openmpi/include", + "/usr/local/include/vtk-9.2/**", + "/home/lmottet/Work/Software/ParMmg/**", + "/home/lmottet/Work/Software/mmg/**", + "/home/lmottet/Work/Software/mmg/build-dev/include/**", + "/home/lmottet/Work/Software/mmg/build-dev/lib/**", + "/home/lmottet/Work/Software/mmg/build-*/include/**", + "/home/lmottet/Work/Software/mmg/build-*/lib/**" + + ], + "defines": [], + "compilerPath": "/usr/bin/mpirun", + "cStandard": "gnu17", + "cppStandard": "gnu++14", + "intelliSenseMode": "linux-gcc-x64" + } + ], + "version": 4 +} diff --git a/cmake/testing/code/mmg_get_tagname.c b/cmake/testing/code/mmg_get_tagname.c new file mode 100644 index 000000000..e8af8f669 --- /dev/null +++ b/cmake/testing/code/mmg_get_tagname.c @@ -0,0 +1,23 @@ +#include +#include + +#include "libmmgcommon_private.h" + +int main() { + + uint16_t tag; + char *tags_name; + + tag = 0; + printf("%s\n", MMG5_Get_tagName(tag)); + + tag = UINT16_MAX; + printf("%s\n", MMG5_Get_tagName(tag)); + + tag &= ~MG_NUL; + printf("%s\n", MMG5_Get_tagName(tag)); + + + return 0; + +} diff --git a/cmake/testing/code/ridge-preservation-in-ls-mode.c b/cmake/testing/code/ridge-preservation-in-ls-mode.c index f8b65d755..11e9c3a42 100644 --- a/cmake/testing/code/ridge-preservation-in-ls-mode.c +++ b/cmake/testing/code/ridge-preservation-in-ls-mode.c @@ -131,7 +131,7 @@ int main(int argc,char *argv[]) { MMG5_pEdge ped = &mesh1->edge[k]; if ( ped->tag & MG_GEO ) { MMG5_int ref; - int16_t tag; + uint16_t tag; if ( !MMG5_hGet(&hash,ped->a,ped->b,&ref,&tag) ) { continue; } diff --git a/cmake/testing/mmg_tests.cmake b/cmake/testing/mmg_tests.cmake index 34427728a..6f1c8883a 100644 --- a/cmake/testing/mmg_tests.cmake +++ b/cmake/testing/mmg_tests.cmake @@ -424,6 +424,65 @@ ADD_TEST(NAME mmg_CommandLineAni_${SHRT_EXEC} ${MMG_CI_TESTS}/SurfEdges_house/housebad.meshb -out ${CTEST_OUTPUT_DIR}/mmg_SurfEdges_OptimAni_${SHRT_EXEC}.o.meshb) +ENDFOREACH() +# Unit tests +## Really not clean: as the organization of the functions definition in .c files +## and headers declatation in .h files is very badly done (and has never been +## cleaned), and we try to test a private function of Mmg, we have to include +## almost all the .c/.h files to be able to build this unit test. +## +## Not built and tested on windows due to unallowed definition of dllimport data +## -ENDFOREACH() +IF ( NOT WIN32 ) + FILE( + GLOB + mmg_get_tagname_files + ${mmg2d_library_files} + ${mmg3d_library_files} + ${mmgs_library_files} + ${PROJECT_SOURCE_DIR}/cmake/testing/code/mmg_get_tagname.c + ) + + ADD_EXECUTABLE ( mmg_get_tagname ${mmg_get_tagname_files} ) + + ADD_DEPENDENCIES ( mmg_get_tagname copy_mmgcommon_headers + copy_3d_headers copy_2d_headers copy_s_headers ) + + + IF ( CMAKE_VERSION VERSION_LESS 2.8.12 ) + INCLUDE_DIRECTORIES ( BEFORE + ${MMGCOMMON_SOURCE_DIR} ${PROJECT_BINARY_DIR}/include + ${PROJECT_BINARY_DIR}/src/common ) + if ( SCOTCH_FOUND AND NOT USE_SCOTCH MATCHES OFF ) + INCLUDE_DIRECTORIES ( AFTER ${SCOTCH_INCLUDE_DIRS} ) + ENDIF() + + IF( ELAS_FOUND AND NOT USE_ELAS MATCHES OFF ) + # Set flags for building test program + INCLUDE_DIRECTORIES(AFTER ${ELAS_INCLUDE_DIR}) + SET( GET_TAGNAME_LIBRARIES ${ELAS_LINK_FLAGS} ${ELAS_LIBRARY} ${LIBRARIES}) + + ENDIF ( ) + + + ELSE ( ) + TARGET_INCLUDE_DIRECTORIES ( mmg_get_tagname BEFORE PUBLIC + ${MMGCOMMON_SOURCE_DIR} ${PROJECT_BINARY_DIR}/include + ${PROJECT_BINARY_DIR}/src/common + ) + if ( SCOTCH_FOUND AND NOT USE_SCOTCH MATCHES OFF ) + target_include_directories( mmg_get_tagname BEFORE PUBLIC ${SCOTCH_INCLUDE_DIRS} ) + ENDIF ( ) + + IF( ELAS_FOUND AND NOT USE_ELAS MATCHES OFF ) + target_include_directories( mmg_get_tagname AFTER PUBLIC ${ELAS_INCLUDE_DIR} ) + SET( GET_TAGNAME_LIBRARIES ${ELAS_LINK_FLAGS} ${ELAS_LIBRARY} ${LIBRARIES}) + ENDIF ( ) + + ENDIF ( ) + + TARGET_LINK_LIBRARIES ( mmg_get_tagname PRIVATE ${GET_TAGNAME_LIBRARIES} ) + +ENDIF ( ) diff --git a/src/common/API_functions.c b/src/common/API_functions.c index 06c759fab..706c0471e 100644 --- a/src/common/API_functions.c +++ b/src/common/API_functions.c @@ -734,7 +734,7 @@ const char* MMG5_Get_typeName(enum MMG5_type typ) } } -const char* MMG5_Get_tagName(int tag) +const char* MMG5_Get_tagName(uint16_t tag) { static char tags_name[1024]; @@ -791,7 +791,12 @@ const char* MMG5_Get_tagName(int tag) if ( tag & MG_PARBDY) { strcat(tags_name,"Parbdy "); - } + } + + if ( tag & MG_OVERLAP) { + strcat(tags_name,"Overlap "); + } + strcat(tags_name,"tag(s)."); return tags_name; diff --git a/src/common/hash.c b/src/common/hash.c index 811e2b85e..ce1f5d11b 100644 --- a/src/common/hash.c +++ b/src/common/hash.c @@ -438,7 +438,7 @@ int MMG5_hashUpdate(MMG5_Hash *hash, MMG5_int a,MMG5_int b,MMG5_int k) { * tag. If the edge exist, add the new tag to the already stored tags. * */ -int MMG5_hashEdgeTag(MMG5_pMesh mesh,MMG5_Hash *hash, MMG5_int a,MMG5_int b,int16_t tag) { +int MMG5_hashEdgeTag(MMG5_pMesh mesh,MMG5_Hash *hash, MMG5_int a,MMG5_int b,uint16_t tag) { MMG5_hedge *ph; MMG5_int key; MMG5_int ia,ib,j; diff --git a/src/common/libmmgcommon_private.h b/src/common/libmmgcommon_private.h index ba3d0bf7a..6687d2894 100644 --- a/src/common/libmmgcommon_private.h +++ b/src/common/libmmgcommon_private.h @@ -300,7 +300,7 @@ LIBMMG_CORE_EXPORT int MMG5_Compute_constantSize(MMG5_pMesh mesh,MMG5_pSol met,d * * \warning for debug purpose, no thread safe. */ -const char* MMG5_Get_tagName(int tag); +const char* MMG5_Get_tagName(uint16_t tag); /** * \param mesh pointer to the mesh structure. diff --git a/src/common/libmmgtypes.h b/src/common/libmmgtypes.h index 2c373593d..fe75d6193 100644 --- a/src/common/libmmgtypes.h +++ b/src/common/libmmgtypes.h @@ -287,7 +287,7 @@ typedef struct { the unused points)*/ MMG5_int flag; /*!< Flag to know if we have already treated the point */ MMG5_int s; - int16_t tag; /*!< Contains binary flags : if \f$tag=23=16+4+2+1\f$, then + uint16_t tag; /*!< Contains binary flags : if \f$tag=23=16+4+2+1\f$, then the point is \a MG_REF, \a MG_GEO, \a MG_REQ and \a MG_BDY */ int8_t tagdel; /*!< Tag for delaunay */ } MMG5_Point; @@ -313,7 +313,7 @@ typedef struct { MMG5_int ref; /*!< Reference of the edge */ MMG5_int base; /*!< 2Donly: used to store the tria+ tria edge indices that allow to access to the edge */ - int16_t tag; /*!< Binary flags */ + uint16_t tag; /*!< Binary flags */ } MMG5_Edge; typedef MMG5_Edge * MMG5_pEdge; @@ -345,7 +345,7 @@ typedef struct { MMG5_int edg[3]; /*!< edg[i] contains the ref of the \f$i^{th}\f$ edge of triangle */ MMG5_int flag; - int16_t tag[3]; /*!< tag[i] contains the tag associated to the + uint16_t tag[3]; /*!< tag[i] contains the tag associated to the \f$i^{th}\f$ edge of triangle */ } MMG5_Tria; typedef MMG5_Tria * MMG5_pTria; @@ -375,7 +375,7 @@ typedef struct { MMG5_int base; MMG5_int edg[4]; /*!< edg[i] contains the ref of the \f$i^{th}\f$ edge of quadrangle */ - int16_t tag[4]; /*!< tag[i] contains the tag associated to the + uint16_t tag[4]; /*!< tag[i] contains the tag associated to the \f$i^{th}\f$ edge of quadrangle */ } MMG5_Quad; typedef MMG5_Quad * MMG5_pQuad; @@ -414,7 +414,7 @@ typedef struct { tetrahedron (only for tetrahedra that are adjacent to surfaces) */ MMG5_int flag; - int16_t tag; + uint16_t tag; } MMG5_Tetra; typedef MMG5_Tetra * MMG5_pTetra; @@ -427,9 +427,9 @@ typedef struct { \f$i^{th}\f$ vertex of the tetrahedron;*/ MMG5_int edg[6]; /*!< edg[i] contains the reference of the \f$i^{th}\f$ edge of the tetrahedron */ - int16_t ftag[4]; /*!< ftag[i] contains the tag associated to the + uint16_t ftag[4]; /*!< ftag[i] contains the tag associated to the \f$i^{th}\f$ face of the tetrahedron */ - int16_t tag[6]; /*!< tag[i] contains the tag associated to the + uint16_t tag[6]; /*!< tag[i] contains the tag associated to the \f$i^{th}\f$ edge of the tetrahedron */ int8_t ori; /*!< Orientation of the triangles of the tetrahedron: the $\f$i^{th}\f$ bit of ori is set to 0 when the @@ -473,7 +473,7 @@ typedef struct { MMG5_int flag; MMG5_int xpr; /*!< Index of the surface \ref MMG5_xPrism associated to the prism*/ - int8_t tag; + uint8_t tag; } MMG5_Prism; typedef MMG5_Prism * MMG5_pPrism; @@ -488,9 +488,9 @@ typedef struct { * edg[0]={0,1},edg[1]={0,2},edg[2]={0,3},edg[3]={1,2}, * edg[4]={1,4},edg[5]={2,5},edg[6]={3,4},edg[7]={3,5}, * edg[8]={4,5}*/ - int16_t ftag[5]; /*!< ftag[i] contains the tag associated to the + uint16_t ftag[5]; /*!< ftag[i] contains the tag associated to the \f$i^{th}\f$ face of the prism */ - int16_t tag[9]; /*!< tag[i] contains the tag associated to the + uint16_t tag[9]; /*!< tag[i] contains the tag associated to the \f$i^{th}\f$ edge of the prism */ } MMG5_xPrism; typedef MMG5_xPrism * MMG5_pxPrism; @@ -572,7 +572,7 @@ typedef struct { MMG5_int b; /*!< Second extremity of edge */ MMG5_int ref; /*!< Reference or idx (2D) of edge */ MMG5_int nxt; /*!< Next element of hash table */ - int16_t tag; /*!< tag of edge */ + uint16_t tag; /*!< tag of edge */ } MMG5_hgeom; /** diff --git a/src/common/mmgcommon_private.h b/src/common/mmgcommon_private.h index 1e139dbac..36b44291b 100644 --- a/src/common/mmgcommon_private.h +++ b/src/common/mmgcommon_private.h @@ -153,7 +153,8 @@ extern "C" { #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 */ +#define MG_OVERLAP (1 << 14) /**< 16384 elements on overlap */ +#define MG_NUL (1 << 15) /**< 32768 vertex removed */ /* binary tags for local parameters */ #define MG_Vert (1 << 0 ) /**< 1 local parameter applied over vertex */ @@ -676,7 +677,7 @@ typedef struct MMG5_iNode_s { 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); + int MMG5_hashEdgeTag(MMG5_pMesh mesh,MMG5_Hash *hash,MMG5_int a,MMG5_int b,uint16_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); diff --git a/src/mmg2d/analys_2d.c b/src/mmg2d/analys_2d.c index 7da68a639..ded88b655 100644 --- a/src/mmg2d/analys_2d.c +++ b/src/mmg2d/analys_2d.c @@ -51,7 +51,7 @@ int MMG2D_setadj(MMG5_pMesh mesh, int8_t init_cc) { MMG5_pTria pt,pt1; MMG5_pQuad pq; MMG5_int *pile,*adja,ipil,k,kk,ncc,ip1,ip2,nr,nref; - int16_t tag; + uint16_t tag; int8_t i,ii,i1,i2; if ( !mesh->nt ) { diff --git a/src/mmg2d/libmmg2d_private.h b/src/mmg2d/libmmg2d_private.h index c301f5855..a700cf5f5 100644 --- a/src/mmg2d/libmmg2d_private.h +++ b/src/mmg2d/libmmg2d_private.h @@ -185,7 +185,7 @@ static const unsigned int MMG2D_idir[5] = {0,1,2,0,1}; /* Prototypes */ /*zaldy*/ -MMG5_int MMG2D_newPt(MMG5_pMesh mesh,double c[2],int16_t tag); +MMG5_int MMG2D_newPt(MMG5_pMesh mesh,double c[2],uint16_t tag); void MMG2D_delPt(MMG5_pMesh mesh,MMG5_int ip) ; void MMG5_delEdge(MMG5_pMesh mesh,MMG5_int iel); MMG5_int MMG2D_newElt(MMG5_pMesh mesh); diff --git a/src/mmg2d/zaldy_2d.c b/src/mmg2d/zaldy_2d.c index 3489dbc0a..865180e2d 100644 --- a/src/mmg2d/zaldy_2d.c +++ b/src/mmg2d/zaldy_2d.c @@ -35,7 +35,7 @@ /* Create a new vertex in the mesh, and return its number */ -MMG5_int MMG2D_newPt(MMG5_pMesh mesh,double c[2],int16_t tag) { +MMG5_int MMG2D_newPt(MMG5_pMesh mesh,double c[2],uint16_t tag) { MMG5_pPoint ppt; MMG5_int curpt; diff --git a/src/mmg3d/analys_3d.c b/src/mmg3d/analys_3d.c index f0a2d5ce7..9c076e19d 100644 --- a/src/mmg3d/analys_3d.c +++ b/src/mmg3d/analys_3d.c @@ -109,7 +109,7 @@ int MMG5_setadj(MMG5_pMesh mesh){ MMG5_pTria pt,pt1; MMG5_int *adja,*adjb,adji1,adji2,*pile,iad,ipil,ip1,ip2,gen; MMG5_int k,kk,iel,jel,nvf,nf,nr,nm,nt,nre,nreq,ncc,ned,ref; - int16_t tag; + uint16_t tag; int8_t i,ii,i1,i2,ii1,ii2,voy; nvf = nf = ncc = ned = 0; diff --git a/src/mmg3d/anisomovpt_3d.c b/src/mmg3d/anisomovpt_3d.c index d88a4b100..ceabaa2fa 100644 --- a/src/mmg3d/anisomovpt_3d.c +++ b/src/mmg3d/anisomovpt_3d.c @@ -503,7 +503,7 @@ int MMG5_movbdyregpt_ani(MMG5_pMesh mesh, MMG5_pSol met, MMG3D_pPROctree PROctre */ static inline int MMG3D_movbdycurvept_ani(MMG5_pMesh mesh, MMG5_pSol met, MMG3D_pPROctree PROctree,int64_t *listv, - int ilistv,MMG5_int *lists, int ilists,int improve,const int16_t edgTag){ + int ilistv,MMG5_int *lists, int ilists,int improve,const uint16_t edgTag){ MMG5_pTetra pt; MMG5_pPoint p0; MMG5_Tria tt; diff --git a/src/mmg3d/boulep_3d.c b/src/mmg3d/boulep_3d.c index a2b37f5a5..e02308f9d 100644 --- a/src/mmg3d/boulep_3d.c +++ b/src/mmg3d/boulep_3d.c @@ -202,7 +202,7 @@ int MMG5_boulenm(MMG5_pMesh mesh,MMG5_int start,int ip,int iface, double dd,nt[3]; int nr,nnm; MMG5_int base,nump,k,*adja,piv,nvstart,aux,na,nb,adj,fstart,ip0,ip1; - int16_t tag; + uint16_t tag; int8_t iopp,ipiv,indb,inda,i,isface; int8_t indedg[4][4] = { {-1,0,1,2}, {0,-1,3,4}, {1,3,-1,5}, {2,4,5,-1} }; @@ -1176,11 +1176,11 @@ int MMG5_bouletrid(MMG5_pMesh mesh,MMG5_int start,int iface,int ip,int *il1,MMG5 */ static inline int MMG3D_settag_oneDir(MMG5_pMesh mesh,MMG5_int start, MMG5_int na, MMG5_int nb, - int16_t tag,int edg, MMG5_int piv,MMG5_int adj) { + uint16_t tag,int edg, MMG5_int piv,MMG5_int adj) { MMG5_pTetra pt; MMG5_pxTetra pxt; MMG5_int *adja; - int16_t taginit; + uint16_t taginit; int8_t i; while ( adj && (adj != start) ) { @@ -1231,11 +1231,11 @@ int MMG3D_settag_oneDir(MMG5_pMesh mesh,MMG5_int start, MMG5_int na, MMG5_int n * travelling its shell. * */ -int MMG5_settag(MMG5_pMesh mesh,MMG5_int start,int ia,int16_t tag,int edg) { +int MMG5_settag(MMG5_pMesh mesh,MMG5_int start,int ia,uint16_t tag,int edg) { MMG5_pTetra pt; MMG5_pxTetra pxt; MMG5_int na,nb,*adja,adj,piv; - int16_t taginit; + uint16_t taginit; assert( start >= 1 ); pt = &mesh->tetra[start]; @@ -1298,7 +1298,7 @@ int MMG5_settag(MMG5_pMesh mesh,MMG5_int start,int ia,int16_t tag,int edg) { */ static inline int MMG3D_deltag_oneDir(MMG5_pMesh mesh,MMG5_int start, MMG5_int na, MMG5_int nb, - int16_t tag,MMG5_int piv,MMG5_int adj) { + uint16_t tag,MMG5_int piv,MMG5_int adj) { MMG5_pTetra pt; MMG5_pxTetra pxt; MMG5_int *adja; @@ -1344,7 +1344,7 @@ int MMG3D_deltag_oneDir(MMG5_pMesh mesh,MMG5_int start, MMG5_int na, MMG5_int n * shell. * */ -int MMG5_deltag(MMG5_pMesh mesh,MMG5_int start,int ia,int16_t tag) { +int MMG5_deltag(MMG5_pMesh mesh,MMG5_int start,int ia,uint16_t tag) { MMG5_pTetra pt; MMG5_pxTetra pxt; MMG5_int na,nb,*adja,adj,piv; diff --git a/src/mmg3d/chkmsh_3d.c b/src/mmg3d/chkmsh_3d.c index 845cd6310..031883f38 100644 --- a/src/mmg3d/chkmsh_3d.c +++ b/src/mmg3d/chkmsh_3d.c @@ -90,7 +90,7 @@ void MMG5_chkvol(MMG5_pMesh mesh) { */ static inline int MMG3D_chk_shellEdgeTag_oneDir(MMG5_pMesh mesh,MMG5_int start, MMG5_int na, MMG5_int nb, - int16_t tag,MMG5_int ref, MMG5_int piv,MMG5_int adj) { + uint16_t tag,MMG5_int ref, MMG5_int piv,MMG5_int adj) { MMG5_pTetra pt; MMG5_pxTetra pxt; MMG5_int *adja; @@ -139,7 +139,7 @@ int MMG3D_chk_shellEdgeTag_oneDir(MMG5_pMesh mesh,MMG5_int start, MMG5_int na, * traveling its shell. * */ -int MMG3D_chk_shellEdgeTag(MMG5_pMesh mesh,MMG5_int start, int8_t ia,int16_t tag,MMG5_int ref) { +int MMG3D_chk_shellEdgeTag(MMG5_pMesh mesh,MMG5_int start, int8_t ia,uint16_t tag,MMG5_int ref) { MMG5_pTetra pt; MMG5_pxTetra pxt; MMG5_int piv,na,nb,adj,*adja; @@ -235,7 +235,7 @@ void MMG3D_chkmeshedgestags(MMG5_pMesh mesh) { ip1 = pt->v[MMG5_iare[i][0]]; ip2 = pt->v[MMG5_iare[i][1]]; - int16_t tag = 0; + uint16_t tag = 0; MMG5_int dummy = 0; int ier = MMG5_hGet ( &hash,ip1,ip2,&dummy,&tag); @@ -899,7 +899,7 @@ int srcface(MMG5_pMesh mesh,MMG5_int n0,MMG5_int n1,MMG5_int n2) { MMG5_pTetra pt; MMG5_pxTetra pxt; MMG5_int ref,minn,maxn,sn,k,ip0,ip1,ip2,mins,maxs,sum; - int16_t tag; + uint16_t tag; int8_t i; static int8_t mmgWarn0 = 0; diff --git a/src/mmg3d/colver_3d.c b/src/mmg3d/colver_3d.c index f31f46606..30aed7edd 100644 --- a/src/mmg3d/colver_3d.c +++ b/src/mmg3d/colver_3d.c @@ -379,7 +379,7 @@ MMG5_topchkcol_bdy(MMG5_pMesh mesh,MMG5_int k,int iface,int8_t iedg,MMG5_int *li */ static inline int MMG3D_get_shellEdgeTag_oneDir(MMG5_pMesh mesh,MMG5_int start, MMG5_int na, MMG5_int nb, - int16_t *tag,MMG5_int *ref, MMG5_int piv,MMG5_int adj, + uint16_t *tag,MMG5_int *ref, MMG5_int piv,MMG5_int adj, int8_t *filled) { MMG5_pTetra pt; MMG5_pxTetra pxt; @@ -436,7 +436,7 @@ int MMG3D_get_shellEdgeTag_oneDir(MMG5_pMesh mesh,MMG5_int start, MMG5_int na, * consistent through the edge shell); * */ -int MMG3D_get_shellEdgeTag(MMG5_pMesh mesh,MMG5_int start, int8_t ia,int16_t *tag,MMG5_int *ref) { +int MMG3D_get_shellEdgeTag(MMG5_pMesh mesh,MMG5_int start, int8_t ia,uint16_t *tag,MMG5_int *ref) { MMG5_pTetra pt; MMG5_pxTetra pxt; MMG5_int piv,na,nb,adj,*adja; @@ -535,7 +535,7 @@ int MMG5_chkcol_bdy(MMG5_pMesh mesh,MMG5_pSol met,MMG5_int k,int8_t iface, double ps,devold,devnew,hmax,hausd; MMG5_int nump,numq,ndepmin,ndepplus,l,kk,iel; int nr,nbbdy,isloc,iedgeOpp,ipp; - int16_t tag; + uint16_t tag; int8_t iopp,iopp2,ia,ip,i,iq,i0,i1,ier,isminp,isplp; #ifndef NDEBUG MMG5_pPoint p0; @@ -635,7 +635,7 @@ int MMG5_chkcol_bdy(MMG5_pMesh mesh,MMG5_pSol met,MMG5_int k,int8_t iface, * shell because some MG_BDY tags may be missings due to the creation * of an xtetra during a previous collapse */ if ( (!pt->xt) || !(pxt->ftag[i] & MG_BDY) ) { - int16_t tag0,tag1,tag2; + uint16_t tag0,tag1,tag2; MMG5_int ref0,ref1,ref2; tag0 = tag1 = tag2 = 0; @@ -954,7 +954,7 @@ void MMG3D_update_edgeTag(MMG5_pTetra pt,MMG5_pxTetra pxt,MMG5_int np, MMG5_int int i,j; MMG5_int p0,p1; uint8_t ia,iav; - int16_t tag,tag1; + uint16_t tag,tag1; /* update tags for edges */ for ( j=0; j<3; j++ ) { @@ -1010,11 +1010,11 @@ void MMG3D_update_edgeTag(MMG5_pTetra pt,MMG5_pxTetra pxt,MMG5_int np, MMG5_int */ static inline MMG5_int MMG3D_update_shellEdgeTag_oneDir(MMG5_pMesh mesh,MMG5_int start, MMG5_int na, MMG5_int nb, - int16_t tag,MMG5_int ref, MMG5_int piv,MMG5_int adj) { + uint16_t tag,MMG5_int ref, MMG5_int piv,MMG5_int adj) { MMG5_pTetra pt; MMG5_pxTetra pxt; MMG5_int *adja; - int16_t xtag; + uint16_t xtag; int8_t i; assert ( tag & MG_BDY && "Unexpected non boundary tag"); @@ -1074,11 +1074,11 @@ MMG5_int MMG3D_update_shellEdgeTag_oneDir(MMG5_pMesh mesh,MMG5_int start, MMG5_ * */ static inline -int MMG3D_update_shellEdgeTag(MMG5_pMesh mesh,MMG5_int start, int8_t ia,int16_t tag,MMG5_int ref) { +int MMG3D_update_shellEdgeTag(MMG5_pMesh mesh,MMG5_int start, int8_t ia,uint16_t tag,MMG5_int ref) { MMG5_pTetra pt; MMG5_pxTetra pxt; MMG5_int piv,na,nb,adj,*adja; - int16_t xtag; + uint16_t xtag; pt = &mesh->tetra[start]; @@ -1278,9 +1278,9 @@ MMG5_int MMG5_colver(MMG5_pMesh mesh,MMG5_pSol met,int64_t *list,int ilist,int8_ int iped = coled[l+0]; int iqed = coled[l+1]; - int16_t tagip = 0; + uint16_t tagip = 0; MMG5_int refip = 0; - int16_t tagiq = 0; + uint16_t tagiq = 0; MMG5_int refiq = 0; if ( !MMG3D_get_shellEdgeTag(mesh,iel,iped,&tagip,&refip) ) { diff --git a/src/mmg3d/hash_3d.c b/src/mmg3d/hash_3d.c index 6c3fe3bfc..f0cfef171 100644 --- a/src/mmg3d/hash_3d.c +++ b/src/mmg3d/hash_3d.c @@ -615,7 +615,7 @@ int MMG5_setEdgeNmTag(MMG5_pMesh mesh, MMG5_Hash *hash) { static inline -int MMG5_skip_ParBdy ( int8_t tag ) { +uint16_t MMG5_skip_ParBdy ( uint16_t tag ) { return (tag & MG_PARBDY); } @@ -634,7 +634,7 @@ int MMG5_skip_ParBdy ( int8_t tag ) { * points to not break the ParMmg distributed analysis in which this field is * used to store the global numbering of nodes. */ -int MMG5_setVertexNmTag(MMG5_pMesh mesh,int func(int8_t) ) { +int MMG5_setVertexNmTag(MMG5_pMesh mesh,uint16_t func(uint16_t) ) { MMG5_pTetra ptet; MMG5_pPoint ppt0,ppt1; MMG5_Hash hash; @@ -911,7 +911,7 @@ int MMG5_hashPop(MMG5_Hash *hash,MMG5_int a,MMG5_int b) { * set tag to edge on geometry * */ -int MMG5_hTag(MMG5_HGeom *hash,MMG5_int a,MMG5_int b,MMG5_int ref,int16_t tag) { +int MMG5_hTag(MMG5_HGeom *hash,MMG5_int a,MMG5_int b,MMG5_int ref,uint16_t tag) { MMG5_hgeom *ph; MMG5_int key; MMG5_int ia,ib; @@ -944,7 +944,7 @@ int MMG5_hTag(MMG5_HGeom *hash,MMG5_int a,MMG5_int b,MMG5_int ref,int16_t tag) { } /** remove edge from hash table */ -int MMG5_hPop(MMG5_HGeom *hash,MMG5_int a,MMG5_int b,MMG5_int *ref,int16_t *tag) { +int MMG5_hPop(MMG5_HGeom *hash,MMG5_int a,MMG5_int b,MMG5_int *ref,uint16_t *tag) { MMG5_hgeom *ph,*php; MMG5_int key; MMG5_int ia,ib,iph,iphp; @@ -1004,7 +1004,7 @@ int MMG5_hPop(MMG5_HGeom *hash,MMG5_int a,MMG5_int b,MMG5_int *ref,int16_t *tag) } /** get ref and tag to edge on geometry */ -int MMG5_hGet(MMG5_HGeom *hash,MMG5_int a,MMG5_int b,MMG5_int *ref,int16_t *tag) { +int MMG5_hGet(MMG5_HGeom *hash,MMG5_int a,MMG5_int b,MMG5_int *ref,uint16_t *tag) { MMG5_hgeom *ph; MMG5_int key; MMG5_int ia,ib; @@ -1037,7 +1037,7 @@ int MMG5_hGet(MMG5_HGeom *hash,MMG5_int a,MMG5_int b,MMG5_int *ref,int16_t *tag) } /** store edge on geometry */ -int MMG5_hEdge(MMG5_pMesh mesh,MMG5_HGeom *hash,MMG5_int a,MMG5_int b,MMG5_int ref,int16_t tag) { +int MMG5_hEdge(MMG5_pMesh mesh,MMG5_HGeom *hash,MMG5_int a,MMG5_int b,MMG5_int ref,uint16_t tag) { MMG5_hgeom *ph; MMG5_int key; MMG5_int ia,ib,j; @@ -1114,7 +1114,7 @@ int MMG5_hGeom(MMG5_pMesh mesh) { MMG5_Hash hash; MMG5_int edg,*adja,k,kk; int ier; - int16_t tag; + uint16_t tag; int8_t i,i1,i2; /* if edges exist in mesh, hash special edges from existing field */ @@ -1964,7 +1964,7 @@ int MMG5_bdrySet(MMG5_pMesh mesh) { MMG5_Hash hash; MMG5_int ref,*adja,adj,k,ia,ib,ic,kt,initedg[3]; int j; - int16_t tag,inittag[3]; + uint16_t tag,inittag[3]; int8_t i,i1,i2; if ( !mesh->nt ) return 1; @@ -2002,6 +2002,7 @@ int MMG5_bdrySet(MMG5_pMesh mesh) { for (k=1; k<=mesh->ne; k++) { pt = &mesh->tetra[k]; if ( !MG_EOK(pt) ) continue; + if (pt->tag & MG_OVERLAP) continue; adja = &mesh->adja[4*(k-1)+1]; for (i=0; i<4; i++) { adj = adja[i] / 4; @@ -2046,6 +2047,7 @@ int MMG5_bdrySet(MMG5_pMesh mesh) { for (k=1; k<=mesh->ne; k++) { pt = &mesh->tetra[k]; if ( !MG_EOK(pt) ) continue; + if (pt->tag & MG_OVERLAP) continue; for (i=0; i<4; i++) { ia = pt->v[MMG5_idir[i][0]]; @@ -2090,6 +2092,7 @@ int MMG5_bdrySet(MMG5_pMesh mesh) { for (k=1; k<=mesh->ne; k++) { pt = &mesh->tetra[k]; if ( !MG_EOK(pt) ) continue; + if (pt->tag & MG_OVERLAP) continue; if ( !pt->xt ) continue; pxt = &mesh->xtetra[pt->xt]; adja = &mesh->adja[4*(k-1)+1]; @@ -2131,6 +2134,7 @@ int MMG5_bdrySet(MMG5_pMesh mesh) { for (k=1; k<=mesh->ne; k++) { pt = &mesh->tetra[k]; if ( !MG_EOK(pt) ) continue; + if (pt->tag & MG_OVERLAP) continue; if ( !pt->xt ) continue; pxt = &mesh->xtetra[pt->xt]; adja = &mesh->adja[4*(k-1)+1]; @@ -2294,7 +2298,7 @@ int MMG5_bdryUpdate(MMG5_pMesh mesh) { MMG5_Hash hash; MMG5_int ia,ib,ic,k,kt; int j; - int16_t tag; + uint16_t tag; int8_t i; if ( !mesh->nt ) return 1; diff --git a/src/mmg3d/intmet_3d.c b/src/mmg3d/intmet_3d.c index 11b9693d5..27b5fd410 100644 --- a/src/mmg3d/intmet_3d.c +++ b/src/mmg3d/intmet_3d.c @@ -94,7 +94,7 @@ int MMG5_intmet_ani(MMG5_pMesh mesh,MMG5_pSol met,MMG5_int k,int8_t i,MMG5_int i // explicitely added if we arrive from a boundary face and a boundary edge // should not be splitted from a non boundary face if ( mesh->adja ) { - int16_t tag = 0; + uint16_t tag = 0; MMG5_int ref = 0; if ( !MMG3D_get_shellEdgeTag(mesh,k,i,&tag,&ref) ) { fprintf(stderr,"\n ## Warning: %s: 0. unable to get edge info" diff --git a/src/mmg3d/libmmg3d_private.h b/src/mmg3d/libmmg3d_private.h index ce8a64993..9c298d1ca 100644 --- a/src/mmg3d/libmmg3d_private.h +++ b/src/mmg3d/libmmg3d_private.h @@ -224,7 +224,7 @@ int MMG3D_Free_all_var( va_list argptr ); int MMG3D_Free_structures_var( va_list argptr ); int MMG3D_Free_names_var( va_list argptr ); void MMG3D_Free_arrays(MMG5_pMesh*,MMG5_pSol*,MMG5_pSol*,MMG5_pSol*,MMG5_pSol*); -MMG5_int MMG3D_newPt(MMG5_pMesh mesh,double c[3],int16_t tag,MMG5_int src); +MMG5_int MMG3D_newPt(MMG5_pMesh mesh,double c[3],uint16_t tag,MMG5_int src); MMG5_int MMG3D_newElt(MMG5_pMesh mesh); int MMG3D_delElt(MMG5_pMesh mesh,MMG5_int iel); void MMG3D_delPt(MMG5_pMesh mesh,MMG5_int ip); @@ -271,11 +271,11 @@ void MMG3D_coquilFaceSecondLoopInit(MMG5_pMesh mesh,MMG5_int piv,int8_t *iface,i void MMG5_coquilFaceErrorMessage(MMG5_pMesh mesh, MMG5_int k1, MMG5_int k2); int16_t MMG5_coquilTravel(MMG5_pMesh,MMG5_int,MMG5_int,MMG5_int*,MMG5_int*,int8_t*,int8_t*); int16_t MMG5_openCoquilTravel(MMG5_pMesh,MMG5_int,MMG5_int,MMG5_int*,MMG5_int*,int8_t*,int8_t*); -int MMG3D_get_shellEdgeTag(MMG5_pMesh,MMG5_int,int8_t,int16_t*,MMG5_int *); -int MMG5_settag(MMG5_pMesh,MMG5_int,int,int16_t,int); -int MMG5_deltag(MMG5_pMesh,MMG5_int,int,int16_t); +int MMG3D_get_shellEdgeTag(MMG5_pMesh,MMG5_int,int8_t,uint16_t*,MMG5_int *); +int MMG5_settag(MMG5_pMesh,MMG5_int,int,uint16_t,int); +int MMG5_deltag(MMG5_pMesh,MMG5_int,int,uint16_t); int MMG5_setNmTag(MMG5_pMesh mesh, MMG5_Hash *hash); -int MMG5_setVertexNmTag(MMG5_pMesh mesh,int func(int8_t) ); +int MMG5_setVertexNmTag(MMG5_pMesh mesh,uint16_t func(uint16_t) ); int MMG5_chkcol_int(MMG5_pMesh,MMG5_pSol,MMG5_int,int8_t,int8_t,int64_t*,int,int8_t); int MMG5_chkcol_bdy(MMG5_pMesh,MMG5_pSol,MMG5_int,int8_t,int8_t,int64_t*,int,MMG5_int*,int,MMG5_int,MMG5_int,int8_t,int,int8_t); int MMG3D_chkmanicoll(MMG5_pMesh,MMG5_int,int,int,MMG5_int,MMG5_int,MMG5_int,MMG5_int,int8_t,int8_t); @@ -295,10 +295,10 @@ MMG5_int MMG5_hashGetFace(MMG5_Hash*,MMG5_int,MMG5_int,MMG5_int); int MMG3D_hashTria(MMG5_pMesh mesh, MMG5_Hash*); int MMG3D_hashPrism(MMG5_pMesh mesh); int MMG5_hashPop(MMG5_Hash *hash,MMG5_int a,MMG5_int b); -int MMG5_hPop(MMG5_HGeom *hash,MMG5_int a,MMG5_int b,MMG5_int *ref,int16_t *tag); -int MMG5_hTag(MMG5_HGeom *hash,MMG5_int a,MMG5_int b,MMG5_int ref,int16_t tag); -int MMG5_hGet(MMG5_HGeom *hash,MMG5_int a,MMG5_int b,MMG5_int *ref,int16_t *tag); -int MMG5_hEdge(MMG5_pMesh mesh,MMG5_HGeom *hash,MMG5_int a,MMG5_int b,MMG5_int ref,int16_t tag); +int MMG5_hPop(MMG5_HGeom *hash,MMG5_int a,MMG5_int b,MMG5_int *ref,uint16_t *tag); +int MMG5_hTag(MMG5_HGeom *hash,MMG5_int a,MMG5_int b,MMG5_int ref,uint16_t tag); +int MMG5_hGet(MMG5_HGeom *hash,MMG5_int a,MMG5_int b,MMG5_int *ref,uint16_t *tag); +int MMG5_hEdge(MMG5_pMesh mesh,MMG5_HGeom *hash,MMG5_int a,MMG5_int b,MMG5_int ref,uint16_t tag); int MMG5_hNew(MMG5_pMesh mesh,MMG5_HGeom *hash,MMG5_int hsiz,MMG5_int hmax); int MMG5_hGeom(MMG5_pMesh mesh); int MMG5_bdryIso(MMG5_pMesh ); @@ -318,6 +318,7 @@ int MMG3D_resetRef_ls(MMG5_pMesh mesh); int MMG3D_resetRef_lssurf(MMG5_pMesh mesh); int MMG3D_setref_ls(MMG5_pMesh mesh, MMG5_pSol sol); int MMG3D_setref_lssurf(MMG5_pMesh mesh, MMG5_pSol sol); +int MMG3D_ismaniball(MMG5_pMesh mesh,MMG5_pSol sol,MMG5_int k,int indp); int MMG3D_snpval_ls(MMG5_pMesh mesh,MMG5_pSol sol); int MMG3D_snpval_lssurf(MMG5_pMesh mesh,MMG5_pSol sol); int MMG3D_cuttet_ls(MMG5_pMesh mesh, MMG5_pSol sol,MMG5_pSol met); @@ -368,7 +369,7 @@ int MMG5_movbdyregpt_iso(MMG5_pMesh, MMG5_pSol,MMG3D_pPROctree, int64_t*, int, MMG5_int*, int, int ,int); int MMG5_movbdyregpt_ani(MMG5_pMesh, MMG5_pSol,MMG3D_pPROctree, int64_t*, int, MMG5_int*, int, int ,int); -int MMG3D_curveEndingPts(MMG5_pMesh,MMG5_int*,int,const int16_t,MMG5_int,MMG5_int*,MMG5_int*); +int MMG3D_curveEndingPts(MMG5_pMesh,MMG5_int*,int,const uint16_t,MMG5_int,MMG5_int*,MMG5_int*); int MMG3D_movbdycurvept_chckAndUpdate(MMG5_pMesh mesh, MMG5_pSol met, MMG3D_pPROctree PROctree, int64_t *listv, int ilistv,int improve,MMG5_pPoint p0, @@ -377,7 +378,7 @@ int MMG3D_movbdycurvept_chckAndUpdate(MMG5_pMesh mesh, MMG5_pSol met, int MMG3D_movbdycurvept_newPosForSimu(MMG5_pMesh,MMG5_pPoint,MMG5_int,MMG5_int,MMG5_int, double,double,uint8_t,const double, double[3],double[3], - double[3],double[3],const int16_t); + double[3],double[3],const uint16_t); int MMG5_movbdyrefpt_iso(MMG5_pMesh, MMG5_pSol,MMG3D_pPROctree, int64_t*, int, MMG5_int*, int ,int); int MMG5_movbdyrefpt_ani(MMG5_pMesh, MMG5_pSol,MMG3D_pPROctree, int64_t*, int, @@ -467,7 +468,7 @@ void MMG5_printTetra(MMG5_pMesh mesh,char* fileName); void MMG3D_chkpointtag(MMG5_pMesh mesh); void MMG3D_chkmeshedgestags(MMG5_pMesh mesh); void MMG3D_chkfacetags(MMG5_pMesh mesh); -int MMG3D_chk_shellEdgeTag(MMG5_pMesh mesh,MMG5_int start, int8_t ia,int16_t tag,MMG5_int ref); +int MMG3D_chk_shellEdgeTag(MMG5_pMesh mesh,MMG5_int start, int8_t ia,uint16_t tag,MMG5_int ref); #ifdef USE_SCOTCH int MMG5_mmg3dRenumbering(int,MMG5_pMesh,MMG5_pSol,MMG5_pSol,MMG5_int*); @@ -493,7 +494,7 @@ int MMG5_cenrad_iso(MMG5_pMesh mesh,double *ct,double *c,double *rad); int MMG5_cenrad_ani(MMG5_pMesh mesh,double *ct,double *m,double *c,double *rad); /* mmg3d1.c */ -void MMG3D_set_geom(MMG5_pMesh,MMG5_pPoint,int16_t,MMG5_int,MMG5_int,double[3],double[3],double[3]); +void MMG3D_set_geom(MMG5_pMesh,MMG5_pPoint,uint16_t,MMG5_int,MMG5_int,double[3],double[3],double[3]); void MMG5_tet2tri(MMG5_pMesh mesh,MMG5_int k,int8_t ie,MMG5_Tria *ptt); int MMG3D_dichoto(MMG5_pMesh mesh,MMG5_pSol met,MMG5_int k,MMG5_int *vx); int MMG3D_dichoto1b(MMG5_pMesh mesh,MMG5_pSol met,int64_t *list,int ret,MMG5_int); @@ -502,7 +503,7 @@ void MMG3D_find_bdyface_from_edge(MMG5_pMesh,MMG5_pTetra,int8_t,int8_t*,int8_t*, int8_t*,int8_t*,MMG5_int*,MMG5_int*,MMG5_pPoint*,MMG5_pPoint*); int8_t MMG3D_build_bezierEdge(MMG5_pMesh,MMG5_int,int8_t,int8_t,int8_t,MMG5_pxTetra, MMG5_int,MMG5_int,MMG5_pPoint,MMG5_pPoint, - MMG5_int*,int16_t*,double[3],double[3],double[3], + MMG5_int*,uint16_t*,double[3],double[3],double[3], double[3],int64_t*,int*); int MMG3D_adpcoledg(MMG5_pMesh,MMG5_pSol,MMG3D_pPROctree*,MMG5_int,int8_t,double,MMG5_int*); int MMG3D_splsurfedge( MMG5_pMesh,MMG5_pSol,MMG5_int,MMG5_pTetra,MMG5_pxTetra,int8_t, diff --git a/src/mmg3d/mmg3d1.c b/src/mmg3d/mmg3d1.c index 7232ad096..dc005e3c7 100644 --- a/src/mmg3d/mmg3d1.c +++ b/src/mmg3d/mmg3d1.c @@ -57,7 +57,7 @@ extern int8_t ddb; * */ void MMG3D_set_geom(MMG5_pMesh mesh, MMG5_pPoint ppt, - int16_t tag,MMG5_int nmref,MMG5_int edgref, + uint16_t tag,MMG5_int nmref,MMG5_int edgref, double no1[3],double no2[3],double to[3]) { if ( MG_EDG_OR_NOM(tag) ) { @@ -899,7 +899,10 @@ static MMG5_int MMG5_coltet(MMG5_pMesh mesh,MMG5_pSol met,int8_t typchk) { MMG5_int base,k,nc,nnm,lists[MMG3D_LMAX+2],refmin,refplus; int64_t list[MMG3D_LMAX+2]; int l,kk,isloc,ifac1; - int16_t tag,tag0,tag1,isnm,isnmint; + + uint16_t tag,tag0,tag1,isnm; + int16_t isnmint; + int8_t i,j,ip,iq; int ier, bsret; // function return values/error codes @@ -938,10 +941,11 @@ static MMG5_int MMG5_coltet(MMG5_pMesh mesh,MMG5_pSol met,int8_t typchk) { } else { /* Ignore OLDPARBDY tag of p0 */ - int16_t tag0 = p0->tag, tag1 = p1->tag; + uint16_t tag0 = p0->tag, tag1 = p1->tag; tag0 &= ~MG_OLDPARBDY; tag1 &= ~MG_OLDPARBDY; if ( (tag0 > tag1) || (tag0 & MG_REQ) ) { + /* Unable to merge edge */ continue; } @@ -1231,7 +1235,7 @@ int MMG3D_adpcoledg(MMG5_pMesh mesh, MMG5_pSol met, MMG3D_find_bdyface_from_edge(mesh,pt,imin,&i,&j,&i1,&i2,&ip1,&ip2,&p0,&p1); /* Ignore OLDPARBDY tag of p0 */ - int16_t tag0 = p0->tag; + uint16_t tag0 = p0->tag; tag0 &= ~MG_OLDPARBDY; if ( (tag0 > p1->tag) || (tag0 & MG_REQ) ) { /* Unable to merge edge: pass to next element */ @@ -1242,7 +1246,7 @@ int MMG3D_adpcoledg(MMG5_pMesh mesh, MMG5_pSol met, ilist = 0; if ( pt->xt && (pxt->ftag[i] & MG_BDY) ) { /* Case of a boundary face */ - int16_t tag = pxt->tag[MMG5_iarf[i][j]]; + uint16_t tag = pxt->tag[MMG5_iarf[i][j]]; if ( tag & MG_REQ ) { return 0; } @@ -1255,7 +1259,7 @@ int MMG3D_adpcoledg(MMG5_pMesh mesh, MMG5_pSol met, return 0; } - int16_t isnm = (p0->tag & MG_NOM); + uint16_t isnm = (p0->tag & MG_NOM); if (MMG5_boulesurfvolp(mesh,k,i1,i, list,&ilist,lists,&ilists,isnm) < 0 ) { return -1; } @@ -1778,7 +1782,7 @@ int8_t MMG3D_build_bezierEdge(MMG5_pMesh mesh,MMG5_int k, MMG5_pxTetra pxt, MMG5_int ip1,MMG5_int ip2, MMG5_pPoint p0, MMG5_pPoint p1, - MMG5_int *ref,int16_t *tag, + MMG5_int *ref,uint16_t *tag, double o[3],double to[3],double no1[3], double no2[3],int64_t *list,int *ilist) { MMG5_Tria ptt; @@ -1959,7 +1963,7 @@ int MMG3D_splsurfedge( MMG5_pMesh mesh,MMG5_pSol met,MMG5_int k, MMG5_int src,ip,ip1,ip2,ref; int64_t list[MMG3D_LMAX+2]; int ier; - int16_t tag; + uint16_t tag; int8_t j,i,i1,i2; assert ( pxt == &mesh->xtetra[pt->xt] && "suitable xtetra assignation" ); diff --git a/src/mmg3d/mmg3d1_delone.c b/src/mmg3d/mmg3d1_delone.c index fd67a6fdd..62911114b 100644 --- a/src/mmg3d/mmg3d1_delone.c +++ b/src/mmg3d/mmg3d1_delone.c @@ -112,7 +112,7 @@ int MMG3D_mmg3d1_delone_split(MMG5_pMesh mesh, MMG5_pSol met, /* Construction of bezier edge */ double to[3],no1[3],no2[3]; MMG5_int ref; - int16_t tag; + uint16_t tag; MMG5_pPoint ppt; int8_t ier = MMG3D_build_bezierEdge(mesh,k,imax,i,j,pxt,ip1,ip2,p0,p1, diff --git a/src/mmg3d/mmg3d2.c b/src/mmg3d/mmg3d2.c index 107763935..094f96b4e 100644 --- a/src/mmg3d/mmg3d2.c +++ b/src/mmg3d/mmg3d2.c @@ -404,8 +404,7 @@ MMG5_invsl(double A[3][3],double b[3],double r[3]) { * */ -static int -MMG3D_ismaniball(MMG5_pMesh mesh,MMG5_pSol sol,MMG5_int k,int indp) { +int MMG3D_ismaniball(MMG5_pMesh mesh,MMG5_pSol sol,MMG5_int k,int indp) { MMG5_pTetra pt,pt1; double v,v0,v1,v2; int ibdy,ilist,cur,l; diff --git a/src/mmg3d/mmg3d3.c b/src/mmg3d/mmg3d3.c index 23d247ce6..ede42ad99 100644 --- a/src/mmg3d/mmg3d3.c +++ b/src/mmg3d/mmg3d3.c @@ -143,7 +143,7 @@ static MMG5_int MMG5_spllag(MMG5_pMesh mesh,MMG5_pSol disp,MMG5_pSol met,int itd if ( pxt && (pxt->tag[i] & MG_BDY) ) continue; // Slower test but allowing to be sure to detect boundary edges - int16_t tag = 0; + uint16_t tag = 0; MMG5_int ref = 0; if ( !MMG3D_get_shellEdgeTag(mesh,k,i,&tag,&ref) ) { fprintf(stderr,"\n ## Warning: %s: 0. unable to get edge info" diff --git a/src/mmg3d/movpt_3d.c b/src/mmg3d/movpt_3d.c index 3318674b6..2954aa2e9 100644 --- a/src/mmg3d/movpt_3d.c +++ b/src/mmg3d/movpt_3d.c @@ -851,11 +851,11 @@ int MMG5_movbdyregpt_iso(MMG5_pMesh mesh, MMG5_pSol met, MMG3D_pPROctree PROctre */ static inline int MMG3D_curveEndingPts_chkEdg(MMG5_pMesh mesh,MMG5_int *lists,int l,MMG5_int ip0, - MMG5_int *ipa,MMG5_int *ipb,const int16_t edgTag,MMG5_int *ip) { + MMG5_int *ipa,MMG5_int *ipb,const uint16_t edgTag,MMG5_int *ip) { MMG5_pTetra pt; MMG5_int iel,iptmpa,iptmpb; - int16_t tag; + uint16_t tag; uint8_t i,ie,iface,iea,ieb; iel = lists[l] / 4; @@ -942,7 +942,7 @@ int MMG3D_curveEndingPts_chkEdg(MMG5_pMesh mesh,MMG5_int *lists,int l,MMG5_int i * other direction until meeting the second curve edge. */ int MMG3D_curveEndingPts(MMG5_pMesh mesh,MMG5_int *lists,int ilists, - const int16_t edgTag, MMG5_int ip0,MMG5_int *ip1, + const uint16_t edgTag, MMG5_int ip0,MMG5_int *ip1, MMG5_int *ip2) { MMG5_pTetra pt; MMG5_int iel,ipa,ipb; @@ -1152,7 +1152,7 @@ int MMG3D_movbdycurvept_newPosForSimu(MMG5_pMesh mesh,MMG5_pPoint p0,MMG5_int ip uint8_t isrid,const double step, double o[3],double no[3], double no2[3],double to[3], - const int16_t edgTag) { + const uint16_t edgTag) { MMG5_int ip; diff --git a/src/mmg3d/split_3d.c b/src/mmg3d/split_3d.c index fbbe0a6ac..d48af88c3 100644 --- a/src/mmg3d/split_3d.c +++ b/src/mmg3d/split_3d.c @@ -4921,7 +4921,7 @@ MMG5_int MMG5_splitedg(MMG5_pMesh mesh, MMG5_pSol met,MMG5_int iel, int iar, dou int warn,lon,ier; int64_t list[MMG3D_LMAX+2]; MMG5_int src,i0,i1,ip; - int16_t tag; + uint16_t tag; warn = 0; pt = &mesh->tetra[iel]; diff --git a/src/mmg3d/swap_3d.c b/src/mmg3d/swap_3d.c index 3102816ae..fc3c6f70b 100644 --- a/src/mmg3d/swap_3d.c +++ b/src/mmg3d/swap_3d.c @@ -348,7 +348,7 @@ int MMG5_chkswpbdy(MMG5_pMesh mesh, MMG5_pSol met, int64_t *list,int ilist, #ifndef NDEBUG /* Security check: ensure that the edge is boundary */ - int16_t tag = 0; + uint16_t tag = 0; MMG5_int ref = 0; if ( !MMG3D_get_shellEdgeTag(mesh,list[0]/6,list[0]%6,&tag,&ref) ) { fprintf(stderr,"\n ## Warning: %s: 0. unable to get edge info" diff --git a/src/mmg3d/zaldy_3d.c b/src/mmg3d/zaldy_3d.c index c062f4d18..d6129246c 100644 --- a/src/mmg3d/zaldy_3d.c +++ b/src/mmg3d/zaldy_3d.c @@ -36,7 +36,7 @@ #include "libmmg3d_private.h" /** get new point address */ -MMG5_int MMG3D_newPt(MMG5_pMesh mesh,double c[3],int16_t tag,MMG5_int src) { +MMG5_int MMG3D_newPt(MMG5_pMesh mesh,double c[3],uint16_t tag,MMG5_int src) { MMG5_pPoint ppt; MMG5_int curpt; @@ -63,7 +63,7 @@ MMG5_int MMG3D_newPt(MMG5_pMesh mesh,double c[3],int16_t tag,MMG5_int src) { } ppt->xp = mesh->xp; } - assert(tag < 24704); + assert(tag <= MG_NUL*2-1 && "Value for tag is valid"); assert(tag >= 0); ppt->n[0] = 0; ppt->n[1] = 0; diff --git a/src/mmgs/analys_s.c b/src/mmgs/analys_s.c index 4fa8259a3..75adaa877 100644 --- a/src/mmgs/analys_s.c +++ b/src/mmgs/analys_s.c @@ -48,7 +48,7 @@ int MMGS_setadj(MMG5_pMesh mesh){ MMG5_pTria pt,pt1; MMG5_int *adja,*adjb,adji1,adji2,*pile,iad,ipil,ip1,ip2,gen; MMG5_int k,kk,iel,jel,nvf,nf,nr,nt,nre,nreq,ncc,ned,ref; - int16_t tag; + uint16_t tag; int8_t i,ii,i1,i2,ii1,ii2,voy; if ( abs(mesh->info.imprim) > 5 || mesh->info.ddebug ) diff --git a/src/mmgs/hash_s.c b/src/mmgs/hash_s.c index fce1a2567..041b049b6 100644 --- a/src/mmgs/hash_s.c +++ b/src/mmgs/hash_s.c @@ -170,7 +170,7 @@ int MMGS_bdryUpdate(MMG5_pMesh mesh) { MMG5_Hash hash; MMG5_pTria pt; MMG5_int k,nad; - int tag; + uint16_t tag; int8_t i,i1,i2; /* adjust hash table params */