From b47ad7acf4e613460e99701bccd86ebadb73ee6e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 17 Jan 2024 15:46:03 -0500 Subject: [PATCH] Revert "make delete_bonds command code compatible with BPM package not being installed" This reverts commit 715b030bd64b8639bc31859737dbedc24aac4d88. --- cmake/CMakeLists.txt | 11 +++------- src/BPM/Install.sh | 49 -------------------------------------------- src/delete_bonds.cpp | 9 +------- 3 files changed, 4 insertions(+), 65 deletions(-) delete mode 100755 src/BPM/Install.sh diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 8833e55443..f7e9b314bd 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -662,14 +662,9 @@ foreach(PKG_WITH_INCL CORESHELL DPD-SMOOTH MC MISC PHONON QEQ OPENMP KOKKOS OPT endif() endforeach() -###################################################################### -# packages with defines to disable package specific code -###################################################################### -foreach(PKG_WITH_DEF BPM PLUGIN) - if(PKG_${PKG_WITH_DEF}) - target_compile_definitions(lammps PRIVATE -DLMP_${PKG_WITH_DEF}) - endif() -endforeach() +if(PKG_PLUGIN) + target_compile_definitions(lammps PRIVATE -DLMP_PLUGIN) +endif() # link with -ldl or equivalent for plugin loading; except on Windows if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows") diff --git a/src/BPM/Install.sh b/src/BPM/Install.sh deleted file mode 100755 index 7f3791a702..0000000000 --- a/src/BPM/Install.sh +++ /dev/null @@ -1,49 +0,0 @@ -# Install/unInstall package files in LAMMPS -# mode = 0/1/2 for uninstall/install/update - -mode=$1 - -# enforce using portable C locale -LC_ALL=C -export LC_ALL - -# arg1 = file, arg2 = file it depends on - -action () { - if (test $mode = 0) then - rm -f ../$1 - elif (! cmp -s $1 ../$1) then - if (test -z "$2" || test -e ../$2) then - cp $1 .. - if (test $mode = 2) then - echo " updating src/$1" - fi - fi - elif (test -n "$2") then - if (test ! -e ../$2) then - rm -f ../$1 - fi - fi -} - -# all package files with no dependencies - -for file in *.cpp *.h; do - test -f ${file} && action $file -done - -# edit 2 Makefile.package files to include/exclude package info - -if (test $1 = 1) then - - if (test -e ../Makefile.package) then - sed -i -e 's|^PKG_INC =[ \t]*|&-DLMP_BPM |' ../Makefile.package - fi - -elif (test $1 = 0) then - - if (test -e ../Makefile.package) then - sed -i -e 's/[^ \t]*LMP_BPM[^ \t]* //' ../Makefile.package - fi - -fi diff --git a/src/delete_bonds.cpp b/src/delete_bonds.cpp index 5a58da7905..1f8fe71bff 100644 --- a/src/delete_bonds.cpp +++ b/src/delete_bonds.cpp @@ -19,15 +19,12 @@ #include "comm.h" #include "domain.h" #include "error.h" +#include "fix_bond_history.h" #include "force.h" #include "group.h" #include "modify.h" #include "special.h" -#if defined(LMP_BPM) -#include "fix_bond_history.h" -#endif - #include using namespace LAMMPS_NS; @@ -121,11 +118,9 @@ void DeleteBonds::command(int narg, char **arg) iarg++; } -#if defined(LMP_BPM) // find instances of bond history to delete data auto histories = modify->get_fix_by_style("BOND_HISTORY"); int n_histories = histories.size(); -#endif // border swap to ensure type and mask is current for off-proc atoms // enforce PBC before in case atoms are outside box @@ -342,13 +337,11 @@ void DeleteBonds::command(int narg, char **arg) n = atom->num_bond[i]; atom->bond_type[i][m] = atom->bond_type[i][n-1]; atom->bond_atom[i][m] = atom->bond_atom[i][n-1]; -#if defined(LMP_BPM) if (n_histories > 0) for (auto &ihistory: histories) { dynamic_cast(ihistory)->shift_history(i,m,n-1); dynamic_cast(ihistory)->delete_history(i,n-1); } -#endif atom->num_bond[i]--; } else m++; } else m++;