Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mpotse committed Mar 28, 2024
2 parents ec9d61d + 4777de7 commit 47a6283
Show file tree
Hide file tree
Showing 9 changed files with 133 additions and 89 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/main-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ jobs:
vtk: on
int: int64_t

- os: ubuntu-20.04
pattern: off
pointmap: off
scotch: on
vtk: on
int: int64_t

- os: ubuntu-20.04
pattern: off
pointmap: off
Expand Down Expand Up @@ -310,6 +317,13 @@ jobs:
cd build
ctest --timeout 7200 -VV -C ${{ inputs.cmake_build_type }} -j ${{ env.NJOBS }}
- name: Test Mmg with in64_t integers
# Run long tests only on ubuntu with pattern off, scotch on, vtk on and int64_t integers
if: matrix.os == 'ubuntu-20.04' && matrix.pattern == 'off' && matrix.scotch == 'on' && matrix.vtk == 'on' && matrix.int == 'int64_t'
run: |
cd build
ctest --timeout 7200 -VV -C ${{ inputs.cmake_build_type }} -j ${{ env.NJOBS }}
- name: Test non native I/Os of Mmg
if: matrix.vtk == 'on'
run: |
Expand Down
5 changes: 5 additions & 0 deletions cmake/testing/libmmg3d_tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,11 @@ IF ( ELAS_FOUND AND NOT USE_ELAS MATCHES OFF )
"${PROJECT_SOURCE_DIR}/libexamples/mmg3d/LagrangianMotion_example0/tinyBoxt"
"${CTEST_OUTPUT_DIR}/libmmg3d_LagrangianMotion_0-tinyBoxt.o"
)
IF (${MMG5_INT} MATCHES int64_t)
SET(passElasRegex "## Error: MMG5_velextLS: impossible to call elasticity library with int64 integers")
SET_PROPERTY(TEST libmmg3d_example4
PROPERTY PASS_REGULAR_EXPRESSION "${passElasRegex}")
ENDIF ()
ENDIF ()

ADD_TEST(NAME libmmg3d_example6_io_0
Expand Down
6 changes: 6 additions & 0 deletions cmake/testing/mmg2d_tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,12 @@ IF ( ELAS_FOUND AND NOT USE_ELAS MATCHES OFF )
-out ${CTEST_OUTPUT_DIR}/mmg2d_LagMotion2_circle-nsd3.o.mesh
)

IF (${MMG5_INT} MATCHES int64_t )
SET(passElasRegex "## Error: MMG2D_velextLS: impossible to call elasticity library with int64 integers")
SET_PROPERTY(TEST mmg2d_LagMotion0_circle mmg2d_LagMotion1_circle mmg2d_LagMotion2_circle mmg2d_LagMotion2_circle-nsd3
PROPERTY PASS_REGULAR_EXPRESSION "${passElasRegex}")
ENDIF()

ENDIF()

###############################################################################
Expand Down
11 changes: 10 additions & 1 deletion cmake/testing/mmg3d_tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,12 @@ IF ( ELAS_FOUND AND NOT USE_ELAS MATCHES OFF )
-out ${CTEST_OUTPUT_DIR}/mmg3d_LagMotion2_tinyBoxt-nsd3.o.meshb
)

IF (${MMG5_INT} MATCHES int64_t )
SET(passElasRegex "## Error: MMG5_velextLS: impossible to call elasticity library with int64 integers")
SET_PROPERTY(TEST mmg3d_LagMotion0_tinyBoxt mmg3d_LagMotion1_tinyBoxt mmg3d_LagMotion2_tinyBoxt mmg3d_LagMotion2_tinyBoxt-nsd3
PROPERTY PASS_REGULAR_EXPRESSION "${passElasRegex}")
ENDIF()

ENDIF()

##############################################################################
Expand Down Expand Up @@ -892,8 +898,11 @@ IF ( LONG_TESTS )
-sol ${MMG3D_CI_TESTS}/LagMotion1_boxt/boxt.sol
-out ${CTEST_OUTPUT_DIR}/mmg3d_LagMotion2_boxt-boxt.o.meshb
)
IF (${MMG5_INT} MATCHES int64_t )
SET_PROPERTY(TEST mmg3d_LagMotion0_boxt mmg3d_LagMotion1_boxt mmg3d_LagMotion2_boxt
PROPERTY PASS_REGULAR_EXPRESSION "${passElasRegex}")
ENDIF()
ENDIF()

