Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove useless code from updateTag function #100

Merged
merged 5 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,11 @@ MESSAGE( STATUS "Compilation with mpi" )
SET( LIBRARIES ${MPI_C_LIBRARIES} ${LIBRARIES} )
SET( LIBRARIES ${MPI_CXX_LIBRARIES} ${LIBRARIES} )

EXECUTE_PROCESS ( COMMAND ${MPIEXEC} --help mapping
EXECUTE_PROCESS ( COMMAND ${MPIEXEC} --oversubscribe sleep 1
RESULT_VARIABLE CMD_ERROR
OUTPUT_VARIABLE CMD_OUTPUT )

STRING(REGEX REPLACE "\"" " " CMD_OUT "${CMD_OUTPUT}")

IF ( "${CMD_OUT}" MATCHES "oversubscribe" )
IF ( "${CMD_ERROR}" MATCHES "0" )
SET ( MPI_ARGS "-oversubscribe" )
ENDIF()

Expand Down Expand Up @@ -254,7 +252,7 @@ IF ( DOWNLOAD_MMG )

EXTERNALPROJECT_ADD ( Mmg
GIT_REPOSITORY https://github.com/MmgTools/mmg.git
GIT_TAG 31769770b
GIT_TAG bdbf11ada1a9c44d179636f7f2ebe00ce76f0558
INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} install
CMAKE_ARGS ${MMG_ARGS} -DUSE_ELAS=OFF ${COMPILER_CFG} ${FLAGS_CFG}
${SCOTCH_CFG} ${VTK_CFG} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
Expand Down
29 changes: 16 additions & 13 deletions src/tag_pmmg.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,9 @@ inline int PMMG_resetOldTag(PMMG_pParMesh parmesh) {
*
* \return 0 if fail, 1 otherwise
*
* Update the tag on the points and tetra
* Update the parallel-related tags on the points and tetra: first, remove
* obsolete parallel markers; second, re-tag boundary entites; third, tag new
* parallel interfaces from the internal communicator.
*
*/
int PMMG_updateTag(PMMG_pParMesh parmesh) {
Expand Down Expand Up @@ -289,15 +291,22 @@ int PMMG_updateTag(PMMG_pParMesh parmesh) {
pt = &mesh->tetra[k];
if ( !pt->xt ) continue;
pxt = &mesh->xtetra[pt->xt];
/* Untag parallel nodes */
/* Untag parallel nodes: remove PARBDY, BDY, REQ, PARBDYBDY and NOSURF
* tag. Point not marked by NOSURF tag are required by the user: re-add
* the REQ tag. */
for ( j=0 ; j<4 ; j++ ) {
ppt = &mesh->point[pt->v[j]];
PMMG_untag_par_node(ppt);
}
/* Untag parallel edges */
/* Untag parallel edges: remove PARBDY, BDY, REQ, PARBDYBDY and NOSURF
* tag. Point not marked by NOSURF tag are required by the user: re-add
* the REQ tag. */
for ( j=0 ; j<6 ; j++ )
PMMG_untag_par_edge(pxt,j);
/* Untag parallel faces */
/* Untag parallel faces: remove PARBDY, BDY, REQ and NOSURF tags but nor
* PARBDYBDY one (used to recognize BDY faces whose BDY tag has been
* removed). Point not marked by NOSURF tag are required by the user:
* re-add the REQ tag. */
for ( j=0 ; j<4 ; j++ )
PMMG_untag_par_face(pxt,j);
}
Expand Down Expand Up @@ -346,14 +355,6 @@ int PMMG_updateTag(PMMG_pParMesh parmesh) {
ip0 = pt->v[MMG5_iare[ia][0]];
ip1 = pt->v[MMG5_iare[ia][1]];
if( !MMG5_hTag( &hash, ip0, ip1, 0, MG_BDY ) ) return 0;
/* Constrain boundary if -nosurf option */
if( mesh->info.nosurf ) {
if( !MMG5_hGet( &hash, ip0, ip1, &getref, &gettag ) ) return 0;
if( !(gettag & MG_REQ) ) {
/* do not add the MG_NOSURF tag on a required entity */
if( !MMG5_hTag( &hash, ip0, ip1, 0, MG_REQ + MG_NOSURF ) ) return 0;
}
}
}
/* Tag face nodes */
for ( j=0 ; j<3 ; j++) {
Expand Down Expand Up @@ -432,7 +433,9 @@ int PMMG_updateTag(PMMG_pParMesh parmesh) {
* so remove the MG_NOSURF tag if the edge is truly required */
if( pxt->tag[j] & MG_REQ )
gettag &= ~MG_NOSURF;
/* set edge tag */
/* set edge tag (without NOSURF tag if the edge is required by the
* user): here we preserve the initial MG_REQ tag of each tetra, thus,
* potential inconsistencies will not be solved. */
pxt->tag[j] |= gettag;
}
}
Expand Down
Loading