Skip to content

Commit

Permalink
Added PASS property to mmg2d lagrangian motion ctests when compiled i…
Browse files Browse the repository at this point in the history
…n int64_t
  • Loading branch information
Corentin Prigent committed Mar 25, 2024
1 parent dac3511 commit 14229cc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
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
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
2 changes: 1 addition & 1 deletion src/mmgs/inout_s.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ int MMGS_loadMesh(MMG5_pMesh mesh, const char *filename) {
}
MMG_FREAD(&mesh->ver,MMG5_SW,1,inm);
if(iswp) mesh->ver = MMG5_swapbin(mesh->ver);
while(fread(&binch,4,1,inm)!=0 && binch!=54 ) {
while(fread(&binch,MMG5_SW,1,inm)!=0 && binch!=54 ) {
if(iswp) binch=MMG5_swapbin(binch);
if(binch==54) break;
if(!bdim && binch==3) { //Dimension
Expand Down

0 comments on commit 14229cc

Please sign in to comment.