Skip to content

Commit

Permalink
Fix error on MG_OVERLAP assignment + reset flag at the beginning of t…
Browse files Browse the repository at this point in the history
…he overlap as the flag is used before if the test case has a metric + add ci test overlap with metric to ensure it works
  • Loading branch information
laetitia-m committed Sep 6, 2024
1 parent 6a83559 commit 9930f80
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
19 changes: 19 additions & 0 deletions cmake/testing/pmmg_tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,16 @@ IF( BUILD_TESTING )
set_property(TEST overlap-check-P0
PROPERTY PASS_REGULAR_EXPRESSION "${overlapCheckP0}")

add_test( NAME overlap-check-P0-met
COMMAND ${MPIEXEC} ${MPI_ARGS} ${MPIEXEC_NUMPROC_FLAG} 5 $<TARGET_FILE:${PROJECT_NAME}>
${CI_DIR}/LevelSet/5p_cubegeom/3D-cube.mesh -v 10 -nomove -noinsert -noswap -nobalance -niter 1
-ls 0.0
-sol ${CI_DIR}/LevelSet/5p_cubegeom/3D-cube-ls.sol
-met ${CI_DIR}/LevelSet/5p_cubegeom/3D-cube-metric.sol
-out ${CI_DIR_RESULTS}/overlap-check-P0-met.o.mesh)
set_property(TEST overlap-check-P0-met
PROPERTY PASS_REGULAR_EXPRESSION "${overlapCheckP0}")

# Tests if overlap is deleted correctly
set(overlapCheckDelete "OVERLAP - part 0 has 282 pts and 882 tetras after overlap deletion")
add_test( NAME overlap-check-delete
Expand All @@ -526,6 +536,15 @@ IF( BUILD_TESTING )
set_property(TEST overlap-check-delete
PROPERTY PASS_REGULAR_EXPRESSION "${overlapCheckDelete}")

add_test( NAME overlap-check-delete-met
COMMAND ${MPIEXEC} ${MPI_ARGS} ${MPIEXEC_NUMPROC_FLAG} 5 $<TARGET_FILE:${PROJECT_NAME}>
${CI_DIR}/LevelSet/5p_cubegeom/3D-cube.mesh -v 10 -nomove -noinsert -noswap -nobalance -niter 1
-ls 0.0
-sol ${CI_DIR}/LevelSet/5p_cubegeom/3D-cube-ls.sol
-out ${CI_DIR_RESULTS}/overlap-check-delete-met.o.mesh)
set_property(TEST overlap-check-delete-met
PROPERTY PASS_REGULAR_EXPRESSION "${overlapCheckDelete}")

###############################################################################
#####
##### Test isovalue mode - ls discretization
Expand Down
4 changes: 4 additions & 0 deletions src/overlap_pmmg.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ int PMMG_create_overlap(PMMG_pParMesh parmesh, MPI_Comm comm) {
nt_initial = mesh->ne;
ndataPBDY_added = 0;

/* Reset flags */
for (k=1; k<=mesh->np; k++)
mesh->point[k].flag = 0;

/* Global allocation memory */
PMMG_CALLOC(parmesh,int_comm->intvalues,int_comm->nitem,int,"intvalues",return 0);
PMMG_CALLOC(parmesh,parmesh->overlap,next_comm,PMMG_Overlap,"overlap",ier = 0);
Expand Down

0 comments on commit 9930f80

Please sign in to comment.