ENDIF()

###############################################################################
Expand Down
47 changes: 24 additions & 23 deletions src/mmg2d/inout_2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ int MMG2D_loadMesh(MMG5_pMesh mesh,const char *filename) {
ncor = nreq = nreqed = ntreq = nqreq = 0;
bin = 0;
iswp = 0;
bpos = 0;
mesh->np = mesh->nt = mesh->na = mesh->xp = 0;
nref = 0;

Expand Down Expand Up @@ -182,7 +183,7 @@ int MMG2D_loadMesh(MMG5_pMesh mesh,const char *filename) {
MMG_FREAD(&bpos,MMG5_SW,1,inm); //NulPos
if(iswp) bpos=MMG5_swapbin(bpos);
MMG_FREAD(&mesh->np,MMG5_SW,1,inm);
if(iswp) mesh->np=MMG5_SWAPBIN(mesh->np);
if(iswp) mesh->np=MMG5_swapbin(mesh->np);
posnp = ftell(inm);
rewind(inm);
fseek(inm,bpos,SEEK_SET);
Expand All @@ -191,7 +192,7 @@ int MMG2D_loadMesh(MMG5_pMesh mesh,const char *filename) {
MMG_FREAD(&bpos,MMG5_SW,1,inm); //NulPos
if(iswp) bpos=MMG5_swapbin(bpos);
MMG_FREAD(&mesh->nt,MMG5_SW,1,inm);
if(iswp) mesh->nt=MMG5_SWAPBIN(mesh->nt);
if(iswp) mesh->nt=MMG5_swapbin(mesh->nt);
posnt = ftell(inm);
rewind(inm);
fseek(inm,bpos,SEEK_SET);
Expand All @@ -201,7 +202,7 @@ int MMG2D_loadMesh(MMG5_pMesh mesh,const char *filename) {
MMG_FREAD(&bpos,MMG5_SW,1,inm); //NulPos
if(iswp) bpos=MMG5_swapbin(bpos);
MMG_FREAD(&ntreq,MMG5_SW,1,inm);
if(iswp) ntreq=MMG5_SWAPBIN(ntreq);
if(iswp) ntreq=MMG5_swapbin(ntreq);
posntreq = ftell(inm);
rewind(inm);
fseek(inm,bpos,SEEK_SET);
Expand All @@ -210,7 +211,7 @@ int MMG2D_loadMesh(MMG5_pMesh mesh,const char *filename) {
MMG_FREAD(&bpos,MMG5_SW,1,inm); //NulPos
if(iswp) bpos=MMG5_swapbin(bpos);
MMG_FREAD(&mesh->nquad,MMG5_SW,1,inm);
if(iswp) mesh->nquad=MMG5_SWAPBIN(mesh->nquad);
if(iswp) mesh->nquad=MMG5_swapbin(mesh->nquad);
posnq = ftell(inm);
rewind(inm);
fseek(inm,bpos,SEEK_SET);
Expand All @@ -219,7 +220,7 @@ int MMG2D_loadMesh(MMG5_pMesh mesh,const char *filename) {
MMG_FREAD(&bpos,MMG5_SW,1,inm); //NulPos
if(iswp) bpos=MMG5_swapbin(bpos);
MMG_FREAD(&nqreq,MMG5_SW,1,inm);
if(iswp) nqreq=MMG5_SWAPBIN(nqreq);
if(iswp) nqreq=MMG5_swapbin(nqreq);
posnqreq = ftell(inm);
rewind(inm);
fseek(inm,bpos,SEEK_SET);
Expand All @@ -228,7 +229,7 @@ int MMG2D_loadMesh(MMG5_pMesh mesh,const char *filename) {
MMG_FREAD(&bpos,MMG5_SW,1,inm); //NulPos
if(iswp) bpos=MMG5_swapbin(bpos);
MMG_FREAD(&ncor,MMG5_SW,1,inm);
if(iswp) ncor=MMG5_SWAPBIN(ncor);
if(iswp) ncor=MMG5_swapbin(ncor);
posncor = ftell(inm);
rewind(inm);
fseek(inm,bpos,SEEK_SET);
Expand All @@ -237,7 +238,7 @@ int MMG2D_loadMesh(MMG5_pMesh mesh,const char *filename) {
MMG_FREAD(&bpos,MMG5_SW,1,inm); //NulPos
if(iswp) bpos=MMG5_swapbin(bpos);
MMG_FREAD(&mesh->na,MMG5_SW,1,inm);
if(iswp) mesh->na=MMG5_SWAPBIN(mesh->na);
if(iswp) mesh->na=MMG5_swapbin(mesh->na);
posned = ftell(inm);
rewind(inm);
fseek(inm,bpos,SEEK_SET);
Expand All @@ -246,7 +247,7 @@ int MMG2D_loadMesh(MMG5_pMesh mesh,const char *filename) {
MMG_FREAD(&bpos,MMG5_SW,1,inm); //NulPos
if(iswp) bpos=MMG5_swapbin(bpos);
MMG_FREAD(&nreqed,MMG5_SW,1,inm);
if(iswp) nreqed=MMG5_SWAPBIN(nreqed);
if(iswp) nreqed=MMG5_swapbin(nreqed);
posreqed = ftell(inm);
rewind(inm);
fseek(inm,bpos,SEEK_SET);
Expand All @@ -255,7 +256,7 @@ int MMG2D_loadMesh(MMG5_pMesh mesh,const char *filename) {
MMG_FREAD(&bpos,MMG5_SW,1,inm); //NulPos
if(iswp) bpos=MMG5_swapbin(bpos);
MMG_FREAD(&nreq,MMG5_SW,1,inm);
if(iswp) nreq=MMG5_SWAPBIN(nreq);
if(iswp) nreq=MMG5_swapbin(nreq);
posreq = ftell(inm);
rewind(inm);
fseek(inm,bpos,SEEK_SET);
Expand Down Expand Up @@ -320,7 +321,7 @@ int MMG2D_loadMesh(MMG5_pMesh mesh,const char *filename) {
ppt->c[i] = (double) fc;
}
MMG_FREAD(&ppt->ref,MMG5_SW,1,inm);
if(iswp) ppt->ref=MMG5_SWAPBIN(ppt->ref);
if(iswp) ppt->ref=MMG5_swapbin(ppt->ref);
}
} else {
if (!bin) {
Expand All @@ -336,7 +337,7 @@ int MMG2D_loadMesh(MMG5_pMesh mesh,const char *filename) {
if(iswp) ppt->c[i]=MMG5_swapd(ppt->c[i]);
}
MMG_FREAD(&ppt->ref,MMG5_SW,1,inm);
if(iswp) ppt->ref=MMG5_SWAPBIN(ppt->ref);
if(iswp) ppt->ref=MMG5_swapbin(ppt->ref);
}
}
if ( ppt->ref < 0 ) {
Expand All @@ -356,11 +357,11 @@ int MMG2D_loadMesh(MMG5_pMesh mesh,const char *filename) {
}
else {
MMG_FREAD(&ped->a,MMG5_SW,1,inm);
if(iswp) ped->a=MMG5_SWAPBIN(ped->a);
if(iswp) ped->a=MMG5_swapbin(ped->a);
MMG_FREAD(&ped->b,MMG5_SW,1,inm);
if(iswp) ped->b=MMG5_SWAPBIN(ped->b);
if(iswp) ped->b=MMG5_swapbin(ped->b);
MMG_FREAD(&ped->ref,MMG5_SW,1,inm);
if(iswp) ped->ref=MMG5_SWAPBIN(ped->ref);
if(iswp) ped->ref=MMG5_swapbin(ped->ref);
}
if ( ped->ref < 0 ) {
ped->ref = -ped->ref;
Expand All @@ -382,10 +383,10 @@ int MMG2D_loadMesh(MMG5_pMesh mesh,const char *filename) {
else {
for (i=0 ; i<3 ; i++) {
MMG_FREAD(&pt->v[i],MMG5_SW,1,inm);
if(iswp) pt->v[i]=MMG5_SWAPBIN(pt->v[i]);
if(iswp) pt->v[i]=MMG5_swapbin(pt->v[i]);
}
MMG_FREAD(&pt->ref,MMG5_SW,1,inm);
if(iswp) pt->ref=MMG5_SWAPBIN(pt->ref);
if(iswp) pt->ref=MMG5_swapbin(pt->ref);
}
for (i=0; i<3; i++) {
ppt = &mesh->point[ pt->v[i] ];
Expand Down Expand Up @@ -425,7 +426,7 @@ int MMG2D_loadMesh(MMG5_pMesh mesh,const char *filename) {
}
else {
MMG_FREAD(&i,MMG5_SW,1,inm);
if(iswp) i=MMG5_SWAPBIN(i);
if(iswp) i=MMG5_swapbin(i);
}
if ( i>mesh->nt ) {
fprintf(stderr,"\n ## Warning: %s: required triangle number %8" MMG5_PRId ""
Expand Down Expand Up @@ -460,10 +461,10 @@ int MMG2D_loadMesh(MMG5_pMesh mesh,const char *filename) {
else {
for (i=0 ; i<4 ; i++) {
MMG_FREAD(&pq1->v[i],MMG5_SW,1,inm);
if(iswp) pq1->v[i]=MMG5_SWAPBIN(pq1->v[i]);
if(iswp) pq1->v[i]=MMG5_swapbin(pq1->v[i]);
}
MMG_FREAD(&pq1->ref,MMG5_SW,1,inm);
if(iswp) pq1->ref=MMG5_SWAPBIN(pq1->ref);
if(iswp) pq1->ref=MMG5_swapbin(pq1->ref);
}
for (i=0; i<4; i++) {
ppt = &mesh->point[ pq1->v[i] ];
Expand All @@ -485,7 +486,7 @@ int MMG2D_loadMesh(MMG5_pMesh mesh,const char *filename) {
}
else {
MMG_FREAD(&i,MMG5_SW,1,inm);
if(iswp) i=MMG5_SWAPBIN(i);
if(iswp) i=MMG5_swapbin(i);
}
if ( i>mesh->nquad ) {
fprintf(stderr,"\n ## Warning: %s: required quadrilaterals number"
Expand All @@ -511,7 +512,7 @@ int MMG2D_loadMesh(MMG5_pMesh mesh,const char *filename) {
}
else {
MMG_FREAD(&ref,MMG5_SW,1,inm);
if(iswp) ref=MMG5_SWAPBIN(ref);
if(iswp) ref=MMG5_swapbin(ref);
}
ppt = &mesh->point[ref];
ppt->tag |= MG_CRN;
Expand All @@ -528,7 +529,7 @@ int MMG2D_loadMesh(MMG5_pMesh mesh,const char *filename) {
}
else {
MMG_FREAD(&ref,MMG5_SW,1,inm);
if(iswp) ref=MMG5_SWAPBIN(ref);
if(iswp) ref=MMG5_swapbin(ref);
}
ppt = &mesh->point[ref];
ppt->tag |= MG_REQ;
Expand All @@ -546,7 +547,7 @@ int MMG2D_loadMesh(MMG5_pMesh mesh,const char *filename) {
}
else {
MMG_FREAD(&ref,MMG5_SW,1,inm);
if(iswp) ref=MMG5_SWAPBIN(ref);
if(iswp) ref=MMG5_swapbin(ref);
}
ped = &mesh->edge[ref];
ped->tag |= MG_REQ;
Expand Down
7 changes: 7 additions & 0 deletions src/mmg2d/velextls_2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,13 @@ int MMG2D_velextLS(MMG5_pMesh mesh,MMG5_pSol disp) {
LSst *lsst;
MMG5_int npf,*invperm;

/* LibElas is not compatible with int64: Check for int32 overflow */
if ( sizeof(MMG5_int) == 8 ) {
fprintf(stderr,"\n ## Error: %s: impossible to call elasticity library"
" with int64 integers.\n",__func__);
return 0;
}

/* Creation of the data structure for storing the submesh */
lsst = LS_init(mesh->dim,mesh->ver,P1,1);

Expand Down
Loading

0 comments on commit 47a6283

Please sign in to comment.