diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index aaa0885072..28c3d6c027 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -376,6 +376,7 @@ pkg_depends(DIELECTRIC EXTRA-PAIR) pkg_depends(CG-DNA MOLECULE) pkg_depends(CG-DNA ASPHERE) pkg_depends(ELECTRODE KSPACE) +pkg_depends(EXTRA-MOLECULE MOLECULE) # detect if we may enable OpenMP support by default set(BUILD_OMP_DEFAULT OFF) diff --git a/cmake/Modules/Packages/MDI.cmake b/cmake/Modules/Packages/MDI.cmake index 5e93f2a272..8f7c87b684 100644 --- a/cmake/Modules/Packages/MDI.cmake +++ b/cmake/Modules/Packages/MDI.cmake @@ -6,13 +6,10 @@ else() endif() option(DOWNLOAD_MDI "Download and compile the MDI library instead of using an already installed one" ${DOWNLOAD_MDI_DEFAULT}) - - - if(DOWNLOAD_MDI) message(STATUS "MDI download requested - we will build our own") - set(MDI_URL "https://github.com/MolSSI-MDI/MDI_Library/archive/v1.4.10.tar.gz" CACHE STRING "URL for MDI tarball") - set(MDI_MD5 "1c203b7fd462d9934834f643f09f3c06" CACHE STRING "MD5 checksum for MDI tarball") + set(MDI_URL "https://github.com/MolSSI-MDI/MDI_Library/archive/v1.4.11.tar.gz" CACHE STRING "URL for MDI tarball") + set(MDI_MD5 "3791fe5081405c14aac07d4687f1cc58" CACHE STRING "MD5 checksum for MDI tarball") mark_as_advanced(MDI_URL) mark_as_advanced(MDI_MD5) enable_language(C) diff --git a/cmake/presets/clang.cmake b/cmake/presets/clang.cmake index a0d654ad35..f1964f3e0f 100644 --- a/cmake/presets/clang.cmake +++ b/cmake/presets/clang.cmake @@ -3,6 +3,13 @@ # prefer flang over gfortran, if available find_program(CLANG_FORTRAN NAMES flang gfortran f95) set(ENV{OMPI_FC} ${CLANG_FORTRAN}) +get_filename_component(_tmp_fc ${CLANG_FORTRAN} NAME) +if (_tmp_fc STREQUAL "flang") + set(FC_STD_VERSION "-std=f2018") + set(BUILD_MPI OFF) +else() + set(FC_STD_VERSION "-std=f2003") +endif() set(CMAKE_CXX_COMPILER "clang++" CACHE STRING "" FORCE) set(CMAKE_C_COMPILER "clang" CACHE STRING "" FORCE) @@ -10,9 +17,9 @@ set(CMAKE_Fortran_COMPILER ${CLANG_FORTRAN} CACHE STRING "" FORCE) set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -g" CACHE STRING "" FORCE) set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE) set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE) -set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -Wextra -g -std=f2003" CACHE STRING "" FORCE) -set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG -std=f2003" CACHE STRING "" FORCE) -set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG -std=f2003" CACHE STRING "" FORCE) +set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -Wextra -g ${FC_STD_VERSION}" CACHE STRING "" FORCE) +set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG ${FC_STD_VERSION}" CACHE STRING "" FORCE) +set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG ${FC_STD_VERSION}" CACHE STRING "" FORCE) set(CMAKE_C_FLAGS_DEBUG "-Wall -Wextra -g" CACHE STRING "" FORCE) set(CMAKE_C_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE) set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE) diff --git a/doc/src/Packages_details.rst b/doc/src/Packages_details.rst index f2291b231e..4e75c5e94a 100644 --- a/doc/src/Packages_details.rst +++ b/doc/src/Packages_details.rst @@ -932,6 +932,10 @@ EXTRA-MOLECULE package Additional bond, angle, dihedral, and improper styles that are less commonly used. +**Install:** + +To use this package, also the :ref:`MOLECULE ` package needs to be installed. + **Supporting info:** * src/EXTRA-MOLECULE: filenames -> commands diff --git a/doc/src/dump_modify.rst b/doc/src/dump_modify.rst index b791395259..3d79ae0101 100644 --- a/doc/src/dump_modify.rst +++ b/doc/src/dump_modify.rst @@ -176,6 +176,31 @@ extra buffering. ---------- +.. versionadded:: 4May2022 + +The *colname* keyword can be used to change the default header keyword +for dump styles: *atom*, *custom*, and *cfg* and their compressed, ADIOS, +and MPIIO variants. The setting for *ID string* replaces the default +text with the provided string. *ID* can be a positive integer when it +represents the column number counting from the left, a negative integer +when it represents the column number from the right (i.e. -1 is the last +column/keyword), or a custom dump keyword (or compute, fix, property, or +variable reference) and then it replaces the string for that specific +keyword. For *atom* dump styles only the keywords "id", "type", "x", +"y", "z", "ix", "iy", "iz" can be accessed via string regardless of +whether scaled or unwrapped coordinates were enabled or disabled, and +it always assumes 8 columns for indexing regardless of whether image +flags are enabled or not. For dump style *cfg* only changes to the +"auxiliary" keywords (6th or later keyword) will become visible. + +The *colname* keyword can be used multiple times. If multiple *colname* +settings refer to the same keyword, the last setting has precedence. A +setting of *default* clears all previous settings, reverting all values +to their default names. Using the *scale* or *image* keyword will also +reset all header keywords to their default values. + +---------- + The *delay* keyword applies to all dump styles. No snapshots will be output until the specified *Dstep* timestep or later. Specifying *Dstep* < 0 is the same as turning off the delay setting. This is a @@ -365,7 +390,7 @@ always occur if the current timestep is a multiple of $N$, the frequency specified in the :doc:`dump ` command or :doc:`dump_modify every ` command, including timestep 0. It will also always occur if the current simulation time is a multiple -of *Delta*, the time interval specified in the doc:`dump_modify +of *Delta*, the time interval specified in the :doc:`dump_modify every/time ` command. But if this is not the case, a dump snapshot will only be written if @@ -373,7 +398,7 @@ the setting of this keyword is *yes*\ . If it is *no*, which is the default, then it will not be written. Note that if the argument to the :doc:`dump_modify every -` doc:`dump_modify every/time ` commands is +` :doc:`dump_modify every/time ` commands is a variable and not a numeric value, then specifying *first yes* is the only way to write a dump snapshot on the first timestep after the dump command is invoked. @@ -388,30 +413,6 @@ performed with dump style *xtc*\ . ---------- -.. versionadded:: 4May2022 - -The *colname* keyword can be used to change the default header keyword -for dump styles: *atom*, *custom*, and *cfg* and their compressed, ADIOS, -and MPIIO variants. The setting for *ID string* replaces the default -text with the provided string. *ID* can be a positive integer when it -represents the column number counting from the left, a negative integer -when it represents the column number from the right (i.e. -1 is the last -column/keyword), or a custom dump keyword (or compute, fix, property, or -variable reference) and then it replaces the string for that specific -keyword. For *atom* dump styles only the keywords "id", "type", "x", -"y", "z", "ix", "iy", "iz" can be accessed via string regardless of -whether scaled or unwrapped coordinates were enabled or disabled, and -it always assumes 8 columns for indexing regardless of whether image -flags are enabled or not. For dump style *cfg* only changes to the -"auxiliary" keywords (6th or later keyword) will become visible. - -The *colname* keyword can be used multiple times. If multiple *colname* -settings refer to the same keyword, the last setting has precedence. A -setting of *default* clears all previous settings, reverting all values -to their default names. - ----------- - The *format* keyword can be used to change the default numeric format output by the text-based dump styles: *atom*, *local*, *custom*, *cfg*, and *xyz* styles, and their MPIIO variants. Only the *line* or *none* @@ -498,6 +499,8 @@ boundary twice and is really two box lengths to the left of its current coordinate. Note that for dump style *custom* these various values can be printed in the dump file by using the appropriate atom attributes in the dump command itself. +Using this keyword will reset all custom header names set with +*dump_modify colname* to their respective default values. ---------- @@ -671,6 +674,8 @@ value of *yes* means atom coords are written in normalized units from (tilted), then all atom coords will still be between 0.0 and 1.0. A value of *no* means they are written in absolute distance units (e.g., :math:`\mathrm{\mathring A}` or :math:`\sigma`). +Using this keyword will reset all custom header names set with +*dump_modify colname* to their respective default values. ---------- diff --git a/doc/src/fix_latte.rst b/doc/src/fix_latte.rst index 8a6315fa48..202f8cf374 100644 --- a/doc/src/fix_latte.rst +++ b/doc/src/fix_latte.rst @@ -8,18 +8,27 @@ Syntax .. parsed-literal:: - fix ID group-ID latte peID + fix ID group-ID latte keyword value ... * ID, group-ID are documented in :doc:`fix ` command * latte = style name of this fix command -* peID = NULL or ID of compute used to calculate per-atom energy +* zero or more keyword/value pairs may be appended + + .. parsed-literal:: + + keyword = *coulomb* or *exclude* + *coulomb* value = peID + peID = ID of compute used to calculate per-atom energy + *exclude* value = fixID + fixID = ID of fix which potentially excludes atoms before calling LATTE Examples """""""" .. code-block:: LAMMPS - fix dftb all latte NULL + fix dftb all latte + fix dftb all exclude GCMC Description """"""""""" @@ -48,10 +57,41 @@ found in examples/latte. A step-by-step tutorial can be followed at: `LAMMPS-LATTE tutorial `_ -The *peID* argument is not yet supported by fix latte, so it must be -specified as NULL. Eventually it will be used to enable LAMMPS to -calculate a Coulomb potential as an alternative to LATTE performing -the calculation. +Currently, LAMMPS must be run in serial or as a single MPI task, to +use this fix. This is because the version of the LATTE library LAMMPS +uses does not support MPI. On the LAMMPS size, this is typically not +a bottleneck, since LATTE will be doing 99% or more of the work to +compute quantum-accurate forces. On the LATTE side, the LATTE library +does support threaded parallelism via OpenMP. You must build the +LATTE library with OpenMP support, then set the OMP_NUM_THREADS +environment variable before performing a LAMMPS + LATTE simulation to +tell LATTE how many threads to invoke. + +.. note:: + + NEB calculations can be done using this fix using multiple + replicas and running LAMMPS in parallel. However, each replica must + be run on a single MPI task. For details, see the :doc:`neb ` + command page and the :doc:`-partition command-line switch ` + +---------- + +The *coulomb* argument is not yet supported by fix latte (as of Sept +2022). Eventually it will be used to enable LAMMPS to calculate a +Coulomb potential as an alternative to LATTE performing the +calculation. + +The *exclude* argument allows this fix to work in tandem with another +fix which may decide to delete one or more atoms of molecules. The +specified fixID is the ID of the other fix. + +The one current example of such a fix is the :doc:`fix gcmc +` command which performs Monte Carlo insertions and +deletions. If a trial deletion is performed, then LAMMPS needs to +only pass LATTE the atoms which remain. Fix gcmc does not actually +remove any atoms until after the new energy is computed (in this case +by LATTE), and a Monte Carlo accept/reject decision is made for the +trial deletion. ---------- @@ -153,18 +193,8 @@ use this fix. LATTE does not currently compute per-atom energy or per-atom virial contributions. So they will not show up as part of the calculations -performed by the :doc:`compute pe/atom ` or :doc:`compute stress/atom ` commands. - -Currently, LAMMPS must be run in serial or as a single MPI task, to -use this fix. This is typically not a bottleneck, since LATTE will be -doing 99% or more of the work to compute quantum-accurate forces. - -.. note:: - - NEB calculations can be done using this fix using multiple - replicas and running LAMMPS in parallel. However, each replica must - be run on a single MPI task. For details, see the :doc:`neb ` - command page and the :doc:`-partition command-line switch ` +performed by the :doc:`compute pe/atom ` or +:doc:`compute stress/atom ` commands. Related commands """""""""""""""" diff --git a/doc/src/labelmap.rst b/doc/src/labelmap.rst index 6ff7e96846..1f500db6b4 100644 --- a/doc/src/labelmap.rst +++ b/doc/src/labelmap.rst @@ -86,6 +86,8 @@ This command must come after the simulation box is defined by a :doc:`read_data `, :doc:`read_restart `, or :doc:`create_box ` command. +Label maps are currently not supported when using the KOKKOS package. + Related commands """""""""""""""" diff --git a/doc/src/pair_dipole.rst b/doc/src/pair_dipole.rst index 850033453a..50e1a1b023 100644 --- a/doc/src/pair_dipole.rst +++ b/doc/src/pair_dipole.rst @@ -249,7 +249,7 @@ Style *lj/long/dipole/long* has the same functionality as style *lj/cut/dipole/long*, except it also has an option to compute 12/6 Lennard-Jones interactions for use with a long-range dispersion kspace style. This is done by setting its *flag_lj* argument to *long*. For -long-range LJ interactions, the doc:`kspace_style ewald/disp +long-range LJ interactions, the :doc:`kspace_style ewald/disp ` command must be used. ---------- diff --git a/doc/src/pair_style.rst b/doc/src/pair_style.rst index ff5e7a2d75..bd047c687f 100644 --- a/doc/src/pair_style.rst +++ b/doc/src/pair_style.rst @@ -81,12 +81,12 @@ only the global settings in that command are reset. Any previous doc:`pair_coeff ` and :doc:`pair_modify ` command settings are preserved. The only exception is that if the global cutoff in the pair_style command is changed, it will override -the corresponding cutoff in any of the previous doc:`pair_modify +the corresponding cutoff in any of the previous :doc:`pair_modify ` commands. Two pair styles which do not follow this rule are the pair_style *table* and *hybrid* commands. A new pair_style command for these -styles will wipe out all previously specified doc:`pair_coeff +styles will wipe out all previously specified :doc:`pair_coeff ` and :doc:`pair_modify ` settings, including for the sub-styles of the *hybrid* command. diff --git a/doc/src/read_data.rst b/doc/src/read_data.rst index b474767422..858029caae 100644 --- a/doc/src/read_data.rst +++ b/doc/src/read_data.rst @@ -1519,11 +1519,14 @@ To read gzipped data files, you must compile LAMMPS with the -DLAMMPS_GZIP option. See the :doc:`Build settings ` doc page for details. +Label maps are currently not supported when using the KOKKOS package. + Related commands """""""""""""""" :doc:`read_dump `, :doc:`read_restart `, -:doc:`create_atoms `, :doc:`write_data ` +:doc:`create_atoms `, :doc:`write_data `, +:doc:`labelmap ` Default """"""" diff --git a/doc/src/restart.rst b/doc/src/restart.rst index 91b920f377..5de2d3d75c 100644 --- a/doc/src/restart.rst +++ b/doc/src/restart.rst @@ -12,7 +12,7 @@ Syntax restart N root keyword value ... restart N file1 file2 keyword value ... -* N = write a restart file on timesteps which are multipls of N +* N = write a restart file on timesteps which are multiples of N * N can be a variable (see below) * root = filename to which timestep # is appended * file1,file2 = two full filenames, toggle between them when writing file diff --git a/examples/QM/LATTE/README b/examples/QM/LATTE/README index a2a835eb41..3f2d6a0181 100644 --- a/examples/QM/LATTE/README +++ b/examples/QM/LATTE/README @@ -54,7 +54,19 @@ Building 3 codes needed to run these examples (3) Build LAMMPS with its MDI package also with the MOLECULE package for these example scripts -Build with CMake (NOTE: do not use traditional make for this use case) +Build with traditional make + +% cd lammps/lib/mdi +% python Install.py -m mpi # downloads and builds MDI +% cd ../../src +% make yes-mdi yes-molecule +$ make mpi # creates lmp_mpi + +% mkdir build; cd build +% cmake -D PKG_MDI=yes -D PKG_MOLECULE=yes ../cmake +% make # creates lmp + +Build with CMake % cd lammps % mkdir build; cd build @@ -63,7 +75,7 @@ Build with CMake (NOTE: do not use traditional make for this use case) (4) Copy LAMMPS and LATTE executables into this dir -Copy the LAMMPS executable into this dir as lmp_mpi. +Copy the LAMMPS executable (lmp_mpi or lmp) into this dir as lmp_mpi. Copy the LATTE executable LATTE_DOUBLE into this dir. The run commands below assume you have done this. diff --git a/examples/latte/in.graphene.boxrel b/examples/latte/in.latte.graphene.boxrelax similarity index 68% rename from examples/latte/in.graphene.boxrel rename to examples/latte/in.latte.graphene.boxrelax index 721b7f014f..bd61c358e6 100644 --- a/examples/latte/in.graphene.boxrel +++ b/examples/latte/in.latte.graphene.boxrelax @@ -1,35 +1,35 @@ # Simple water model with LATTE -units metal -atom_style full +units metal +atom_style full atom_modify sort 0 0.0 # turn off sorting of the coordinates read_data data.graphene # replicate system if requested -variable x index 1 -variable y index 1 -variable z index 1 +variable x index 1 +variable y index 1 +variable z index 1 variable nrep equal v_x*v_y*v_z if "${nrep} > 1" then "replicate $x $y $z" # initialize system -velocity all create 0.0 87287 loop geom +velocity all create 0.0 87287 loop geom pair_style zero 1.0 -pair_coeff * * +pair_coeff * * -neighbor 1.0 bin -neigh_modify every 1 delay 0 check yes +neighbor 1.0 bin +neigh_modify every 1 delay 0 check yes timestep 0.00025 fix 1 all box/relax iso 0.0 vmax 0.001 -fix 2 all latte NULL +fix 2 all latte fix_modify 2 energy yes thermo_style custom etotal diff --git a/examples/latte/in.latte.multiple b/examples/latte/in.latte.multiple index 4888d14ebc..1c5dc3d2d3 100644 --- a/examples/latte/in.latte.multiple +++ b/examples/latte/in.latte.multiple @@ -9,7 +9,7 @@ read_data data.water velocity all create 0.0 87287 loop geom pair_style zero 1.0 -pair_coeff * * +pair_coeff * * neighbor 1.0 bin neigh_modify every 1 delay 0 check yes @@ -17,7 +17,7 @@ neigh_modify every 1 delay 0 check yes timestep 0.00025 fix 1 all nve -fix 2 all latte NULL +fix 2 all latte fix_modify 2 energy yes thermo_style custom step temp pe etotal press @@ -44,7 +44,7 @@ read_data data.ch4 velocity all create 0.0 87287 loop geom pair_style zero 1.0 -pair_coeff * * +pair_coeff * * neighbor 1.0 bin neigh_modify every 1 delay 0 check yes @@ -53,7 +53,7 @@ timestep 0.00025 fix 1 all nve -fix 2 all latte NULL +fix 2 all latte fix_modify 2 energy yes thermo_style custom step temp pe etotal press diff --git a/examples/latte/in.latte.sucrose b/examples/latte/in.latte.sucrose deleted file mode 100644 index a10dae5c5e..0000000000 --- a/examples/latte/in.latte.sucrose +++ /dev/null @@ -1,40 +0,0 @@ -# simple sucrose model with LATTE - -units metal -atom_style full -atom_modify sort 0 0.0 # turn off sorting of the coordinates - -read_data data.sucrose - -# replicate system if requested - -variable x index 1 -variable y index 1 -variable z index 1 - -variable nrep equal v_x*v_y*v_z -if "${nrep} > 1" then "replicate $x $y $z" - -# initialize system - -velocity all create 0.0 87287 loop geom - -pair_style zero 1.0 -pair_coeff * * - -neighbor 1.0 bin -neigh_modify every 1 delay 0 check yes - -timestep 0.00025 - -fix 1 all nve - -fix 2 all latte NULL -fix_modify 2 energy yes - -thermo_style custom step temp pe etotal press - -# dynamics - -thermo 10 -run 100 diff --git a/examples/latte/in.latte.sucrose.md b/examples/latte/in.latte.sucrose.md index a10dae5c5e..53eaf80dd7 100644 --- a/examples/latte/in.latte.sucrose.md +++ b/examples/latte/in.latte.sucrose.md @@ -1,35 +1,35 @@ # simple sucrose model with LATTE -units metal -atom_style full +units metal +atom_style full atom_modify sort 0 0.0 # turn off sorting of the coordinates read_data data.sucrose # replicate system if requested -variable x index 1 -variable y index 1 -variable z index 1 +variable x index 1 +variable y index 1 +variable z index 1 variable nrep equal v_x*v_y*v_z if "${nrep} > 1" then "replicate $x $y $z" # initialize system -velocity all create 0.0 87287 loop geom +velocity all create 0.0 87287 loop geom pair_style zero 1.0 -pair_coeff * * +pair_coeff * * -neighbor 1.0 bin -neigh_modify every 1 delay 0 check yes +neighbor 1.0 bin +neigh_modify every 1 delay 0 check yes timestep 0.00025 -fix 1 all nve +fix 1 all nve -fix 2 all latte NULL +fix 2 all latte fix_modify 2 energy yes thermo_style custom step temp pe etotal press @@ -37,4 +37,4 @@ thermo_style custom step temp pe etotal press # dynamics thermo 10 -run 100 +run 100 diff --git a/examples/latte/in.latte.water b/examples/latte/in.latte.water deleted file mode 100644 index e1185602b4..0000000000 --- a/examples/latte/in.latte.water +++ /dev/null @@ -1,40 +0,0 @@ -# simple water model with LATTE - -units metal -atom_style full -atom_modify sort 0 0.0 # turn off sorting of the coordinates - -read_data data.water - -# replicate system if requested - -variable x index 1 -variable y index 1 -variable z index 1 - -variable nrep equal v_x*v_y*v_z -if "${nrep} > 1" then "replicate $x $y $z" - -# initialize system - -velocity all create 0.0 87287 loop geom - -pair_style zero 1.0 -pair_coeff * * - -neighbor 1.0 bin -neigh_modify every 1 delay 0 check yes - -timestep 0.00025 - -fix 1 all nve - -fix 2 all latte NULL -fix_modify 2 energy yes - -thermo_style custom step temp pe etotal press - -# dynamics - -thermo 10 -run 100 diff --git a/examples/latte/in.latte.water.md b/examples/latte/in.latte.water.md index e1185602b4..7940b7f992 100644 --- a/examples/latte/in.latte.water.md +++ b/examples/latte/in.latte.water.md @@ -1,35 +1,35 @@ # simple water model with LATTE -units metal -atom_style full +units metal +atom_style full atom_modify sort 0 0.0 # turn off sorting of the coordinates read_data data.water # replicate system if requested -variable x index 1 -variable y index 1 -variable z index 1 +variable x index 1 +variable y index 1 +variable z index 1 variable nrep equal v_x*v_y*v_z if "${nrep} > 1" then "replicate $x $y $z" # initialize system -velocity all create 0.0 87287 loop geom +velocity all create 0.0 87287 loop geom pair_style zero 1.0 -pair_coeff * * +pair_coeff * * -neighbor 1.0 bin -neigh_modify every 1 delay 0 check yes +neighbor 1.0 bin +neigh_modify every 1 delay 0 check yes timestep 0.00025 -fix 1 all nve +fix 1 all nve -fix 2 all latte NULL +fix 2 all latte fix_modify 2 energy yes thermo_style custom step temp pe etotal press @@ -37,4 +37,4 @@ thermo_style custom step temp pe etotal press # dynamics thermo 10 -run 100 +run 100 diff --git a/examples/latte/in.latte.water.min b/examples/latte/in.latte.water.min index 173afee96a..81474a0773 100644 --- a/examples/latte/in.latte.water.min +++ b/examples/latte/in.latte.water.min @@ -1,35 +1,35 @@ # simple water model with LATTE -units metal -atom_style full +units metal +atom_style full atom_modify sort 0 0.0 # turn off sorting of the coordinates read_data data.water # replicate system if requested -variable x index 1 -variable y index 1 -variable z index 1 +variable x index 1 +variable y index 1 +variable z index 1 variable nrep equal v_x*v_y*v_z if "${nrep} > 1" then "replicate $x $y $z" # initialize system -velocity all create 0.0 87287 loop geom +velocity all create 0.0 87287 loop geom pair_style zero 1.0 -pair_coeff * * +pair_coeff * * -neighbor 1.0 bin -neigh_modify every 1 delay 0 check yes +neighbor 1.0 bin +neigh_modify every 1 delay 0 check yes timestep 0.00025 -fix 1 all nve +fix 1 all nve -fix 2 all latte NULL +fix 2 all latte fix_modify 2 energy yes thermo_style custom step temp pe etotal press diff --git a/examples/latte/log.13Sep22.latte.graphene.boxrelax.g++.1 b/examples/latte/log.13Sep22.latte.graphene.boxrelax.g++.1 new file mode 100644 index 0000000000..2350e8ad39 --- /dev/null +++ b/examples/latte/log.13Sep22.latte.graphene.boxrelax.g++.1 @@ -0,0 +1,179 @@ +LAMMPS (3 Aug 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# Simple water model with LATTE + +units metal +atom_style full +atom_modify sort 0 0.0 # turn off sorting of the coordinates + +read_data data.graphene +Reading data file ... + triclinic box = (0 0 0) to (10 8 20) with tilt (4.8985872e-16 1.2246468e-15 1.2246468e-15) + 1 by 1 by 1 MPI processor grid + reading atoms ... + 32 atoms +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0 0 0 + special bond factors coul: 0 0 0 + 0 = max # of 1-2 neighbors + 0 = max # of 1-3 neighbors + 0 = max # of 1-4 neighbors + 1 = max # of special neighbors + special bonds CPU = 0.000 seconds + read_data CPU = 0.001 seconds + +# replicate system if requested + +variable x index 1 +variable y index 1 +variable z index 1 + +variable nrep equal v_x*v_y*v_z +if "${nrep} > 1" then "replicate $x $y $z" + +# initialize system + +velocity all create 0.0 87287 loop geom + +pair_style zero 1.0 +pair_coeff * * + +neighbor 1.0 bin +neigh_modify every 1 delay 0 check yes + +timestep 0.00025 + +fix 1 all box/relax iso 0.0 vmax 0.001 + +fix 2 all latte +fix_modify 2 energy yes + +thermo_style custom etotal + +# minimization + +thermo 1 +fix 3 all print 1 "Total Energy =" +min_style cg +min_modify dmax 0.1 +min_modify line quadratic +minimize 1.0e-4 1.0e-4 10000 10000 +Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 2 + ghost atom cutoff = 2 + binsize = 1, bins = 11 9 20 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair zero, perpetual + attributes: half, newton on + pair build: half/bin/newton/tri + stencil: half/bin/3d/tri + bin: standard +Per MPI rank memory allocation (min/avg/max) = 7.03 | 7.03 | 7.03 Mbytes + TotEng +-247.46002 +-247.67224 +-247.87937 +-248.08148 +-248.27865 +-248.47096 +-248.65851 +-248.84137 +-249.01964 +-249.19342 +-249.36281 +-249.52791 +-249.68883 +-249.8457 +-249.99865 +-250.1478 +-250.29332 +-250.43535 +-250.57409 +-250.70972 +-250.84247 +-250.97258 +-251.10035 +-251.2261 +-251.35021 +-251.47314 +-251.59543 +-251.71776 +-251.84096 +-251.9661 +-252.09459 +-252.22833 +-252.37003 +-252.52371 +-252.69578 +-252.89752 +-253.15197 +-253.52044 +-254.31418 +-255.6175 +-256.8162 +-258.1227 +-259.38401 +-260.74831 +-262.03991 +-263.5463 +-264.70486 +-267.69143 +-267.88682 +-269.0352 +-270.602 +-270.65395 +-270.7429 +-271.55831 +-271.81159 +-271.87447 +-273.03096 +-273.23109 +-273.27869 +-273.34621 +-273.4082 +-273.45599 +-273.53849 +-273.57478 +-273.71381 +-273.74092 +Loop time of 20.5496 on 1 procs for 65 steps with 32 atoms + +99.7% CPU use with 1 MPI tasks x 1 OpenMP threads + +Minimization stats: + Stopping criterion = energy tolerance + Energy initial, next-to-last, final = + -247.460020562055 -273.713813242259 -273.740918498854 + Force two-norm initial, final = 201.60784 9.4927634 + Force max component initial, final = 188.92406 2.4327308 + Final line search alpha, max atom move = 0.00022885545 0.0005567437 + Iterations, force evaluations = 65 65 + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 7.7869e-05 | 7.7869e-05 | 7.7869e-05 | 0.0 | 0.00 +Bond | 3.531e-06 | 3.531e-06 | 3.531e-06 | 0.0 | 0.00 +Neigh | 1.3988e-05 | 1.3988e-05 | 1.3988e-05 | 0.0 | 0.00 +Comm | 0.00014355 | 0.00014355 | 0.00014355 | 0.0 | 0.00 +Output | 0.00071475 | 0.00071475 | 0.00071475 | 0.0 | 0.00 +Modify | 20.547 | 20.547 | 20.547 | 0.0 | 99.99 +Other | | 0.001683 | | | 0.01 + +Nlocal: 32 ave 32 max 32 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 100 ave 100 max 100 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 48 ave 48 max 48 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 48 +Ave neighs/atom = 1.5 +Ave special neighs/atom = 0 +Neighbor list builds = 1 +Dangerous builds = 0 +Total wall time: 0:00:20 diff --git a/examples/latte/log.13Sep22.latte.multiple.g++.1 b/examples/latte/log.13Sep22.latte.multiple.g++.1 new file mode 100644 index 0000000000..ca32c96e15 --- /dev/null +++ b/examples/latte/log.13Sep22.latte.multiple.g++.1 @@ -0,0 +1,189 @@ +LAMMPS (3 Aug 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +units metal +atom_style full +atom_modify sort 0 0.0 # turn off sorting of the coordinates + +read_data data.water +Reading data file ... + orthogonal box = (0 0 0) to (6.267 6.267 6.267) + 1 by 1 by 1 MPI processor grid + reading atoms ... + 24 atoms +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0 0 0 + special bond factors coul: 0 0 0 + 0 = max # of 1-2 neighbors + 0 = max # of 1-3 neighbors + 0 = max # of 1-4 neighbors + 1 = max # of special neighbors + special bonds CPU = 0.000 seconds + read_data CPU = 0.001 seconds + +# initialize system + +velocity all create 0.0 87287 loop geom + +pair_style zero 1.0 +pair_coeff * * + +neighbor 1.0 bin +neigh_modify every 1 delay 0 check yes + +timestep 0.00025 + +fix 1 all nve +fix 2 all latte +fix_modify 2 energy yes + +thermo_style custom step temp pe etotal press + +# dynamics + +thermo 10 +run 10 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 2 + ghost atom cutoff = 2 + binsize = 1, bins = 7 7 7 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair zero, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 5.88 | 5.88 | 5.88 Mbytes + Step Temp PotEng TotEng Press + 0 0 -104.95596 -104.95596 48235.442 + 10 336.53107 -105.96027 -104.95977 97996.851 +Loop time of 0.334108 on 1 procs for 10 steps with 24 atoms + +Performance: 0.646 ns/day, 37.123 hours/ns, 29.930 timesteps/s +99.2% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 3.714e-06 | 3.714e-06 | 3.714e-06 | 0.0 | 0.00 +Bond | 5.02e-07 | 5.02e-07 | 5.02e-07 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 1.1209e-05 | 1.1209e-05 | 1.1209e-05 | 0.0 | 0.00 +Output | 2.3638e-05 | 2.3638e-05 | 2.3638e-05 | 0.0 | 0.01 +Modify | 0.33404 | 0.33404 | 0.33404 | 0.0 | 99.98 +Other | | 2.795e-05 | | | 0.01 + +Nlocal: 24 ave 24 max 24 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 71 ave 71 max 71 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 37 ave 37 max 37 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 37 +Ave neighs/atom = 1.5416667 +Ave special neighs/atom = 0 +Neighbor list builds = 0 +Dangerous builds = 0 + +# Clear up previus calculation + +clear +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task + +# simple CH4 molecule with LATTE + +units metal +atom_style full +atom_modify sort 0 0.0 # turn off sorting of the coordinates + +read_data data.ch4 +Reading data file ... + triclinic box = (0 0 0) to (19.523 12.758 11.692) with tilt (0 0 0) + 1 by 1 by 1 MPI processor grid + reading atoms ... + 5 atoms +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0 0 0 + special bond factors coul: 0 0 0 + 0 = max # of 1-2 neighbors + 0 = max # of 1-3 neighbors + 0 = max # of 1-4 neighbors + 1 = max # of special neighbors + special bonds CPU = 0.000 seconds + read_data CPU = 0.007 seconds + +# initialize system + +velocity all create 0.0 87287 loop geom + +pair_style zero 1.0 +pair_coeff * * + +neighbor 1.0 bin +neigh_modify every 1 delay 0 check yes + +timestep 0.00025 + +fix 1 all nve + +fix 2 all latte +fix_modify 2 energy yes + +thermo_style custom step temp pe etotal press + +# dynamics + +thermo 10 +run 10 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 2 + ghost atom cutoff = 2 + binsize = 1, bins = 20 13 12 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair zero, perpetual + attributes: half, newton on + pair build: half/bin/newton/tri + stencil: half/bin/3d/tri + bin: standard +Per MPI rank memory allocation (min/avg/max) = 5.902 | 5.902 | 5.902 Mbytes + Step Temp PotEng TotEng Press + 0 0 -23.980353 -23.980353 348.02716 + 10 19.123149 -23.990297 -23.98041 18.774332 +Loop time of 0.0121573 on 1 procs for 10 steps with 5 atoms + +Performance: 17.767 ns/day, 1.351 hours/ns, 822.549 timesteps/s +99.7% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1.224e-06 | 1.224e-06 | 1.224e-06 | 0.0 | 0.01 +Bond | 2.93e-07 | 2.93e-07 | 2.93e-07 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 3.845e-06 | 3.845e-06 | 3.845e-06 | 0.0 | 0.03 +Output | 8.633e-06 | 8.633e-06 | 8.633e-06 | 0.0 | 0.07 +Modify | 0.012132 | 0.012132 | 0.012132 | 0.0 | 99.80 +Other | | 1.089e-05 | | | 0.09 + +Nlocal: 5 ave 5 max 5 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 7 ave 7 max 7 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 10 ave 10 max 10 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 10 +Ave neighs/atom = 2 +Ave special neighs/atom = 0 +Neighbor list builds = 0 +Dangerous builds = 0 + +Total wall time: 0:00:00 diff --git a/examples/latte/log.13Sep22.latte.sucrose.md.g++.1 b/examples/latte/log.13Sep22.latte.sucrose.md.g++.1 new file mode 100644 index 0000000000..9d3a98b66b --- /dev/null +++ b/examples/latte/log.13Sep22.latte.sucrose.md.g++.1 @@ -0,0 +1,112 @@ +LAMMPS (3 Aug 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# simple sucrose model with LATTE + +units metal +atom_style full +atom_modify sort 0 0.0 # turn off sorting of the coordinates + +read_data data.sucrose +Reading data file ... + orthogonal box = (0 0 0) to (17.203 18.009 21.643) + 1 by 1 by 1 MPI processor grid + reading atoms ... + 45 atoms +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0 0 0 + special bond factors coul: 0 0 0 + 0 = max # of 1-2 neighbors + 0 = max # of 1-3 neighbors + 0 = max # of 1-4 neighbors + 1 = max # of special neighbors + special bonds CPU = 0.000 seconds + read_data CPU = 0.001 seconds + +# replicate system if requested + +variable x index 1 +variable y index 1 +variable z index 1 + +variable nrep equal v_x*v_y*v_z +if "${nrep} > 1" then "replicate $x $y $z" + +# initialize system + +velocity all create 0.0 87287 loop geom + +pair_style zero 1.0 +pair_coeff * * + +neighbor 1.0 bin +neigh_modify every 1 delay 0 check yes + +timestep 0.00025 + +fix 1 all nve + +fix 2 all latte +fix_modify 2 energy yes + +thermo_style custom step temp pe etotal press + +# dynamics + +thermo 10 +run 100 +Generated 0 of 3 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 2 + ghost atom cutoff = 2 + binsize = 1, bins = 18 19 22 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair zero, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 5.93 | 5.93 | 5.93 Mbytes + Step Temp PotEng TotEng Press + 0 0 -251.26617 -251.26617 16.617233 + 10 0.025263738 -251.26631 -251.26617 8.0576369 + 20 0.034232485 -251.26636 -251.26617 1.6672772 + 30 0.059079585 -251.2665 -251.26617 11.058355 + 40 0.055499785 -251.26648 -251.26617 14.837599 + 50 0.058499496 -251.2665 -251.26617 6.7180488 + 60 0.071094531 -251.26657 -251.26617 6.6131215 + 70 0.084309398 -251.26665 -251.26617 12.372502 + 80 0.1089929 -251.26679 -251.26617 8.8352747 + 90 0.11378255 -251.26681 -251.26617 5.1175071 + 100 0.13003967 -251.26691 -251.26617 8.2429118 +Loop time of 14.4456 on 1 procs for 100 steps with 45 atoms + +Performance: 0.150 ns/day, 160.507 hours/ns, 6.923 timesteps/s +99.8% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 7.5758e-05 | 7.5758e-05 | 7.5758e-05 | 0.0 | 0.00 +Bond | 6.748e-06 | 6.748e-06 | 6.748e-06 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 9.0137e-05 | 9.0137e-05 | 9.0137e-05 | 0.0 | 0.00 +Output | 0.00025976 | 0.00025976 | 0.00025976 | 0.0 | 0.00 +Modify | 14.445 | 14.445 | 14.445 | 0.0 | 99.99 +Other | | 0.0005283 | | | 0.00 + +Nlocal: 45 ave 45 max 45 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 59 ave 59 max 59 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 59 +Ave neighs/atom = 1.3111111 +Ave special neighs/atom = 0 +Neighbor list builds = 0 +Dangerous builds = 0 +Total wall time: 0:00:14 diff --git a/examples/latte/log.13Sep22.latte.water.md.g++.1 b/examples/latte/log.13Sep22.latte.water.md.g++.1 new file mode 100644 index 0000000000..04cc99135c --- /dev/null +++ b/examples/latte/log.13Sep22.latte.water.md.g++.1 @@ -0,0 +1,112 @@ +LAMMPS (3 Aug 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# simple water model with LATTE + +units metal +atom_style full +atom_modify sort 0 0.0 # turn off sorting of the coordinates + +read_data data.water +Reading data file ... + orthogonal box = (0 0 0) to (6.267 6.267 6.267) + 1 by 1 by 1 MPI processor grid + reading atoms ... + 24 atoms +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0 0 0 + special bond factors coul: 0 0 0 + 0 = max # of 1-2 neighbors + 0 = max # of 1-3 neighbors + 0 = max # of 1-4 neighbors + 1 = max # of special neighbors + special bonds CPU = 0.000 seconds + read_data CPU = 0.001 seconds + +# replicate system if requested + +variable x index 1 +variable y index 1 +variable z index 1 + +variable nrep equal v_x*v_y*v_z +if "${nrep} > 1" then "replicate $x $y $z" + +# initialize system + +velocity all create 0.0 87287 loop geom + +pair_style zero 1.0 +pair_coeff * * + +neighbor 1.0 bin +neigh_modify every 1 delay 0 check yes + +timestep 0.00025 + +fix 1 all nve + +fix 2 all latte +fix_modify 2 energy yes + +thermo_style custom step temp pe etotal press + +# dynamics + +thermo 10 +run 100 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 2 + ghost atom cutoff = 2 + binsize = 1, bins = 7 7 7 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair zero, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 5.88 | 5.88 | 5.88 Mbytes + Step Temp PotEng TotEng Press + 0 0 -104.95596 -104.95596 48235.442 + 10 336.53107 -105.96027 -104.95977 97996.851 + 20 529.06408 -106.53023 -104.95733 131519.85 + 30 753.62603 -107.19952 -104.959 49296.66 + 40 716.65648 -107.08803 -104.95742 28307.121 + 50 824.04392 -107.40823 -104.95836 102167.59 + 60 933.56146 -107.73479 -104.95933 92508.517 + 70 851.18489 -107.48767 -104.95711 13993.262 + 80 999.8028 -107.93147 -104.95907 36700.736 + 90 998.77488 -107.9257 -104.95636 107233.54 + 100 1281.4438 -108.76963 -104.95992 49702.386 +Loop time of 3.14578 on 1 procs for 100 steps with 24 atoms + +Performance: 0.687 ns/day, 34.953 hours/ns, 31.789 timesteps/s +99.8% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 3.0818e-05 | 3.0818e-05 | 3.0818e-05 | 0.0 | 0.00 +Bond | 4.704e-06 | 4.704e-06 | 4.704e-06 | 0.0 | 0.00 +Neigh | 1.8668e-05 | 1.8668e-05 | 1.8668e-05 | 0.0 | 0.00 +Comm | 0.00010831 | 0.00010831 | 0.00010831 | 0.0 | 0.00 +Output | 0.00021087 | 0.00021087 | 0.00021087 | 0.0 | 0.01 +Modify | 3.1452 | 3.1452 | 3.1452 | 0.0 | 99.98 +Other | | 0.0002339 | | | 0.01 + +Nlocal: 24 ave 24 max 24 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 77 ave 77 max 77 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 31 ave 31 max 31 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 31 +Ave neighs/atom = 1.2916667 +Ave special neighs/atom = 0 +Neighbor list builds = 2 +Dangerous builds = 0 +Total wall time: 0:00:03 diff --git a/examples/latte/log.13Sep22.latte.water.min.g++.1 b/examples/latte/log.13Sep22.latte.water.min.g++.1 new file mode 100644 index 0000000000..1b1cc59e10 --- /dev/null +++ b/examples/latte/log.13Sep22.latte.water.min.g++.1 @@ -0,0 +1,122 @@ +LAMMPS (3 Aug 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# simple water model with LATTE + +units metal +atom_style full +atom_modify sort 0 0.0 # turn off sorting of the coordinates + +read_data data.water +Reading data file ... + orthogonal box = (0 0 0) to (6.267 6.267 6.267) + 1 by 1 by 1 MPI processor grid + reading atoms ... + 24 atoms +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0 0 0 + special bond factors coul: 0 0 0 + 0 = max # of 1-2 neighbors + 0 = max # of 1-3 neighbors + 0 = max # of 1-4 neighbors + 1 = max # of special neighbors + special bonds CPU = 0.000 seconds + read_data CPU = 0.001 seconds + +# replicate system if requested + +variable x index 1 +variable y index 1 +variable z index 1 + +variable nrep equal v_x*v_y*v_z +if "${nrep} > 1" then "replicate $x $y $z" + +# initialize system + +velocity all create 0.0 87287 loop geom + +pair_style zero 1.0 +pair_coeff * * + +neighbor 1.0 bin +neigh_modify every 1 delay 0 check yes + +timestep 0.00025 + +fix 1 all nve + +fix 2 all latte +fix_modify 2 energy yes + +thermo_style custom step temp pe etotal press + +# minimization + +thermo 10 + +min_style fire +minimize 1.0e-4 1.0e-4 500 500 +Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update: every = 1 steps, delay = 0 steps, check = yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 2 + ghost atom cutoff = 2 + binsize = 1, bins = 7 7 7 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair zero, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d + bin: standard + Parameters for fire: + dmax delaystep dtgrow dtshrink alpha0 alphashrink tmax tmin integrator halfstepback + 0.1 20 1.1 0.5 0.25 0.99 10 0.02 eulerimplicit yes +Per MPI rank memory allocation (min/avg/max) = 5.88 | 5.88 | 5.88 Mbytes + Step Temp PotEng TotEng Press + 0 0 -104.95596 -104.95596 48235.442 + 10 853.69689 -106.31143 -103.7734 79191.444 + 20 1112.0893 -107.2723 -103.96607 82675.468 + 30 1897.6249 -108.36769 -102.72608 71447.508 + 40 3068.3491 -110.06452 -100.94237 47627.967 + 50 3.730935 -110.16042 -110.14932 5913.0643 + 60 28.603141 -110.18885 -110.10381 5778.8586 + 66 54.717686 -110.21503 -110.05236 5739.5831 +Loop time of 2.48723 on 1 procs for 66 steps with 24 atoms + +99.5% CPU use with 1 MPI tasks x 1 OpenMP threads + +Minimization stats: + Stopping criterion = energy tolerance + Energy initial, next-to-last, final = + -104.955957263186 -110.209885831179 -110.215033825672 + Force two-norm initial, final = 19.119006 0.51695213 + Force max component initial, final = 11.775801 0.1663917 + Final line search alpha, max atom move = 0 0 + Iterations, force evaluations = 66 69 + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 2.7159e-05 | 2.7159e-05 | 2.7159e-05 | 0.0 | 0.00 +Bond | 3.124e-06 | 3.124e-06 | 3.124e-06 | 0.0 | 0.00 +Neigh | 1.0201e-05 | 1.0201e-05 | 1.0201e-05 | 0.0 | 0.00 +Comm | 0.000109 | 0.000109 | 0.000109 | 0.0 | 0.00 +Output | 0.00010568 | 0.00010568 | 0.00010568 | 0.0 | 0.00 +Modify | 2.4866 | 2.4866 | 2.4866 | 0.0 | 99.98 +Other | | 0.0003552 | | | 0.01 + +Nlocal: 24 ave 24 max 24 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 75 ave 75 max 75 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 33 ave 33 max 33 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 33 +Ave neighs/atom = 1.375 +Ave special neighs/atom = 0 +Neighbor list builds = 1 +Dangerous builds = 0 +Total wall time: 0:00:02 diff --git a/examples/latte/log.19Sep17.latte.sucrose.md.g++.1 b/examples/latte/log.19Sep17.latte.sucrose.md.g++.1 deleted file mode 100644 index bc8843ef7f..0000000000 --- a/examples/latte/log.19Sep17.latte.sucrose.md.g++.1 +++ /dev/null @@ -1,406 +0,0 @@ - The log file for latte_lib - - CONTROL{ } - - WARNING: variable JobName= is missing. I will use a default value instead ... - WARNING: variable PARAMPATH= is missing. I will use a default value instead ... - WARNING: variable DEBUGON= is missing. I will use a default value instead ... - WARNING: variable FERMIM= is missing. I will use a default value instead ... - WARNING: variable CGORLIB= is missing. I will use a default value instead ... - WARNING: variable NORECS= is missing. I will use a default value instead ... - WARNING: variable VDWON= is missing. I will use a default value instead ... - WARNING: variable ORDERNMOL= is missing. I will use a default value instead ... - WARNING: variable LCNON= is missing. I will use a default value instead ... - WARNING: variable LCNITER= is missing. I will use a default value instead ... - WARNING: variable MDON= is missing. I will use a default value instead ... - WARNING: variable PBCON= is missing. I will use a default value instead ... - WARNING: variable RESTART= is missing. I will use a default value instead ... - WARNING: variable NGPU= is missing. I will use a default value instead ... - WARNING: variable COMPFORCE= is missing. I will use a default value instead ... - WARNING: variable DOSFIT= is missing. I will use a default value instead ... - WARNING: variable INTS2FIT= is missing. I will use a default value instead ... - WARNING: variable NFITSTEP= is missing. I will use a default value instead ... - WARNING: variable QFIT= is missing. I will use a default value instead ... - WARNING: variable PPFITON= is missing. I will use a default value instead ... - WARNING: variable ALLFITON= is missing. I will use a default value instead ... - WARNING: variable PPSTEP= is missing. I will use a default value instead ... - WARNING: variable BISTEP= is missing. I will use a default value instead ... - WARNING: variable PP2FIT= is missing. I will use a default value instead ... - WARNING: variable BINT2FIT= is missing. I will use a default value instead ... - WARNING: variable PPNMOL= is missing. I will use a default value instead ... - WARNING: variable PPNGEOM= is missing. I will use a default value instead ... - WARNING: variable PARREP= is missing. I will use a default value instead ... - WARNING: variable VERBOSE= is missing. I will use a default value instead ... - WARNING: variable MIXER= is missing. I will use a default value instead ... - WARNING: variable RESTARTLIB= is missing. I will use a default value instead ... - WARNING: variable CGTOL= is missing. I will use a default value instead ... - WARNING: variable ELEC_ETOL= is missing. I will use a default value instead ... - WARNING: variable COULACC= is missing. I will use a default value instead ... - WARNING: variable COULCUT= is missing. I will use a default value instead ... - WARNING: variable COULR1= is missing. I will use a default value instead ... - WARNING: variable CHTOL= is missing. I will use a default value instead ... - WARNING: variable BETA= is missing. I will use a default value instead ... - WARNING: variable MCSIGMA= is missing. I will use a default value instead ... - WARNING: variable PPBETA= is missing. I will use a default value instead ... - WARNING: variable PPSIGMA= is missing. I will use a default value instead ... - WARNING: variable ER= is missing. I will use a default value instead ... - WARNING: variable INITIALIZED= is missing. I will use a default value instead ... - - - ############### Parameters used for this run ################ - CONTROL{ - xControl= 1 - DEBUGON= 0 - FERMIM= 6 - CGORLIB= 1 - NORECS= 1 - ENTROPYKIND= 1 - PPOTON= 1 - VDWON= 0 - SPINON= 0 - ELECTRO= 1 - ELECMETH= 0 - MAXSCF= 450 - MINSP2ITER= 22 - FULLQCONV= 1 - QITER= 3 - ORDERNMOL= 0 - SPARSEON= 1 - THRESHOLDON= 1 - FILLINSTOP= 100 - BLKSZ= 4 - MSPARSE= 1500 - LCNON= 0 - LCNITER= 4 - RELAX= 0 - MAXITER= 100000 - MDON= 1 - PBCON= 1 - RESTART= 0 - CHARGE= 0 - XBO= 1 - XBODISON= 1 - XBODISORDER= 5 - NGPU= 2 - KON= 0 - COMPFORCE= 1 - DOSFIT= 0 - INTS2FIT= 1 - NFITSTEP= 5000 - QFIT= 0 - PPFITON= 0 - ALLFITON= 0 - PPSTEP= 500 - BISTEP= 500 - PP2FIT= 2 - BINT2FIT= 6 - PPNMOL= 10 - PPNGEOM= 200 - PARREP= 0 - VERBOSE= 0 - MIXER= 0 - RESTARTLIB= 0 - CGTOL= 9.9999999747524271E-007 - KBT= 0.0000000000000000 - SPINTOL= 1.0000000000000000E-004 - ELEC_ETOL= 1.0000000474974513E-003 - ELEC_QTOL= 1.0000000000000000E-008 - COULACC= 9.9999999747524271E-007 - COULCUT= -500.00000000000000 - COULR1= 500.00000000000000 - BREAKTOL= 9.9999999999999995E-007 - QMIX= 0.25000000000000000 - SPINMIX= 0.25000000000000000 - MDMIX= 0.25000000000000000 - NUMTHRESH= 9.9999999999999995E-007 - CHTOL= 9.9999997764825821E-003 - SKIN= 1.0000000000000000 - RLXFTOL= 9.9999999999999995E-008 - BETA= 1000.0000000000000 - MCSIGMA= 0.20000000298023224 - PPBETA= 1000.0000000000000 - PPSIGMA= 9.9999997764825821E-003 - ER= 1.0000000000000000 - JobName=MyJob - BASISTYPE=NONORTHO - SP2CONV=REL - RELAXTYPE=SD - PARAMPATH=./TBparam - COORDSFILE=./coords.dat - INITIALIZED= F - } - - ./TBparam/electrons.dat - MDCONTROL{ } - - WARNING: variable RNDIST= is missing. I will use a default value instead ... - WARNING: variable SEEDINIT= is missing. I will use a default value instead ... - WARNING: variable NPTTYPE= is missing. I will use a default value instead ... - WARNING: variable UDNEIGH= is missing. I will use a default value instead ... - WARNING: variable DUMPFREQ= is missing. I will use a default value instead ... - WARNING: variable RSFREQ= is missing. I will use a default value instead ... - WARNING: variable WRTFREQ= is missing. I will use a default value instead ... - WARNING: variable TOINITTEMP5= is missing. I will use a default value instead ... - WARNING: variable THERMPER= is missing. I will use a default value instead ... - WARNING: variable THERMRUN= is missing. I will use a default value instead ... - WARNING: variable NVTON= is missing. I will use a default value instead ... - WARNING: variable NPTON= is missing. I will use a default value instead ... - WARNING: variable AVEPER= is missing. I will use a default value instead ... - WARNING: variable SEED= is missing. I will use a default value instead ... - WARNING: variable SHOCKON= is missing. I will use a default value instead ... - WARNING: variable SHOCKSTART= is missing. I will use a default value instead ... - WARNING: variable SHOCKDIR= is missing. I will use a default value instead ... - WARNING: variable MDADAPT= is missing. I will use a default value instead ... - WARNING: variable GETHUG= is missing. I will use a default value instead ... - WARNING: variable RSLEVEL= is missing. I will use a default value instead ... - WARNING: variable DT= is missing. I will use a default value instead ... - WARNING: variable TEMPERATURE= is missing. I will use a default value instead ... - WARNING: variable FRICTION= is missing. I will use a default value instead ... - WARNING: variable PTARGET= is missing. I will use a default value instead ... - WARNING: variable UPARTICLE= is missing. I will use a default value instead ... - WARNING: variable USHOCK= is missing. I will use a default value instead ... - WARNING: variable C0= is missing. I will use a default value instead ... - WARNING: variable E0= is missing. I will use a default value instead ... - WARNING: variable V0= is missing. I will use a default value instead ... - WARNING: variable P0= is missing. I will use a default value instead ... - WARNING: variable DUMMY= is missing. I will use a default value instead ... - - - ############### Parameters used for this run ################ - MDCONTROL{ - MAXITER= -1 - UDNEIGH= 1 - DUMPFREQ= 250 - RSFREQ= 500 - WRTFREQ= 25 - TOINITTEMP5= 1 - THERMPER= 500 - THERMRUN= 50000 - NVTON= 0 - NPTON= 0 - AVEPER= 1000 - SEED= 54 - SHOCKON= 0 - SHOCKSTART= 100000 - SHOCKDIR= 1 - MDADAPT= 0 - GETHUG= 0 - RSLEVEL= 0 - DT= 0.25000000000000000 - TEMPERATURE= 300.00000000000000 - FRICTION= 1000.0000000000000 - PTARGET= 0.0000000000000000 - UPARTICLE= 500.00000000000000 - USHOCK= -4590.0000000000000 - C0= 1300.0000000000000 - E0= -795.72497558593750 - V0= 896.98486328125000 - P0= 8.3149001002311707E-002 - RNDIST=GAUSSIAN - SEEDINIT=UNIFORM - NPTTYPE=ISO - DUMMY= F - } - - LIBCALLS 0 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.15165627147849 13.850829743067372 0.0000000000000000 3.9653384620309846 - LIBCALLS 1 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.15142147081917 13.850596160685321 0.0000000000000000 3.9653428217526296 - LIBCALLS 2 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.15072431717670 13.849902902335046 0.0000000000000000 3.9653556077235628 - LIBCALLS 3 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.14958682134301 13.848772166382796 0.0000000000000000 3.9653762812719782 - LIBCALLS 4 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.14804481054080 13.847240065975685 0.0000000000000000 3.9654039257311324 - LIBCALLS 5 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.14614669298459 13.845355347298943 0.0000000000000000 3.9654372593625880 - LIBCALLS 6 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.14395200541782 13.843177681164811 0.0000000000000000 3.9654747563744728 - LIBCALLS 7 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.14152950027858 13.840775605612510 0.0000000000000000 3.9655146828204026 - LIBCALLS 8 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13895477239572 13.838224210058369 0.0000000000000000 3.9655551214573213 - LIBCALLS 9 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13630808318862 13.835602658269416 0.0000000000000000 3.9655940696401335 - LIBCALLS 10 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13367156672246 13.832991646694552 0.0000000000000000 3.9656294961085377 - LIBCALLS 11 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13112695791978 13.830470890853416 0.0000000000000000 3.9656594331001127 - LIBCALLS 12 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.12875304084571 13.828116721514562 0.0000000000000000 3.9656820468287637 - LIBCALLS 13 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.12662314462005 13.825999860613845 0.0000000000000000 3.9656956633599689 - LIBCALLS 14 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.12480303363179 13.824183432931337 0.0000000000000000 3.9656988576578489 - LIBCALLS 15 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.12334906554690 13.822721254684298 0.0000000000000000 3.9656905013961525 - LIBCALLS 16 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.12230649281338 13.821656427050725 0.0000000000000000 3.9656697961568699 - LIBCALLS 17 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.12170820445976 13.821020251989051 0.0000000000000000 3.9656362957330207 - LIBCALLS 18 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.12157378544725 13.820831478957400 0.0000000000000000 3.9655899465557289 - LIBCALLS 19 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.12190902409918 13.821095885466233 0.0000000000000000 3.9655310732858191 - LIBCALLS 20 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.12270578464654 13.821806190548854 0.0000000000000000 3.9654603894825375 - LIBCALLS 21 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.12394226924755 13.822942298269552 0.0000000000000000 3.9653789701528157 - LIBCALLS 22 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.12558369933174 13.824471866833779 0.0000000000000000 3.9652882392864672 - LIBCALLS 23 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.12758334335854 13.826351196916939 0.0000000000000000 3.9651899208403507 - LIBCALLS 24 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.12988392857540 13.828526429544008 0.0000000000000000 3.9650859962581815 - LIBCALLS 25 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13241933900565 13.830935038404082 0.0000000000000000 3.9649786471076300 - LIBCALLS 26 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13511663668885 13.833507593821677 0.0000000000000000 3.9648702062183578 - LIBCALLS 27 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13789821166085 13.836169765592846 0.0000000000000000 3.9647630647732250 - LIBCALLS 28 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.14068416314257 13.838844520440762 0.0000000000000000 3.9646596094056243 - LIBCALLS 29 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.14339478125902 13.841454456993119 0.0000000000000000 3.9645621614306648 - LIBCALLS 30 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.14595299166797 13.843924209084781 0.0000000000000000 3.9644728862209537 - LIBCALLS 31 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.14828672908391 13.846182838096166 0.0000000000000000 3.9643937231592781 - LIBCALLS 32 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.15033121417270 13.848166127650318 0.0000000000000000 3.9643263326484774 - LIBCALLS 33 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.15203097820654 13.849818691045462 0.0000000000000000 3.9642720350529470 - LIBCALLS 34 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.15334158494318 13.851095804201121 0.0000000000000000 3.9642317563508436 - LIBCALLS 35 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.15423101277941 13.851964884709183 0.0000000000000000 3.9642060118064197 - LIBCALLS 36 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.15468060067406 13.852406550643760 0.0000000000000000 3.9641948735126151 - LIBCALLS 37 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.15468556770435 13.852415210893483 0.0000000000000000 3.9641979705462513 - LIBCALLS 38 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.15425506702360 13.851999160128511 0.0000000000000000 3.9642145018322728 - LIBCALLS 39 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.15341177086162 13.851180175004831 0.0000000000000000 3.9642432622019754 - LIBCALLS 40 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.15219100341108 13.849992631968849 0.0000000000000000 3.9642826797086155 - LIBCALLS 41 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.15063948253476 13.848482189284203 0.0000000000000000 3.9643308764467280 - LIBCALLS 42 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.14881366363778 13.846704095034502 0.0000000000000000 3.9643857194231229 - LIBCALLS 43 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.14677783841711 13.844721197666447 0.0000000000000000 3.9644449063996254 - LIBCALLS 44 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.14460195130079 13.842601745208173 0.0000000000000000 3.9645060327113080 - LIBCALLS 45 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.14235930197236 13.840417063344470 0.0000000000000000 3.9645666751650537 - LIBCALLS 46 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.14012416839108 13.838239201362184 0.0000000000000000 3.9646244709241216 - LIBCALLS 47 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13796944534135 13.836138629087953 0.0000000000000000 3.9646771958199687 - LIBCALLS 48 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13596436459642 13.834182058508610 0.0000000000000000 3.9647228360374207 - LIBCALLS 49 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13417236277201 13.832430452024822 0.0000000000000000 3.9647596471475066 - LIBCALLS 50 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13264918465853 13.830937266579358 0.0000000000000000 3.9647862263274365 - LIBCALLS 51 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13144121811348 13.829746970164395 0.0000000000000000 3.9648015300858930 - LIBCALLS 52 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13058418584075 13.828893856279002 0.0000000000000000 3.9648049379175174 - LIBCALLS 53 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13010212355317 13.828401171909800 0.0000000000000000 3.9647962482159476 - LIBCALLS 54 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13000675986638 13.828280567696357 0.0000000000000000 3.9647757005033171 - LIBCALLS 55 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13029725443062 13.828531873218640 0.0000000000000000 3.9647439679967813 - LIBCALLS 56 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13096031859556 13.829143196581525 0.0000000000000000 3.9647021412055241 - LIBCALLS 57 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13197071275096 13.830091344339912 0.0000000000000000 3.9646517009757813 - LIBCALLS 58 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13329208290526 13.831342554670950 0.0000000000000000 3.9645944691057076 - LIBCALLS 59 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13487817952188 13.832853532802908 0.0000000000000000 3.9645325717081379 - LIBCALLS 60 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13667431785007 13.834572772174083 0.0000000000000000 3.9644683636269380 - LIBCALLS 61 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13861917436014 13.836442137716100 0.0000000000000000 3.9644043716683206 - LIBCALLS 62 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.14064674344610 13.838398678492441 0.0000000000000000 3.9643432117931376 - LIBCALLS 63 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.14268847880851 13.840376626541268 0.0000000000000000 3.9642875107994442 - LIBCALLS 64 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.14467552446979 13.842309527587247 0.0000000000000000 3.9642398279114381 - LIBCALLS 65 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.14654097615647 13.844132438475109 0.0000000000000000 3.9642025589783412 - LIBCALLS 66 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.14822207995957 13.845784117078871 0.0000000000000000 3.9641778771678413 - LIBCALLS 67 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.14966231911774 13.847209123749478 0.0000000000000000 3.9641676470155103 - LIBCALLS 68 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.15081329445576 13.848359751049152 0.0000000000000000 3.9641733618391299 - LIBCALLS 69 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.15163634076458 13.849197700537186 0.0000000000000000 3.9641960937768981 - LIBCALLS 70 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.15210380659516 13.849695432596437 0.0000000000000000 3.9642364336978391 - LIBCALLS 71 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.15219997215792 13.849837127658775 0.0000000000000000 3.9642944914660605 - LIBCALLS 72 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.15192153900722 13.849619213627008 0.0000000000000000 3.9643698667021590 - LIBCALLS 73 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.15127769530471 13.849050434626310 0.0000000000000000 3.9644616585289247 - LIBCALLS 74 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.15028974592457 13.848151458176057 0.0000000000000000 3.9645684873567908 - LIBCALLS 75 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.14899032381624 13.846954040343237 0.0000000000000000 3.9646885325372980 - LIBCALLS 76 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.14742221364327 13.845499789571511 0.0000000000000000 3.9648195821504211 - LIBCALLS 77 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.14563684020112 13.843838588134755 0.0000000000000000 3.9649591055666282 - LIBCALLS 78 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.14369246883172 13.842026744273829 0.0000000000000000 3.9651043223068876 - LIBCALLS 79 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.14165219754119 13.840124957235691 0.0000000000000000 3.9652522794782556 - LIBCALLS 80 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13958181195608 13.838196181062383 0.0000000000000000 3.9653999492835532 - LIBCALLS 81 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13754757713065 13.836303471774007 0.0000000000000000 3.9655443071963385 - LIBCALLS 82 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13561405478509 13.834507896249461 0.0000000000000000 3.9656824354232736 - LIBCALLS 83 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13384198639028 13.832866571528193 0.0000000000000000 3.9658115908515681 - LIBCALLS 84 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13228634940748 13.831430891696755 0.0000000000000000 3.9659292903699495 - LIBCALLS 85 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13099461122306 13.830244986101496 0.0000000000000000 3.9660333724384569 - LIBCALLS 86 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13000526350720 13.829344440260281 0.0000000000000000 3.9661220782532145 - LIBCALLS 87 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.12934661713206 13.828755299191645 0.0000000000000000 3.9661940662588862 - LIBCALLS 88 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.12903595764971 13.828493364127572 0.0000000000000000 3.9662484623936765 - LIBCALLS 89 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.12907904533250 13.828563786156602 0.0000000000000000 3.9662848954537067 - LIBCALLS 90 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.12946994320248 13.828960955791626 0.0000000000000000 3.9663034756730777 - LIBCALLS 91 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13019123489619 13.829668684955367 0.0000000000000000 3.9663048073711558 - LIBCALLS 92 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13121457766835 13.830660675785223 0.0000000000000000 3.9662899643566578 - LIBCALLS 93 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13250159637499 13.831901269302985 0.0000000000000000 3.9662604605307470 - LIBCALLS 94 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13400508153813 13.833346464674193 0.0000000000000000 3.9662181906403653 - LIBCALLS 95 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13567049003717 13.834945196074795 0.0000000000000000 3.9661653991148187 - LIBCALLS 96 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13743766487022 13.836640848231452 0.0000000000000000 3.9661045863001441 - LIBCALLS 97 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.13924277096038 13.838372983906890 0.0000000000000000 3.9660384593805307 - LIBCALLS 98 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.14102036682124 13.840079246589914 0.0000000000000000 3.9659698320311318 - LIBCALLS 99 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.14270555407057 13.841697390518378 0.0000000000000000 3.9659015537535014 - LIBCALLS 100 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -261.14423615166146 13.843167378892108 0.0000000000000000 3.9658364191978137 diff --git a/examples/latte/log.19Sep17.latte.water.md.g++.1 b/examples/latte/log.19Sep17.latte.water.md.g++.1 deleted file mode 100644 index f4603f5963..0000000000 --- a/examples/latte/log.19Sep17.latte.water.md.g++.1 +++ /dev/null @@ -1,406 +0,0 @@ - The log file for latte_lib - - CONTROL{ } - - WARNING: variable JobName= is missing. I will use a default value instead ... - WARNING: variable PARAMPATH= is missing. I will use a default value instead ... - WARNING: variable DEBUGON= is missing. I will use a default value instead ... - WARNING: variable FERMIM= is missing. I will use a default value instead ... - WARNING: variable CGORLIB= is missing. I will use a default value instead ... - WARNING: variable NORECS= is missing. I will use a default value instead ... - WARNING: variable VDWON= is missing. I will use a default value instead ... - WARNING: variable ORDERNMOL= is missing. I will use a default value instead ... - WARNING: variable LCNON= is missing. I will use a default value instead ... - WARNING: variable LCNITER= is missing. I will use a default value instead ... - WARNING: variable MDON= is missing. I will use a default value instead ... - WARNING: variable PBCON= is missing. I will use a default value instead ... - WARNING: variable RESTART= is missing. I will use a default value instead ... - WARNING: variable NGPU= is missing. I will use a default value instead ... - WARNING: variable COMPFORCE= is missing. I will use a default value instead ... - WARNING: variable DOSFIT= is missing. I will use a default value instead ... - WARNING: variable INTS2FIT= is missing. I will use a default value instead ... - WARNING: variable NFITSTEP= is missing. I will use a default value instead ... - WARNING: variable QFIT= is missing. I will use a default value instead ... - WARNING: variable PPFITON= is missing. I will use a default value instead ... - WARNING: variable ALLFITON= is missing. I will use a default value instead ... - WARNING: variable PPSTEP= is missing. I will use a default value instead ... - WARNING: variable BISTEP= is missing. I will use a default value instead ... - WARNING: variable PP2FIT= is missing. I will use a default value instead ... - WARNING: variable BINT2FIT= is missing. I will use a default value instead ... - WARNING: variable PPNMOL= is missing. I will use a default value instead ... - WARNING: variable PPNGEOM= is missing. I will use a default value instead ... - WARNING: variable PARREP= is missing. I will use a default value instead ... - WARNING: variable VERBOSE= is missing. I will use a default value instead ... - WARNING: variable MIXER= is missing. I will use a default value instead ... - WARNING: variable RESTARTLIB= is missing. I will use a default value instead ... - WARNING: variable CGTOL= is missing. I will use a default value instead ... - WARNING: variable ELEC_ETOL= is missing. I will use a default value instead ... - WARNING: variable COULACC= is missing. I will use a default value instead ... - WARNING: variable COULCUT= is missing. I will use a default value instead ... - WARNING: variable COULR1= is missing. I will use a default value instead ... - WARNING: variable CHTOL= is missing. I will use a default value instead ... - WARNING: variable BETA= is missing. I will use a default value instead ... - WARNING: variable MCSIGMA= is missing. I will use a default value instead ... - WARNING: variable PPBETA= is missing. I will use a default value instead ... - WARNING: variable PPSIGMA= is missing. I will use a default value instead ... - WARNING: variable ER= is missing. I will use a default value instead ... - WARNING: variable INITIALIZED= is missing. I will use a default value instead ... - - - ############### Parameters used for this run ################ - CONTROL{ - xControl= 1 - DEBUGON= 0 - FERMIM= 6 - CGORLIB= 1 - NORECS= 1 - ENTROPYKIND= 1 - PPOTON= 1 - VDWON= 0 - SPINON= 0 - ELECTRO= 1 - ELECMETH= 0 - MAXSCF= 450 - MINSP2ITER= 22 - FULLQCONV= 1 - QITER= 3 - ORDERNMOL= 0 - SPARSEON= 1 - THRESHOLDON= 1 - FILLINSTOP= 100 - BLKSZ= 4 - MSPARSE= 1500 - LCNON= 0 - LCNITER= 4 - RELAX= 0 - MAXITER= 100000 - MDON= 1 - PBCON= 1 - RESTART= 0 - CHARGE= 0 - XBO= 1 - XBODISON= 1 - XBODISORDER= 5 - NGPU= 2 - KON= 0 - COMPFORCE= 1 - DOSFIT= 0 - INTS2FIT= 1 - NFITSTEP= 5000 - QFIT= 0 - PPFITON= 0 - ALLFITON= 0 - PPSTEP= 500 - BISTEP= 500 - PP2FIT= 2 - BINT2FIT= 6 - PPNMOL= 10 - PPNGEOM= 200 - PARREP= 0 - VERBOSE= 0 - MIXER= 0 - RESTARTLIB= 0 - CGTOL= 9.9999999747524271E-007 - KBT= 0.0000000000000000 - SPINTOL= 1.0000000000000000E-004 - ELEC_ETOL= 1.0000000474974513E-003 - ELEC_QTOL= 1.0000000000000000E-008 - COULACC= 9.9999999747524271E-007 - COULCUT= -500.00000000000000 - COULR1= 500.00000000000000 - BREAKTOL= 9.9999999999999995E-007 - QMIX= 0.25000000000000000 - SPINMIX= 0.25000000000000000 - MDMIX= 0.25000000000000000 - NUMTHRESH= 9.9999999999999995E-007 - CHTOL= 9.9999997764825821E-003 - SKIN= 1.0000000000000000 - RLXFTOL= 9.9999999999999995E-008 - BETA= 1000.0000000000000 - MCSIGMA= 0.20000000298023224 - PPBETA= 1000.0000000000000 - PPSIGMA= 9.9999997764825821E-003 - ER= 1.0000000000000000 - JobName=MyJob - BASISTYPE=NONORTHO - SP2CONV=REL - RELAXTYPE=SD - PARAMPATH=./TBparam - COORDSFILE=./coords.dat - INITIALIZED= F - } - - ./TBparam/electrons.dat - MDCONTROL{ } - - WARNING: variable RNDIST= is missing. I will use a default value instead ... - WARNING: variable SEEDINIT= is missing. I will use a default value instead ... - WARNING: variable NPTTYPE= is missing. I will use a default value instead ... - WARNING: variable UDNEIGH= is missing. I will use a default value instead ... - WARNING: variable DUMPFREQ= is missing. I will use a default value instead ... - WARNING: variable RSFREQ= is missing. I will use a default value instead ... - WARNING: variable WRTFREQ= is missing. I will use a default value instead ... - WARNING: variable TOINITTEMP5= is missing. I will use a default value instead ... - WARNING: variable THERMPER= is missing. I will use a default value instead ... - WARNING: variable THERMRUN= is missing. I will use a default value instead ... - WARNING: variable NVTON= is missing. I will use a default value instead ... - WARNING: variable NPTON= is missing. I will use a default value instead ... - WARNING: variable AVEPER= is missing. I will use a default value instead ... - WARNING: variable SEED= is missing. I will use a default value instead ... - WARNING: variable SHOCKON= is missing. I will use a default value instead ... - WARNING: variable SHOCKSTART= is missing. I will use a default value instead ... - WARNING: variable SHOCKDIR= is missing. I will use a default value instead ... - WARNING: variable MDADAPT= is missing. I will use a default value instead ... - WARNING: variable GETHUG= is missing. I will use a default value instead ... - WARNING: variable RSLEVEL= is missing. I will use a default value instead ... - WARNING: variable DT= is missing. I will use a default value instead ... - WARNING: variable TEMPERATURE= is missing. I will use a default value instead ... - WARNING: variable FRICTION= is missing. I will use a default value instead ... - WARNING: variable PTARGET= is missing. I will use a default value instead ... - WARNING: variable UPARTICLE= is missing. I will use a default value instead ... - WARNING: variable USHOCK= is missing. I will use a default value instead ... - WARNING: variable C0= is missing. I will use a default value instead ... - WARNING: variable E0= is missing. I will use a default value instead ... - WARNING: variable V0= is missing. I will use a default value instead ... - WARNING: variable P0= is missing. I will use a default value instead ... - WARNING: variable DUMMY= is missing. I will use a default value instead ... - - - ############### Parameters used for this run ################ - MDCONTROL{ - MAXITER= -1 - UDNEIGH= 1 - DUMPFREQ= 250 - RSFREQ= 500 - WRTFREQ= 25 - TOINITTEMP5= 1 - THERMPER= 500 - THERMRUN= 50000 - NVTON= 0 - NPTON= 0 - AVEPER= 1000 - SEED= 54 - SHOCKON= 0 - SHOCKSTART= 100000 - SHOCKDIR= 1 - MDADAPT= 0 - GETHUG= 0 - RSLEVEL= 0 - DT= 0.25000000000000000 - TEMPERATURE= 300.00000000000000 - FRICTION= 1000.0000000000000 - PTARGET= 0.0000000000000000 - UPARTICLE= 500.00000000000000 - USHOCK= -4590.0000000000000 - C0= 1300.0000000000000 - E0= -795.72497558593750 - V0= 896.98486328125000 - P0= 8.3149001002311707E-002 - RNDIST=GAUSSIAN - SEEDINIT=UNIFORM - NPTTYPE=ISO - DUMMY= F - } - - LIBCALLS 0 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -110.94281402417451 9.3197859655447317 0.0000000000000000 3.3331152608769714 - LIBCALLS 1 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -111.00875524736128 9.3653691493930946 0.0000000000000000 3.3307590218500454 - LIBCALLS 2 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -111.20542679804305 9.5022104076319209 0.0000000000000000 3.3237269236958826 - LIBCALLS 3 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -111.52938059528239 9.7304811436977623 0.0000000000000000 3.3121168872278743 - LIBCALLS 4 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -111.97463249071366 10.050121693432235 0.0000000000000000 3.2961492065207088 - LIBCALLS 5 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -112.53270518796754 10.460328095449432 0.0000000000000000 3.2761112890303719 - LIBCALLS 6 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -113.19233973551384 10.958848347453728 0.0000000000000000 3.2524094948032394 - LIBCALLS 7 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -113.93936061504219 11.541120618354967 0.0000000000000000 3.2255715906285793 - LIBCALLS 8 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -114.75657630591589 12.199315594286325 0.0000000000000000 3.1962412869596100 - LIBCALLS 9 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -115.62363727592754 12.921383532128770 0.0000000000000000 3.1652236023838971 - LIBCALLS 10 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -116.51738028417616 13.690253224922545 0.0000000000000000 3.1333864449223818 - LIBCALLS 11 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -117.41167836078414 14.483370804317431 0.0000000000000000 3.1018474945925432 - LIBCALLS 12 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -118.27888830961329 15.272791625586624 0.0000000000000000 3.0716022180609772 - LIBCALLS 13 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -119.09006809777934 16.026020995592610 0.0000000000000000 3.0437832241644842 - LIBCALLS 14 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -119.81665859965702 16.707725410478066 0.0000000000000000 3.0194382402972129 - LIBCALLS 15 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -120.43171665196000 17.282293509806884 0.0000000000000000 2.9995944159949395 - LIBCALLS 16 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -120.91202932933264 17.717025741135480 0.0000000000000000 2.9850159611897484 - LIBCALLS 17 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -121.23935305628714 17.985521384886379 0.0000000000000000 2.9763132734231292 - LIBCALLS 18 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -121.40195013006486 18.070687763205626 0.0000000000000000 2.9738279411203812 - LIBCALLS 19 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -121.39540873020161 17.966785565900089 0.0000000000000000 2.9776410698341418 - LIBCALLS 20 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -121.22299732491055 17.680085363043698 0.0000000000000000 2.9875419962840417 - LIBCALLS 21 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -120.89520311723561 17.228004261852682 0.0000000000000000 3.0030824758482719 - LIBCALLS 22 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -120.42892991839108 16.636927104987372 0.0000000000000000 3.0235548851138652 - LIBCALLS 23 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -119.84603562384113 15.939176953031323 0.0000000000000000 3.0480682132279808 - LIBCALLS 24 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -119.17151378155378 15.169713318754383 0.0000000000000000 3.0757033760823562 - LIBCALLS 25 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -118.43237009319661 14.363090728730079 0.0000000000000000 3.1053593079625457 - LIBCALLS 26 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -117.65587959220025 13.551051330611342 0.0000000000000000 3.1359367589132958 - LIBCALLS 27 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -116.86794783202731 12.760928656005802 0.0000000000000000 3.1665525874091585 - LIBCALLS 28 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -116.09314111752745 12.014864684105008 0.0000000000000000 3.1962157162544820 - LIBCALLS 29 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -115.35329645548983 11.329720850249741 0.0000000000000000 3.2241713466126849 - LIBCALLS 30 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -114.66766945168203 10.717501941208962 0.0000000000000000 3.2497326120829619 - LIBCALLS 31 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -114.05267853351812 10.186102377105355 0.0000000000000000 3.2723439005172468 - LIBCALLS 32 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -113.52195471723405 9.7402032028335377 0.0000000000000000 3.2915777178346559 - LIBCALLS 33 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -113.08654808143162 9.3821857555240076 0.0000000000000000 3.3070881064986164 - LIBCALLS 34 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -112.75494140290169 9.1129669843369658 0.0000000000000000 3.3186769594405297 - LIBCALLS 35 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -112.53346080566452 8.9326971516334606 0.0000000000000000 3.3261797960311763 - LIBCALLS 36 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -112.42631053676025 8.8412887543407273 0.0000000000000000 3.3295101207595583 - LIBCALLS 37 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -112.43567911088179 8.8387604511711384 0.0000000000000000 3.3286360397306387 - LIBCALLS 38 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -112.56180874683180 8.9253908783870841 0.0000000000000000 3.3235794828927934 - LIBCALLS 39 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -112.80290981416660 9.1016780459478674 0.0000000000000000 3.3144303393175201 - LIBCALLS 40 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -113.15529209572232 9.3681021116147463 0.0000000000000000 3.3012719922659173 - LIBCALLS 41 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -113.61284717182851 9.7246892073080176 0.0000000000000000 3.2843276907821406 - LIBCALLS 42 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -114.16711238367500 10.170382433756300 0.0000000000000000 3.2638758866524444 - LIBCALLS 43 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -114.80697882175535 10.702240750749448 0.0000000000000000 3.2402928278295451 - LIBCALLS 44 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -115.51862249254057 11.314512276989859 0.0000000000000000 3.2140189987358694 - LIBCALLS 45 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -116.28534475502829 11.997664972113199 0.0000000000000000 3.1855791836729437 - LIBCALLS 46 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -117.08723294353808 12.737504349188432 0.0000000000000000 3.1557205936583181 - LIBCALLS 47 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -117.90172272355942 13.514542609912253 0.0000000000000000 3.1252466759266087 - LIBCALLS 48 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -118.70392627447073 14.303827027310493 0.0000000000000000 3.0950533786893732 - LIBCALLS 49 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -119.46728361372288 15.075425279261220 0.0000000000000000 3.0661202668284480 - LIBCALLS 50 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -120.16480071670361 15.795723720235596 0.0000000000000000 3.0394030522382605 - LIBCALLS 51 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -120.77012122199473 16.429579578207949 0.0000000000000000 3.0158910566711334 - LIBCALLS 52 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -121.25943485841766 16.943195338409559 0.0000000000000000 2.9964108616830281 - LIBCALLS 53 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -121.61275582007269 17.307379355481601 0.0000000000000000 2.9817016064731785 - LIBCALLS 54 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -121.81557415209883 17.500688554193868 0.0000000000000000 2.9722905637821611 - LIBCALLS 55 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -121.85979389563140 17.511877645177901 0.0000000000000000 2.9685356305551474 - LIBCALLS 56 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -121.74454585055143 17.341170281709367 0.0000000000000000 2.9705149057151141 - LIBCALLS 57 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -121.47625724150488 17.000096879575938 0.0000000000000000 2.9780008785307088 - LIBCALLS 58 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -121.06771474420596 16.509959464438374 0.0000000000000000 2.9906138266349656 - LIBCALLS 59 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -120.53702830874704 15.899266098308772 0.0000000000000000 3.0078351734174715 - LIBCALLS 60 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -119.90667912574422 15.200652842845301 0.0000000000000000 3.0288733658622142 - LIBCALLS 61 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -119.20142467775943 14.447825469624703 0.0000000000000000 3.0529481020908245 - LIBCALLS 62 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -118.44747494197328 13.672949108115853 0.0000000000000000 3.0790791220573088 - LIBCALLS 63 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -117.67063237406208 12.904741667499017 0.0000000000000000 3.1063745183559131 - LIBCALLS 64 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -116.89550228683500 12.167344616151606 0.0000000000000000 3.1339818740985033 - LIBCALLS 65 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -116.14487351718614 11.479908971904207 0.0000000000000000 3.1610748652786995 - LIBCALLS 66 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -115.43917601644073 10.856755674815151 0.0000000000000000 3.1869042214936911 - LIBCALLS 67 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -114.79630542914917 10.307930318909381 0.0000000000000000 3.2107896540741994 - LIBCALLS 68 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -114.23118520942130 9.8399835349372715 0.0000000000000000 3.2322754400486997 - LIBCALLS 69 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -113.75645667348935 9.4568320682906393 0.0000000000000000 3.2508686207040949 - LIBCALLS 70 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -113.38220191758144 9.1605931457952803 0.0000000000000000 3.2662052636761625 - LIBCALLS 71 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -113.11651461323785 8.9523172650382463 0.0000000000000000 3.2778578161416640 - LIBCALLS 72 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -112.96490300473705 8.8325758589074610 0.0000000000000000 3.2856373346184280 - LIBCALLS 73 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -112.93101384064629 8.8018792766284140 0.0000000000000000 3.2893376450243901 - LIBCALLS 74 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -113.01657988020818 8.8609123616606951 0.0000000000000000 3.2887786713823335 - LIBCALLS 75 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -113.22122702505257 9.0105808374276855 0.0000000000000000 3.2838806809960044 - LIBCALLS 76 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -113.54255812607462 9.2518619694254909 0.0000000000000000 3.2746170980725564 - LIBCALLS 77 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -113.97595003796289 9.5854566564348804 0.0000000000000000 3.2610495238703536 - LIBCALLS 78 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -114.51445216471619 10.011242264155852 0.0000000000000000 3.2433103887056101 - LIBCALLS 79 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -115.14835871057100 10.527538366743359 0.0000000000000000 3.2217018278255036 - LIBCALLS 80 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -115.86512618816471 11.130220642932718 0.0000000000000000 3.1966546818138903 - LIBCALLS 81 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -116.64916580084807 11.811746817430592 0.0000000000000000 3.1687509169099037 - LIBCALLS 82 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -117.48162972769103 12.560201275368994 0.0000000000000000 3.1387793445426220 - LIBCALLS 83 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -118.34080112521505 13.358507776606700 0.0000000000000000 3.1076005013428842 - LIBCALLS 84 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -119.20206255799097 14.183999576696523 0.0000000000000000 3.0762625451098367 - LIBCALLS 85 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -120.03875955947012 15.008549885925623 0.0000000000000000 3.0458557745855401 - LIBCALLS 86 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -120.82281065648482 15.799445052997022 0.0000000000000000 3.0175902569508040 - LIBCALLS 87 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -121.52638053902615 16.521105731022047 0.0000000000000000 2.9925661691795984 - LIBCALLS 88 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -122.12297505178334 17.137613862262167 0.0000000000000000 2.9718740800190462 - LIBCALLS 89 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -122.58954501498538 17.615819283155187 0.0000000000000000 2.9563457612376758 - LIBCALLS 90 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -122.90768650775293 17.928615619513138 0.0000000000000000 2.9466637669908935 - LIBCALLS 91 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -123.06510359278838 18.057846294334183 0.0000000000000000 2.9432773288779130 - LIBCALLS 92 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -123.05653995529889 17.996310208253615 0.0000000000000000 2.9463730237128352 - LIBCALLS 93 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -122.88443709725219 17.748486968230267 0.0000000000000000 2.9557418006906766 - LIBCALLS 94 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -122.55804625906457 17.329857520510558 0.0000000000000000 2.9710497340098647 - LIBCALLS 95 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -122.09316916859144 16.764989519228550 0.0000000000000000 2.9916333369114647 - LIBCALLS 96 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -121.51050736457847 16.084787212290774 0.0000000000000000 3.0167038701280053 - LIBCALLS 97 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -120.83475656442954 15.323405512114466 0.0000000000000000 3.0451593241515909 - LIBCALLS 98 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -120.09218577985371 14.515310319889227 0.0000000000000000 3.0759929793994090 - LIBCALLS 99 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -119.30969482099719 13.692843612811791 0.0000000000000000 3.1081426979179545 - LIBCALLS 100 - Energy Components (TRRHOH, EREP, ENTE, ECOUL) -118.51358261827596 12.884492109393644 0.0000000000000000 3.1405428597121636 diff --git a/examples/latte/log.21Jun18.latte.graphene.boxrelax.g++.1 b/examples/latte/log.21Jun18.latte.graphene.boxrelax.g++.1 deleted file mode 100644 index 3a37136fd3..0000000000 --- a/examples/latte/log.21Jun18.latte.graphene.boxrelax.g++.1 +++ /dev/null @@ -1,170 +0,0 @@ -LAMMPS (11 May 2018) -# Simple water model with LATTE - -units metal -atom_style full -atom_modify sort 0 0.0 # turn off sorting of the coordinates - -read_data data.graphene.boxrel - triclinic box = (0 0 0) to (10 8 20) with tilt (4.89859e-16 1.22465e-15 1.22465e-15) - 1 by 1 by 1 MPI processor grid - reading atoms ... - 32 atoms - 0 = max # of 1-2 neighbors - 0 = max # of 1-3 neighbors - 0 = max # of 1-4 neighbors - 1 = max # of special neighbors - -# replicate system if requested - -variable x index 1 -variable y index 1 -variable z index 1 - -variable nrep equal v_x*v_y*v_z -if "${nrep} > 1" then "replicate $x $y $z" - -# initialize system - -velocity all create 0.0 87287 loop geom - -pair_style zero 1.0 -pair_coeff * * - -neighbor 1.0 bin -neigh_modify every 1 delay 0 check yes - -timestep 0.00025 - -fix 1 all box/relax iso 0.0 vmax 0.001 - -fix 2 all latte NULL -fix_modify 2 energy yes - -thermo_style custom etotal - -# minimization - -thermo 1 -fix 3 all print 1 "Total Energy =" -min_style cg -min_modify dmax 0.1 -min_modify line quadratic -minimize 1.0e-4 1.0e-4 10000 10000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 2 - ghost atom cutoff = 2 - binsize = 1, bins = 11 9 20 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair zero, perpetual - attributes: half, newton on - pair build: half/bin/newton/tri - stencil: half/bin/3d/newton/tri - bin: standard -Per MPI rank memory allocation (min/avg/max) = 6.779 | 6.779 | 6.779 Mbytes -TotEng - -247.46002 - -247.67224 - -247.87937 - -248.08148 - -248.27865 - -248.47096 - -248.65851 - -248.84137 - -249.01964 - -249.19342 - -249.36281 - -249.52791 - -249.68883 - -249.8457 - -249.99865 - -250.1478 - -250.29332 - -250.43535 - -250.57409 - -250.70972 - -250.84247 - -250.97258 - -251.10035 - -251.2261 - -251.35021 - -251.47314 - -251.59543 - -251.71776 - -251.84096 - -251.9661 - -252.09459 - -252.22833 - -252.37003 - -252.52371 - -252.69578 - -252.89752 - -253.15197 - -253.52044 - -254.31418 - -255.6175 - -256.8162 - -258.1227 - -259.38401 - -260.74831 - -262.03991 - -263.5463 - -264.70486 - -267.69144 - -267.88682 - -269.03519 - -270.60187 - -270.65382 - -270.74279 - -271.55883 - -271.81248 - -271.87529 - -273.01494 - -273.23948 - -273.28719 - -273.35272 - -273.41591 - -273.46274 - -273.54755 - -273.58318 - -273.73111 - -273.75754 -Loop time of 39.4155 on 1 procs for 65 steps with 32 atoms - -1582.4% CPU use with 1 MPI tasks x no OpenMP threads - -Minimization stats: - Stopping criterion = energy tolerance - Energy initial, next-to-last, final = - -247.460020579 -273.731112592 -273.757543461 - Force two-norm initial, final = 201.608 9.43485 - Force max component initial, final = 188.924 2.41297 - Final line search alpha, max atom move = 0.000223273 0.00053875 - Iterations, force evaluations = 65 65 - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.00012159 | 0.00012159 | 0.00012159 | 0.0 | 0.00 -Bond | 5.1975e-05 | 5.1975e-05 | 5.1975e-05 | 0.0 | 0.00 -Neigh | 4.1962e-05 | 4.1962e-05 | 4.1962e-05 | 0.0 | 0.00 -Comm | 0.00026107 | 0.00026107 | 0.00026107 | 0.0 | 0.00 -Output | 0.0013342 | 0.0013342 | 0.0013342 | 0.0 | 0.00 -Modify | 39.412 | 39.412 | 39.412 | 0.0 | 99.99 -Other | | 0.00127 | | | 0.00 - -Nlocal: 32 ave 32 max 32 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 100 ave 100 max 100 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 48 ave 48 max 48 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 48 -Ave neighs/atom = 1.5 -Ave special neighs/atom = 0 -Neighbor list builds = 1 -Dangerous builds = 0 -Total wall time: 0:00:40 diff --git a/examples/latte/log.21Jun18.latte.sucrose.g++.1 b/examples/latte/log.21Jun18.latte.sucrose.g++.1 deleted file mode 100644 index cb4526587c..0000000000 --- a/examples/latte/log.21Jun18.latte.sucrose.g++.1 +++ /dev/null @@ -1,103 +0,0 @@ -LAMMPS (11 May 2018) -# simple sucrose model with LATTE - -units metal -atom_style full -atom_modify sort 0 0.0 # turn off sorting of the coordinates - -read_data data.sucrose - orthogonal box = (0 0 0) to (17.203 18.009 21.643) - 1 by 1 by 1 MPI processor grid - reading atoms ... - 45 atoms - 0 = max # of 1-2 neighbors - 0 = max # of 1-3 neighbors - 0 = max # of 1-4 neighbors - 1 = max # of special neighbors - -# replicate system if requested - -variable x index 1 -variable y index 1 -variable z index 1 - -variable nrep equal v_x*v_y*v_z -if "${nrep} > 1" then "replicate $x $y $z" - -# initialize system - -velocity all create 0.0 87287 loop geom - -pair_style zero 1.0 -pair_coeff * * - -neighbor 1.0 bin -neigh_modify every 1 delay 0 check yes - -timestep 0.00025 - -fix 1 all nve - -fix 2 all latte NULL -fix_modify 2 energy yes - -thermo_style custom step temp pe etotal press - -# dynamics - -thermo 10 -run 100 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 2 - ghost atom cutoff = 2 - binsize = 1, bins = 18 19 22 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair zero, perpetual - attributes: half, newton on - pair build: half/bin/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 0.5064 | 0.5064 | 0.5064 Mbytes -Step Temp PotEng TotEng Press - 0 0 -251.26617 -251.26617 16.617234 - 10 0.025263709 -251.26631 -251.26617 8.0576708 - 20 0.034232467 -251.26636 -251.26617 1.6673442 - 30 0.059079556 -251.2665 -251.26617 11.058458 - 40 0.055499766 -251.26648 -251.26617 14.837775 - 50 0.058499509 -251.2665 -251.26617 6.7183113 - 60 0.071094535 -251.26657 -251.26617 6.6133687 - 70 0.084309439 -251.26665 -251.26617 12.372721 - 80 0.1089929 -251.26679 -251.26617 8.8355516 - 90 0.11378257 -251.26681 -251.26617 5.1177922 - 100 0.13003966 -251.26691 -251.26617 8.2431185 -Loop time of 27.8386 on 1 procs for 100 steps with 45 atoms - -Performance: 0.078 ns/day, 309.318 hours/ns, 3.592 timesteps/s -1799.6% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 8.3685e-05 | 8.3685e-05 | 8.3685e-05 | 0.0 | 0.00 -Bond | 7.4148e-05 | 7.4148e-05 | 7.4148e-05 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.00016689 | 0.00016689 | 0.00016689 | 0.0 | 0.00 -Output | 0.00032401 | 0.00032401 | 0.00032401 | 0.0 | 0.00 -Modify | 27.837 | 27.837 | 27.837 | 0.0 |100.00 -Other | | 0.0005403 | | | 0.00 - -Nlocal: 45 ave 45 max 45 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 59 ave 59 max 59 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 59 -Ave neighs/atom = 1.31111 -Ave special neighs/atom = 0 -Neighbor list builds = 0 -Dangerous builds = 0 -Total wall time: 0:00:28 diff --git a/examples/latte/log.21Jun18.latte.water.g++.1 b/examples/latte/log.21Jun18.latte.water.g++.1 deleted file mode 100644 index 0decce1f98..0000000000 --- a/examples/latte/log.21Jun18.latte.water.g++.1 +++ /dev/null @@ -1,103 +0,0 @@ -LAMMPS (11 May 2018) -# simple water model with LATTE - -units metal -atom_style full -atom_modify sort 0 0.0 # turn off sorting of the coordinates - -read_data data.water - orthogonal box = (0 0 0) to (6.267 6.267 6.267) - 1 by 1 by 1 MPI processor grid - reading atoms ... - 24 atoms - 0 = max # of 1-2 neighbors - 0 = max # of 1-3 neighbors - 0 = max # of 1-4 neighbors - 1 = max # of special neighbors - -# replicate system if requested - -variable x index 1 -variable y index 1 -variable z index 1 - -variable nrep equal v_x*v_y*v_z -if "${nrep} > 1" then "replicate $x $y $z" - -# initialize system - -velocity all create 0.0 87287 loop geom - -pair_style zero 1.0 -pair_coeff * * - -neighbor 1.0 bin -neigh_modify every 1 delay 0 check yes - -timestep 0.00025 - -fix 1 all nve - -fix 2 all latte NULL -fix_modify 2 energy yes - -thermo_style custom step temp pe etotal press - -# dynamics - -thermo 10 -run 100 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 2 - ghost atom cutoff = 2 - binsize = 1, bins = 7 7 7 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair zero, perpetual - attributes: half, newton on - pair build: half/bin/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 5.629 | 5.629 | 5.629 Mbytes -Step Temp PotEng TotEng Press - 0 0 -104.95594 -104.95594 48236.006 - 10 336.5303 -105.96026 -104.95976 97997.303 - 20 529.06385 -106.53021 -104.95731 131520.49 - 30 753.62616 -107.1995 -104.95898 49297.371 - 40 716.6565 -107.08802 -104.95741 28307.272 - 50 824.04417 -107.40822 -104.95835 102167.48 - 60 933.56056 -107.73478 -104.95932 92508.792 - 70 851.18518 -107.48766 -104.95711 13993.28 - 80 999.80265 -107.93146 -104.95906 36700.417 - 90 998.77707 -107.92569 -104.95634 107233.7 - 100 1281.4446 -108.76961 -104.95989 49703.193 -Loop time of 10.6388 on 1 procs for 100 steps with 24 atoms - -Performance: 0.203 ns/day, 118.209 hours/ns, 9.400 timesteps/s -6459.7% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 7.6771e-05 | 7.6771e-05 | 7.6771e-05 | 0.0 | 0.00 -Bond | 7.5817e-05 | 7.5817e-05 | 7.5817e-05 | 0.0 | 0.00 -Neigh | 4.6015e-05 | 4.6015e-05 | 4.6015e-05 | 0.0 | 0.00 -Comm | 0.00031829 | 0.00031829 | 0.00031829 | 0.0 | 0.00 -Output | 0.00032401 | 0.00032401 | 0.00032401 | 0.0 | 0.00 -Modify | 10.637 | 10.637 | 10.637 | 0.0 | 99.99 -Other | | 0.00052 | | | 0.00 - -Nlocal: 24 ave 24 max 24 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 77 ave 77 max 77 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 31 ave 31 max 31 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 31 -Ave neighs/atom = 1.29167 -Ave special neighs/atom = 0 -Neighbor list builds = 2 -Dangerous builds = 0 -Total wall time: 0:00:10 diff --git a/examples/latte/log.21Jun18.latte.water.min.g++.1 b/examples/latte/log.21Jun18.latte.water.min.g++.1 deleted file mode 100644 index 1c8921fd60..0000000000 --- a/examples/latte/log.21Jun18.latte.water.min.g++.1 +++ /dev/null @@ -1,108 +0,0 @@ -LAMMPS (11 May 2018) -# simple water model with LATTE - -units metal -atom_style full -atom_modify sort 0 0.0 # turn off sorting of the coordinates - -read_data data.water - orthogonal box = (0 0 0) to (6.267 6.267 6.267) - 1 by 1 by 1 MPI processor grid - reading atoms ... - 24 atoms - 0 = max # of 1-2 neighbors - 0 = max # of 1-3 neighbors - 0 = max # of 1-4 neighbors - 1 = max # of special neighbors - -# replicate system if requested - -variable x index 1 -variable y index 1 -variable z index 1 - -variable nrep equal v_x*v_y*v_z -if "${nrep} > 1" then "replicate $x $y $z" - -# initialize system - -velocity all create 0.0 87287 loop geom - -pair_style zero 1.0 -pair_coeff * * - -neighbor 1.0 bin -neigh_modify every 1 delay 0 check yes - -timestep 0.00025 - -fix 1 all nve - -fix 2 all latte NULL -fix_modify 2 energy yes - -thermo_style custom step temp pe etotal press - -# minimization - -thermo 10 - -min_style fire -minimize 1.0e-4 1.0e-4 500 500 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 2 - ghost atom cutoff = 2 - binsize = 1, bins = 7 7 7 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair zero, perpetual - attributes: half, newton on - pair build: half/bin/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 5.629 | 5.629 | 5.629 Mbytes -Step Temp PotEng TotEng Press - 0 0 -104.95594 -104.95594 48236.006 - 10 349.4534 -105.50948 -104.47056 62157.729 - 20 1253.6636 -107.00863 -103.28151 116456.71 - 30 134.64051 -107.56155 -107.16127 59864.196 - 40 2.4044989 -108.1527 -108.14556 32695.648 - 47 137.26885 -108.30413 -107.89603 60177.442 -Loop time of 6.42677 on 1 procs for 47 steps with 24 atoms - -6481.9% CPU use with 1 MPI tasks x no OpenMP threads - -Minimization stats: - Stopping criterion = energy tolerance - Energy initial, next-to-last, final = - -104.955944301 -108.302982895 -108.304126127 - Force two-norm initial, final = 19.119 3.44609 - Force max component initial, final = 11.7758 1.3408 - Final line search alpha, max atom move = 0 0 - Iterations, force evaluations = 47 47 - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 4.6253e-05 | 4.6253e-05 | 4.6253e-05 | 0.0 | 0.00 -Bond | 3.1948e-05 | 3.1948e-05 | 3.1948e-05 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.00014353 | 0.00014353 | 0.00014353 | 0.0 | 0.00 -Output | 0.00012302 | 0.00012302 | 0.00012302 | 0.0 | 0.00 -Modify | 6.426 | 6.426 | 6.426 | 0.0 | 99.99 -Other | | 0.0004699 | | | 0.01 - -Nlocal: 24 ave 24 max 24 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 71 ave 71 max 71 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 37 ave 37 max 37 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 37 -Ave neighs/atom = 1.54167 -Ave special neighs/atom = 0 -Neighbor list builds = 0 -Dangerous builds = 0 -Total wall time: 0:00:06 diff --git a/lib/mdi/Install.py b/lib/mdi/Install.py index 0dbc4d03cf..1ef6a515da 100644 --- a/lib/mdi/Install.py +++ b/lib/mdi/Install.py @@ -32,12 +32,12 @@ make lib-mdi args="-m mpi" # build MDI lib with same settings as in the mpi Make # settings -version = "1.4.10" +version = "1.4.11" url = "https://github.com/MolSSI-MDI/MDI_Library/archive/v%s.tar.gz" % version # known checksums for different MDI versions. used to validate the download. checksums = { \ - '1.4.10' : '1c203b7fd462d9934834f643f09f3c06', \ + '1.4.11' : '3791fe5081405c14aac07d4687f1cc58', \ } # print error message or help diff --git a/src/AMOEBA/amoeba_file.cpp b/src/AMOEBA/amoeba_file.cpp index ebedbc13d5..2089ab3a27 100644 --- a/src/AMOEBA/amoeba_file.cpp +++ b/src/AMOEBA/amoeba_file.cpp @@ -416,7 +416,7 @@ void PairAmoeba::read_keyfile(char *filename) const auto words = Tokenizer(trimmed).as_vector(); const int nwords = words.size(); - const auto keyword = words[0]; + const auto &keyword = words[0]; if (utils::strmatch(keyword, "^[^a-z]+")) { ; // ignore keywords that do not start with text diff --git a/src/ASPHERE/compute_erotate_asphere.cpp b/src/ASPHERE/compute_erotate_asphere.cpp index 192b5e5ed3..d98ef4efb2 100644 --- a/src/ASPHERE/compute_erotate_asphere.cpp +++ b/src/ASPHERE/compute_erotate_asphere.cpp @@ -43,9 +43,9 @@ void ComputeERotateAsphere::init() { // error check - avec_ellipsoid = dynamic_cast( atom->style_match("ellipsoid")); - avec_line = dynamic_cast( atom->style_match("line")); - avec_tri = dynamic_cast( atom->style_match("tri")); + avec_ellipsoid = dynamic_cast(atom->style_match("ellipsoid")); + avec_line = dynamic_cast(atom->style_match("line")); + avec_tri = dynamic_cast(atom->style_match("tri")); if (!avec_ellipsoid && !avec_line && !avec_tri) error->all(FLERR,"Compute erotate/asphere requires " "atom style ellipsoid or line or tri"); diff --git a/src/ASPHERE/compute_temp_asphere.cpp b/src/ASPHERE/compute_temp_asphere.cpp index 84581c63c1..36ef8af338 100644 --- a/src/ASPHERE/compute_temp_asphere.cpp +++ b/src/ASPHERE/compute_temp_asphere.cpp @@ -94,7 +94,7 @@ void ComputeTempAsphere::init() { // error check - avec = dynamic_cast( atom->style_match("ellipsoid")); + avec = dynamic_cast(atom->style_match("ellipsoid")); if (!avec) error->all(FLERR,"Compute temp/asphere requires atom style ellipsoid"); diff --git a/src/ASPHERE/fix_nh_asphere.cpp b/src/ASPHERE/fix_nh_asphere.cpp index 11e11926e4..07461ba365 100644 --- a/src/ASPHERE/fix_nh_asphere.cpp +++ b/src/ASPHERE/fix_nh_asphere.cpp @@ -36,7 +36,7 @@ FixNHAsphere::FixNHAsphere(LAMMPS *lmp, int narg, char **arg) : void FixNHAsphere::init() { - avec = dynamic_cast( atom->style_match("ellipsoid")); + avec = dynamic_cast(atom->style_match("ellipsoid")); if (!avec) error->all(FLERR, "Compute nvt/nph/npt asphere requires atom style ellipsoid"); diff --git a/src/ASPHERE/fix_nve_asphere.cpp b/src/ASPHERE/fix_nve_asphere.cpp index ee8c8d3b6e..d969796f89 100644 --- a/src/ASPHERE/fix_nve_asphere.cpp +++ b/src/ASPHERE/fix_nve_asphere.cpp @@ -37,7 +37,7 @@ FixNVEAsphere::FixNVEAsphere(LAMMPS *lmp, int narg, char **arg) : void FixNVEAsphere::init() { - avec = dynamic_cast( atom->style_match("ellipsoid")); + avec = dynamic_cast(atom->style_match("ellipsoid")); if (!avec) error->all(FLERR,"Compute nve/asphere requires atom style ellipsoid"); diff --git a/src/ASPHERE/fix_nve_asphere_noforce.cpp b/src/ASPHERE/fix_nve_asphere_noforce.cpp index 799df8115a..2be23a644c 100644 --- a/src/ASPHERE/fix_nve_asphere_noforce.cpp +++ b/src/ASPHERE/fix_nve_asphere_noforce.cpp @@ -37,7 +37,7 @@ void FixNVEAsphereNoforce::init() { // error check - avec = dynamic_cast( atom->style_match("ellipsoid")); + avec = dynamic_cast(atom->style_match("ellipsoid")); if (!atom->ellipsoid_flag) error->all(FLERR,"Fix nve/asphere/noforce requires atom style ellipsoid"); diff --git a/src/ASPHERE/fix_nve_line.cpp b/src/ASPHERE/fix_nve_line.cpp index a46f6cf67b..5d9251d541 100644 --- a/src/ASPHERE/fix_nve_line.cpp +++ b/src/ASPHERE/fix_nve_line.cpp @@ -56,7 +56,7 @@ void FixNVELine::init() { // error checks - avec = dynamic_cast( atom->style_match("line")); + avec = dynamic_cast(atom->style_match("line")); if (!avec) error->all(FLERR,"Fix nve/line requires atom style line"); if (domain->dimension != 2) diff --git a/src/ASPHERE/fix_nve_tri.cpp b/src/ASPHERE/fix_nve_tri.cpp index d41d3ee0ef..d594f6a854 100644 --- a/src/ASPHERE/fix_nve_tri.cpp +++ b/src/ASPHERE/fix_nve_tri.cpp @@ -50,7 +50,7 @@ void FixNVETri::init() { // error checks - avec = dynamic_cast( atom->style_match("tri")); + avec = dynamic_cast(atom->style_match("tri")); if (!avec) error->all(FLERR,"Fix nve/tri requires atom style tri"); if (domain->dimension != 3) diff --git a/src/ASPHERE/pair_gayberne.cpp b/src/ASPHERE/pair_gayberne.cpp index 71b8a82cc7..025de0975b 100644 --- a/src/ASPHERE/pair_gayberne.cpp +++ b/src/ASPHERE/pair_gayberne.cpp @@ -346,7 +346,7 @@ void PairGayBerne::coeff(int narg, char **arg) void PairGayBerne::init_style() { - avec = dynamic_cast( atom->style_match("ellipsoid")); + avec = dynamic_cast(atom->style_match("ellipsoid")); if (!avec) error->all(FLERR,"Pair gayberne requires atom style ellipsoid"); neighbor->add_request(this,NeighConst::REQ_DEFAULT); diff --git a/src/ASPHERE/pair_line_lj.cpp b/src/ASPHERE/pair_line_lj.cpp index ab1b81ca73..6784f3341d 100644 --- a/src/ASPHERE/pair_line_lj.cpp +++ b/src/ASPHERE/pair_line_lj.cpp @@ -402,7 +402,7 @@ void PairLineLJ::coeff(int narg, char **arg) void PairLineLJ::init_style() { - avec = dynamic_cast( atom->style_match("line")); + avec = dynamic_cast(atom->style_match("line")); if (!avec) error->all(FLERR,"Pair line/lj requires atom style line"); neighbor->add_request(this,NeighConst::REQ_DEFAULT); diff --git a/src/ASPHERE/pair_tri_lj.cpp b/src/ASPHERE/pair_tri_lj.cpp index eaec71b055..a62e4f253d 100644 --- a/src/ASPHERE/pair_tri_lj.cpp +++ b/src/ASPHERE/pair_tri_lj.cpp @@ -467,7 +467,7 @@ void PairTriLJ::coeff(int narg, char **arg) void PairTriLJ::init_style() { - avec = dynamic_cast( atom->style_match("tri")); + avec = dynamic_cast(atom->style_match("tri")); if (!avec) error->all(FLERR,"Pair tri/lj requires atom style tri"); neighbor->add_request(this,NeighConst::REQ_DEFAULT); diff --git a/src/AWPMD/atom_vec_wavepacket.cpp b/src/AWPMD/atom_vec_wavepacket.cpp index b4950e2ef0..b904410cd3 100644 --- a/src/AWPMD/atom_vec_wavepacket.cpp +++ b/src/AWPMD/atom_vec_wavepacket.cpp @@ -39,7 +39,7 @@ AtomVecWavepacket::AtomVecWavepacket(LAMMPS *lmp) : AtomVec(lmp) // order of fields in a string does not matter // except: fields_data_atom & fields_data_vel must match data file - fields_grow = {"q", "espin", "eradius", "ervel", "erforce", + fields_grow = {"q", "espin", "eradius", "ervel", "erforce", "cs", "csforce", "vforce", "ervelforce", "etag"}; fields_copy = {"q", "espin", "eradius", "ervel", "cs", "etag"}; fields_comm = {"eradius"}; @@ -108,7 +108,7 @@ void AtomVecWavepacket::data_atom_post(int ilocal) int AtomVecWavepacket::property_atom(const std::string &name) { if (name == "espin") return 0; - if (name == "spin") return 0; // backward compatibility + if (name == "spin") return 0; // backward compatibility if (name == "eradius") return 1; if (name == "ervel") return 2; if (name == "erforce") return 3; diff --git a/src/AWPMD/fix_nve_awpmd.cpp b/src/AWPMD/fix_nve_awpmd.cpp index c37feb2ede..f9931d5302 100644 --- a/src/AWPMD/fix_nve_awpmd.cpp +++ b/src/AWPMD/fix_nve_awpmd.cpp @@ -61,7 +61,7 @@ void FixNVEAwpmd::init() dtf = 0.5 * update->dt * force->ftm2v; if (utils::strmatch(update->integrate_style,"^respa")) - step_respa = (dynamic_cast( update->integrate))->step; + step_respa = (dynamic_cast(update->integrate))->step; awpmd_pair=dynamic_cast(force->pair); awpmd_pair->wpmd->norm_needed=1; diff --git a/src/BOCS/fix_bocs.cpp b/src/BOCS/fix_bocs.cpp index 449deefd59..de55019be0 100644 --- a/src/BOCS/fix_bocs.cpp +++ b/src/BOCS/fix_bocs.cpp @@ -491,7 +491,7 @@ void FixBocs::init() { for (int i = 0; i < modify->nfix; i++) if (strcmp(modify->fix[i]->style,"deform") == 0) { - int *dimflag = (dynamic_cast( modify->fix[i]))->dimflag; + int *dimflag = (dynamic_cast(modify->fix[i]))->dimflag; if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) || (p_flag[2] && dimflag[2]) || (p_flag[3] && dimflag[3]) || (p_flag[4] && dimflag[4]) || (p_flag[5] && dimflag[5])) @@ -591,8 +591,8 @@ void FixBocs::init() else kspace_flag = 0; if (utils::strmatch(update->integrate_style,"^respa")) { - nlevels_respa = (dynamic_cast( update->integrate))->nlevels; - step_respa = (dynamic_cast( update->integrate))->step; + nlevels_respa = (dynamic_cast(update->integrate))->nlevels; + step_respa = (dynamic_cast(update->integrate))->step; dto = 0.5*step_respa[0]; } diff --git a/src/BODY/compute_body_local.cpp b/src/BODY/compute_body_local.cpp index 7d48b0770f..d3d28a7ea0 100644 --- a/src/BODY/compute_body_local.cpp +++ b/src/BODY/compute_body_local.cpp @@ -53,7 +53,7 @@ ComputeBodyLocal::ComputeBodyLocal(LAMMPS *lmp, int narg, char **arg) : } } - avec = dynamic_cast( atom->style_match("body")); + avec = dynamic_cast(atom->style_match("body")); if (!avec) error->all(FLERR,"Compute body/local requires atom style body"); bptr = avec->bptr; diff --git a/src/BODY/compute_temp_body.cpp b/src/BODY/compute_temp_body.cpp index 3f97c2c82f..084b715b25 100644 --- a/src/BODY/compute_temp_body.cpp +++ b/src/BODY/compute_temp_body.cpp @@ -87,7 +87,7 @@ void ComputeTempBody::init() { // error check - avec = dynamic_cast( atom->style_match("body")); + avec = dynamic_cast(atom->style_match("body")); if (!avec) error->all(FLERR,"Compute temp/body requires atom style body"); diff --git a/src/BODY/fix_nh_body.cpp b/src/BODY/fix_nh_body.cpp index ba46bce2ac..2b462f1f4c 100644 --- a/src/BODY/fix_nh_body.cpp +++ b/src/BODY/fix_nh_body.cpp @@ -37,7 +37,7 @@ FixNHBody::FixNHBody(LAMMPS *lmp, int narg, char **arg) : void FixNHBody::init() { - avec = dynamic_cast( atom->style_match("body")); + avec = dynamic_cast(atom->style_match("body")); if (!avec) error->all(FLERR, "Compute nvt/nph/npt body requires atom style body"); diff --git a/src/BODY/fix_nve_body.cpp b/src/BODY/fix_nve_body.cpp index f731bed81e..a0c2430f18 100644 --- a/src/BODY/fix_nve_body.cpp +++ b/src/BODY/fix_nve_body.cpp @@ -30,7 +30,7 @@ FixNVEBody::FixNVEBody(LAMMPS *lmp, int narg, char **arg) : void FixNVEBody::init() { - avec = dynamic_cast( atom->style_match("body")); + avec = dynamic_cast(atom->style_match("body")); if (!avec) error->all(FLERR,"Fix nve/body requires atom style body"); // check that all particles are bodies diff --git a/src/BODY/fix_wall_body_polygon.cpp b/src/BODY/fix_wall_body_polygon.cpp index 47467f9d42..be1d89468b 100644 --- a/src/BODY/fix_wall_body_polygon.cpp +++ b/src/BODY/fix_wall_body_polygon.cpp @@ -179,13 +179,13 @@ void FixWallBodyPolygon::init() { dt = update->dt; - avec = dynamic_cast( atom->style_match("body")); + avec = dynamic_cast(atom->style_match("body")); if (!avec) error->all(FLERR,"Pair body/rounded/polygon requires atom style body"); if (strcmp(avec->bptr->style,"rounded/polygon") != 0) error->all(FLERR,"Pair body/rounded/polygon requires " "body style rounded/polygon"); - bptr = dynamic_cast( avec->bptr); + bptr = dynamic_cast(avec->bptr); // set pairstyle from body/polygonular pair style diff --git a/src/BODY/fix_wall_body_polyhedron.cpp b/src/BODY/fix_wall_body_polyhedron.cpp index 2e503640d8..f739d9d682 100644 --- a/src/BODY/fix_wall_body_polyhedron.cpp +++ b/src/BODY/fix_wall_body_polyhedron.cpp @@ -184,13 +184,13 @@ void FixWallBodyPolyhedron::init() { dt = update->dt; - avec = dynamic_cast( atom->style_match("body")); + avec = dynamic_cast(atom->style_match("body")); if (!avec) error->all(FLERR,"Pair body/rounded/polyhedron requires atom style body"); if (strcmp(avec->bptr->style,"rounded/polyhedron") != 0) error->all(FLERR,"Pair body/rounded/polyhedron requires " "body style rounded/polyhedron"); - bptr = dynamic_cast( avec->bptr); + bptr = dynamic_cast(avec->bptr); // set pairstyle from body/polyhedronular pair style diff --git a/src/BODY/pair_body_nparticle.cpp b/src/BODY/pair_body_nparticle.cpp index df2c6c1d23..d056dd2840 100644 --- a/src/BODY/pair_body_nparticle.cpp +++ b/src/BODY/pair_body_nparticle.cpp @@ -416,11 +416,11 @@ void PairBodyNparticle::coeff(int narg, char **arg) void PairBodyNparticle::init_style() { - avec = dynamic_cast( atom->style_match("body")); + avec = dynamic_cast(atom->style_match("body")); if (!avec) error->all(FLERR,"Pair body/nparticle requires atom style body"); if (strcmp(avec->bptr->style,"nparticle") != 0) error->all(FLERR,"Pair body/nparticle requires body style nparticle"); - bptr = dynamic_cast( avec->bptr); + bptr = dynamic_cast(avec->bptr); neighbor->add_request(this); } diff --git a/src/BODY/pair_body_rounded_polygon.cpp b/src/BODY/pair_body_rounded_polygon.cpp index 7485cf4b9c..a7a83049a2 100644 --- a/src/BODY/pair_body_rounded_polygon.cpp +++ b/src/BODY/pair_body_rounded_polygon.cpp @@ -411,13 +411,13 @@ void PairBodyRoundedPolygon::coeff(int narg, char **arg) void PairBodyRoundedPolygon::init_style() { - avec = dynamic_cast( atom->style_match("body")); + avec = dynamic_cast(atom->style_match("body")); if (!avec) error->all(FLERR,"Pair body/rounded/polygon requires atom style body"); if (strcmp(avec->bptr->style,"rounded/polygon") != 0) error->all(FLERR,"Pair body/rounded/polygon requires " "body style rounded/polygon"); - bptr = dynamic_cast( avec->bptr); + bptr = dynamic_cast(avec->bptr); if (force->newton_pair == 0) error->all(FLERR,"Pair style body/rounded/polygon requires " diff --git a/src/BODY/pair_body_rounded_polyhedron.cpp b/src/BODY/pair_body_rounded_polyhedron.cpp index a9593b5fa2..db8d6baf5d 100644 --- a/src/BODY/pair_body_rounded_polyhedron.cpp +++ b/src/BODY/pair_body_rounded_polyhedron.cpp @@ -390,13 +390,13 @@ void PairBodyRoundedPolyhedron::coeff(int narg, char **arg) void PairBodyRoundedPolyhedron::init_style() { - avec = dynamic_cast( atom->style_match("body")); + avec = dynamic_cast(atom->style_match("body")); if (!avec) error->all(FLERR,"Pair body/rounded/polyhedron requires " "atom style body"); if (strcmp(avec->bptr->style,"rounded/polyhedron") != 0) error->all(FLERR,"Pair body/rounded/polyhedron requires " "body style rounded/polyhedron"); - bptr = dynamic_cast( avec->bptr); + bptr = dynamic_cast(avec->bptr); if (force->newton_pair == 0) error->all(FLERR,"Pair style body/rounded/polyhedron requires " diff --git a/src/BPM/bond_bpm.cpp b/src/BPM/bond_bpm.cpp index 67c1992912..73c2d04728 100644 --- a/src/BPM/bond_bpm.cpp +++ b/src/BPM/bond_bpm.cpp @@ -84,9 +84,9 @@ void BondBPM::init_style() { if (id_fix_store_local) { auto ifix = modify->get_fix_by_id(id_fix_store_local); - if (!ifix) error->all(FLERR, "Cannot find fix STORE/LOCAL id {}",id_fix_store_local); + if (!ifix) error->all(FLERR, "Cannot find fix STORE/LOCAL id {}", id_fix_store_local); if (strcmp(ifix->style, "STORE/LOCAL") != 0) - error->all(FLERR, "Incorrect fix style matched, not STORE/LOCAL: {}",ifix->style); + error->all(FLERR, "Incorrect fix style matched, not STORE/LOCAL: {}", ifix->style); fix_store_local = dynamic_cast(ifix); fix_store_local->nvalues = nvalues; } diff --git a/src/BROWNIAN/fix_brownian.cpp b/src/BROWNIAN/fix_brownian.cpp index 97c4017a14..9284126676 100644 --- a/src/BROWNIAN/fix_brownian.cpp +++ b/src/BROWNIAN/fix_brownian.cpp @@ -70,7 +70,7 @@ void FixBrownian::initial_integrate(int /*vflag */) initial_integrate_templated<1, 0, 0>(); } } - } +} /* ---------------------------------------------------------------------- */ @@ -126,4 +126,4 @@ template void FixBrownian::initial_int v[i][2] = dz / dt; } } - } +} diff --git a/src/BROWNIAN/fix_brownian_asphere.cpp b/src/BROWNIAN/fix_brownian_asphere.cpp index 63b618ea2c..46c58e7877 100644 --- a/src/BROWNIAN/fix_brownian_asphere.cpp +++ b/src/BROWNIAN/fix_brownian_asphere.cpp @@ -157,7 +157,7 @@ void FixBrownianAsphere::initial_integrate(int /*vflag */) } } } - } +} /* ---------------------------------------------------------------------- */ @@ -296,5 +296,4 @@ void FixBrownianAsphere::initial_integrate_templated() } } } - - } +} diff --git a/src/BROWNIAN/fix_brownian_sphere.cpp b/src/BROWNIAN/fix_brownian_sphere.cpp index 763d20fdd7..5a20c4c0ec 100644 --- a/src/BROWNIAN/fix_brownian_sphere.cpp +++ b/src/BROWNIAN/fix_brownian_sphere.cpp @@ -85,7 +85,7 @@ void FixBrownianSphere::initial_integrate(int /*vflag */) initial_integrate_templated<1, 0, 0, 0>(); } } - } +} /* ---------------------------------------------------------------------- */ diff --git a/src/CG-DNA/fix_nve_dot.cpp b/src/CG-DNA/fix_nve_dot.cpp index 3806e452c3..47506874a7 100644 --- a/src/CG-DNA/fix_nve_dot.cpp +++ b/src/CG-DNA/fix_nve_dot.cpp @@ -37,7 +37,7 @@ FixNVEDot::FixNVEDot(LAMMPS *lmp, int narg, char **arg) : void FixNVEDot::init() { - avec = dynamic_cast( atom->style_match("ellipsoid")); + avec = dynamic_cast(atom->style_match("ellipsoid")); if (!avec) error->all(FLERR,"Compute nve/dot requires atom style ellipsoid"); diff --git a/src/CG-DNA/fix_nve_dotc_langevin.cpp b/src/CG-DNA/fix_nve_dotc_langevin.cpp index 8ca4acf510..0c48df32ce 100644 --- a/src/CG-DNA/fix_nve_dotc_langevin.cpp +++ b/src/CG-DNA/fix_nve_dotc_langevin.cpp @@ -89,7 +89,7 @@ void FixNVEDotcLangevin::init() int *mask = atom->mask; int nlocal = atom->nlocal; - avec = dynamic_cast( atom->style_match("ellipsoid")); + avec = dynamic_cast(atom->style_match("ellipsoid")); if (!avec) error->all(FLERR,"Fix nve/dotc/langevin requires atom style ellipsoid"); diff --git a/src/CG-DNA/pair_oxdna_excv.cpp b/src/CG-DNA/pair_oxdna_excv.cpp index a201a5ccf7..73386f3fe4 100644 --- a/src/CG-DNA/pair_oxdna_excv.cpp +++ b/src/CG-DNA/pair_oxdna_excv.cpp @@ -139,7 +139,7 @@ void PairOxdnaExcv::compute(int eflag, int vflag) int newton_pair = force->newton_pair; int *alist,*blist,*numneigh,**firstneigh; - auto avec = dynamic_cast( atom->style_match("ellipsoid")); + auto avec = dynamic_cast(atom->style_match("ellipsoid")); AtomVecEllipsoid::Bonus *bonus = avec->bonus; int *ellipsoid = atom->ellipsoid; diff --git a/src/COLLOID/pair_brownian_poly.cpp b/src/COLLOID/pair_brownian_poly.cpp index d24a65a821..69af4ae769 100644 --- a/src/COLLOID/pair_brownian_poly.cpp +++ b/src/COLLOID/pair_brownian_poly.cpp @@ -362,7 +362,7 @@ void PairBrownianPoly::init_style() error->all(FLERR, "Cannot use multiple fix wall commands with pair brownian"); flagwall = 1; // Walls exist - wallfix = dynamic_cast( modify->fix[i]); + wallfix = dynamic_cast(modify->fix[i]); if (wallfix->xflag) flagwall = 2; // Moving walls exist } } diff --git a/src/COLLOID/pair_lubricate.cpp b/src/COLLOID/pair_lubricate.cpp index 1267d42f1f..7e15bc563a 100644 --- a/src/COLLOID/pair_lubricate.cpp +++ b/src/COLLOID/pair_lubricate.cpp @@ -563,7 +563,7 @@ void PairLubricate::init_style() for (int i = 0; i < modify->nfix; i++) { if (strcmp(modify->fix[i]->style,"deform") == 0) { shearing = flagdeform = 1; - if ((dynamic_cast( modify->fix[i]))->remapflag != Domain::V_REMAP) + if ((dynamic_cast(modify->fix[i]))->remapflag != Domain::V_REMAP) error->all(FLERR,"Using pair lubricate with inconsistent " "fix deform remap option"); } @@ -572,7 +572,7 @@ void PairLubricate::init_style() error->all(FLERR, "Cannot use multiple fix wall commands with pair lubricate"); flagwall = 1; // Walls exist - wallfix = dynamic_cast( modify->fix[i]); + wallfix = dynamic_cast(modify->fix[i]); if (wallfix->xflag) flagwall = 2; // Moving walls exist } } diff --git a/src/COLLOID/pair_lubricateU.cpp b/src/COLLOID/pair_lubricateU.cpp index aa83a53ce4..f263b18a86 100644 --- a/src/COLLOID/pair_lubricateU.cpp +++ b/src/COLLOID/pair_lubricateU.cpp @@ -1801,7 +1801,7 @@ void PairLubricateU::init_style() "Cannot use multiple fix wall commands with " "pair lubricateU"); flagwall = 1; // Walls exist - wallfix = dynamic_cast( modify->fix[i]); + wallfix = dynamic_cast(modify->fix[i]); if (wallfix->xflag) flagwall = 2; // Moving walls exist } } diff --git a/src/COLLOID/pair_lubricateU_poly.cpp b/src/COLLOID/pair_lubricateU_poly.cpp index 1fad75a68c..7598baa88e 100644 --- a/src/COLLOID/pair_lubricateU_poly.cpp +++ b/src/COLLOID/pair_lubricateU_poly.cpp @@ -1165,7 +1165,7 @@ void PairLubricateUPoly::init_style() "Cannot use multiple fix wall commands with " "pair lubricateU"); flagwall = 1; // Walls exist - wallfix = dynamic_cast( modify->fix[i]); + wallfix = dynamic_cast(modify->fix[i]); if (wallfix->xflag) flagwall = 2; // Moving walls exist } } diff --git a/src/COLLOID/pair_lubricate_poly.cpp b/src/COLLOID/pair_lubricate_poly.cpp index 38ec073f48..8ce3e8e110 100644 --- a/src/COLLOID/pair_lubricate_poly.cpp +++ b/src/COLLOID/pair_lubricate_poly.cpp @@ -463,7 +463,7 @@ void PairLubricatePoly::init_style() for (int i = 0; i < modify->nfix; i++) { if (strcmp(modify->fix[i]->style,"deform") == 0) { shearing = flagdeform = 1; - if ((dynamic_cast( modify->fix[i]))->remapflag != Domain::V_REMAP) + if ((dynamic_cast(modify->fix[i]))->remapflag != Domain::V_REMAP) error->all(FLERR,"Using pair lubricate with inconsistent " "fix deform remap option"); } @@ -473,15 +473,15 @@ void PairLubricatePoly::init_style() "Cannot use multiple fix wall commands with " "pair lubricate/poly"); flagwall = 1; // Walls exist - wallfix = dynamic_cast( modify->fix[i]); + wallfix = dynamic_cast(modify->fix[i]); if (wallfix->xflag) flagwall = 2; // Moving walls exist } if (strstr(modify->fix[i]->style,"wall") != nullptr) { flagwall = 1; // Walls exist - if ((dynamic_cast( modify->fix[i]))->xflag) { + if ((dynamic_cast(modify->fix[i]))->xflag) { flagwall = 2; // Moving walls exist - wallfix = dynamic_cast( modify->fix[i]); + wallfix = dynamic_cast(modify->fix[i]); } } } @@ -539,7 +539,7 @@ void PairLubricatePoly::init_style() for (int i = 0; i < modify->nfix; i++) if (strcmp(modify->fix[i]->style,"deform") == 0) { shearing = 1; - if ((dynamic_cast( modify->fix[i]))->remapflag != Domain::V_REMAP) + if ((dynamic_cast(modify->fix[i]))->remapflag != Domain::V_REMAP) error->all(FLERR,"Using pair lubricate/poly with inconsistent " "fix deform remap option"); } diff --git a/src/COLVARS/colvarproxy_lammps.h b/src/COLVARS/colvarproxy_lammps.h index 3ff713713f..338f64fa86 100644 --- a/src/COLVARS/colvarproxy_lammps.h +++ b/src/COLVARS/colvarproxy_lammps.h @@ -101,7 +101,8 @@ class colvarproxy_lammps : public colvarproxy { void log(std::string const &message) override; void error(std::string const &message) override; - cvm::rvector position_distance(cvm::atom_pos const &pos1, cvm::atom_pos const &pos2) const override; + cvm::rvector position_distance(cvm::atom_pos const &pos1, + cvm::atom_pos const &pos2) const override; cvm::real rand_gaussian(void) override { return _random->gaussian(); }; diff --git a/src/COMPRESS/gz_file_writer.cpp b/src/COMPRESS/gz_file_writer.cpp index d53576b9c2..a796568e70 100644 --- a/src/COMPRESS/gz_file_writer.cpp +++ b/src/COMPRESS/gz_file_writer.cpp @@ -21,7 +21,7 @@ using namespace LAMMPS_NS; -GzFileWriter::GzFileWriter() : compression_level(Z_BEST_COMPRESSION), gzFp(nullptr) {} +GzFileWriter::GzFileWriter() : compression_level(Z_BEST_COMPRESSION), gzFp(nullptr) {} /* ---------------------------------------------------------------------- */ diff --git a/src/COMPRESS/zstd_file_writer.cpp b/src/COMPRESS/zstd_file_writer.cpp index f2f64fcc1c..2485074ad9 100644 --- a/src/COMPRESS/zstd_file_writer.cpp +++ b/src/COMPRESS/zstd_file_writer.cpp @@ -24,7 +24,7 @@ using namespace LAMMPS_NS; ZstdFileWriter::ZstdFileWriter() : - compression_level(0), checksum_flag(1), cctx(nullptr), fp(nullptr) + compression_level(0), checksum_flag(1), cctx(nullptr), fp(nullptr) { out_buffer_size = ZSTD_CStreamOutSize(); out_buffer = new char[out_buffer_size]; diff --git a/src/DIELECTRIC/atom_vec_dielectric.cpp b/src/DIELECTRIC/atom_vec_dielectric.cpp index 8fb4744fa6..23dee2f38d 100644 --- a/src/DIELECTRIC/atom_vec_dielectric.cpp +++ b/src/DIELECTRIC/atom_vec_dielectric.cpp @@ -101,29 +101,30 @@ void AtomVecDielectric::init() // with pair styles using coulomb without dielectric support. std::string pair_style(force->pair_style); - if ((pair_style != "none") && (pair_style != "zero") && !utils::strmatch(force->pair_style,"/dielectric")) { + if ((pair_style != "none") && (pair_style != "zero") && + !utils::strmatch(force->pair_style, "/dielectric")) { bool mismatch = false; - if (utils::strmatch(force->pair_style,"^reaxff")) mismatch = true; - if (utils::strmatch(force->pair_style,"^comb")) mismatch = true; - if (utils::strmatch(force->pair_style,"coul")) mismatch = true; - if (utils::strmatch(force->pair_style,"tip4p")) mismatch = true; - if (utils::strmatch(force->pair_style,"dipole")) mismatch = true; + if (utils::strmatch(force->pair_style, "^reaxff")) mismatch = true; + if (utils::strmatch(force->pair_style, "^comb")) mismatch = true; + if (utils::strmatch(force->pair_style, "coul")) mismatch = true; + if (utils::strmatch(force->pair_style, "tip4p")) mismatch = true; + if (utils::strmatch(force->pair_style, "dipole")) mismatch = true; - if (utils::strmatch(force->pair_style,"^hybrid")) { + if (utils::strmatch(force->pair_style, "^hybrid")) { auto hybrid = dynamic_cast(force->pair); if (hybrid) { for (int i = 0; i < hybrid->nstyles; i++) { - if (utils::strmatch(hybrid->keywords[i],"^reaxff")) mismatch = true; - if (utils::strmatch(hybrid->keywords[i],"^comb")) mismatch = true; - if (utils::strmatch(hybrid->keywords[i],"coul")) mismatch = true; - if (utils::strmatch(hybrid->keywords[i],"tip4p")) mismatch = true; - if (utils::strmatch(hybrid->keywords[i],"dipole")) mismatch = true; + if (utils::strmatch(hybrid->keywords[i], "^reaxff")) mismatch = true; + if (utils::strmatch(hybrid->keywords[i], "^comb")) mismatch = true; + if (utils::strmatch(hybrid->keywords[i], "coul")) mismatch = true; + if (utils::strmatch(hybrid->keywords[i], "tip4p")) mismatch = true; + if (utils::strmatch(hybrid->keywords[i], "dipole")) mismatch = true; } } } if (mismatch) - error->all(FLERR, "Pair style {} is not compatible with atom style {}", - pair_style, atom->get_style()); + error->all(FLERR, "Pair style {} is not compatible with atom style {}", pair_style, + atom->get_style()); } } diff --git a/src/DIELECTRIC/msm_dielectric.cpp b/src/DIELECTRIC/msm_dielectric.cpp index 3217c8dbad..d371a5c0ff 100644 --- a/src/DIELECTRIC/msm_dielectric.cpp +++ b/src/DIELECTRIC/msm_dielectric.cpp @@ -58,7 +58,7 @@ void MSMDielectric::init() { MSM::init(); - avec = dynamic_cast( atom->style_match("dielectric")); + avec = dynamic_cast(atom->style_match("dielectric")); if (!avec) error->all(FLERR,"msm/dielectric requires atom style dielectric"); } diff --git a/src/DIELECTRIC/pair_coul_long_dielectric.cpp b/src/DIELECTRIC/pair_coul_long_dielectric.cpp index 32b6e34360..991135199e 100644 --- a/src/DIELECTRIC/pair_coul_long_dielectric.cpp +++ b/src/DIELECTRIC/pair_coul_long_dielectric.cpp @@ -36,8 +36,7 @@ using MathConst::MY_PIS; /* ---------------------------------------------------------------------- */ -PairCoulLongDielectric::PairCoulLongDielectric(LAMMPS *_lmp) : - PairCoulLong(_lmp), efield(nullptr) +PairCoulLongDielectric::PairCoulLongDielectric(LAMMPS *_lmp) : PairCoulLong(_lmp), efield(nullptr) { nmax = 0; single_enable = 0; @@ -177,7 +176,8 @@ void PairCoulLongDielectric::compute(int eflag, int vflag) ecoul = scale[itype][jtype] * qtmp * q[j] * 0.5 * (etmp + eps[j]) * table; } if (factor_coul < 1.0) ecoul -= (1.0 - factor_coul) * prefactor; - } else ecoul = 0.0; + } else + ecoul = 0.0; if (evflag) ev_tally_full(i, 0.0, ecoul, fpair_i, delx, dely, delz); } diff --git a/src/DIELECTRIC/pair_lj_cut_coul_cut_dielectric.cpp b/src/DIELECTRIC/pair_lj_cut_coul_cut_dielectric.cpp index ac4e470ff7..2234ef1e83 100644 --- a/src/DIELECTRIC/pair_lj_cut_coul_cut_dielectric.cpp +++ b/src/DIELECTRIC/pair_lj_cut_coul_cut_dielectric.cpp @@ -159,7 +159,7 @@ void PairLJCutCoulCutDielectric::compute(int eflag, int vflag) if (eflag) { if (rsq < cut_coulsq[itype][jtype]) { - ecoul = factor_coul * qqrd2e * qtmp * q[j] * 0.5 * (etmp + eps[j]) *rinv; + ecoul = factor_coul * qqrd2e * qtmp * q[j] * 0.5 * (etmp + eps[j]) * rinv; } else ecoul = 0.0; if (rsq < cut_ljsq[itype][jtype]) { diff --git a/src/DIELECTRIC/pppm_dielectric.cpp b/src/DIELECTRIC/pppm_dielectric.cpp index 92bd89ebd9..c063750a75 100644 --- a/src/DIELECTRIC/pppm_dielectric.cpp +++ b/src/DIELECTRIC/pppm_dielectric.cpp @@ -61,7 +61,7 @@ PPPMDielectric::PPPMDielectric(LAMMPS *_lmp) : PPPM(_lmp) // no warnings about non-neutral systems from qsum_qsq() warn_nonneutral = 2; - avec = dynamic_cast( atom->style_match("dielectric")); + avec = dynamic_cast(atom->style_match("dielectric")); if (!avec) error->all(FLERR,"pppm/dielectric requires atom style dielectric"); } diff --git a/src/DIELECTRIC/pppm_disp_dielectric.cpp b/src/DIELECTRIC/pppm_disp_dielectric.cpp index d4d84e0f62..beb392a3b3 100644 --- a/src/DIELECTRIC/pppm_disp_dielectric.cpp +++ b/src/DIELECTRIC/pppm_disp_dielectric.cpp @@ -72,7 +72,7 @@ PPPMDispDielectric::PPPMDispDielectric(LAMMPS *_lmp) : PPPMDisp(_lmp) phi = nullptr; potflag = 0; - avec = dynamic_cast( atom->style_match("dielectric")); + avec = dynamic_cast(atom->style_match("dielectric")); if (!avec) error->all(FLERR,"pppm/dielectric requires atom style dielectric"); } diff --git a/src/DIFFRACTION/fix_saed_vtk.cpp b/src/DIFFRACTION/fix_saed_vtk.cpp index 45b2db9743..64c62164ef 100644 --- a/src/DIFFRACTION/fix_saed_vtk.cpp +++ b/src/DIFFRACTION/fix_saed_vtk.cpp @@ -67,7 +67,7 @@ FixSAEDVTK::FixSAEDVTK(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Compute ID for fix saed/vtk does not exist"); // Check that specified compute is for SAED - compute_saed = dynamic_cast( modify->compute[icompute]); + compute_saed = dynamic_cast(modify->compute[icompute]); if (strcmp(compute_saed->style,"saed") != 0) error->all(FLERR,"Fix saed/vtk has invalid compute assigned"); diff --git a/src/DPD-REACT/fix_dpd_energy.cpp b/src/DPD-REACT/fix_dpd_energy.cpp index 79ff1cc231..c8dbf15bc4 100644 --- a/src/DPD-REACT/fix_dpd_energy.cpp +++ b/src/DPD-REACT/fix_dpd_energy.cpp @@ -30,9 +30,9 @@ FixDPDenergy::FixDPDenergy(LAMMPS *lmp, int narg, char **arg) : if (narg != 3 ) error->all(FLERR,"Illegal fix dpd/energy command"); pairDPDE = nullptr; - pairDPDE = dynamic_cast( force->pair_match("dpd/fdt/energy",1)); + pairDPDE = dynamic_cast(force->pair_match("dpd/fdt/energy",1)); if (pairDPDE == nullptr) - pairDPDE = dynamic_cast( force->pair_match("dpd/fdt/energy/kk",1)); + pairDPDE = dynamic_cast(force->pair_match("dpd/fdt/energy/kk",1)); if (pairDPDE == nullptr) error->all(FLERR,"Must use pair_style dpd/fdt/energy with fix dpd/energy"); diff --git a/src/DPD-REACT/fix_rx.cpp b/src/DPD-REACT/fix_rx.cpp index a85c6bfdd7..c54a8acee1 100644 --- a/src/DPD-REACT/fix_rx.cpp +++ b/src/DPD-REACT/fix_rx.cpp @@ -319,9 +319,9 @@ void FixRX::post_constructor() newcmd1 += " ghost yes"; newcmd2 += " ghost yes"; - fix_species = dynamic_cast( modify->add_fix(newcmd1)); + fix_species = dynamic_cast(modify->add_fix(newcmd1)); restartFlag = fix_species->restart_reset; - fix_species_old = dynamic_cast( modify->add_fix(newcmd2)); + fix_species_old = dynamic_cast(modify->add_fix(newcmd2)); if (nspecies==0) error->all(FLERR,"There are no rx species specified."); @@ -579,9 +579,9 @@ int FixRX::setmask() void FixRX::init() { - pairDPDE = dynamic_cast( force->pair_match("dpd/fdt/energy",1)); + pairDPDE = dynamic_cast(force->pair_match("dpd/fdt/energy",1)); if (pairDPDE == nullptr) - pairDPDE = dynamic_cast( force->pair_match("dpd/fdt/energy/kk",1)); + pairDPDE = dynamic_cast(force->pair_match("dpd/fdt/energy/kk",1)); if (pairDPDE == nullptr) error->all(FLERR,"Must use pair_style dpd/fdt/energy with fix rx"); diff --git a/src/DPD-REACT/fix_shardlow.cpp b/src/DPD-REACT/fix_shardlow.cpp index 41239c9058..824386019d 100644 --- a/src/DPD-REACT/fix_shardlow.cpp +++ b/src/DPD-REACT/fix_shardlow.cpp @@ -94,10 +94,10 @@ FixShardlow::FixShardlow(LAMMPS *lmp, int narg, char **arg) : pairDPD = nullptr; pairDPDE = nullptr; - pairDPD = dynamic_cast( force->pair_match("dpd/fdt",1)); - pairDPDE = dynamic_cast( force->pair_match("dpd/fdt/energy",1)); + pairDPD = dynamic_cast(force->pair_match("dpd/fdt",1)); + pairDPDE = dynamic_cast(force->pair_match("dpd/fdt/energy",1)); if (pairDPDE == nullptr) - pairDPDE = dynamic_cast( force->pair_match("dpd/fdt/energy/kk",1)); + pairDPDE = dynamic_cast(force->pair_match("dpd/fdt/energy/kk",1)); maxRNG = 0; if (pairDPDE) { diff --git a/src/DRUDE/compute_temp_drude.cpp b/src/DRUDE/compute_temp_drude.cpp index f5cfe35223..18a924ba17 100644 --- a/src/DRUDE/compute_temp_drude.cpp +++ b/src/DRUDE/compute_temp_drude.cpp @@ -67,7 +67,7 @@ void ComputeTempDrude::init() for (ifix = 0; ifix < modify->nfix; ifix++) if (strcmp(modify->fix[ifix]->style,"drude") == 0) break; if (ifix == modify->nfix) error->all(FLERR, "compute temp/drude requires fix drude"); - fix_drude = dynamic_cast( modify->fix[ifix]); + fix_drude = dynamic_cast(modify->fix[ifix]); if (!comm->ghost_velocity) error->all(FLERR,"compute temp/drude requires ghost velocities. Use comm_modify vel yes"); diff --git a/src/DRUDE/fix_langevin_drude.cpp b/src/DRUDE/fix_langevin_drude.cpp index 54cc156d67..622aa77f9f 100644 --- a/src/DRUDE/fix_langevin_drude.cpp +++ b/src/DRUDE/fix_langevin_drude.cpp @@ -148,7 +148,7 @@ void FixLangevinDrude::init() for (ifix = 0; ifix < modify->nfix; ifix++) if (strcmp(modify->fix[ifix]->style,"drude") == 0) break; if (ifix == modify->nfix) error->all(FLERR, "fix langevin/drude requires fix drude"); - fix_drude = dynamic_cast( modify->fix[ifix]); + fix_drude = dynamic_cast(modify->fix[ifix]); } /* ---------------------------------------------------------------------- */ diff --git a/src/DRUDE/fix_tgnh_drude.cpp b/src/DRUDE/fix_tgnh_drude.cpp index d5de5bd67f..779b557fcf 100644 --- a/src/DRUDE/fix_tgnh_drude.cpp +++ b/src/DRUDE/fix_tgnh_drude.cpp @@ -523,7 +523,7 @@ FixTGNHDrude::FixTGNHDrude(LAMMPS *lmp, int narg, char **arg) : for (ifix = 0; ifix < modify->nfix; ifix++) if (strcmp(modify->fix[ifix]->style,"drude") == 0) break; if (ifix == modify->nfix) error->all(FLERR, "fix tgnh/drude requires fix drude"); - fix_drude = dynamic_cast( modify->fix[ifix]); + fix_drude = dynamic_cast(modify->fix[ifix]); // make sure ghost atoms have velocity if (!comm->ghost_velocity) @@ -595,7 +595,7 @@ void FixTGNHDrude::init() if (pstat_flag) for (int i = 0; i < modify->nfix; i++) if (strcmp(modify->fix[i]->style,"deform") == 0) { - int *dimflag = (dynamic_cast( modify->fix[i]))->dimflag; + int *dimflag = (dynamic_cast(modify->fix[i]))->dimflag; if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) || (p_flag[2] && dimflag[2]) || (p_flag[3] && dimflag[3]) || (p_flag[4] && dimflag[4]) || (p_flag[5] && dimflag[5])) @@ -664,8 +664,8 @@ void FixTGNHDrude::init() else kspace_flag = 0; if (utils::strmatch(update->integrate_style,"^respa")) { - nlevels_respa = (dynamic_cast( update->integrate))->nlevels; - step_respa = (dynamic_cast( update->integrate))->step; + nlevels_respa = (dynamic_cast(update->integrate))->nlevels; + step_respa = (dynamic_cast(update->integrate))->step; dto = 0.5*step_respa[0]; } diff --git a/src/DRUDE/pair_coul_tt.cpp b/src/DRUDE/pair_coul_tt.cpp index af8ed099c5..9d8395b535 100644 --- a/src/DRUDE/pair_coul_tt.cpp +++ b/src/DRUDE/pair_coul_tt.cpp @@ -289,7 +289,7 @@ void PairCoulTT::init_style() for (ifix = 0; ifix < modify->nfix; ifix++) if (utils::strmatch(modify->fix[ifix]->style,"^drude")) break; if (ifix == modify->nfix) error->all(FLERR, "Pair coul/tt requires fix drude"); - fix_drude = dynamic_cast( modify->fix[ifix]); + fix_drude = dynamic_cast(modify->fix[ifix]); neighbor->add_request(this); } diff --git a/src/DRUDE/pair_lj_cut_thole_long.cpp b/src/DRUDE/pair_lj_cut_thole_long.cpp index 33e1e435fa..581496a1f5 100644 --- a/src/DRUDE/pair_lj_cut_thole_long.cpp +++ b/src/DRUDE/pair_lj_cut_thole_long.cpp @@ -364,7 +364,7 @@ void PairLJCutTholeLong::init_style() if (strcmp(modify->fix[ifix]->style,"drude") == 0) break; if (ifix == modify->nfix) error->all(FLERR, "Pair style lj/cut/thole/long requires fix drude"); - fix_drude = dynamic_cast( modify->fix[ifix]); + fix_drude = dynamic_cast(modify->fix[ifix]); neighbor->add_request(this); diff --git a/src/DRUDE/pair_thole.cpp b/src/DRUDE/pair_thole.cpp index a2f0b25e13..79f7c8557a 100644 --- a/src/DRUDE/pair_thole.cpp +++ b/src/DRUDE/pair_thole.cpp @@ -258,7 +258,7 @@ void PairThole::init_style() for (ifix = 0; ifix < modify->nfix; ifix++) if (strcmp(modify->fix[ifix]->style,"drude") == 0) break; if (ifix == modify->nfix) error->all(FLERR, "Pair thole requires fix drude"); - fix_drude = dynamic_cast( modify->fix[ifix]); + fix_drude = dynamic_cast(modify->fix[ifix]); neighbor->add_request(this); } diff --git a/src/EFF/atom_vec_electron.cpp b/src/EFF/atom_vec_electron.cpp index e456c1916c..83772df700 100644 --- a/src/EFF/atom_vec_electron.cpp +++ b/src/EFF/atom_vec_electron.cpp @@ -120,7 +120,7 @@ void AtomVecElectron::data_atom_post(int ilocal) int AtomVecElectron::property_atom(const std::string &name) { if (name == "espin") return 0; - if (name == "spin") return 0; // backward compatibility + if (name == "spin") return 0; // backward compatibility if (name == "eradius") return 1; if (name == "ervel") return 2; if (name == "erforce") return 3; diff --git a/src/EFF/compute_temp_deform_eff.cpp b/src/EFF/compute_temp_deform_eff.cpp index 292bf64d7b..66452bb95c 100644 --- a/src/EFF/compute_temp_deform_eff.cpp +++ b/src/EFF/compute_temp_deform_eff.cpp @@ -74,7 +74,7 @@ void ComputeTempDeformEff::init() int i; for (i = 0; i < modify->nfix; i++) if (strcmp(modify->fix[i]->style,"deform") == 0) { - if ((dynamic_cast( modify->fix[i]))->remapflag == Domain::X_REMAP && + if ((dynamic_cast(modify->fix[i]))->remapflag == Domain::X_REMAP && comm->me == 0) error->warning(FLERR,"Using compute temp/deform/eff with inconsistent " "fix deform remap option"); diff --git a/src/EFF/fix_nve_eff.cpp b/src/EFF/fix_nve_eff.cpp index 6639197285..f8ce14f9f9 100644 --- a/src/EFF/fix_nve_eff.cpp +++ b/src/EFF/fix_nve_eff.cpp @@ -59,7 +59,7 @@ void FixNVEEff::init() dtf = 0.5 * update->dt * force->ftm2v; if (utils::strmatch(update->integrate_style,"^respa")) - step_respa = (dynamic_cast( update->integrate))->step; + step_respa = (dynamic_cast(update->integrate))->step; } /* ---------------------------------------------------------------------- diff --git a/src/EFF/fix_nvt_sllod_eff.cpp b/src/EFF/fix_nvt_sllod_eff.cpp index c4cc2de87f..8b7c6bac9b 100644 --- a/src/EFF/fix_nvt_sllod_eff.cpp +++ b/src/EFF/fix_nvt_sllod_eff.cpp @@ -70,7 +70,7 @@ void FixNVTSllodEff::init() int i; for (i = 0; i < modify->nfix; i++) if (strncmp(modify->fix[i]->style,"deform",6) == 0) { - if ((dynamic_cast( modify->fix[i]))->remapflag != Domain::V_REMAP) + if ((dynamic_cast(modify->fix[i]))->remapflag != Domain::V_REMAP) error->all(FLERR,"Using fix nvt/sllod/eff with inconsistent fix deform " "remap option"); break; diff --git a/src/ELECTRODE/electrode_vector.cpp b/src/ELECTRODE/electrode_vector.cpp index b979836ff3..4f742df5c5 100644 --- a/src/ELECTRODE/electrode_vector.cpp +++ b/src/ELECTRODE/electrode_vector.cpp @@ -57,8 +57,9 @@ ElectrodeVector::~ElectrodeVector() utils::logmesg(lmp, fmt::format("B time: {:.4g} s\n", b_time_total)); utils::logmesg(lmp, fmt::format("B kspace time: {:.4g} s\n", kspace_time_total)); utils::logmesg(lmp, fmt::format("B pair time: {:.4g} s\n", pair_time_total)); - utils::logmesg(lmp, fmt::format("B boundary time: {:.4g} s\n", boundary_time_total)); - } catch (std::exception &) {} + utils::logmesg(lmp, fmt::format("B boundary time: {:.4g} s\n", boundary_time_total)); + } catch (std::exception &) { + } } } diff --git a/src/ELECTRODE/fix_electrode_conp.cpp b/src/ELECTRODE/fix_electrode_conp.cpp index e42a2ab138..e6f15ee33d 100644 --- a/src/ELECTRODE/fix_electrode_conp.cpp +++ b/src/ELECTRODE/fix_electrode_conp.cpp @@ -1058,7 +1058,8 @@ FixElectrodeConp::~FixElectrodeConp() try { utils::logmesg(lmp, fmt::format("Multiplication time: {:.4g} s\n", mult_time)); utils::logmesg(lmp, fmt::format("Update time: {:.4g} s\n", update_time)); - } catch (std::exception &) {} + } catch (std::exception &) { + } } if (!modify->get_fix_by_id(id)) // avoid segfault if derived fixes' ctor throws err atom->delete_callback(id, Atom::GROW); // atomvec track local electrode atoms @@ -1107,7 +1108,7 @@ void FixElectrodeConp::write_to_file(FILE *file, const std::vector &tags /*----------------------------------------------------------------------- */ -void FixElectrodeConp::read_from_file(const std::string& input_file, double **array, +void FixElectrodeConp::read_from_file(const std::string &input_file, double **array, const std::string &filetype) { if (comm->me == 0) { diff --git a/src/ELECTRODE/fix_electrode_conp.h b/src/ELECTRODE/fix_electrode_conp.h index cc24aa6b76..0ddc612d2f 100644 --- a/src/ELECTRODE/fix_electrode_conp.h +++ b/src/ELECTRODE/fix_electrode_conp.h @@ -101,7 +101,7 @@ class FixElectrodeConp : public Fix { double potential_energy(int); double self_energy(int); void write_to_file(FILE *, const std::vector &, const std::vector> &); - void read_from_file(const std::string& input_file, double **, const std::string &); + void read_from_file(const std::string &input_file, double **, const std::string &); void compute_sd_vectors(); void compute_sd_vectors_ffield(); std::vector setvars_types, setvars_groups, setvars_vars; diff --git a/src/ELECTRODE/fix_electrode_thermo.cpp b/src/ELECTRODE/fix_electrode_thermo.cpp index 148254bd75..0c2ee06816 100644 --- a/src/ELECTRODE/fix_electrode_thermo.cpp +++ b/src/ELECTRODE/fix_electrode_thermo.cpp @@ -55,7 +55,7 @@ FixElectrodeThermo::FixElectrodeThermo(LAMMPS *lmp, int narg, char **arg) : FixElectrodeThermo::~FixElectrodeThermo() { - delete thermo_random; + delete thermo_random; } /* ----------------------------------------------------------------------- */ diff --git a/src/EXTRA-FIX/fix_addtorque.cpp b/src/EXTRA-FIX/fix_addtorque.cpp index eb95db52b0..3a29a5abd7 100644 --- a/src/EXTRA-FIX/fix_addtorque.cpp +++ b/src/EXTRA-FIX/fix_addtorque.cpp @@ -130,7 +130,7 @@ void FixAddTorque::init() else varflag = CONSTANT; if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; + ilevel_respa = (dynamic_cast(update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } } @@ -142,9 +142,9 @@ void FixAddTorque::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); + (dynamic_cast(update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); + (dynamic_cast(update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/EXTRA-FIX/fix_drag.cpp b/src/EXTRA-FIX/fix_drag.cpp index 48977a0cd1..64d37a4853 100644 --- a/src/EXTRA-FIX/fix_drag.cpp +++ b/src/EXTRA-FIX/fix_drag.cpp @@ -71,7 +71,7 @@ int FixDrag::setmask() void FixDrag::init() { if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; + ilevel_respa = (dynamic_cast(update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } } @@ -83,9 +83,9 @@ void FixDrag::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); + (dynamic_cast(update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); + (dynamic_cast(update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/EXTRA-FIX/fix_electron_stopping_fit.cpp b/src/EXTRA-FIX/fix_electron_stopping_fit.cpp index aa3e7fc867..3907ee8408 100644 --- a/src/EXTRA-FIX/fix_electron_stopping_fit.cpp +++ b/src/EXTRA-FIX/fix_electron_stopping_fit.cpp @@ -139,9 +139,9 @@ void FixElectronStoppingFit::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - (dynamic_cast( update->integrate))->copy_flevel_f(nlevels_respa-1); + (dynamic_cast(update->integrate))->copy_flevel_f(nlevels_respa-1); post_force_respa(vflag,nlevels_respa-1,0); - (dynamic_cast( update->integrate))->copy_f_flevel(nlevels_respa-1); + (dynamic_cast(update->integrate))->copy_f_flevel(nlevels_respa-1); }; }; diff --git a/src/EXTRA-FIX/fix_ffl.cpp b/src/EXTRA-FIX/fix_ffl.cpp index 6e08ae6c79..0b7f58e349 100644 --- a/src/EXTRA-FIX/fix_ffl.cpp +++ b/src/EXTRA-FIX/fix_ffl.cpp @@ -158,8 +158,8 @@ void FixFFL::init() { } if (utils::strmatch(update->integrate_style,"^respa")) { - nlevels_respa = (dynamic_cast( update->integrate))->nlevels; - step_respa = (dynamic_cast( update->integrate))->step; + nlevels_respa = (dynamic_cast(update->integrate))->nlevels; + step_respa = (dynamic_cast(update->integrate))->step; } init_ffl(); @@ -182,9 +182,9 @@ void FixFFL::setup(int vflag) { if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - (dynamic_cast( update->integrate))->copy_flevel_f(nlevels_respa-1); + (dynamic_cast(update->integrate))->copy_flevel_f(nlevels_respa-1); post_force_respa(vflag,nlevels_respa-1,0); - (dynamic_cast( update->integrate))->copy_f_flevel(nlevels_respa-1); + (dynamic_cast(update->integrate))->copy_f_flevel(nlevels_respa-1); } } diff --git a/src/EXTRA-FIX/fix_filter_corotate.cpp b/src/EXTRA-FIX/fix_filter_corotate.cpp index 06eefd9ebd..cd8406f810 100644 --- a/src/EXTRA-FIX/fix_filter_corotate.cpp +++ b/src/EXTRA-FIX/fix_filter_corotate.cpp @@ -279,7 +279,7 @@ void FixFilterCorotate::init() // set ptrs to rRESPA variables if (utils::strmatch(update->integrate_style,"^respa")) { - nlevels_respa = (dynamic_cast( update->integrate))->nlevels; + nlevels_respa = (dynamic_cast(update->integrate))->nlevels; } else error->all(FLERR,"Fix filter/corotate requires rRESPA!"); @@ -656,9 +656,9 @@ void FixFilterCorotate::pre_neighbor() void FixFilterCorotate::setup(int vflag) { - (dynamic_cast( update->integrate))->copy_flevel_f(nlevels_respa-1); + (dynamic_cast(update->integrate))->copy_flevel_f(nlevels_respa-1); post_force_respa(vflag,nlevels_respa-1,0); - (dynamic_cast( update->integrate))->copy_f_flevel(nlevels_respa-1); + (dynamic_cast(update->integrate))->copy_f_flevel(nlevels_respa-1); } void FixFilterCorotate::setup_pre_force_respa(int vflag,int ilevel) { diff --git a/src/EXTRA-FIX/fix_flow_gauss.cpp b/src/EXTRA-FIX/fix_flow_gauss.cpp index 8b9d9dca8f..36a4788479 100644 --- a/src/EXTRA-FIX/fix_flow_gauss.cpp +++ b/src/EXTRA-FIX/fix_flow_gauss.cpp @@ -123,7 +123,7 @@ void FixFlowGauss::init() //if respa level specified by fix_modify, then override default (outermost) //if specified level too high, set to max level if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; + ilevel_respa = (dynamic_cast(update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -146,9 +146,9 @@ void FixFlowGauss::setup(int vflag) error->all(FLERR,"Invalid group mass in fix flow/gauss"); if (utils::strmatch(update->integrate_style,"^respa")) { - (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); + (dynamic_cast(update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); + (dynamic_cast(update->integrate))->copy_f_flevel(ilevel_respa); } else post_force(vflag); diff --git a/src/EXTRA-FIX/fix_gld.cpp b/src/EXTRA-FIX/fix_gld.cpp index 3af37005c3..ea16976e83 100644 --- a/src/EXTRA-FIX/fix_gld.cpp +++ b/src/EXTRA-FIX/fix_gld.cpp @@ -197,7 +197,7 @@ void FixGLD::init() dtf = 0.5 * update->dt * force->ftm2v; if (utils::strmatch(update->integrate_style,"^respa")) - step_respa = (dynamic_cast( update->integrate))->step; + step_respa = (dynamic_cast(update->integrate))->step; } /* ---------------------------------------------------------------------- diff --git a/src/EXTRA-FIX/fix_gle.cpp b/src/EXTRA-FIX/fix_gle.cpp index cabc876ab5..54e9073361 100644 --- a/src/EXTRA-FIX/fix_gle.cpp +++ b/src/EXTRA-FIX/fix_gle.cpp @@ -356,8 +356,8 @@ void FixGLE::init() } if (utils::strmatch(update->integrate_style,"^respa")) { - nlevels_respa = (dynamic_cast( update->integrate))->nlevels; - step_respa = (dynamic_cast( update->integrate))->step; + nlevels_respa = (dynamic_cast(update->integrate))->nlevels; + step_respa = (dynamic_cast(update->integrate))->step; } init_gle(); @@ -443,9 +443,9 @@ void FixGLE::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - (dynamic_cast( update->integrate))->copy_flevel_f(nlevels_respa-1); + (dynamic_cast(update->integrate))->copy_flevel_f(nlevels_respa-1); post_force_respa(vflag,nlevels_respa-1,0); - (dynamic_cast( update->integrate))->copy_f_flevel(nlevels_respa-1); + (dynamic_cast(update->integrate))->copy_f_flevel(nlevels_respa-1); } } diff --git a/src/EXTRA-FIX/fix_momentum_chunk.cpp b/src/EXTRA-FIX/fix_momentum_chunk.cpp index 2734a4565b..653d3e1806 100644 --- a/src/EXTRA-FIX/fix_momentum_chunk.cpp +++ b/src/EXTRA-FIX/fix_momentum_chunk.cpp @@ -110,7 +110,7 @@ void FixMomentumChunk::init() int icompute = modify->find_compute(id_chunk); if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for fix momentum/chunk"); - cchunk = dynamic_cast( modify->compute[icompute]); + cchunk = dynamic_cast(modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Fix momentum/chunk does not use chunk/atom compute"); @@ -122,7 +122,7 @@ void FixMomentumChunk::init() auto cmd = fmt::format("{} {} com/chunk {}",id_com,group->names[igroup],id_chunk); modify->add_compute(cmd); icompute = modify->find_compute(id_com); - ccom = dynamic_cast( modify->compute[icompute]); + ccom = dynamic_cast(modify->compute[icompute]); id_vcm = id + id_chunk + "_vcm"; icompute = modify->find_compute(id_vcm); diff --git a/src/EXTRA-FIX/fix_npt_cauchy.cpp b/src/EXTRA-FIX/fix_npt_cauchy.cpp index c066d471d6..2f629f6f1c 100644 --- a/src/EXTRA-FIX/fix_npt_cauchy.cpp +++ b/src/EXTRA-FIX/fix_npt_cauchy.cpp @@ -680,7 +680,7 @@ void FixNPTCauchy::init() if (pstat_flag) for (int i = 0; i < modify->nfix; i++) if (strcmp(modify->fix[i]->style,"deform") == 0) { - int *dimflag = (dynamic_cast( modify->fix[i]))->dimflag; + int *dimflag = (dynamic_cast(modify->fix[i]))->dimflag; if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) || (p_flag[2] && dimflag[2]) || (p_flag[3] && dimflag[3]) || (p_flag[4] && dimflag[4]) || (p_flag[5] && dimflag[5])) @@ -753,8 +753,8 @@ void FixNPTCauchy::init() else kspace_flag = 0; if (utils::strmatch(update->integrate_style,"^respa")) { - nlevels_respa = (dynamic_cast( update->integrate))->nlevels; - step_respa = (dynamic_cast( update->integrate))->step; + nlevels_respa = (dynamic_cast(update->integrate))->nlevels; + step_respa = (dynamic_cast(update->integrate))->step; dto = 0.5*step_respa[0]; } diff --git a/src/EXTRA-FIX/fix_nvk.cpp b/src/EXTRA-FIX/fix_nvk.cpp index 168af71262..fdb3e30532 100644 --- a/src/EXTRA-FIX/fix_nvk.cpp +++ b/src/EXTRA-FIX/fix_nvk.cpp @@ -62,7 +62,7 @@ void FixNVK::init() if (utils::strmatch(update->integrate_style,"^respa")) { error->all(FLERR,"Fix nvk not yet enabled for RESPA"); - step_respa = (dynamic_cast( update->integrate))->step; + step_respa = (dynamic_cast(update->integrate))->step; } // compute initial kinetic energy diff --git a/src/EXTRA-FIX/fix_pafi.cpp b/src/EXTRA-FIX/fix_pafi.cpp index 1326dcc44a..c16daf9336 100644 --- a/src/EXTRA-FIX/fix_pafi.cpp +++ b/src/EXTRA-FIX/fix_pafi.cpp @@ -178,8 +178,8 @@ void FixPAFI::init() if (utils::strmatch(update->integrate_style,"^respa")) { - step_respa = (dynamic_cast( update->integrate))->step; // nve - nlevels_respa = (dynamic_cast( update->integrate))->nlevels; + step_respa = (dynamic_cast(update->integrate))->step; // nve + nlevels_respa = (dynamic_cast(update->integrate))->nlevels; if (respa_level >= 0) ilevel_respa = MIN(respa_level,nlevels_respa-1); else ilevel_respa = nlevels_respa-1; } @@ -192,9 +192,9 @@ void FixPAFI::setup(int vflag) post_force(vflag); else for (int ilevel = 0; ilevel < nlevels_respa; ilevel++) { - (dynamic_cast( update->integrate))->copy_flevel_f(ilevel); + (dynamic_cast(update->integrate))->copy_flevel_f(ilevel); post_force_respa(vflag,ilevel,0); - (dynamic_cast( update->integrate))->copy_f_flevel(ilevel); + (dynamic_cast(update->integrate))->copy_f_flevel(ilevel); } } diff --git a/src/EXTRA-FIX/fix_rhok.cpp b/src/EXTRA-FIX/fix_rhok.cpp index 077dad7f25..d90277819e 100644 --- a/src/EXTRA-FIX/fix_rhok.cpp +++ b/src/EXTRA-FIX/fix_rhok.cpp @@ -96,7 +96,7 @@ void FixRhok::init() { // RESPA boilerplate if (utils::strmatch(update->integrate_style,"^respa")) - mNLevelsRESPA = (dynamic_cast( update->integrate))->nlevels; + mNLevelsRESPA = (dynamic_cast(update->integrate))->nlevels; // Count the number of affected particles int nThisLocal = 0; @@ -121,9 +121,9 @@ void FixRhok::setup( int inVFlag ) post_force( inVFlag ); else { - (dynamic_cast( update->integrate))->copy_flevel_f( mNLevelsRESPA - 1 ); + (dynamic_cast(update->integrate))->copy_flevel_f( mNLevelsRESPA - 1 ); post_force_respa( inVFlag, mNLevelsRESPA - 1,0 ); - (dynamic_cast( update->integrate))->copy_f_flevel( mNLevelsRESPA - 1 ); + (dynamic_cast(update->integrate))->copy_f_flevel( mNLevelsRESPA - 1 ); } } diff --git a/src/EXTRA-FIX/fix_smd.cpp b/src/EXTRA-FIX/fix_smd.cpp index 4a0a9f040f..47fb5a5053 100644 --- a/src/EXTRA-FIX/fix_smd.cpp +++ b/src/EXTRA-FIX/fix_smd.cpp @@ -161,7 +161,7 @@ void FixSMD::init() } if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; + ilevel_respa = (dynamic_cast(update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } } @@ -173,9 +173,9 @@ void FixSMD::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); + (dynamic_cast(update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); + (dynamic_cast(update->integrate))->copy_f_flevel(ilevel_respa); } } @@ -194,7 +194,7 @@ void FixSMD::post_force(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) r_old += v_smd * update->dt; else - r_old += v_smd * (dynamic_cast( update->integrate))->step[ilevel_respa]; + r_old += v_smd * (dynamic_cast(update->integrate))->step[ilevel_respa]; } } @@ -207,7 +207,7 @@ void FixSMD::smd_tether() double dt = update->dt; if (utils::strmatch(update->integrate_style,"^respa")) - dt = (dynamic_cast( update->integrate))->step[ilevel_respa]; + dt = (dynamic_cast(update->integrate))->step[ilevel_respa]; // fx,fy,fz = components of k * (r-r0) @@ -313,7 +313,7 @@ void FixSMD::smd_couple() double dt = update->dt; if (utils::strmatch(update->integrate_style,"^respa")) - dt = (dynamic_cast( update->integrate))->step[ilevel_respa]; + dt = (dynamic_cast(update->integrate))->step[ilevel_respa]; // renormalize direction of spring double dx,dy,dz,r,dr; diff --git a/src/EXTRA-FIX/fix_spring_rg.cpp b/src/EXTRA-FIX/fix_spring_rg.cpp index b955716923..b4ddaaeb15 100644 --- a/src/EXTRA-FIX/fix_spring_rg.cpp +++ b/src/EXTRA-FIX/fix_spring_rg.cpp @@ -79,7 +79,7 @@ void FixSpringRG::init() } if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; + ilevel_respa = (dynamic_cast(update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } } @@ -91,9 +91,9 @@ void FixSpringRG::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); + (dynamic_cast(update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); + (dynamic_cast(update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/EXTRA-FIX/fix_ti_spring.cpp b/src/EXTRA-FIX/fix_ti_spring.cpp index e44afdba01..36d9b8bd05 100644 --- a/src/EXTRA-FIX/fix_ti_spring.cpp +++ b/src/EXTRA-FIX/fix_ti_spring.cpp @@ -143,7 +143,7 @@ int FixTISpring::setmask() void FixTISpring::init() { if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = (dynamic_cast( update->integrate))->nlevels; + nlevels_respa = (dynamic_cast(update->integrate))->nlevels; } /* ---------------------------------------------------------------------- */ @@ -153,9 +153,9 @@ void FixTISpring::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - (dynamic_cast( update->integrate))->copy_flevel_f(nlevels_respa-1); + (dynamic_cast(update->integrate))->copy_flevel_f(nlevels_respa-1); post_force_respa(vflag,nlevels_respa-1,0); - (dynamic_cast( update->integrate))->copy_f_flevel(nlevels_respa-1); + (dynamic_cast(update->integrate))->copy_f_flevel(nlevels_respa-1); } } diff --git a/src/EXTRA-FIX/fix_tmd.cpp b/src/EXTRA-FIX/fix_tmd.cpp index 1404682cda..e86b9d82e4 100644 --- a/src/EXTRA-FIX/fix_tmd.cpp +++ b/src/EXTRA-FIX/fix_tmd.cpp @@ -167,7 +167,7 @@ void FixTMD::init() dtv = update->dt; dtf = update->dt * force->ftm2v; if (utils::strmatch(update->integrate_style,"^respa")) - step_respa = (dynamic_cast( update->integrate))->step; + step_respa = (dynamic_cast(update->integrate))->step; } /* ---------------------------------------------------------------------- */ diff --git a/src/EXTRA-FIX/fix_ttm.cpp b/src/EXTRA-FIX/fix_ttm.cpp index 9184983bdb..facb207bfe 100644 --- a/src/EXTRA-FIX/fix_ttm.cpp +++ b/src/EXTRA-FIX/fix_ttm.cpp @@ -241,7 +241,7 @@ void FixTTM::init() } if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = (dynamic_cast( update->integrate))->nlevels; + nlevels_respa = (dynamic_cast(update->integrate))->nlevels; } /* ---------------------------------------------------------------------- */ @@ -251,9 +251,9 @@ void FixTTM::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) { post_force_setup(vflag); } else { - (dynamic_cast( update->integrate))->copy_flevel_f(nlevels_respa-1); + (dynamic_cast(update->integrate))->copy_flevel_f(nlevels_respa-1); post_force_respa_setup(vflag,nlevels_respa-1,0); - (dynamic_cast( update->integrate))->copy_f_flevel(nlevels_respa-1); + (dynamic_cast(update->integrate))->copy_f_flevel(nlevels_respa-1); } } diff --git a/src/EXTRA-FIX/fix_ttm_mod.cpp b/src/EXTRA-FIX/fix_ttm_mod.cpp index 539b7e1c19..1b82e5452b 100644 --- a/src/EXTRA-FIX/fix_ttm_mod.cpp +++ b/src/EXTRA-FIX/fix_ttm_mod.cpp @@ -271,7 +271,7 @@ void FixTTMMod::init() net_energy_transfer_all[ix][iy][iz] = 0; if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = (dynamic_cast( update->integrate))->nlevels; + nlevels_respa = (dynamic_cast(update->integrate))->nlevels; } /* ---------------------------------------------------------------------- */ @@ -281,9 +281,9 @@ void FixTTMMod::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) { post_force_setup(vflag); } else { - (dynamic_cast( update->integrate))->copy_flevel_f(nlevels_respa-1); + (dynamic_cast(update->integrate))->copy_flevel_f(nlevels_respa-1); post_force_respa_setup(vflag,nlevels_respa-1,0); - (dynamic_cast( update->integrate))->copy_f_flevel(nlevels_respa-1); + (dynamic_cast(update->integrate))->copy_f_flevel(nlevels_respa-1); } } diff --git a/src/EXTRA-FIX/fix_wall_ees.cpp b/src/EXTRA-FIX/fix_wall_ees.cpp index 8b30e4a0be..a6226930c4 100644 --- a/src/EXTRA-FIX/fix_wall_ees.cpp +++ b/src/EXTRA-FIX/fix_wall_ees.cpp @@ -50,7 +50,7 @@ void FixWallEES::precompute(int m) /* ---------------------------------------------------------------------- */ void FixWallEES::init() { - avec = dynamic_cast( atom->style_match("ellipsoid")); + avec = dynamic_cast(atom->style_match("ellipsoid")); if (!avec) error->all(FLERR,"Fix wall/ees requires atom style ellipsoid"); @@ -85,7 +85,7 @@ void FixWallEES::wall_particle(int m, int which, double coord) double **f = atom->f; double **tor = atom->torque; - avec = dynamic_cast( atom->style_match("ellipsoid")); + avec = dynamic_cast(atom->style_match("ellipsoid")); AtomVecEllipsoid::Bonus *bonus = avec->bonus; int *ellipsoid = atom->ellipsoid; int *mask = atom->mask; diff --git a/src/EXTRA-MOLECULE/Install.sh b/src/EXTRA-MOLECULE/Install.sh new file mode 100644 index 0000000000..37a61b1ab6 --- /dev/null +++ b/src/EXTRA-MOLECULE/Install.sh @@ -0,0 +1,40 @@ +# 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 +} + +# some styles in EXTRA-MOLECULE have base classes in MOLECULE + +if (test $1 = 1) then + if (test ! -e ../bond_fene.cpp) then + echo "Must install MOLECULE package with EXTRA-MOLECULE package" + exit 1 + fi +fi + +for file in *.cpp *.h; do + action ${file} +done diff --git a/src/EXTRA-PAIR/pair_lj96_cut.cpp b/src/EXTRA-PAIR/pair_lj96_cut.cpp index 778dfbb562..4b7c2912b0 100644 --- a/src/EXTRA-PAIR/pair_lj96_cut.cpp +++ b/src/EXTRA-PAIR/pair_lj96_cut.cpp @@ -487,7 +487,7 @@ void PairLJ96Cut::init_style() int list_style = NeighConst::REQ_DEFAULT; if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) { - auto respa = dynamic_cast( update->integrate); + auto respa = dynamic_cast(update->integrate); if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT; if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL; } @@ -496,8 +496,8 @@ void PairLJ96Cut::init_style() // set rRESPA cutoffs if (utils::strmatch(update->integrate_style,"^respa") && - (dynamic_cast( update->integrate))->level_inner >= 0) - cut_respa = (dynamic_cast( update->integrate))->cutoff; + (dynamic_cast(update->integrate))->level_inner >= 0) + cut_respa = (dynamic_cast(update->integrate))->cutoff; else cut_respa = nullptr; } diff --git a/src/EXTRA-PAIR/pair_lj_expand_coul_long.cpp b/src/EXTRA-PAIR/pair_lj_expand_coul_long.cpp index a62aabf3a5..3841b50d45 100644 --- a/src/EXTRA-PAIR/pair_lj_expand_coul_long.cpp +++ b/src/EXTRA-PAIR/pair_lj_expand_coul_long.cpp @@ -688,7 +688,7 @@ void PairLJExpandCoulLong::init_style() int list_style = NeighConst::REQ_DEFAULT; if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) { - auto respa = dynamic_cast( update->integrate); + auto respa = dynamic_cast(update->integrate); if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT; if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL; } @@ -699,8 +699,8 @@ void PairLJExpandCoulLong::init_style() // set rRESPA cutoffs if (utils::strmatch(update->integrate_style,"^respa") && - (dynamic_cast( update->integrate))->level_inner >= 0) - cut_respa = (dynamic_cast( update->integrate))->cutoff; + (dynamic_cast(update->integrate))->level_inner >= 0) + cut_respa = (dynamic_cast(update->integrate))->cutoff; else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald diff --git a/src/EXTRA-PAIR/pair_mie_cut.cpp b/src/EXTRA-PAIR/pair_mie_cut.cpp index dff41ce81b..8556bacb30 100644 --- a/src/EXTRA-PAIR/pair_mie_cut.cpp +++ b/src/EXTRA-PAIR/pair_mie_cut.cpp @@ -499,7 +499,7 @@ void PairMIECut::init_style() int list_style = NeighConst::REQ_DEFAULT; if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) { - auto respa = dynamic_cast( update->integrate); + auto respa = dynamic_cast(update->integrate); if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT; if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL; } @@ -508,8 +508,8 @@ void PairMIECut::init_style() // set rRESPA cutoffs if (utils::strmatch(update->integrate_style,"^respa") && - (dynamic_cast( update->integrate))->level_inner >= 0) - cut_respa = (dynamic_cast( update->integrate))->cutoff; + (dynamic_cast(update->integrate))->level_inner >= 0) + cut_respa = (dynamic_cast(update->integrate))->cutoff; else cut_respa = nullptr; } diff --git a/src/FEP/fix_adapt_fep.cpp b/src/FEP/fix_adapt_fep.cpp index 0fad4f362d..7d2831e179 100644 --- a/src/FEP/fix_adapt_fep.cpp +++ b/src/FEP/fix_adapt_fep.cpp @@ -294,7 +294,7 @@ void FixAdaptFEP::init() if (ad->pdim == 2 && (strcmp(force->pair_style,"hybrid") == 0 || strcmp(force->pair_style,"hybrid/overlay") == 0)) { - auto pair = dynamic_cast( force->pair); + auto pair = dynamic_cast(force->pair); for (i = ad->ilo; i <= ad->ihi; i++) for (j = MAX(ad->jlo,i); j <= ad->jhi; j++) if (!pair->check_ijtype(i,j,ad->pstyle)) diff --git a/src/FEP/pair_lj_charmm_coul_long_soft.cpp b/src/FEP/pair_lj_charmm_coul_long_soft.cpp index 119c545579..63e7be5490 100644 --- a/src/FEP/pair_lj_charmm_coul_long_soft.cpp +++ b/src/FEP/pair_lj_charmm_coul_long_soft.cpp @@ -692,7 +692,7 @@ void PairLJCharmmCoulLongSoft::init_style() int list_style = NeighConst::REQ_DEFAULT; if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) { - auto respa = dynamic_cast( update->integrate); + auto respa = dynamic_cast(update->integrate); if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT; if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL; } @@ -714,8 +714,8 @@ void PairLJCharmmCoulLongSoft::init_style() // set & error check interior rRESPA cutoffs if (utils::strmatch(update->integrate_style,"^respa") && - (dynamic_cast( update->integrate))->level_inner >= 0) { - cut_respa = (dynamic_cast( update->integrate))->cutoff; + (dynamic_cast(update->integrate))->level_inner >= 0) { + cut_respa = (dynamic_cast(update->integrate))->cutoff; if (MIN(cut_lj,cut_coul) < cut_respa[3]) error->all(FLERR,"Pair cutoff < Respa interior cutoff"); if (cut_lj_inner < cut_respa[1]) diff --git a/src/FEP/pair_lj_cut_coul_long_soft.cpp b/src/FEP/pair_lj_cut_coul_long_soft.cpp index d3e0ca8a88..8090562c3e 100644 --- a/src/FEP/pair_lj_cut_coul_long_soft.cpp +++ b/src/FEP/pair_lj_cut_coul_long_soft.cpp @@ -635,7 +635,7 @@ void PairLJCutCoulLongSoft::init_style() int list_style = NeighConst::REQ_DEFAULT; if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) { - auto respa = dynamic_cast( update->integrate); + auto respa = dynamic_cast(update->integrate); if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT; if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL; } @@ -646,8 +646,8 @@ void PairLJCutCoulLongSoft::init_style() // set rRESPA cutoffs if (utils::strmatch(update->integrate_style,"^respa") && - (dynamic_cast( update->integrate))->level_inner >= 0) - cut_respa = (dynamic_cast( update->integrate))->cutoff; + (dynamic_cast(update->integrate))->level_inner >= 0) + cut_respa = (dynamic_cast(update->integrate))->cutoff; else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald diff --git a/src/FEP/pair_lj_cut_soft.cpp b/src/FEP/pair_lj_cut_soft.cpp index 8cf61f013c..2f2b29af86 100644 --- a/src/FEP/pair_lj_cut_soft.cpp +++ b/src/FEP/pair_lj_cut_soft.cpp @@ -513,7 +513,7 @@ void PairLJCutSoft::init_style() int list_style = NeighConst::REQ_DEFAULT; if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) { - auto respa = dynamic_cast( update->integrate); + auto respa = dynamic_cast(update->integrate); if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT; if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL; } @@ -522,8 +522,8 @@ void PairLJCutSoft::init_style() // set rRESPA cutoffs if (utils::strmatch(update->integrate_style,"^respa") && - (dynamic_cast( update->integrate))->level_inner >= 0) - cut_respa = (dynamic_cast( update->integrate))->cutoff; + (dynamic_cast(update->integrate))->level_inner >= 0) + cut_respa = (dynamic_cast(update->integrate))->cutoff; else cut_respa = nullptr; } diff --git a/src/GPU/fix_gpu.cpp b/src/GPU/fix_gpu.cpp index 1488900aec..0de2ab51f8 100644 --- a/src/GPU/fix_gpu.cpp +++ b/src/GPU/fix_gpu.cpp @@ -294,7 +294,7 @@ void FixGPU::init() // rRESPA support if (utils::strmatch(update->integrate_style,"^respa")) - _nlevels_respa = (dynamic_cast( update->integrate))->nlevels; + _nlevels_respa = (dynamic_cast(update->integrate))->nlevels; } /* ---------------------------------------------------------------------- */ @@ -308,9 +308,9 @@ void FixGPU::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { // In setup only, all forces calculated on GPU are put in the outer level - (dynamic_cast( update->integrate))->copy_flevel_f(_nlevels_respa-1); + (dynamic_cast(update->integrate))->copy_flevel_f(_nlevels_respa-1); post_force(vflag); - (dynamic_cast( update->integrate))->copy_f_flevel(_nlevels_respa-1); + (dynamic_cast(update->integrate))->copy_f_flevel(_nlevels_respa-1); } } diff --git a/src/GPU/fix_nve_asphere_gpu.cpp b/src/GPU/fix_nve_asphere_gpu.cpp index 1139c56272..1112641837 100644 --- a/src/GPU/fix_nve_asphere_gpu.cpp +++ b/src/GPU/fix_nve_asphere_gpu.cpp @@ -165,7 +165,7 @@ FixNVEAsphereGPU::FixNVEAsphereGPU(LAMMPS *lmp, int narg, char **arg) : void FixNVEAsphereGPU::init() { - avec = dynamic_cast( atom->style_match("ellipsoid")); + avec = dynamic_cast(atom->style_match("ellipsoid")); if (!avec) error->all(FLERR,"Compute nve/asphere requires atom style ellipsoid"); diff --git a/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp b/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp index 8201e3e17f..938aeaea3f 100644 --- a/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp +++ b/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp @@ -187,7 +187,7 @@ void PairLJCutTIP4PLongGPU::init_style() cut_coulsq = cut_coul * cut_coul; double cut_coulplus = cut_coul + qdist + blen; - double cut_coulsqplus = cut_coulplus*cut_coulplus; + double cut_coulsqplus = cut_coulplus * cut_coulplus; if (maxcut < cut_coulsqplus) { cell_size = cut_coulplus + neighbor->skin; } if (comm->cutghostuser < cell_size) { if (comm->me == 0) diff --git a/src/GPU/pair_lj_spica_coul_long_gpu.cpp b/src/GPU/pair_lj_spica_coul_long_gpu.cpp index 9c72fe5ed3..a1f7838a59 100644 --- a/src/GPU/pair_lj_spica_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_spica_coul_long_gpu.cpp @@ -42,23 +42,23 @@ using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition int spical_gpu_init(const int ntypes, double **cutsq, int **lj_type, double **host_lj1, - double **host_lj2, double **host_lj3, double **host_lj4, double **offset, - double *special_lj, const int nlocal, const int nall, const int max_nbors, - const int maxspecial, const double cell_size, int &gpu_mode, FILE *screen, - double **host_cut_ljsq, double host_cut_coulsq, double *host_special_coul, - const double qqrd2e, const double g_ewald); + double **host_lj2, double **host_lj3, double **host_lj4, double **offset, + double *special_lj, const int nlocal, const int nall, const int max_nbors, + const int maxspecial, const double cell_size, int &gpu_mode, FILE *screen, + double **host_cut_ljsq, double host_cut_coulsq, double *host_special_coul, + const double qqrd2e, const double g_ewald); void spical_gpu_clear(); int **spical_gpu_compute_n(const int ago, const int inum, const int nall, double **host_x, - int *host_type, double *sublo, double *subhi, tagint *tag, int **nspecial, - tagint **special, const bool eflag, const bool vflag, const bool eatom, - const bool vatom, int &host_start, int **ilist, int **jnum, - const double cpu_time, bool &success, double *host_q, double *boxlo, - double *prd); + int *host_type, double *sublo, double *subhi, tagint *tag, + int **nspecial, tagint **special, const bool eflag, const bool vflag, + const bool eatom, const bool vatom, int &host_start, int **ilist, + int **jnum, const double cpu_time, bool &success, double *host_q, + double *boxlo, double *prd); void spical_gpu_compute(const int ago, const int inum, const int nall, double **host_x, - int *host_type, int *ilist, int *numj, int **firstneigh, const bool eflag, - const bool vflag, const bool eatom, const bool vatom, int &host_start, - const double cpu_time, bool &success, double *host_q, const int nlocal, - double *boxlo, double *prd); + int *host_type, int *ilist, int *numj, int **firstneigh, const bool eflag, + const bool vflag, const bool eatom, const bool vatom, int &host_start, + const double cpu_time, bool &success, double *host_q, const int nlocal, + double *boxlo, double *prd); double spical_gpu_bytes(); #include "lj_spica_common.h" @@ -111,17 +111,17 @@ void PairLJSPICACoulLongGPU::compute(int eflag, int vflag) } inum = atom->nlocal; firstneigh = spical_gpu_compute_n(neighbor->ago, inum, nall, atom->x, atom->type, sublo, subhi, - atom->tag, atom->nspecial, atom->special, eflag, vflag, - eflag_atom, vflag_atom, host_start, &ilist, &numneigh, cpu_time, - success, atom->q, domain->boxlo, domain->prd); + atom->tag, atom->nspecial, atom->special, eflag, vflag, + eflag_atom, vflag_atom, host_start, &ilist, &numneigh, + cpu_time, success, atom->q, domain->boxlo, domain->prd); } else { inum = list->inum; ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; spical_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type, ilist, numneigh, firstneigh, - eflag, vflag, eflag_atom, vflag_atom, host_start, cpu_time, success, atom->q, - atom->nlocal, domain->boxlo, domain->prd); + eflag, vflag, eflag_atom, vflag_atom, host_start, cpu_time, success, atom->q, + atom->nlocal, domain->boxlo, domain->prd); } if (!success) error->one(FLERR, "Insufficient memory on accelerator"); @@ -144,7 +144,8 @@ void PairLJSPICACoulLongGPU::compute(int eflag, int vflag) void PairLJSPICACoulLongGPU::init_style() { - if (!atom->q_flag) error->all(FLERR, "Pair style lj/spica/coul/long/gpu requires atom attribute q"); + if (!atom->q_flag) + error->all(FLERR, "Pair style lj/spica/coul/long/gpu requires atom attribute q"); // Repeat cutsq calculation because done after call to init_style double maxcut = -1.0; @@ -176,10 +177,10 @@ void PairLJSPICACoulLongGPU::init_style() int maxspecial = 0; if (atom->molecular != Atom::ATOMIC) maxspecial = atom->maxspecial; int mnf = 5e-2 * neighbor->oneatom; - int success = - spical_gpu_init(atom->ntypes + 1, cutsq, lj_type, lj1, lj2, lj3, lj4, offset, force->special_lj, - atom->nlocal, atom->nlocal + atom->nghost, mnf, maxspecial, cell_size, gpu_mode, - screen, cut_ljsq, cut_coulsq, force->special_coul, force->qqrd2e, g_ewald); + int success = spical_gpu_init(atom->ntypes + 1, cutsq, lj_type, lj1, lj2, lj3, lj4, offset, + force->special_lj, atom->nlocal, atom->nlocal + atom->nghost, mnf, + maxspecial, cell_size, gpu_mode, screen, cut_ljsq, cut_coulsq, + force->special_coul, force->qqrd2e, g_ewald); GPU_EXTRA::check_flag(success, error, world); if (gpu_mode == GPU_FORCE) neighbor->add_request(this, NeighConst::REQ_FULL); @@ -196,7 +197,7 @@ double PairLJSPICACoulLongGPU::memory_usage() /* ---------------------------------------------------------------------- */ template void PairLJSPICACoulLongGPU::cpu_compute(int start, int inum, int *ilist, int *numneigh, - int **firstneigh) + int **firstneigh) { int i, j, ii, jj; double qtmp, xtmp, ytmp, ztmp; diff --git a/src/GPU/pair_lj_spica_gpu.cpp b/src/GPU/pair_lj_spica_gpu.cpp index 394480428c..24f556a3b6 100644 --- a/src/GPU/pair_lj_spica_gpu.cpp +++ b/src/GPU/pair_lj_spica_gpu.cpp @@ -33,19 +33,19 @@ using namespace LAMMPS_NS; // External functions from cuda library for atom decomposition int spica_gpu_init(const int ntypes, double **cutsq, int **cg_types, double **host_lj1, - double **host_lj2, double **host_lj3, double **host_lj4, double **offset, - double *special_lj, const int nlocal, const int nall, const int max_nbors, - const int maxspecial, const double cell_size, int &gpu_mode, FILE *screen); + double **host_lj2, double **host_lj3, double **host_lj4, double **offset, + double *special_lj, const int nlocal, const int nall, const int max_nbors, + const int maxspecial, const double cell_size, int &gpu_mode, FILE *screen); void spica_gpu_clear(); int **spica_gpu_compute_n(const int ago, const int inum, const int nall, double **host_x, - int *host_type, double *sublo, double *subhi, tagint *tag, int **nspecial, - tagint **special, const bool eflag, const bool vflag, const bool eatom, - const bool vatom, int &host_start, int **ilist, int **jnum, - const double cpu_time, bool &success); -void spica_gpu_compute(const int ago, const int inum, const int nall, double **host_x, int *host_type, - int *ilist, int *numj, int **firstneigh, const bool eflag, const bool vflag, - const bool eatom, const bool vatom, int &host_start, const double cpu_time, - bool &success); + int *host_type, double *sublo, double *subhi, tagint *tag, int **nspecial, + tagint **special, const bool eflag, const bool vflag, const bool eatom, + const bool vatom, int &host_start, int **ilist, int **jnum, + const double cpu_time, bool &success); +void spica_gpu_compute(const int ago, const int inum, const int nall, double **host_x, + int *host_type, int *ilist, int *numj, int **firstneigh, const bool eflag, + const bool vflag, const bool eatom, const bool vatom, int &host_start, + const double cpu_time, bool &success); double spica_gpu_bytes(); #include "lj_spica_common.h" @@ -98,15 +98,15 @@ void PairLJSPICAGPU::compute(int eflag, int vflag) inum = atom->nlocal; firstneigh = spica_gpu_compute_n(neighbor->ago, inum, nall, atom->x, atom->type, sublo, subhi, atom->tag, - atom->nspecial, atom->special, eflag, vflag, eflag_atom, vflag_atom, - host_start, &ilist, &numneigh, cpu_time, success); + atom->nspecial, atom->special, eflag, vflag, eflag_atom, vflag_atom, + host_start, &ilist, &numneigh, cpu_time, success); } else { inum = list->inum; ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; spica_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type, ilist, numneigh, firstneigh, - eflag, vflag, eflag_atom, vflag_atom, host_start, cpu_time, success); + eflag, vflag, eflag_atom, vflag_atom, host_start, cpu_time, success); } if (!success) error->one(FLERR, "Insufficient memory on accelerator"); @@ -150,8 +150,8 @@ void PairLJSPICAGPU::init_style() if (atom->molecular != Atom::ATOMIC) maxspecial = atom->maxspecial; int mnf = 5e-2 * neighbor->oneatom; int success = spica_gpu_init(atom->ntypes + 1, cutsq, lj_type, lj1, lj2, lj3, lj4, offset, - force->special_lj, atom->nlocal, atom->nlocal + atom->nghost, mnf, - maxspecial, cell_size, gpu_mode, screen); + force->special_lj, atom->nlocal, atom->nlocal + atom->nghost, mnf, + maxspecial, cell_size, gpu_mode, screen); GPU_EXTRA::check_flag(success, error, world); if (gpu_mode == GPU_FORCE) neighbor->add_request(this, NeighConst::REQ_FULL); diff --git a/src/GRANULAR/fix_freeze.cpp b/src/GRANULAR/fix_freeze.cpp index d3ed4db921..576daaff9c 100644 --- a/src/GRANULAR/fix_freeze.cpp +++ b/src/GRANULAR/fix_freeze.cpp @@ -73,11 +73,11 @@ void FixFreeze::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - int nlevels_respa = (dynamic_cast( update->integrate))->nlevels; + int nlevels_respa = (dynamic_cast(update->integrate))->nlevels; for (int ilevel = 0; ilevel < nlevels_respa; ilevel++) { - (dynamic_cast( update->integrate))->copy_flevel_f(ilevel); + (dynamic_cast(update->integrate))->copy_flevel_f(ilevel); post_force_respa(vflag,ilevel,0); - (dynamic_cast( update->integrate))->copy_f_flevel(ilevel); + (dynamic_cast(update->integrate))->copy_f_flevel(ilevel); } } } diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index da7af48e82..f59a7fa2e1 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -498,7 +498,7 @@ void FixWallGran::init() dt = update->dt; if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = (dynamic_cast( update->integrate))->nlevels; + nlevels_respa = (dynamic_cast(update->integrate))->nlevels; // check for FixRigid so can extract rigid body masses @@ -550,9 +550,9 @@ void FixWallGran::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - (dynamic_cast( update->integrate))->copy_flevel_f(nlevels_respa-1); + (dynamic_cast(update->integrate))->copy_flevel_f(nlevels_respa-1); post_force_respa(vflag,nlevels_respa-1,0); - (dynamic_cast( update->integrate))->copy_f_flevel(nlevels_respa-1); + (dynamic_cast(update->integrate))->copy_f_flevel(nlevels_respa-1); } } diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index 013c63172d..df46e27b95 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -102,7 +102,7 @@ PairGranular::PairGranular(LAMMPS *lmp) : Pair(lmp) // this is so final order of Modify:fix will conform to input script fix_history = nullptr; - fix_dummy = dynamic_cast( modify->add_fix("NEIGH_HISTORY_GRANULAR_DUMMY all DUMMY")); + fix_dummy = dynamic_cast(modify->add_fix("NEIGH_HISTORY_GRANULAR_DUMMY all DUMMY")); } /* ---------------------------------------------------------------------- */ @@ -1130,7 +1130,7 @@ void PairGranular::init_style() // this is so its order in the fix list is preserved if (use_history && fix_history == nullptr) { - fix_history = dynamic_cast( modify->replace_fix("NEIGH_HISTORY_GRANULAR_DUMMY", + fix_history = dynamic_cast(modify->replace_fix("NEIGH_HISTORY_GRANULAR_DUMMY", "NEIGH_HISTORY_GRANULAR" " all NEIGH_HISTORY " + std::to_string(size_history),1)); @@ -1199,7 +1199,7 @@ void PairGranular::init_style() // set fix which stores history info if (size_history > 0) { - fix_history = dynamic_cast( modify->get_fix_by_id("NEIGH_HISTORY_GRANULAR")); + fix_history = dynamic_cast(modify->get_fix_by_id("NEIGH_HISTORY_GRANULAR")); if (!fix_history) error->all(FLERR,"Could not find pair fix neigh history ID"); } } diff --git a/src/H5MD/dump_h5md.h b/src/H5MD/dump_h5md.h index e33f64f54a..7d766e0eec 100644 --- a/src/H5MD/dump_h5md.h +++ b/src/H5MD/dump_h5md.h @@ -60,7 +60,7 @@ class DumpH5MD : public Dump { void init_style() override; int modify_param(int, char **) override; void openfile() override; - void write_header(bigint) override {}; + void write_header(bigint) override{}; void pack(tagint *) override; void write_data(int, double *) override; diff --git a/src/INTEL/fix_nve_asphere_intel.cpp b/src/INTEL/fix_nve_asphere_intel.cpp index fa68c9bb4a..2917edd3e8 100644 --- a/src/INTEL/fix_nve_asphere_intel.cpp +++ b/src/INTEL/fix_nve_asphere_intel.cpp @@ -49,7 +49,7 @@ FixNVEAsphereIntel::FixNVEAsphereIntel(LAMMPS *lmp, int narg, char **arg) : void FixNVEAsphereIntel::init() { - avec = dynamic_cast( atom->style_match("ellipsoid")); + avec = dynamic_cast(atom->style_match("ellipsoid")); if (!avec) error->all(FLERR,"Compute nve/asphere requires atom style ellipsoid"); diff --git a/src/INTEL/fix_nvt_sllod_intel.cpp b/src/INTEL/fix_nvt_sllod_intel.cpp index bc13d1d677..eb11c8a7bb 100644 --- a/src/INTEL/fix_nvt_sllod_intel.cpp +++ b/src/INTEL/fix_nvt_sllod_intel.cpp @@ -70,7 +70,7 @@ void FixNVTSllodIntel::init() int i; for (i = 0; i < modify->nfix; i++) if (strncmp(modify->fix[i]->style,"deform",6) == 0) { - if ((dynamic_cast( modify->fix[i]))->remapflag != Domain::V_REMAP) + if ((dynamic_cast(modify->fix[i]))->remapflag != Domain::V_REMAP) error->all(FLERR,"Using fix nvt/sllod with inconsistent fix deform " "remap option"); break; diff --git a/src/INTERLAYER/pair_ilp_tmd.cpp b/src/INTERLAYER/pair_ilp_tmd.cpp index e80f542716..65163acb48 100644 --- a/src/INTERLAYER/pair_ilp_tmd.cpp +++ b/src/INTERLAYER/pair_ilp_tmd.cpp @@ -43,17 +43,17 @@ using namespace InterLayer; #define PGDELTA 1 static const char cite_ilp_tmd[] = -"ilp/tmd potential doi:10.1021/acs.jctc.1c00782\n" - "@Article{Ouyang2021\n" - " author = {W. Ouyang and R. Sofer and X. Gao and J. Hermann and\n" - " A. Tkatchenko and L. Kronik and M. Urbakh and O. Hod},\n" - " title = {Anisotropic Interlayer Force Field for Transition\n" - " Metal Dichalcogenides: The Case of Molybdenum Disulfide},\n" - " journal = {J.~Chem.\\ Theory Comput.},\n" - " volume = 17,\n" - " pages = {7237--7245}\n" - " year = 2021,\n" - "}\n\n"; + "ilp/tmd potential doi:10.1021/acs.jctc.1c00782\n" + "@Article{Ouyang2021\n" + " author = {W. Ouyang and R. Sofer and X. Gao and J. Hermann and\n" + " A. Tkatchenko and L. Kronik and M. Urbakh and O. Hod},\n" + " title = {Anisotropic Interlayer Force Field for Transition\n" + " Metal Dichalcogenides: The Case of Molybdenum Disulfide},\n" + " journal = {J.~Chem.\\ Theory Comput.},\n" + " volume = 17,\n" + " pages = {7237--7245}\n" + " year = 2021,\n" + "}\n\n"; /* ---------------------------------------------------------------------- */ diff --git a/src/KIM/kim_interactions.cpp b/src/KIM/kim_interactions.cpp index 3427d6fb57..94c182026a 100644 --- a/src/KIM/kim_interactions.cpp +++ b/src/KIM/kim_interactions.cpp @@ -121,7 +121,7 @@ void KimInteractions::do_setup(int narg, char **arg) int ifix = modify->find_fix("KIM_MODEL_STORE"); if (ifix >= 0) { - auto fix_store = dynamic_cast( modify->fix[ifix]); + auto fix_store = dynamic_cast(modify->fix[ifix]); model_name = (char *)fix_store->getptr("model_name"); simulatorModel = (KIM_SimulatorModel *)fix_store->getptr("simulator_model"); } else error->all(FLERR, "Must use 'kim init' before 'kim interactions'"); diff --git a/src/KIM/kim_query.cpp b/src/KIM/kim_query.cpp index f3d1815aed..4851338367 100644 --- a/src/KIM/kim_query.cpp +++ b/src/KIM/kim_query.cpp @@ -158,7 +158,7 @@ void KimQuery::command(int narg, char **arg) // check if we had a kim init command by finding fix STORE/KIM const int ifix = modify->find_fix("KIM_MODEL_STORE"); if (ifix >= 0) { - auto fix_store = dynamic_cast( modify->fix[ifix]); + auto fix_store = dynamic_cast(modify->fix[ifix]); char *model_name_c = (char *) fix_store->getptr("model_name"); model_name = model_name_c; } else { diff --git a/src/KOKKOS/atom_vec_angle_kokkos.cpp b/src/KOKKOS/atom_vec_angle_kokkos.cpp index dd37d1a838..3746f62a81 100644 --- a/src/KOKKOS/atom_vec_angle_kokkos.cpp +++ b/src/KOKKOS/atom_vec_angle_kokkos.cpp @@ -1633,7 +1633,7 @@ void AtomVecAngleKokkos::create_atom(int itype, double *coord) ------------------------------------------------------------------------- */ void AtomVecAngleKokkos::data_atom(double *coord, imageint imagetmp, - const std::vector &values) + const std::vector &values, std::string &extract) { int nlocal = atom->nlocal; if (nlocal == nmax) grow(0); @@ -1642,6 +1642,7 @@ void AtomVecAngleKokkos::data_atom(double *coord, imageint imagetmp, h_tag(nlocal) = utils::inumeric(FLERR,values[0],true,lmp); h_molecule(nlocal) = utils::inumeric(FLERR,values[1],true,lmp); h_type(nlocal) = utils::inumeric(FLERR,values[2],true,lmp); + extract = values[2]; if (h_type(nlocal) <= 0 || h_type(nlocal) > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); diff --git a/src/KOKKOS/atom_vec_angle_kokkos.h b/src/KOKKOS/atom_vec_angle_kokkos.h index 5dec05f9db..193d4b7635 100644 --- a/src/KOKKOS/atom_vec_angle_kokkos.h +++ b/src/KOKKOS/atom_vec_angle_kokkos.h @@ -51,7 +51,7 @@ class AtomVecAngleKokkos : public AtomVecKokkos { int pack_restart(int, double *) override; int unpack_restart(double *) override; void create_atom(int, double *) override; - void data_atom(double *, imageint, const std::vector &) override; + void data_atom(double *, imageint, const std::vector &, std::string &) override; int data_atom_hybrid(int, const std::vector &, int) override; void pack_data(double **) override; int pack_data_hybrid(int, double *) override; diff --git a/src/KOKKOS/atom_vec_atomic_kokkos.cpp b/src/KOKKOS/atom_vec_atomic_kokkos.cpp index 0a78b42227..e291c10c39 100644 --- a/src/KOKKOS/atom_vec_atomic_kokkos.cpp +++ b/src/KOKKOS/atom_vec_atomic_kokkos.cpp @@ -824,13 +824,14 @@ void AtomVecAtomicKokkos::create_atom(int itype, double *coord) ------------------------------------------------------------------------- */ void AtomVecAtomicKokkos::data_atom(double *coord, imageint imagetmp, - const std::vector &values) + const std::vector &values, std::string &extract) { int nlocal = atom->nlocal; if (nlocal == nmax) grow(0); h_tag[nlocal] = utils::inumeric(FLERR,values[0],true,lmp); h_type[nlocal] = utils::inumeric(FLERR,values[1],true,lmp); + extract = values[1]; if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); diff --git a/src/KOKKOS/atom_vec_atomic_kokkos.h b/src/KOKKOS/atom_vec_atomic_kokkos.h index bc4004d2c0..410a0f66e2 100644 --- a/src/KOKKOS/atom_vec_atomic_kokkos.h +++ b/src/KOKKOS/atom_vec_atomic_kokkos.h @@ -44,7 +44,7 @@ class AtomVecAtomicKokkos : public AtomVecKokkos { int pack_restart(int, double *) override; int unpack_restart(double *) override; void create_atom(int, double *) override; - void data_atom(double *, imageint, const std::vector &) override; + void data_atom(double *, imageint, const std::vector &, std::string &) override; void pack_data(double **) override; void write_data(FILE *, int, double **) override; double memory_usage() override; diff --git a/src/KOKKOS/atom_vec_bond_kokkos.cpp b/src/KOKKOS/atom_vec_bond_kokkos.cpp index ea70f15dcb..bc5db852ae 100644 --- a/src/KOKKOS/atom_vec_bond_kokkos.cpp +++ b/src/KOKKOS/atom_vec_bond_kokkos.cpp @@ -1059,7 +1059,7 @@ void AtomVecBondKokkos::create_atom(int itype, double *coord) ------------------------------------------------------------------------- */ void AtomVecBondKokkos::data_atom(double *coord, imageint imagetmp, - const std::vector &values) + const std::vector &values, std::string &extract) { int nlocal = atomKK->nlocal; if (nlocal == nmax) grow(0); @@ -1068,6 +1068,7 @@ void AtomVecBondKokkos::data_atom(double *coord, imageint imagetmp, h_tag(nlocal) = utils::inumeric(FLERR,values[0],true,lmp); h_molecule(nlocal) = utils::inumeric(FLERR,values[1],true,lmp); h_type(nlocal) = utils::inumeric(FLERR,values[2],true,lmp); + extract = values[2]; if (h_type(nlocal) <= 0 || h_type(nlocal) > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); diff --git a/src/KOKKOS/atom_vec_bond_kokkos.h b/src/KOKKOS/atom_vec_bond_kokkos.h index eb3fca3130..573438ed41 100644 --- a/src/KOKKOS/atom_vec_bond_kokkos.h +++ b/src/KOKKOS/atom_vec_bond_kokkos.h @@ -45,7 +45,7 @@ class AtomVecBondKokkos : public AtomVecKokkos { int pack_restart(int, double *) override; int unpack_restart(double *) override; void create_atom(int, double *) override; - void data_atom(double *, imageint, const std::vector &) override; + void data_atom(double *, imageint, const std::vector &, std::string &) override; int data_atom_hybrid(int, const std::vector &, int) override; void pack_data(double **) override; int pack_data_hybrid(int, double *) override; diff --git a/src/KOKKOS/atom_vec_charge_kokkos.cpp b/src/KOKKOS/atom_vec_charge_kokkos.cpp index 3c0e1d46bb..0cf39938d9 100644 --- a/src/KOKKOS/atom_vec_charge_kokkos.cpp +++ b/src/KOKKOS/atom_vec_charge_kokkos.cpp @@ -957,13 +957,14 @@ void AtomVecChargeKokkos::create_atom(int itype, double *coord) ------------------------------------------------------------------------- */ void AtomVecChargeKokkos::data_atom(double *coord, imageint imagetmp, - const std::vector &values) + const std::vector &values, std::string &extract) { int nlocal = atom->nlocal; if (nlocal == nmax) grow(0); h_tag[nlocal] = utils::inumeric(FLERR,values[0],true,lmp); h_type[nlocal] = utils::inumeric(FLERR,values[1],true,lmp); + extract = values[1]; if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); diff --git a/src/KOKKOS/atom_vec_charge_kokkos.h b/src/KOKKOS/atom_vec_charge_kokkos.h index ceca4c8688..10b482fca5 100644 --- a/src/KOKKOS/atom_vec_charge_kokkos.h +++ b/src/KOKKOS/atom_vec_charge_kokkos.h @@ -46,7 +46,7 @@ class AtomVecChargeKokkos : public AtomVecKokkos { int pack_restart(int, double *) override; int unpack_restart(double *) override; void create_atom(int, double *) override; - void data_atom(double *, imageint, const std::vector &) override; + void data_atom(double *, imageint, const std::vector &, std::string &) override; int data_atom_hybrid(int , const std::vector &, int) override; void pack_data(double **) override; int pack_data_hybrid(int, double *) override; diff --git a/src/KOKKOS/atom_vec_dpd_kokkos.cpp b/src/KOKKOS/atom_vec_dpd_kokkos.cpp index 1b7ccd97d0..9176de6a67 100644 --- a/src/KOKKOS/atom_vec_dpd_kokkos.cpp +++ b/src/KOKKOS/atom_vec_dpd_kokkos.cpp @@ -1719,13 +1719,14 @@ void AtomVecDPDKokkos::create_atom(int itype, double *coord) ------------------------------------------------------------------------- */ void AtomVecDPDKokkos::data_atom(double *coord, imageint imagetmp, - const std::vector &values) + const std::vector &values, std::string &extract) { int nlocal = atom->nlocal; if (nlocal == nmax) grow(0); h_tag[nlocal] = utils::tnumeric(FLERR,values[0],true,lmp); h_type[nlocal] = utils::inumeric(FLERR,values[1],true,lmp); + extract = values[1]; if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); diff --git a/src/KOKKOS/atom_vec_dpd_kokkos.h b/src/KOKKOS/atom_vec_dpd_kokkos.h index 1a6b62f4af..338e0f6004 100644 --- a/src/KOKKOS/atom_vec_dpd_kokkos.h +++ b/src/KOKKOS/atom_vec_dpd_kokkos.h @@ -54,7 +54,7 @@ class AtomVecDPDKokkos : public AtomVecKokkos { int pack_restart(int, double *) override; int unpack_restart(double *) override; void create_atom(int, double *) override; - void data_atom(double *, imageint, const std::vector &) override; + void data_atom(double *, imageint, const std::vector &, std::string &) override; int data_atom_hybrid(int, const std::vector &, int) override; void pack_data(double **) override; int pack_data_hybrid(int, double *) override; diff --git a/src/KOKKOS/atom_vec_full_kokkos.cpp b/src/KOKKOS/atom_vec_full_kokkos.cpp index 7322a75b11..807953ef41 100644 --- a/src/KOKKOS/atom_vec_full_kokkos.cpp +++ b/src/KOKKOS/atom_vec_full_kokkos.cpp @@ -1491,7 +1491,7 @@ void AtomVecFullKokkos::create_atom(int itype, double *coord) ------------------------------------------------------------------------- */ void AtomVecFullKokkos::data_atom(double *coord, imageint imagetmp, - const std::vector &values) + const std::vector &values, std::string &extract) { int nlocal = atom->nlocal; if (nlocal == nmax) grow(0); @@ -1500,6 +1500,7 @@ void AtomVecFullKokkos::data_atom(double *coord, imageint imagetmp, h_tag(nlocal) = utils::inumeric(FLERR,values[0],true,lmp); h_molecule(nlocal) = utils::inumeric(FLERR,values[1],true,lmp); h_type(nlocal) = utils::inumeric(FLERR,values[2],true,lmp); + extract = values[2]; if (h_type(nlocal) <= 0 || h_type(nlocal) > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); diff --git a/src/KOKKOS/atom_vec_full_kokkos.h b/src/KOKKOS/atom_vec_full_kokkos.h index c1fa9242f4..9fc25b509e 100644 --- a/src/KOKKOS/atom_vec_full_kokkos.h +++ b/src/KOKKOS/atom_vec_full_kokkos.h @@ -45,7 +45,7 @@ class AtomVecFullKokkos : public AtomVecKokkos { int pack_restart(int, double *) override; int unpack_restart(double *) override; void create_atom(int, double *) override; - void data_atom(double *, imageint, const std::vector &) override; + void data_atom(double *, imageint, const std::vector &, std::string &) override; int data_atom_hybrid(int, const std::vector &, int) override; void pack_data(double **) override; int pack_data_hybrid(int, double *) override; diff --git a/src/KOKKOS/atom_vec_hybrid_kokkos.cpp b/src/KOKKOS/atom_vec_hybrid_kokkos.cpp index c733e5fe18..d9c3aa89f7 100644 --- a/src/KOKKOS/atom_vec_hybrid_kokkos.cpp +++ b/src/KOKKOS/atom_vec_hybrid_kokkos.cpp @@ -971,7 +971,7 @@ void AtomVecHybridKokkos::create_atom(int itype, double *coord) ------------------------------------------------------------------------- */ void AtomVecHybridKokkos::data_atom(double *coord, imageint imagetmp, - const std::vector &values) + const std::vector &values, std::string &extract) { atomKK->sync(Host,X_MASK|TAG_MASK|TYPE_MASK|IMAGE_MASK|MASK_MASK|V_MASK|OMEGA_MASK/*|ANGMOM_MASK*/); @@ -980,6 +980,7 @@ void AtomVecHybridKokkos::data_atom(double *coord, imageint imagetmp, h_tag[nlocal] = utils::tnumeric(FLERR,values[0],true,lmp); h_type[nlocal] = utils::inumeric(FLERR,values[1],true,lmp); + extract = values[1]; if (h_type[nlocal] <= 0 || h_type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom h_type in Atoms section of data file"); diff --git a/src/KOKKOS/atom_vec_hybrid_kokkos.h b/src/KOKKOS/atom_vec_hybrid_kokkos.h index 6578ecdb9e..f633460634 100644 --- a/src/KOKKOS/atom_vec_hybrid_kokkos.h +++ b/src/KOKKOS/atom_vec_hybrid_kokkos.h @@ -57,7 +57,7 @@ class AtomVecHybridKokkos : public AtomVecKokkos { int pack_restart(int, double *) override; int unpack_restart(double *) override; void create_atom(int, double *) override; - void data_atom(double *, imageint, const std::vector &) override; + void data_atom(double *, imageint, const std::vector &, std::string &) override; int data_atom_hybrid(int, const std::vector &, int) override {return 0;} void data_vel(int, const std::vector &) override; void pack_data(double **) override; diff --git a/src/KOKKOS/atom_vec_molecular_kokkos.cpp b/src/KOKKOS/atom_vec_molecular_kokkos.cpp index 123adedbdf..a9f229c969 100644 --- a/src/KOKKOS/atom_vec_molecular_kokkos.cpp +++ b/src/KOKKOS/atom_vec_molecular_kokkos.cpp @@ -1892,7 +1892,7 @@ void AtomVecMolecularKokkos::create_atom(int itype, double *coord) ------------------------------------------------------------------------- */ void AtomVecMolecularKokkos::data_atom(double *coord, imageint imagetmp, - const std::vector &values) + const std::vector &values, std::string &extract) { int nlocal = atom->nlocal; if (nlocal == nmax) grow(0); @@ -1901,6 +1901,7 @@ void AtomVecMolecularKokkos::data_atom(double *coord, imageint imagetmp, h_tag(nlocal) = utils::inumeric(FLERR,values[0],true,lmp); h_molecule(nlocal) = utils::inumeric(FLERR,values[1],true,lmp); h_type(nlocal) = utils::inumeric(FLERR,values[2],true,lmp); + extract = values[2]; if (h_type(nlocal) <= 0 || h_type(nlocal) > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); diff --git a/src/KOKKOS/atom_vec_molecular_kokkos.h b/src/KOKKOS/atom_vec_molecular_kokkos.h index 418d800c7b..cca7c3c6d9 100644 --- a/src/KOKKOS/atom_vec_molecular_kokkos.h +++ b/src/KOKKOS/atom_vec_molecular_kokkos.h @@ -51,7 +51,7 @@ class AtomVecMolecularKokkos : public AtomVecKokkos { int pack_restart(int, double *) override; int unpack_restart(double *) override; void create_atom(int, double *) override; - void data_atom(double *, imageint, const std::vector &) override; + void data_atom(double *, imageint, const std::vector &, std::string &) override; int data_atom_hybrid(int, const std::vector &, int) override; void pack_data(double **) override; int pack_data_hybrid(int, double *) override; diff --git a/src/KOKKOS/atom_vec_sphere_kokkos.cpp b/src/KOKKOS/atom_vec_sphere_kokkos.cpp index 206d6c832c..fa952beb5f 100644 --- a/src/KOKKOS/atom_vec_sphere_kokkos.cpp +++ b/src/KOKKOS/atom_vec_sphere_kokkos.cpp @@ -2546,13 +2546,14 @@ void AtomVecSphereKokkos::create_atom(int itype, double *coord) ------------------------------------------------------------------------- */ void AtomVecSphereKokkos::data_atom(double *coord, imageint imagetmp, - const std::vector &values) + const std::vector &values, std::string &extract) { int nlocal = atom->nlocal; if (nlocal == nmax) grow(0); tag[nlocal] = utils::tnumeric(FLERR,values[0],true,lmp); type[nlocal] = utils::inumeric(FLERR,values[1],true,lmp); + extract = values[1]; if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); diff --git a/src/KOKKOS/atom_vec_sphere_kokkos.h b/src/KOKKOS/atom_vec_sphere_kokkos.h index 05bfeb6eb4..fee46ff5cf 100644 --- a/src/KOKKOS/atom_vec_sphere_kokkos.h +++ b/src/KOKKOS/atom_vec_sphere_kokkos.h @@ -58,7 +58,7 @@ class AtomVecSphereKokkos : public AtomVecKokkos { int pack_restart(int, double *) override; int unpack_restart(double *) override; void create_atom(int, double *) override; - void data_atom(double *, imageint, const std::vector &) override; + void data_atom(double *, imageint, const std::vector &, std::string &) override; int data_atom_hybrid(int, const std::vector &, int) override; void data_vel(int, const std::vector &) override; int data_vel_hybrid(int, const std::vector &, int) override; diff --git a/src/KOKKOS/atom_vec_spin_kokkos.cpp b/src/KOKKOS/atom_vec_spin_kokkos.cpp index 7722241756..3d22cbd183 100644 --- a/src/KOKKOS/atom_vec_spin_kokkos.cpp +++ b/src/KOKKOS/atom_vec_spin_kokkos.cpp @@ -1058,13 +1058,14 @@ void AtomVecSpinKokkos::create_atom(int itype, double *coord) ------------------------------------------------------------------------- */ void AtomVecSpinKokkos::data_atom(double *coord, imageint imagetmp, - const std::vector &values) + const std::vector &values, std::string &extract) { int nlocal = atom->nlocal; if (nlocal == nmax) grow(0); h_tag[nlocal] = utils::inumeric(FLERR,values[0],true,lmp); h_type[nlocal] = utils::inumeric(FLERR,values[1],true,lmp); + extract = values[1]; if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); diff --git a/src/KOKKOS/atom_vec_spin_kokkos.h b/src/KOKKOS/atom_vec_spin_kokkos.h index ab0d14e08e..3f48ad323a 100644 --- a/src/KOKKOS/atom_vec_spin_kokkos.h +++ b/src/KOKKOS/atom_vec_spin_kokkos.h @@ -45,7 +45,7 @@ class AtomVecSpinKokkos : public AtomVecKokkos { int pack_restart(int, double *) override; int unpack_restart(double *) override; void create_atom(int, double *) override; - void data_atom(double *, imageint, const std::vector &) override; + void data_atom(double *, imageint, const std::vector &, std::string &) override; int data_atom_hybrid(int, const std::vector &, int) override; void pack_data(double **) override; int pack_data_hybrid(int, double *) override; diff --git a/src/KOKKOS/compute_ave_sphere_atom_kokkos.h b/src/KOKKOS/compute_ave_sphere_atom_kokkos.h index 1ddf943e7d..a2ba6bff63 100644 --- a/src/KOKKOS/compute_ave_sphere_atom_kokkos.h +++ b/src/KOKKOS/compute_ave_sphere_atom_kokkos.h @@ -46,7 +46,7 @@ template class ComputeAveSphereAtomKokkos : public ComputeAve void operator()(TagComputeAveSphereAtom, const int &) const; private: - double adof,mvv2e,mv2d,boltz; + double adof, mvv2e, mv2d, boltz; typename AT::t_x_array x; typename AT::t_v_array v; diff --git a/src/KSPACE/fft3d.h b/src/KSPACE/fft3d.h index d365dec029..3d15be9e2b 100644 --- a/src/KSPACE/fft3d.h +++ b/src/KSPACE/fft3d.h @@ -13,7 +13,6 @@ #include - #include "lmpfftsettings.h" // ------------------------------------------------------------------------- diff --git a/src/KSPACE/pair_buck_long_coul_long.cpp b/src/KSPACE/pair_buck_long_coul_long.cpp index b1717a891d..b4beaa9766 100644 --- a/src/KSPACE/pair_buck_long_coul_long.cpp +++ b/src/KSPACE/pair_buck_long_coul_long.cpp @@ -249,8 +249,8 @@ void PairBuckLongCoulLong::init_style() // set rRESPA cutoffs if (utils::strmatch(update->integrate_style,"^respa") && - (dynamic_cast( update->integrate))->level_inner >= 0) - cut_respa = (dynamic_cast( update->integrate))->cutoff; + (dynamic_cast(update->integrate))->level_inner >= 0) + cut_respa = (dynamic_cast(update->integrate))->cutoff; else cut_respa = nullptr; // setup force tables @@ -264,7 +264,7 @@ void PairBuckLongCoulLong::init_style() int list_style = NeighConst::REQ_DEFAULT; if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) { - auto respa = dynamic_cast( update->integrate); + auto respa = dynamic_cast(update->integrate); if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT; if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL; } diff --git a/src/KSPACE/pair_lj_charmm_coul_long.cpp b/src/KSPACE/pair_lj_charmm_coul_long.cpp index 6e39a4f56f..d1ca3117e9 100644 --- a/src/KSPACE/pair_lj_charmm_coul_long.cpp +++ b/src/KSPACE/pair_lj_charmm_coul_long.cpp @@ -690,7 +690,7 @@ void PairLJCharmmCoulLong::init_style() int list_style = NeighConst::REQ_DEFAULT; if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) { - auto respa = dynamic_cast( update->integrate); + auto respa = dynamic_cast(update->integrate); if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT; if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL; } @@ -713,8 +713,8 @@ void PairLJCharmmCoulLong::init_style() // set & error check interior rRESPA cutoffs if (utils::strmatch(update->integrate_style,"^respa") && - (dynamic_cast( update->integrate))->level_inner >= 0) { - cut_respa = (dynamic_cast( update->integrate))->cutoff; + (dynamic_cast(update->integrate))->level_inner >= 0) { + cut_respa = (dynamic_cast(update->integrate))->cutoff; cut_in_off = cut_respa[0]; cut_in_on = cut_respa[1]; cut_out_on = cut_respa[2]; diff --git a/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp b/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp index a4741a56a2..02dd4ac541 100644 --- a/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp +++ b/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp @@ -741,7 +741,7 @@ void PairLJCharmmfswCoulLong::init_style() int list_style = NeighConst::REQ_DEFAULT; if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) { - auto respa = dynamic_cast( update->integrate); + auto respa = dynamic_cast(update->integrate); if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT; if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL; } @@ -775,8 +775,8 @@ void PairLJCharmmfswCoulLong::init_style() // set & error check interior rRESPA cutoffs if (utils::strmatch(update->integrate_style,"^respa") && - (dynamic_cast( update->integrate))->level_inner >= 0) { - cut_respa = (dynamic_cast( update->integrate))->cutoff; + (dynamic_cast(update->integrate))->level_inner >= 0) { + cut_respa = (dynamic_cast(update->integrate))->cutoff; if (MIN(cut_lj,cut_coul) < cut_respa[3]) error->all(FLERR,"Pair cutoff < Respa interior cutoff"); if (cut_lj_inner < cut_respa[1]) diff --git a/src/KSPACE/pair_lj_cut_coul_long.cpp b/src/KSPACE/pair_lj_cut_coul_long.cpp index 0ffdde24de..da9a783dec 100644 --- a/src/KSPACE/pair_lj_cut_coul_long.cpp +++ b/src/KSPACE/pair_lj_cut_coul_long.cpp @@ -658,7 +658,7 @@ void PairLJCutCoulLong::init_style() int list_style = NeighConst::REQ_DEFAULT; if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) { - auto respa = dynamic_cast( update->integrate); + auto respa = dynamic_cast(update->integrate); if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT; if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL; } @@ -669,8 +669,8 @@ void PairLJCutCoulLong::init_style() // set rRESPA cutoffs if (utils::strmatch(update->integrate_style,"^respa") && - (dynamic_cast( update->integrate))->level_inner >= 0) - cut_respa = (dynamic_cast( update->integrate))->cutoff; + (dynamic_cast(update->integrate))->level_inner >= 0) + cut_respa = (dynamic_cast(update->integrate))->cutoff; else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald diff --git a/src/KSPACE/pair_lj_long_coul_long.cpp b/src/KSPACE/pair_lj_long_coul_long.cpp index 742f424b95..c1bba53d75 100644 --- a/src/KSPACE/pair_lj_long_coul_long.cpp +++ b/src/KSPACE/pair_lj_long_coul_long.cpp @@ -242,8 +242,8 @@ void PairLJLongCoulLong::init_style() // set rRESPA cutoffs if (utils::strmatch(update->integrate_style,"^respa") && - (dynamic_cast( update->integrate))->level_inner >= 0) - cut_respa = (dynamic_cast( update->integrate))->cutoff; + (dynamic_cast(update->integrate))->level_inner >= 0) + cut_respa = (dynamic_cast(update->integrate))->cutoff; else cut_respa = nullptr; // setup force tables @@ -257,7 +257,7 @@ void PairLJLongCoulLong::init_style() int list_style = NeighConst::REQ_DEFAULT; if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) { - auto respa = dynamic_cast( update->integrate); + auto respa = dynamic_cast(update->integrate); if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT; if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL; } diff --git a/src/LATTE/fix_latte.cpp b/src/LATTE/fix_latte.cpp index 71df0d0c8b..f97162cd40 100644 --- a/src/LATTE/fix_latte.cpp +++ b/src/LATTE/fix_latte.cpp @@ -24,6 +24,7 @@ #include "domain.h" #include "error.h" #include "force.h" +#include "group.h" #include "memory.h" #include "modify.h" #include "update.h" @@ -54,6 +55,8 @@ extern "C" { FixLatte::FixLatte(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { + if (narg < 3) utils::missing_cmd_args(FLERR, "fix latte", error); + if (strcmp(update->unit_style,"metal") != 0) error->all(FLERR,"Must use units metal with fix latte command"); @@ -63,8 +66,6 @@ FixLatte::FixLatte(LAMMPS *lmp, int narg, char **arg) : if (LATTE_ABIVERSION != latte_abiversion()) error->all(FLERR,"LAMMPS is linked against incompatible LATTE library"); - if (narg != 4) error->all(FLERR,"Illegal fix latte command"); - scalar_flag = 1; global_freq = 1; extscalar = 1; @@ -72,21 +73,37 @@ FixLatte::FixLatte(LAMMPS *lmp, int narg, char **arg) : virial_global_flag = 1; thermo_energy = thermo_virial = 1; - // store ID of compute pe/atom used to generate Coulomb potential for LATTE - // null pointer means LATTE will compute Coulombic potential + // process optional args coulomb = 0; id_pe = nullptr; + exclude = 0; + id_exclude = nullptr; - if (strcmp(arg[3],"NULL") != 0) { - coulomb = 1; - error->all(FLERR,"Fix latte does not yet support a LAMMPS calculation of a Coulomb potential"); + int iarg = 3; + while (iarg < narg) { + if (strcmp(arg[iarg],"coulomb") == 0) { + if (iarg+2 > narg) + utils::missing_cmd_args(FLERR, "fix latte coulomb", error); + coulomb = 1; + error->all(FLERR,"Fix latte does not yet support LAMMPS calculation of a Coulomb potential"); + delete[] id_pe; + id_pe = utils::strdup(arg[iarg+1]); + c_pe = modify->get_compute_by_id(id_pe); + if (!c_pe) error->all(FLERR,"Could not find fix latte compute ID {}", id_pe); + if (c_pe->peatomflag == 0) error->all(FLERR,"Fix latte compute ID does not compute pe/atom"); + iarg += 2; - id_pe = utils::strdup(arg[3]); - c_pe = modify->get_compute_by_id(id_pe); - if (!c_pe) error->all(FLERR,"Could not find fix latte compute ID {}", id_pe); - if (c_pe->peatomflag == 0) - error->all(FLERR,"Fix latte compute ID does not compute pe/atom"); + } else if (strcmp(arg[iarg],"exclude") == 0) { + if (iarg+2 > narg) + utils::missing_cmd_args(FLERR, "fix latte exclude", error); + exclude = 1; + delete[] id_exclude; + id_exclude = utils::strdup(arg[iarg+1]); + iarg += 2; + + } else + error->all(FLERR, "Unknown fix latte keyword: {}", arg[iarg]); } // initializations @@ -103,6 +120,7 @@ FixLatte::FixLatte(LAMMPS *lmp, int narg, char **arg) : FixLatte::~FixLatte() { delete[] id_pe; + delete[] id_exclude; memory->destroy(qpotential); memory->destroy(flatte); } @@ -130,9 +148,8 @@ void FixLatte::init() if (coulomb) { if (atom->q_flag == 0 || force->pair == nullptr || force->kspace == nullptr) error->all(FLERR,"Fix latte cannot compute Coulomb potential"); - c_pe = modify->get_compute_by_id(id_pe); - if (!c_pe) error->all(FLERR,"Could not find fix latte compute ID {}", id_pe); + if (!c_pe) error->all(FLERR,"Fix latte could not find Coulomb compute ID {}",id_pe); } // must be fully periodic or fully non-periodic @@ -149,6 +166,18 @@ void FixLatte::init() memory->create(qpotential,atom->nlocal,"latte:qpotential"); memory->create(flatte,atom->nlocal,3,"latte:flatte"); } + + // extract pointer to exclusion_group variable from id_exclude + // exclusion_group is index of a group the Fix defines + + if (exclude) { + Fix *f_exclude = modify->get_fix_by_id(id_exclude); + if (!f_exclude) error->all(FLERR,"Fix latte could not find exclude fix ID {}", id_exclude); + int dim; + exclusion_group_ptr = (int *) f_exclude->extract("exclusion_group", dim); + if (!exclusion_group_ptr || dim != 0) + error->all(FLERR,"Fix latte could not query exclude_group of fix ID {}", id_exclude); + } } /* ---------------------------------------------------------------------- */ @@ -162,18 +191,20 @@ void FixLatte::init_list(int /*id*/, NeighList * /*ptr*/) void FixLatte::setup(int vflag) { - newsystem = 1; + natoms_last = -1; + setupflag = 1; post_force(vflag); - newsystem = 0; + setupflag = 0; } /* ---------------------------------------------------------------------- */ void FixLatte::min_setup(int vflag) { - newsystem = 1; + natoms_last = -1; + setupflag = 1; post_force(vflag); - newsystem = 0; + setupflag = 0; } /* ---------------------------------------------------------------------- */ @@ -234,37 +265,48 @@ void FixLatte::post_force(int vflag) neighflag = 0; // set flags used by LATTE - // NOTE: LATTE does not compute per-atom energies or virials + // note that LATTE does not compute per-atom energies or virials - int flags[6]; + flags_latte[0] = pbcflag; // 1 for fully periodic, 0 for fully non-periodic + flags_latte[1] = coulombflag; // 1 for LAMMPS computes Coulombics, 0 for LATTE + flags_latte[2] = eflag_atom; // 1 to return per-atom energies, 0 for no + flags_latte[3] = vflag_global && thermo_virial; // 1 to return global/per-atom + flags_latte[4] = vflag_atom && thermo_virial; // virial, 0 for no + flags_latte[5] = neighflag; // 1 to pass neighbor list to LATTE, 0 for no - flags[0] = pbcflag; // 1 for fully periodic, 0 for fully non-periodic - flags[1] = coulombflag; // 1 for LAMMPS computes Coulombics, 0 for LATTE - flags[2] = eflag_atom; // 1 to return per-atom energies, 0 for no - flags[3] = vflag_global && thermo_virial; // 1 to return global/per-atom - flags[4] = vflag_atom && thermo_virial; // virial, 0 for no - flags[5] = neighflag; // 1 to pass neighbor list to LATTE, 0 for no + // newsystem flag determines whether LATTE treats snapshot + // as new system (more work) or increment to last system + // if setup or atom count changed then newsystem = 1 + // else newsystem = 0 - // setup LATTE arguments + if (setupflag || atom->natoms != natoms_last) newsystem = 1; + else newsystem = 0; - int natoms = atom->nlocal; - double *coords = &atom->x[0][0]; - int *type = atom->type; - int ntypes = atom->ntypes; - double *mass = &atom->mass[1]; - double *boxlo = domain->boxlo; - double *boxhi = domain->boxhi; - double *forces; - bool latteerror = false; - if (coulomb) forces = &flatte[0][0]; - else forces = &atom->f[0][0]; - int maxiter = -1; + // setup arguments for latte() function and invoke it + // either for all atoms or excluding some atoms + // in latter case, need to construct reduced-size per-atom vectors/arrays - latte(flags,&natoms,coords,type,&ntypes,mass,boxlo,boxhi,&domain->xy, - &domain->xz,&domain->yz,forces,&maxiter,&latte_energy, - &atom->v[0][0],&update->dt,virial,&newsystem,&latteerror); + if (!exclude) latte_wrapper_all(); + else { + int anyexclude = 0; - if (latteerror) error->all(FLERR,"Internal LATTE problem"); + int exclusion_group = *exclusion_group_ptr; + if (exclusion_group) { + int excludebit = group->bitmask[exclusion_group]; + + int *mask = atom->mask; + int nlocal = atom->nlocal; + + for (int i = 0; i < nlocal; i++) + if (mask[i] & excludebit) anyexclude = 1; + } + + if (!anyexclude) latte_wrapper_all(); + else latte_wrapper_exclude(); + } + + newsystem = 0; + natoms_last = atom->natoms; // sum LATTE forces to LAMMPS forces // e.g. LAMMPS may compute Coulombics at some point @@ -280,6 +322,110 @@ void FixLatte::post_force(int vflag) } } +/* ---------------------------------------------------------------------- + invoke LATTE on all LAMMPS atoms +------------------------------------------------------------------------- */ + +void FixLatte::latte_wrapper_all() +{ + int natoms = atom->nlocal; + double *coords = &atom->x[0][0]; + int *types = atom->type; + int ntypes = atom->ntypes; + double *mass = &atom->mass[1]; + double *boxlo = domain->boxlo; + double *boxhi = domain->boxhi; + double *forces; + bool latteerror = false; + if (coulomb) forces = &flatte[0][0]; + else forces = &atom->f[0][0]; + int maxiter = -1; + + latte(flags_latte,&natoms,coords,types,&ntypes,mass,boxlo,boxhi, + &domain->xy,&domain->xz,&domain->yz,forces,&maxiter,&latte_energy, + &atom->v[0][0],&update->dt,virial,&newsystem,&latteerror); + + if (latteerror) error->all(FLERR,"Internal LATTE problem"); +} + +/* ---------------------------------------------------------------------- + invoke LATTE on only LAMMPS atoms not in exclude group +------------------------------------------------------------------------- */ + +void FixLatte::latte_wrapper_exclude() +{ + int m; + + int exclusion_group = *exclusion_group_ptr; + int excludebit = group->bitmask[exclusion_group]; + + int *mask = atom->mask; + int nlocal = atom->nlocal; + + // nlatte = number of non-excluded atoms to pass to LATTE + + int nlatte = 0; + for (int i = 0; i < nlocal; i++) + if (!(mask[i] & excludebit)) nlatte++; + + // created compressed type vector and coords array + + int *typeinclude; + double **xinclude,**finclude; + memory->create(typeinclude,nlatte,"latte:typeinclude"); + memory->create(xinclude,nlatte,3,"latte:xinclude"); + memory->create(finclude,nlatte,3,"latte:finclude"); + + double *coords = &xinclude[0][0]; + int *types = typeinclude; + double *forces = &finclude[0][0]; + + double **x = atom->x; + int *type = atom->type; + + nlatte = 0; + m = 0; + for (int i = 0; i < nlocal; i++) { + if (mask[i] & excludebit) continue; + types[nlatte] = type[i]; + nlatte++; + coords[m+0] = x[i][0]; + coords[m+1] = x[i][1]; + coords[m+2] = x[i][2]; + m += 3; + } + + int ntypes = atom->ntypes; + double *mass = &atom->mass[1]; + double *boxlo = domain->boxlo; + double *boxhi = domain->boxhi; + bool latteerror = false; + int maxiter = -1; + + latte(flags_latte,&nlatte,coords,types,&ntypes,mass,boxlo,boxhi, + &domain->xy,&domain->xz,&domain->yz,forces,&maxiter,&latte_energy, + &atom->v[0][0],&update->dt,virial,&newsystem,&latteerror); + + if (latteerror) error->all(FLERR,"Internal LATTE problem"); + + // expand compressed forces array + + double **f = atom->f; + + m = 0; + for (int i = 0; i < nlocal; i++) { + if (mask[i] & excludebit) continue; + f[i][0] = forces[m+0]; + f[i][1] = forces[m+1]; + f[i][2] = forces[m+2]; + m += 3; + } + + memory->destroy(typeinclude); + memory->destroy(xinclude); + memory->destroy(finclude); +} + /* ---------------------------------------------------------------------- */ void FixLatte::min_post_force(int vflag) diff --git a/src/LATTE/fix_latte.h b/src/LATTE/fix_latte.h index 894940e1e2..18730e7f5e 100644 --- a/src/LATTE/fix_latte.h +++ b/src/LATTE/fix_latte.h @@ -44,17 +44,26 @@ class FixLatte : public Fix { double memory_usage() override; protected: - char *id_pe; int coulomb, pbcflag, pe_peratom, virial_global, virial_peratom, neighflag; + int exclude, excludebit; int eflag_caller; + char *id_pe,*id_exclude; + int *exclusion_group_ptr; + int setupflag, newsystem; + bigint natoms_last; - int nmax, newsystem; + int flags_latte[6]; + + int nmax; double *qpotential; double **flatte; double latte_energy; class NeighList *list; class Compute *c_pe; + + void latte_wrapper_all(); + void latte_wrapper_exclude(); }; } // namespace LAMMPS_NS diff --git a/src/MACHDYN/pair_smd_tlsph.cpp b/src/MACHDYN/pair_smd_tlsph.cpp index 6a55948426..6c8f286fe5 100644 --- a/src/MACHDYN/pair_smd_tlsph.cpp +++ b/src/MACHDYN/pair_smd_tlsph.cpp @@ -143,11 +143,11 @@ void PairTlsph::PreCompute() { int nlocal = atom->nlocal; int jnum, jj, i, j, itype, idim; - tagint **partner = (dynamic_cast( modify->fix[ifix_tlsph]))->partner; - int *npartner = (dynamic_cast( modify->fix[ifix_tlsph]))->npartner; - float **wfd_list = (dynamic_cast( modify->fix[ifix_tlsph]))->wfd_list; - float **wf_list = (dynamic_cast( modify->fix[ifix_tlsph]))->wf_list; - float **degradation_ij = (dynamic_cast( modify->fix[ifix_tlsph]))->degradation_ij; + tagint **partner = (dynamic_cast(modify->fix[ifix_tlsph]))->partner; + int *npartner = (dynamic_cast(modify->fix[ifix_tlsph]))->npartner; + float **wfd_list = (dynamic_cast(modify->fix[ifix_tlsph]))->wfd_list; + float **wf_list = (dynamic_cast(modify->fix[ifix_tlsph]))->wf_list; + float **degradation_ij = (dynamic_cast(modify->fix[ifix_tlsph]))->degradation_ij; double r0, r0Sq, wf, wfd, h, irad, voli, volj, scale, shepardWeight; Vector3d dx, dx0, dv, g; Matrix3d Ktmp, Ftmp, Fdottmp, L, U, eye; @@ -421,12 +421,12 @@ void PairTlsph::ComputeForces(int eflag, int vflag) { Vector3d xi, xj, vi, vj, f_visc, sumForces, f_spring; int periodic = (domain->xperiodic || domain->yperiodic || domain->zperiodic); - tagint **partner = (dynamic_cast( modify->fix[ifix_tlsph]))->partner; - int *npartner = (dynamic_cast( modify->fix[ifix_tlsph]))->npartner; - float **wfd_list = (dynamic_cast( modify->fix[ifix_tlsph]))->wfd_list; - float **wf_list = (dynamic_cast( modify->fix[ifix_tlsph]))->wf_list; - float **degradation_ij = (dynamic_cast( modify->fix[ifix_tlsph]))->degradation_ij; - float **energy_per_bond = (dynamic_cast( modify->fix[ifix_tlsph]))->energy_per_bond; + tagint **partner = (dynamic_cast(modify->fix[ifix_tlsph]))->partner; + int *npartner = (dynamic_cast(modify->fix[ifix_tlsph]))->npartner; + float **wfd_list = (dynamic_cast(modify->fix[ifix_tlsph]))->wfd_list; + float **wf_list = (dynamic_cast(modify->fix[ifix_tlsph]))->wf_list; + float **degradation_ij = (dynamic_cast(modify->fix[ifix_tlsph]))->degradation_ij; + float **energy_per_bond = (dynamic_cast(modify->fix[ifix_tlsph]))->energy_per_bond; Matrix3d eye; eye.setIdentity(); @@ -1612,7 +1612,7 @@ void PairTlsph::init_style() { fixarg[2] = (char *) "SMD_TLSPH_NEIGHBORS"; modify->add_fix(3, fixarg); delete[] fixarg; - fix_tlsph_reference_configuration = dynamic_cast( modify->fix[modify->nfix - 1]); + fix_tlsph_reference_configuration = dynamic_cast(modify->fix[modify->nfix - 1]); fix_tlsph_reference_configuration->pair = this; } diff --git a/src/MACHDYN/pair_smd_tlsph.h b/src/MACHDYN/pair_smd_tlsph.h index abcf05ba75..6b4cb229a5 100644 --- a/src/MACHDYN/pair_smd_tlsph.h +++ b/src/MACHDYN/pair_smd_tlsph.h @@ -59,17 +59,17 @@ class PairTlsph : public Pair { void PreCompute(); void ComputeForces(int eflag, int vflag); void effective_longitudinal_modulus(const int itype, const double dt, const double d_iso, - const double p_rate, const Eigen::Matrix3d& d_dev, - const Eigen::Matrix3d& sigma_dev_rate, const double damage, + const double p_rate, const Eigen::Matrix3d &d_dev, + const Eigen::Matrix3d &sigma_dev_rate, const double damage, double &K_eff, double &mu_eff, double &M_eff); void ComputePressure(const int i, const double rho, const double mass_specific_energy, const double vol_specific_energy, const double pInitial, const double d_iso, double &pFinal, double &p_rate); - void ComputeStressDeviator(const int i, const Eigen::Matrix3d& sigmaInitial_dev, - const Eigen::Matrix3d& d_dev, Eigen::Matrix3d &sigmaFinal_dev, + void ComputeStressDeviator(const int i, const Eigen::Matrix3d &sigmaInitial_dev, + const Eigen::Matrix3d &d_dev, Eigen::Matrix3d &sigmaFinal_dev, Eigen::Matrix3d &sigma_dev_rate, double &plastic_strain_increment); - void ComputeDamage(const int i, const Eigen::Matrix3d& strain, const Eigen::Matrix3d& sigmaFinal, + void ComputeDamage(const int i, const Eigen::Matrix3d &strain, const Eigen::Matrix3d &sigmaFinal, Eigen::Matrix3d &sigma_damaged); protected: diff --git a/src/MACHDYN/pair_smd_triangulated_surface.h b/src/MACHDYN/pair_smd_triangulated_surface.h index 64acae2576..0c07d81a3a 100644 --- a/src/MACHDYN/pair_smd_triangulated_surface.h +++ b/src/MACHDYN/pair_smd_triangulated_surface.h @@ -47,8 +47,8 @@ class PairTriSurf : public Pair { void init_style() override; void init_list(int, class NeighList *) override; double memory_usage() override; - void PointTriangleDistance(const Eigen::Vector3d& P, const Eigen::Vector3d& TRI1, - const Eigen::Vector3d& TRI2, const Eigen::Vector3d& TRI3, + void PointTriangleDistance(const Eigen::Vector3d &P, const Eigen::Vector3d &TRI1, + const Eigen::Vector3d &TRI2, const Eigen::Vector3d &TRI3, Eigen::Vector3d &CP, double &dist); double clamp(const double a, const double min, const double max); void *extract(const char *, int &) override; diff --git a/src/MACHDYN/pair_smd_ulsph.h b/src/MACHDYN/pair_smd_ulsph.h index 4f50367e8e..0cd6eefb83 100644 --- a/src/MACHDYN/pair_smd_ulsph.h +++ b/src/MACHDYN/pair_smd_ulsph.h @@ -53,12 +53,13 @@ class PairULSPH : public Pair { void *extract(const char *, int &) override; void PreCompute(); void PreCompute_DensitySummation(); - double effective_shear_modulus(const Eigen::Matrix3d& d_dev, const Eigen::Matrix3d& deltaStressDev, - const double dt, const int itype); + double effective_shear_modulus(const Eigen::Matrix3d &d_dev, + const Eigen::Matrix3d &deltaStressDev, const double dt, + const int itype); Eigen::Vector3d ComputeHourglassForce(const int i, const int itype, const int j, const int jtype, - const Eigen::Vector3d& dv, const Eigen::Vector3d& xij, - const Eigen::Vector3d& g, const double c_ij, + const Eigen::Vector3d &dv, const Eigen::Vector3d &xij, + const Eigen::Vector3d &g, const double c_ij, const double mu_ij, const double rho_ij); protected: diff --git a/src/MACHDYN/smd_material_models.h b/src/MACHDYN/smd_material_models.h index dd7130d77a..769b2aa375 100644 --- a/src/MACHDYN/smd_material_models.h +++ b/src/MACHDYN/smd_material_models.h @@ -44,18 +44,18 @@ void PerfectGasEOS(const double gamma, const double vol, const double mass, cons /* * Material strength models */ -void LinearStrength(const double mu, const Eigen::Matrix3d& sigmaInitial_dev, - const Eigen::Matrix3d& d_dev, const double dt, Eigen::Matrix3d &sigmaFinal_dev__, - Eigen::Matrix3d &sigma_dev_rate__); +void LinearStrength(const double mu, const Eigen::Matrix3d &sigmaInitial_dev, + const Eigen::Matrix3d &d_dev, const double dt, + Eigen::Matrix3d &sigmaFinal_dev__, Eigen::Matrix3d &sigma_dev_rate__); void LinearPlasticStrength(const double G, const double yieldStress, - const Eigen::Matrix3d& sigmaInitial_dev, const Eigen::Matrix3d& d_dev, + const Eigen::Matrix3d &sigmaInitial_dev, const Eigen::Matrix3d &d_dev, const double dt, Eigen::Matrix3d &sigmaFinal_dev__, Eigen::Matrix3d &sigma_dev_rate__, double &plastic_strain_increment); void JohnsonCookStrength(const double G, const double cp, const double espec, const double A, const double B, const double a, const double C, const double epdot0, const double T0, const double Tmelt, const double M, const double dt, const double ep, const double epdot, - const Eigen::Matrix3d& sigmaInitial_dev, const Eigen::Matrix3d& d_dev, + const Eigen::Matrix3d &sigmaInitial_dev, const Eigen::Matrix3d &d_dev, Eigen::Matrix3d &sigmaFinal_dev__, Eigen::Matrix3d &sigma_dev_rate__, double &plastic_strain_increment); @@ -63,9 +63,9 @@ void JohnsonCookStrength(const double G, const double cp, const double espec, co * Damage models */ -bool IsotropicMaxStrainDamage(const Eigen::Matrix3d& E, const double maxStrain); -bool IsotropicMaxStressDamage(const Eigen::Matrix3d& E, const double maxStrain); -double JohnsonCookFailureStrain(const double p, const Eigen::Matrix3d& Sdev, const double d1, +bool IsotropicMaxStrainDamage(const Eigen::Matrix3d &E, const double maxStrain); +bool IsotropicMaxStressDamage(const Eigen::Matrix3d &E, const double maxStrain); +double JohnsonCookFailureStrain(const double p, const Eigen::Matrix3d &Sdev, const double d1, const double d2, const double d3, const double d4, const double epdot0, const double epdot); diff --git a/src/MANIFOLD/fix_manifoldforce.cpp b/src/MANIFOLD/fix_manifoldforce.cpp index 7542205f8f..9e56b624d7 100644 --- a/src/MANIFOLD/fix_manifoldforce.cpp +++ b/src/MANIFOLD/fix_manifoldforce.cpp @@ -124,11 +124,11 @@ void FixManifoldForce::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - int nlevels_respa = (dynamic_cast( update->integrate))->nlevels; + int nlevels_respa = (dynamic_cast(update->integrate))->nlevels; for (int ilevel = 0; ilevel < nlevels_respa; ilevel++) { - (dynamic_cast( update->integrate))->copy_flevel_f(ilevel); + (dynamic_cast(update->integrate))->copy_flevel_f(ilevel); post_force_respa(vflag,ilevel,0); - (dynamic_cast( update->integrate))->copy_f_flevel(ilevel); + (dynamic_cast(update->integrate))->copy_f_flevel(ilevel); } } } diff --git a/src/MANIFOLD/manifold.h b/src/MANIFOLD/manifold.h index 5cabe459b2..ab4319fd80 100644 --- a/src/MANIFOLD/manifold.h +++ b/src/MANIFOLD/manifold.h @@ -83,7 +83,10 @@ namespace user_manifold { return largest; } - inline double dot(double *a, double *b) { return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; } + inline double dot(double *a, double *b) + { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; + } } // namespace user_manifold diff --git a/src/MANYBODY/fix_qeq_comb.cpp b/src/MANYBODY/fix_qeq_comb.cpp index cf9441da1e..23a4d49566 100644 --- a/src/MANYBODY/fix_qeq_comb.cpp +++ b/src/MANYBODY/fix_qeq_comb.cpp @@ -119,14 +119,14 @@ void FixQEQComb::init() if (!atom->q_flag) error->all(FLERR,"Fix qeq/comb requires atom attribute q"); - comb3 = dynamic_cast( force->pair_match("^comb3",0)); - if (!comb3) comb = dynamic_cast( force->pair_match("^comb",0)); + comb3 = dynamic_cast(force->pair_match("^comb3",0)); + if (!comb3) comb = dynamic_cast(force->pair_match("^comb",0)); if (comb == nullptr && comb3 == nullptr) error->all(FLERR,"Must use pair_style comb or comb3 with fix qeq/comb"); if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; + ilevel_respa = (dynamic_cast(update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -154,9 +154,9 @@ void FixQEQComb::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); + (dynamic_cast(update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); + (dynamic_cast(update->integrate))->copy_f_flevel(ilevel_respa); } firstflag = 0; } diff --git a/src/MANYBODY/pair_meam_spline.h b/src/MANYBODY/pair_meam_spline.h index 34ebb7858f..5d692b98f2 100644 --- a/src/MANYBODY/pair_meam_spline.h +++ b/src/MANYBODY/pair_meam_spline.h @@ -197,10 +197,16 @@ class PairMEAMSpline : public Pair { } /// Returns the number of bytes used by this function object. - double memory_usage() const { return sizeof(*this) + sizeof(X[0]) * N * 3; } + double memory_usage() const + { + return sizeof(*this) + sizeof(X[0]) * N * 3; + } /// Returns the cutoff radius of this function. - double cutoff() const { return X[N - 1]; } + double cutoff() const + { + return X[N - 1]; + } /// Writes a Gnuplot script that plots the spline function. void writeGnuplot(const char *filename, const char *title = nullptr) const; diff --git a/src/MANYBODY/pair_meam_sw_spline.h b/src/MANYBODY/pair_meam_sw_spline.h index 8e91ac0b2f..b2f5fd7f67 100644 --- a/src/MANYBODY/pair_meam_sw_spline.h +++ b/src/MANYBODY/pair_meam_sw_spline.h @@ -187,10 +187,16 @@ class PairMEAMSWSpline : public Pair { } /// Returns the number of bytes used by this function object. - double memory_usage() const { return sizeof(*this) + sizeof(X[0]) * N * 3; } + double memory_usage() const + { + return sizeof(*this) + sizeof(X[0]) * N * 3; + } /// Returns the cutoff radius of this function. - double cutoff() const { return X[N - 1]; } + double cutoff() const + { + return X[N - 1]; + } /// Writes a Gnuplot script that plots the spline function. void writeGnuplot(const char *filename, const char *title = nullptr) const; diff --git a/src/MANYBODY/pair_sw_angle_table.h b/src/MANYBODY/pair_sw_angle_table.h index e8ff8f82cd..04404210bd 100644 --- a/src/MANYBODY/pair_sw_angle_table.h +++ b/src/MANYBODY/pair_sw_angle_table.h @@ -55,8 +55,8 @@ class PairSWAngleTable : public PairSW { ParamTable *table_params; // tabulated parameter set for an I-J-K interaction void read_file(char *) override; - void threebody_table(Param *, Param *, ParamTable *, double, double, double *, double *, - double *, double *, int, double &); + void threebody_table(Param *, Param *, ParamTable *, double, double, double *, double *, double *, + double *, int, double &); void read_table(Table *, char *, char *); void spline_table(Table *); diff --git a/src/MC/fix_bond_break.cpp b/src/MC/fix_bond_break.cpp index 71408d8aed..7bd70e93ec 100644 --- a/src/MC/fix_bond_break.cpp +++ b/src/MC/fix_bond_break.cpp @@ -149,7 +149,7 @@ int FixBondBreak::setmask() void FixBondBreak::init() { if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = (dynamic_cast( update->integrate))->nlevels; + nlevels_respa = (dynamic_cast(update->integrate))->nlevels; // enable angle/dihedral/improper breaking if any defined diff --git a/src/MC/fix_bond_break.h b/src/MC/fix_bond_break.h index 6fdb6a3a20..630b6cac90 100644 --- a/src/MC/fix_bond_break.h +++ b/src/MC/fix_bond_break.h @@ -26,6 +26,7 @@ namespace LAMMPS_NS { class FixBondBreak : public Fix { friend class FixSRPREACT; + public: FixBondBreak(class LAMMPS *, int, char **); ~FixBondBreak() override; diff --git a/src/MC/fix_bond_create.cpp b/src/MC/fix_bond_create.cpp index 2550e881d6..6651dd9d13 100644 --- a/src/MC/fix_bond_create.cpp +++ b/src/MC/fix_bond_create.cpp @@ -235,7 +235,7 @@ int FixBondCreate::setmask() void FixBondCreate::init() { if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = (dynamic_cast( update->integrate))->nlevels; + nlevels_respa = (dynamic_cast(update->integrate))->nlevels; // check cutoff for iatomtype,jatomtype diff --git a/src/MC/fix_bond_create.h b/src/MC/fix_bond_create.h index 469394af32..9fc77cc427 100644 --- a/src/MC/fix_bond_create.h +++ b/src/MC/fix_bond_create.h @@ -26,6 +26,7 @@ namespace LAMMPS_NS { class FixBondCreate : public Fix { friend class FixSRPREACT; + public: FixBondCreate(class LAMMPS *, int, char **); ~FixBondCreate() override; diff --git a/src/MC/fix_gcmc.cpp b/src/MC/fix_gcmc.cpp index 0cc6590d5a..ef1ad324b0 100644 --- a/src/MC/fix_gcmc.cpp +++ b/src/MC/fix_gcmc.cpp @@ -2573,3 +2573,17 @@ void FixGCMC::grow_molecule_arrays(int nmolatoms) { molq = memory->grow(molq,nmaxmolatoms,"gcmc:molq"); molimage = memory->grow(molimage,nmaxmolatoms,"gcmc:molimage"); } + + +/* ---------------------------------------------------------------------- + extract variable which stores index of exclusion group +------------------------------------------------------------------------- */ + +void *FixGCMC::extract(const char *name, int &dim) +{ + if (strcmp(name,"exclusion_group") == 0) { + dim = 0; + return (void *) &exclusion_group; + } + return nullptr; +} diff --git a/src/MC/fix_gcmc.h b/src/MC/fix_gcmc.h index d945b82346..2bdd9eb461 100644 --- a/src/MC/fix_gcmc.h +++ b/src/MC/fix_gcmc.h @@ -31,32 +31,11 @@ class FixGCMC : public Fix { int setmask() override; void init() override; void pre_exchange() override; - void attempt_atomic_translation(); - void attempt_atomic_deletion(); - void attempt_atomic_insertion(); - void attempt_molecule_translation(); - void attempt_molecule_rotation(); - void attempt_molecule_deletion(); - void attempt_molecule_insertion(); - void attempt_atomic_translation_full(); - void attempt_atomic_deletion_full(); - void attempt_atomic_insertion_full(); - void attempt_molecule_translation_full(); - void attempt_molecule_rotation_full(); - void attempt_molecule_deletion_full(); - void attempt_molecule_insertion_full(); - double energy(int, int, tagint, double *); - double molecule_energy(tagint); - double energy_full(); - int pick_random_gas_atom(); - tagint pick_random_gas_molecule(); - void toggle_intramolecular(int); - void update_gas_atoms_list(); double compute_vector(int) override; double memory_usage() override; void write_restart(FILE *) override; void restart(char *) override; - void grow_molecule_arrays(int); + void *extract(const char *, int &); private: int molecule_group, molecule_group_bit; @@ -139,7 +118,35 @@ class FixGCMC : public Fix { class Compute *c_pe; + // private methods + void options(int, char **); + + void attempt_atomic_translation(); + void attempt_atomic_deletion(); + void attempt_atomic_insertion(); + void attempt_molecule_translation(); + void attempt_molecule_rotation(); + void attempt_molecule_deletion(); + void attempt_molecule_insertion(); + void attempt_atomic_translation_full(); + void attempt_atomic_deletion_full(); + void attempt_atomic_insertion_full(); + void attempt_molecule_translation_full(); + void attempt_molecule_rotation_full(); + void attempt_molecule_deletion_full(); + void attempt_molecule_insertion_full(); + + double energy(int, int, tagint, double *); + double energy_full(); + double molecule_energy(tagint); + + int pick_random_gas_atom(); + tagint pick_random_gas_molecule(); + void toggle_intramolecular(int); + void update_gas_atoms_list(); + + void grow_molecule_arrays(int); }; } // namespace LAMMPS_NS diff --git a/src/MESONT/pair_mesocnt_viscous.h b/src/MESONT/pair_mesocnt_viscous.h index 84a2391031..611e67602a 100644 --- a/src/MESONT/pair_mesocnt_viscous.h +++ b/src/MESONT/pair_mesocnt_viscous.h @@ -21,7 +21,6 @@ PairStyle(mesocnt/viscous, PairMesoCNTViscous); // clang-format on #else - #ifndef LMP_PAIR_MESOCNT_VISCOUS_H #define LMP_PAIR_MESOCNT_VISCOUS_H diff --git a/src/MISC/fix_imd.cpp b/src/MISC/fix_imd.cpp index 33a7aa5d2b..4a4a077cb4 100644 --- a/src/MISC/fix_imd.cpp +++ b/src/MISC/fix_imd.cpp @@ -590,7 +590,7 @@ int FixIMD::setmask() void FixIMD::init() { if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = (dynamic_cast( update->integrate))->nlevels; + nlevels_respa = (dynamic_cast(update->integrate))->nlevels; } /* ---------------------------------------------------------------------- */ diff --git a/src/MISC/fix_srp.cpp b/src/MISC/fix_srp.cpp index f4f9abc629..e82e98448f 100644 --- a/src/MISC/fix_srp.cpp +++ b/src/MISC/fix_srp.cpp @@ -116,7 +116,7 @@ void FixSRP::init() // because this fix's pre_exchange() creates per-atom data structure // that data must be current for atom migration to carry it along - for (auto ifix : modify->get_fix_list()) { + for (auto &ifix : modify->get_fix_list()) { if (ifix == this) break; if (ifix->pre_exchange_migrate) error->all(FLERR,"Fix {} comes after a fix which migrates atoms in pre_exchange", style); diff --git a/src/MISC/pair_srp_react.cpp b/src/MISC/pair_srp_react.cpp index 25975c7fb0..4a3f260fe0 100644 --- a/src/MISC/pair_srp_react.cpp +++ b/src/MISC/pair_srp_react.cpp @@ -72,7 +72,7 @@ PairSRPREACT::PairSRPREACT(LAMMPS *lmp) : // pair srp/react has its own fix, hence delete fix srp instance // created in the constructor of pair srp - for (auto ifix : modify->get_fix_by_style("SRP")) + for (auto &ifix : modify->get_fix_by_style("SRP")) modify->delete_fix(ifix->id); // similar to fix SRP, create fix SRP REACT instance here with unique fix id diff --git a/src/ML-IAP/mliap_descriptor_snap.h b/src/ML-IAP/mliap_descriptor_snap.h index b49ff6d2cc..2939252629 100644 --- a/src/ML-IAP/mliap_descriptor_snap.h +++ b/src/ML-IAP/mliap_descriptor_snap.h @@ -42,8 +42,8 @@ class MLIAPDescriptorSNAP : public MLIAPDescriptor { int switchinnerflag; double rfac0, rmin0; - double* sinnerelem; - double* dinnerelem; + double *sinnerelem; + double *dinnerelem; }; } // namespace LAMMPS_NS diff --git a/src/ML-IAP/mliap_model_python.cpp b/src/ML-IAP/mliap_model_python.cpp index acbf2ed92d..50347cd4f5 100644 --- a/src/ML-IAP/mliap_model_python.cpp +++ b/src/ML-IAP/mliap_model_python.cpp @@ -19,6 +19,7 @@ #include "mliap_model_python.h" +#include "comm.h" #include "error.h" #include "lmppython.h" #include "mliap_data.h" @@ -26,7 +27,6 @@ #include "pair_mliap.h" #include "python_compat.h" #include "utils.h" -#include "comm.h" #include diff --git a/src/ML-RANN/rann_activation.h b/src/ML-RANN/rann_activation.h index ce2074acda..e35056efa6 100644 --- a/src/ML-RANN/rann_activation.h +++ b/src/ML-RANN/rann_activation.h @@ -53,11 +53,20 @@ namespace RANN { Activation::~Activation() {} //default is linear activation (no change). - double Activation::activation_function(double A) { return A; } + double Activation::activation_function(double A) + { + return A; + } - double Activation::dactivation_function(double) { return 1.0; } + double Activation::dactivation_function(double) + { + return 1.0; + } - double Activation::ddactivation_function(double) { return 0.0; } + double Activation::ddactivation_function(double) + { + return 0.0; + } } // namespace RANN } // namespace LAMMPS_NS diff --git a/src/ML-RANN/rann_activation_linear.h b/src/ML-RANN/rann_activation_linear.h index 8f0d65f35c..5fd30e086c 100644 --- a/src/ML-RANN/rann_activation_linear.h +++ b/src/ML-RANN/rann_activation_linear.h @@ -49,11 +49,20 @@ namespace RANN { style = "linear"; } - double Activation_linear::activation_function(double A) { return A; } + double Activation_linear::activation_function(double A) + { + return A; + } - double Activation_linear::dactivation_function(double) { return 1.0; } + double Activation_linear::dactivation_function(double) + { + return 1.0; + } - double Activation_linear::ddactivation_function(double) { return 0.0; } + double Activation_linear::ddactivation_function(double) + { + return 0.0; + } } // namespace RANN } // namespace LAMMPS_NS diff --git a/src/ML-SNAP/compute_sna_grid_local.cpp b/src/ML-SNAP/compute_sna_grid_local.cpp index 76fe03a03b..4970584a12 100644 --- a/src/ML-SNAP/compute_sna_grid_local.cpp +++ b/src/ML-SNAP/compute_sna_grid_local.cpp @@ -227,7 +227,7 @@ void ComputeSNAGridLocal::compute_local() const double ztmp = xgrid[2]; // currently, all grid points are type 1 - // not clear what a better choice would be + // not clear what a better choice would be const int itype = 1; int ielem = 0; diff --git a/src/ML-SNAP/pair_snap.h b/src/ML-SNAP/pair_snap.h index fc7c41a6ce..60de13f268 100644 --- a/src/ML-SNAP/pair_snap.h +++ b/src/ML-SNAP/pair_snap.h @@ -62,7 +62,7 @@ class PairSNAP : public Pair { int switchinnerflag; // inner cutoff switch double *sinnerelem; // element inner cutoff midpoint double *dinnerelem; // element inner cutoff half-width - int chunksize,parallel_thresh; + int chunksize, parallel_thresh; double rfac0, rmin0, wj1, wj2; int rcutfacflag, twojmaxflag; // flags for required parameters int beta_max; // length of beta diff --git a/src/ML-SNAP/sna.h b/src/ML-SNAP/sna.h index d35d7bd4fd..0ba749028e 100644 --- a/src/ML-SNAP/sna.h +++ b/src/ML-SNAP/sna.h @@ -77,8 +77,8 @@ class SNA : protected Pointers { // only allocated for switch_inner_flag=1 - double *sinnerij; // short inner cutoff midpoint list - double *dinnerij; // short inner half-width list + double *sinnerij; // short inner cutoff midpoint list + double *dinnerij; // short inner half-width list // only allocated for chem_flag=1 diff --git a/src/MOLECULE/fix_cmap.cpp b/src/MOLECULE/fix_cmap.cpp index b384294a89..a0137ab40c 100644 --- a/src/MOLECULE/fix_cmap.cpp +++ b/src/MOLECULE/fix_cmap.cpp @@ -189,7 +189,7 @@ void FixCMAP::init() newton_bond = force->newton_bond; if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; + ilevel_respa = (dynamic_cast(update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } } @@ -203,9 +203,9 @@ void FixCMAP::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); + (dynamic_cast(update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); + (dynamic_cast(update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/OPENMP/fix_nh_asphere_omp.cpp b/src/OPENMP/fix_nh_asphere_omp.cpp index 554a0d52b6..4b93706f32 100644 --- a/src/OPENMP/fix_nh_asphere_omp.cpp +++ b/src/OPENMP/fix_nh_asphere_omp.cpp @@ -43,7 +43,7 @@ FixNHAsphereOMP::FixNHAsphereOMP(LAMMPS *lmp, int narg, char **arg) : void FixNHAsphereOMP::init() { - avec = dynamic_cast( atom->style_match("ellipsoid")); + avec = dynamic_cast(atom->style_match("ellipsoid")); if (!avec) error->all(FLERR,"Compute nvt/nph/npt asphere requires atom style ellipsoid"); diff --git a/src/OPENMP/fix_nvt_sllod_omp.cpp b/src/OPENMP/fix_nvt_sllod_omp.cpp index c9ee6c153f..866592728d 100644 --- a/src/OPENMP/fix_nvt_sllod_omp.cpp +++ b/src/OPENMP/fix_nvt_sllod_omp.cpp @@ -78,7 +78,7 @@ void FixNVTSllodOMP::init() int i; for (i = 0; i < modify->nfix; i++) if (utils::strmatch(modify->fix[i]->style,"^deform")) { - if ((dynamic_cast( modify->fix[i]))->remapflag != Domain::V_REMAP) + if ((dynamic_cast(modify->fix[i]))->remapflag != Domain::V_REMAP) error->all(FLERR,"Using fix nvt/sllod/omp with inconsistent fix " "deform remap option"); break; diff --git a/src/OPENMP/pair_lj_cut_coul_cut_dielectric_omp.cpp b/src/OPENMP/pair_lj_cut_coul_cut_dielectric_omp.cpp index b979ade28f..159dd27f41 100644 --- a/src/OPENMP/pair_lj_cut_coul_cut_dielectric_omp.cpp +++ b/src/OPENMP/pair_lj_cut_coul_cut_dielectric_omp.cpp @@ -116,7 +116,6 @@ void PairLJCutCoulCutDielectricOMP::eval(int iifrom, int iito, ThrData *const th const double *_noalias const curvature = atom->curvature; const double *_noalias const area = atom->area; const int *_noalias const type = atom->type; - const int nlocal = atom->nlocal; const double *_noalias const special_coul = force->special_coul; const double *_noalias const special_lj = force->special_lj; const double qqrd2e = force->qqrd2e; diff --git a/src/OPENMP/pair_lj_cut_coul_debye_dielectric_omp.cpp b/src/OPENMP/pair_lj_cut_coul_debye_dielectric_omp.cpp index ddcf364c60..113536408d 100644 --- a/src/OPENMP/pair_lj_cut_coul_debye_dielectric_omp.cpp +++ b/src/OPENMP/pair_lj_cut_coul_debye_dielectric_omp.cpp @@ -116,7 +116,6 @@ void PairLJCutCoulDebyeDielectricOMP::eval(int iifrom, int iito, ThrData *const const double *_noalias const curvature = atom->curvature; const double *_noalias const area = atom->area; const int *_noalias const type = atom->type; - const int nlocal = atom->nlocal; const double *_noalias const special_coul = force->special_coul; const double *_noalias const special_lj = force->special_lj; const double qqrd2e = force->qqrd2e; diff --git a/src/OPENMP/pair_reaxff_omp.cpp b/src/OPENMP/pair_reaxff_omp.cpp index 7112681b06..c860514f6e 100644 --- a/src/OPENMP/pair_reaxff_omp.cpp +++ b/src/OPENMP/pair_reaxff_omp.cpp @@ -136,7 +136,7 @@ void PairReaxFFOMP::init_style() "increased neighbor list skin."); if (fix_reaxff == nullptr) - fix_reaxff = dynamic_cast( modify->add_fix(fmt::format("{} all REAXFF",fix_id))); + fix_reaxff = dynamic_cast(modify->add_fix(fmt::format("{} all REAXFF",fix_id))); api->control->nthreads = comm->nthreads; } diff --git a/src/ORIENT/fix_orient_bcc.cpp b/src/ORIENT/fix_orient_bcc.cpp index c8979794e8..a97123a33d 100644 --- a/src/ORIENT/fix_orient_bcc.cpp +++ b/src/ORIENT/fix_orient_bcc.cpp @@ -202,7 +202,7 @@ int FixOrientBCC::setmask() void FixOrientBCC::init() { if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; + ilevel_respa = (dynamic_cast(update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -225,9 +225,9 @@ void FixOrientBCC::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); + (dynamic_cast(update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); + (dynamic_cast(update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/ORIENT/fix_orient_eco.cpp b/src/ORIENT/fix_orient_eco.cpp index 5f725a9e06..b34ce8e33a 100644 --- a/src/ORIENT/fix_orient_eco.cpp +++ b/src/ORIENT/fix_orient_eco.cpp @@ -176,7 +176,7 @@ void FixOrientECO::init() { MPI_Bcast(&inv_norm_fac, 1, MPI_DOUBLE, 0, world); if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = (dynamic_cast( update->integrate))->nlevels - 1; + ilevel_respa = (dynamic_cast(update->integrate))->nlevels - 1; if (respa_level >= 0) ilevel_respa = MIN(respa_level, ilevel_respa); } @@ -197,9 +197,9 @@ void FixOrientECO::setup(int vflag) { if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); + (dynamic_cast(update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa, 0); - (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); + (dynamic_cast(update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/ORIENT/fix_orient_fcc.cpp b/src/ORIENT/fix_orient_fcc.cpp index 069d4b58fc..57a6e5ffd8 100644 --- a/src/ORIENT/fix_orient_fcc.cpp +++ b/src/ORIENT/fix_orient_fcc.cpp @@ -199,7 +199,7 @@ int FixOrientFCC::setmask() void FixOrientFCC::init() { if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; + ilevel_respa = (dynamic_cast(update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -222,9 +222,9 @@ void FixOrientFCC::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); + (dynamic_cast(update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); + (dynamic_cast(update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/PLUGIN/plugin.cpp b/src/PLUGIN/plugin.cpp index 5451cd31e2..1ca241d20a 100644 --- a/src/PLUGIN/plugin.cpp +++ b/src/PLUGIN/plugin.cpp @@ -369,7 +369,7 @@ void plugin_unload(const char *style, const char *name, LAMMPS *lmp) // must delete all compute instances using this compute style - for (auto icompute : lmp->modify->get_compute_by_style(name)) + for (auto &icompute : lmp->modify->get_compute_by_style(name)) lmp->modify->delete_compute(icompute->id); } else if (pstyle == "fix") { @@ -380,7 +380,7 @@ void plugin_unload(const char *style, const char *name, LAMMPS *lmp) // must delete all fix instances using this fix style - for (auto ifix : lmp->modify->get_fix_by_style(name)) lmp->modify->delete_fix(ifix->id); + for (auto &ifix : lmp->modify->get_fix_by_style(name)) lmp->modify->delete_fix(ifix->id); } else if (pstyle == "region") { @@ -388,7 +388,8 @@ void plugin_unload(const char *style, const char *name, LAMMPS *lmp) auto found = region_map->find(name); if (found != region_map->end()) region_map->erase(name); - for (auto iregion : lmp->domain->get_region_by_style(name)) lmp->domain->delete_region(iregion); + for (auto &iregion : lmp->domain->get_region_by_style(name)) + lmp->domain->delete_region(iregion); } else if (pstyle == "command") { diff --git a/src/POEMS/fix_poems.cpp b/src/POEMS/fix_poems.cpp index b2b0366b9e..312208f4d9 100644 --- a/src/POEMS/fix_poems.cpp +++ b/src/POEMS/fix_poems.cpp @@ -354,7 +354,7 @@ void FixPOEMS::init() if (earlyflag) { bool pflag = false; - for (auto ifix : modify->get_fix_list()) { + for (auto &ifix : modify->get_fix_list()) { if (utils::strmatch(ifix->style, "^poems")) pflag = true; if (pflag && (ifix->setmask() & POST_FORCE) && !ifix->rigid_flag) if (comm->me == 0) @@ -365,7 +365,7 @@ void FixPOEMS::init() // error if npt,nph fix comes before rigid fix bool pflag = false; - for (auto ifix : modify->get_fix_list()) { + for (auto &ifix : modify->get_fix_list()) { if (!pflag && utils::strmatch(ifix->style, "np[th]")) error->all(FLERR, "POEMS fix must come before NPT/NPH fix"); if (utils::strmatch(ifix->style, "^poems")) pflag = true; diff --git a/src/QEQ/fix_qeq.cpp b/src/QEQ/fix_qeq.cpp index b586ecb9d9..aec84947a1 100644 --- a/src/QEQ/fix_qeq.cpp +++ b/src/QEQ/fix_qeq.cpp @@ -308,7 +308,7 @@ void FixQEq::init() error->warning(FLERR,"Fix efield is ignored during charge equilibration"); if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = (dynamic_cast( update->integrate))->nlevels; + nlevels_respa = (dynamic_cast(update->integrate))->nlevels; // compute net charge and print warning if too large diff --git a/src/QEQ/fix_qeq_fire.cpp b/src/QEQ/fix_qeq_fire.cpp index d4dc68ace2..429fcc79d6 100644 --- a/src/QEQ/fix_qeq_fire.cpp +++ b/src/QEQ/fix_qeq_fire.cpp @@ -81,8 +81,8 @@ void FixQEqFire::init() if (comm->me == 0) error->warning(FLERR,"Fix qeq/fire tolerance may be too small for damped fires"); - comb3 = dynamic_cast( force->pair_match("^comb3",0)); - if (!comb3) comb = dynamic_cast( force->pair_match("^comb",0)); + comb3 = dynamic_cast(force->pair_match("^comb3",0)); + if (!comb3) comb = dynamic_cast(force->pair_match("^comb",0)); } /* ---------------------------------------------------------------------- */ diff --git a/src/QTB/fix_qtb.cpp b/src/QTB/fix_qtb.cpp index f9faf2475c..217e386953 100644 --- a/src/QTB/fix_qtb.cpp +++ b/src/QTB/fix_qtb.cpp @@ -218,7 +218,7 @@ void FixQTB::init() // respa if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = (dynamic_cast( update->integrate))->nlevels; + nlevels_respa = (dynamic_cast(update->integrate))->nlevels; } /* ---------------------------------------------------------------------- @@ -229,9 +229,9 @@ void FixQTB::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - (dynamic_cast( update->integrate))->copy_flevel_f(nlevels_respa-1); + (dynamic_cast(update->integrate))->copy_flevel_f(nlevels_respa-1); post_force_respa(vflag,nlevels_respa-1,0); - (dynamic_cast( update->integrate))->copy_f_flevel(nlevels_respa-1); + (dynamic_cast(update->integrate))->copy_f_flevel(nlevels_respa-1); } } diff --git a/src/REACTION/fix_bond_react.cpp b/src/REACTION/fix_bond_react.cpp index 60bd6fa82d..a76d11630c 100644 --- a/src/REACTION/fix_bond_react.cpp +++ b/src/REACTION/fix_bond_react.cpp @@ -794,7 +794,7 @@ void FixBondReact::init() { if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = (dynamic_cast( update->integrate))->nlevels; + nlevels_respa = (dynamic_cast(update->integrate))->nlevels; // check cutoff for iatomtype,jatomtype for (int i = 0; i < nreacts; i++) { diff --git a/src/REAXFF/compute_spec_atom.cpp b/src/REAXFF/compute_spec_atom.cpp index 1df4ae559b..117ee0c862 100644 --- a/src/REAXFF/compute_spec_atom.cpp +++ b/src/REAXFF/compute_spec_atom.cpp @@ -40,7 +40,7 @@ ComputeSpecAtom::ComputeSpecAtom(LAMMPS *lmp, int narg, char **arg) : else size_peratom_cols = nvalues; // get reference to ReaxFF pair style - reaxff = dynamic_cast( force->pair_match("^reax..",0)); + reaxff = dynamic_cast(force->pair_match("^reax..",0)); pack_choice = new FnPtrPack[nvalues]; diff --git a/src/REAXFF/fix_qeq_reaxff.cpp b/src/REAXFF/fix_qeq_reaxff.cpp index 6c03683518..f0d58ae120 100644 --- a/src/REAXFF/fix_qeq_reaxff.cpp +++ b/src/REAXFF/fix_qeq_reaxff.cpp @@ -141,7 +141,7 @@ FixQEqReaxFF::FixQEqReaxFF(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based arrays // register with Atom class - reaxff = dynamic_cast( force->pair_match("^reax..",0)); + reaxff = dynamic_cast(force->pair_match("^reax..",0)); s_hist = t_hist = nullptr; atom->add_callback(Atom::GROW); @@ -395,7 +395,7 @@ void FixQEqReaxFF::init() efield = nullptr; auto fixes = modify->get_fix_by_style("^efield"); - if (fixes.size() == 1) efield = dynamic_cast( fixes.front()); + if (fixes.size() == 1) efield = dynamic_cast(fixes.front()); else if (fixes.size() > 1) error->all(FLERR, "There may be only one fix efield instance used with fix {}", style); @@ -423,7 +423,7 @@ void FixQEqReaxFF::init() init_taper(); if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = (dynamic_cast( update->integrate))->nlevels; + nlevels_respa = (dynamic_cast(update->integrate))->nlevels; } /* ---------------------------------------------------------------------- */ diff --git a/src/REAXFF/fix_reaxff_bonds.cpp b/src/REAXFF/fix_reaxff_bonds.cpp index 4b96cb21a1..3eba1e205d 100644 --- a/src/REAXFF/fix_reaxff_bonds.cpp +++ b/src/REAXFF/fix_reaxff_bonds.cpp @@ -101,7 +101,7 @@ void FixReaxFFBonds::setup(int /*vflag*/) void FixReaxFFBonds::init() { - reaxff = dynamic_cast( force->pair_match("^reax..",0)); + reaxff = dynamic_cast(force->pair_match("^reax..",0)); if (reaxff == nullptr) error->all(FLERR,"Cannot use fix reaxff/bonds without " "pair_style reaxff, reaxff/kk, or reaxff/omp"); } diff --git a/src/REAXFF/fix_reaxff_species.cpp b/src/REAXFF/fix_reaxff_species.cpp index f38b6fb1c5..7307621a83 100644 --- a/src/REAXFF/fix_reaxff_species.cpp +++ b/src/REAXFF/fix_reaxff_species.cpp @@ -189,43 +189,43 @@ FixReaxFFSpecies::FixReaxFFSpecies(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, iarg += ntypes + 1; // delete species - } else if (strcmp(arg[iarg],"delete") == 0) { + } else if (strcmp(arg[iarg], "delete") == 0) { delflag = 1; delete[] filedel; - filedel = utils::strdup(arg[iarg+1]); + filedel = utils::strdup(arg[iarg + 1]); if (me == 0) { fdel = fopen(filedel, "w"); - if (!fdel) error->one(FLERR,"Cannot open fix reaxff/species delete file {}: {}", - filedel, utils::getsyserror()); + if (!fdel) + error->one(FLERR, "Cannot open fix reaxff/species delete file {}: {}", filedel, + utils::getsyserror()); } del_opened = 1; - if (strcmp(arg[iarg+2],"masslimit") == 0) { - if (iarg+5 > narg) error->all(FLERR,"Illegal fix reaxff/species command"); + if (strcmp(arg[iarg + 2], "masslimit") == 0) { + if (iarg + 5 > narg) error->all(FLERR, "Illegal fix reaxff/species command"); masslimitflag = 1; - massmin = atof(arg[iarg+3]); - massmax = atof(arg[iarg+4]); + massmin = atof(arg[iarg + 3]); + massmax = atof(arg[iarg + 4]); iarg += 5; - } else if (strcmp(arg[iarg+2],"specieslist") == 0) { + } else if (strcmp(arg[iarg + 2], "specieslist") == 0) { specieslistflag = 1; - ndelspec = atoi(arg[iarg+3]); - if (iarg+ndelspec+4 > narg) error->all(FLERR,"Illegal fix reaxff/species command"); + ndelspec = atoi(arg[iarg + 3]); + if (iarg + ndelspec + 4 > narg) error->all(FLERR, "Illegal fix reaxff/species command"); del_species.resize(ndelspec); - for (int i = 0; i < ndelspec; i ++) - del_species[i] = arg[iarg+4+i]; + for (int i = 0; i < ndelspec; i++) del_species[i] = arg[iarg + 4 + i]; if (me == 0) { - fprintf(fdel,"Timestep"); - for (i = 0; i < ndelspec; i++) - fprintf(fdel,"\t%s",del_species[i].c_str()); - fprintf(fdel,"\n"); + fprintf(fdel, "Timestep"); + for (i = 0; i < ndelspec; i++) fprintf(fdel, "\t%s", del_species[i].c_str()); + fprintf(fdel, "\n"); fflush(fdel); } iarg += ndelspec + 4; - } else error->all(FLERR, "Illegal fix reaxff/species command"); + } else + error->all(FLERR, "Illegal fix reaxff/species command"); // position of molecules } else if (strcmp(arg[iarg], "position") == 0) { @@ -524,17 +524,19 @@ void FixReaxFFSpecies::SortMolecule(int &Nmole) MPI_Allreduce(&lo, &idlo, 1, MPI_INT, MPI_MIN, world); MPI_Allreduce(&hi, &idhi, 1, MPI_INT, MPI_MAX, world); int nlen = idhi - idlo + 1; - if (nlen <= 0) { // no atoms in group + if (nlen <= 0) { // no atoms in group Nmole = 0; return; } if (idlo == ntotal) if (me == 0) - error->warning(FLERR, "Atom with cluster ID = maxmol included in fix reaxff/species group {}",group->names[igroup]); + error->warning(FLERR, "Atom with cluster ID = maxmol included in fix reaxff/species group {}", + group->names[igroup]); MPI_Allreduce(&flag, &flagall, 1, MPI_INT, MPI_SUM, world); if (flagall && me == 0) - error->warning(FLERR, "Atom with cluster ID = 0 included in fix reaxff/species group {}", group->names[igroup]); + error->warning(FLERR, "Atom with cluster ID = 0 included in fix reaxff/species group {}", + group->names[igroup]); memory->create(molmap, nlen, "reaxff/species:molmap"); for (n = 0; n < nlen; n++) molmap[n] = 0; @@ -628,13 +630,13 @@ void FixReaxFFSpecies::FindSpecies(int Nmole, int &Nspec) if (MolName[ntypes * k + l] != Name[l]) flag_spec = 1; if (flag_spec == 0) { NMol[k]++; - Mol2Spec[m-1] = k; + Mol2Spec[m - 1] = k; } flag_identity *= flag_spec; } if (Nspec == 0 || flag_identity == 1) { for (l = 0; l < ntypes; l++) MolName[ntypes * Nspec + l] = Name[l]; - Mol2Spec[m-1] = Nspec; + Mol2Spec[m - 1] = Nspec; Nspec++; } } @@ -844,8 +846,10 @@ void FixReaxFFSpecies::DeleteSpecies(int Nmole, int Nspec) memory->create(Nameall, ntypes, "reaxff/species:Nameall"); int ndelcomm; - if (masslimitflag) ndelcomm = Nspec; - else ndelcomm = ndelspec; + if (masslimitflag) + ndelcomm = Nspec; + else + ndelcomm = ndelspec; double *deletecount; memory->create(deletecount, ndelcomm, "reaxff/species:deletecount"); @@ -863,7 +867,7 @@ void FixReaxFFSpecies::DeleteSpecies(int Nmole, int Nspec) if (!(mask[i] & groupbit)) continue; cid = nint(clusterID[i]); if (cid == m) { - itype = atom->type[i]-1; + itype = atom->type[i] - 1; Name[itype]++; count++; marklist[nmarklist++] = i; @@ -877,14 +881,16 @@ void FixReaxFFSpecies::DeleteSpecies(int Nmole, int Nspec) MPI_Allreduce(Name, Nameall, ntypes, MPI_INT, MPI_SUM, world); for (n = 0; n < ntypes; n++) Name[n] = Nameall[n]; - MPI_Allreduce(&localmass, &totalmass, 1 , MPI_DOUBLE, MPI_SUM, world); + MPI_Allreduce(&localmass, &totalmass, 1, MPI_DOUBLE, MPI_SUM, world); species_str = ""; for (j = 0; j < ntypes; j++) { if (Name[j] != 0) { - if (eletype) species_str += eletype[j]; - else species_str += ele[j]; - if (Name[j] != 1) species_str += fmt::format("{}",Name[j]); + if (eletype) + species_str += eletype[j]; + else + species_str += ele[j]; + if (Name[j] != 1) species_str += fmt::format("{}", Name[j]); } } @@ -895,7 +901,7 @@ void FixReaxFFSpecies::DeleteSpecies(int Nmole, int Nspec) if (totalmass > massmin && totalmass < massmax) { for (j = 0; j < nmarklist; j++) { mark[marklist[j]] = 1; - deletecount[Mol2Spec[m-1]] += 1.0 / (double) count; + deletecount[Mol2Spec[m - 1]] += 1.0 / (double) count; } } } else { @@ -916,9 +922,9 @@ void FixReaxFFSpecies::DeleteSpecies(int Nmole, int Nspec) // delete atoms. loop in reverse order to avoid copying marked atoms ndel = ndelone = 0; - for (i = atom->nlocal-1; i >= 0; i--) { + for (i = atom->nlocal - 1; i >= 0; i--) { if (mark[i] == 1) { - avec->copy(atom->nlocal-1,i,1); + avec->copy(atom->nlocal - 1, i, 1); atom->nlocal--; ndelone++; } @@ -928,8 +934,10 @@ void FixReaxFFSpecies::DeleteSpecies(int Nmole, int Nspec) atom->natoms -= ndel; - if (me == 0) MPI_Reduce(MPI_IN_PLACE, deletecount, ndelcomm, MPI_DOUBLE, MPI_SUM, 0, world); - else MPI_Reduce(deletecount, deletecount, ndelcomm, MPI_DOUBLE, MPI_SUM, 0, world); + if (me == 0) + MPI_Reduce(MPI_IN_PLACE, deletecount, ndelcomm, MPI_DOUBLE, MPI_SUM, 0, world); + else + MPI_Reduce(deletecount, deletecount, ndelcomm, MPI_DOUBLE, MPI_SUM, 0, world); if (me == 0) { if (masslimitflag) { @@ -941,11 +949,13 @@ void FixReaxFFSpecies::DeleteSpecies(int Nmole, int Nspec) printflag = 1; } fprintf(fdel, " %g ", deletecount[m]); - for (j = 0; j < ntypes; j ++) { + for (j = 0; j < ntypes; j++) { int itemp = MolName[ntypes * m + j]; if (itemp != 0) { - if (eletype) fprintf(fdel, "%s", eletype[j]); - else fprintf(fdel, "%c", ele[j]); + if (eletype) + fprintf(fdel, "%s", eletype[j]); + else + fprintf(fdel, "%c", ele[j]); if (itemp != 1) fprintf(fdel, "%d", itemp); } } @@ -962,9 +972,7 @@ void FixReaxFFSpecies::DeleteSpecies(int Nmole, int Nspec) if (writeflag) { fmt::print(fdel, "{}", update->ntimestep); - for (i = 0; i < ndelspec; i++) { - fprintf(fdel, "\t%g", deletecount[i]); - } + for (i = 0; i < ndelspec; i++) { fprintf(fdel, "\t%g", deletecount[i]); } fprintf(fdel, "\n"); fflush(fdel); } diff --git a/src/REAXFF/pair_reaxff.cpp b/src/REAXFF/pair_reaxff.cpp index b08a167431..f3ab23bf06 100644 --- a/src/REAXFF/pair_reaxff.cpp +++ b/src/REAXFF/pair_reaxff.cpp @@ -374,7 +374,7 @@ void PairReaxFF::init_style() "increased neighbor list skin."); if (fix_reaxff == nullptr) - fix_reaxff = dynamic_cast( modify->add_fix(fmt::format("{} all REAXFF",fix_id))); + fix_reaxff = dynamic_cast(modify->add_fix(fmt::format("{} all REAXFF",fix_id))); } /* ---------------------------------------------------------------------- */ @@ -468,7 +468,7 @@ void PairReaxFF::compute(int eflag, int vflag) if (api->system->acks2_flag) { auto ifix = modify->get_fix_by_style("^acks2/reax").front(); - api->workspace->s = (dynamic_cast( ifix))->get_s(); + api->workspace->s = (dynamic_cast(ifix))->get_s(); } // setup data structures diff --git a/src/REPLICA/compute_event_displace.cpp b/src/REPLICA/compute_event_displace.cpp index 6a8791de71..7d08955803 100644 --- a/src/REPLICA/compute_event_displace.cpp +++ b/src/REPLICA/compute_event_displace.cpp @@ -69,7 +69,7 @@ void ComputeEventDisplace::init() int ifix = modify->find_fix(id_event); if (ifix < 0) error->all(FLERR, "Could not find compute event/displace fix ID"); - fix_event = dynamic_cast( modify->fix[ifix]); + fix_event = dynamic_cast(modify->fix[ifix]); if (strcmp(fix_event->style,"EVENT/PRD") != 0 && strcmp(fix_event->style,"EVENT/TAD") != 0 && diff --git a/src/REPLICA/hyper.cpp b/src/REPLICA/hyper.cpp index f13711f213..7b402a1729 100644 --- a/src/REPLICA/hyper.cpp +++ b/src/REPLICA/hyper.cpp @@ -86,7 +86,7 @@ void Hyper::command(int narg, char **arg) } else { int ifix = modify->find_fix(id_fix); if (ifix < 0) error->all(FLERR,"Could not find fix ID for hyper"); - fix_hyper = dynamic_cast( modify->fix[ifix]); + fix_hyper = dynamic_cast(modify->fix[ifix]); int dim; int *hyperflag = (int *) fix_hyper->extract("hyperflag",dim); if (hyperflag == nullptr || *hyperflag == 0) @@ -98,7 +98,7 @@ void Hyper::command(int narg, char **arg) // create FixEventHyper class to store event and pre-quench states - fix_event = dynamic_cast( modify->add_fix("hyper_event all EVENT/HYPER")); + fix_event = dynamic_cast(modify->add_fix("hyper_event all EVENT/HYPER")); // create Finish for timing output @@ -109,7 +109,7 @@ void Hyper::command(int narg, char **arg) int icompute = modify->find_compute(id_compute); if (icompute < 0) error->all(FLERR,"Could not find compute ID for hyper"); - compute_event = dynamic_cast( modify->compute[icompute]); + compute_event = dynamic_cast(modify->compute[icompute]); compute_event->reset_extra_compute_fix("hyper_event"); // reset reneighboring criteria since will perform minimizations @@ -152,10 +152,10 @@ void Hyper::command(int narg, char **arg) // cannot use hyper with time-dependent fixes or regions - for (auto ifix : modify->get_fix_list()) + for (auto &ifix : modify->get_fix_list()) if (ifix->time_depend) error->all(FLERR,"Cannot use hyper with a time-dependent fix defined"); - for (auto reg : domain->get_region_list()) + for (auto ® : domain->get_region_list()) if (reg->dynamic_check()) error->all(FLERR,"Cannot use hyper with a time-dependent region defined"); @@ -177,7 +177,7 @@ void Hyper::command(int narg, char **arg) fix_event->store_state_quench(); quench(1); - if (dumpflag) for (auto idump : dumplist) idump->write(); + if (dumpflag) for (auto &idump : dumplist) idump->write(); fix_event->store_event(); if (hyperenable) fix_hyper->build_bond_list(0); fix_event->restore_state_quench(); @@ -206,7 +206,7 @@ void Hyper::command(int narg, char **arg) nevent++; nevent_atoms += ecount; - if (dumpflag) for (auto idump : dumplist) idump->write(); + if (dumpflag) for (auto &idump : dumplist) idump->write(); fix_event->store_event(); if (hyperenable) fix_hyper->build_bond_list(ecount); diff --git a/src/REPLICA/neb.cpp b/src/REPLICA/neb.cpp index a811dabfd5..e80668a687 100644 --- a/src/REPLICA/neb.cpp +++ b/src/REPLICA/neb.cpp @@ -178,7 +178,7 @@ void NEB::run() if (fixes.size() != 1) error->all(FLERR,"NEB requires use of exactly one fix neb instance"); - fneb = dynamic_cast( fixes[0]); + fneb = dynamic_cast(fixes[0]); if (verbose) numall =7; else numall = 4; memory->create(all,nreplica,numall,"neb:all"); diff --git a/src/REPLICA/prd.cpp b/src/REPLICA/prd.cpp index 79d09080ec..e09807e565 100644 --- a/src/REPLICA/prd.cpp +++ b/src/REPLICA/prd.cpp @@ -167,7 +167,7 @@ void PRD::command(int narg, char **arg) // create FixEventPRD class to store event and pre-quench states - fix_event = dynamic_cast( modify->add_fix("prd_event all EVENT/PRD")); + fix_event = dynamic_cast(modify->add_fix("prd_event all EVENT/PRD")); // create Finish for timing output @@ -229,10 +229,10 @@ void PRD::command(int narg, char **arg) // cannot use PRD with time-dependent fixes or regions - for (auto ifix : modify->get_fix_list()) + for (auto &ifix : modify->get_fix_list()) if (ifix->time_depend) error->all(FLERR,"Cannot use PRD with a time-dependent fix defined"); - for (auto reg : domain->get_region_list()) + for (auto ® : domain->get_region_list()) if (reg->dynamic_check()) error->all(FLERR,"Cannot use PRD with a time-dependent region defined"); diff --git a/src/REPLICA/tad.cpp b/src/REPLICA/tad.cpp index 490e98f168..ceda4fb592 100644 --- a/src/REPLICA/tad.cpp +++ b/src/REPLICA/tad.cpp @@ -844,7 +844,7 @@ void TAD::add_event() int ievent = n_event_list++; fix_event_list[ievent] - = dynamic_cast( modify->add_fix(fmt::format("tad_event_{} all EVENT/TAD", ievent))); + = dynamic_cast(modify->add_fix(fmt::format("tad_event_{} all EVENT/TAD", ievent))); // store quenched state for new event diff --git a/src/RIGID/compute_erotate_rigid.cpp b/src/RIGID/compute_erotate_rigid.cpp index 6e51e4853f..0d0ad038b1 100644 --- a/src/RIGID/compute_erotate_rigid.cpp +++ b/src/RIGID/compute_erotate_rigid.cpp @@ -66,8 +66,8 @@ double ComputeERotateRigid::compute_scalar() if (strncmp(modify->fix[irfix]->style,"rigid",5) == 0) { if (strstr(modify->fix[irfix]->style,"/small")) { - scalar = (dynamic_cast( modify->fix[irfix]))->extract_erotational(); - } else scalar = (dynamic_cast( modify->fix[irfix]))->extract_erotational(); + scalar = (dynamic_cast(modify->fix[irfix]))->extract_erotational(); + } else scalar = (dynamic_cast(modify->fix[irfix]))->extract_erotational(); } scalar *= force->mvv2e; return scalar; diff --git a/src/RIGID/compute_ke_rigid.cpp b/src/RIGID/compute_ke_rigid.cpp index 1b858dea15..b0342ec1f9 100644 --- a/src/RIGID/compute_ke_rigid.cpp +++ b/src/RIGID/compute_ke_rigid.cpp @@ -65,8 +65,8 @@ double ComputeKERigid::compute_scalar() if (strncmp(modify->fix[irfix]->style,"rigid",5) == 0) { if (strstr(modify->fix[irfix]->style,"/small")) { - scalar = (dynamic_cast( modify->fix[irfix]))->extract_ke(); - } else scalar = (dynamic_cast( modify->fix[irfix]))->extract_ke(); + scalar = (dynamic_cast(modify->fix[irfix]))->extract_ke(); + } else scalar = (dynamic_cast(modify->fix[irfix]))->extract_ke(); } scalar *= force->mvv2e; return scalar; diff --git a/src/RIGID/compute_rigid_local.cpp b/src/RIGID/compute_rigid_local.cpp index 21b232fdfe..4254acc025 100644 --- a/src/RIGID/compute_rigid_local.cpp +++ b/src/RIGID/compute_rigid_local.cpp @@ -111,7 +111,7 @@ void ComputeRigidLocal::init() int ifix = modify->find_fix(idrigid); if (ifix < 0) error->all(FLERR,"FixRigidSmall ID for compute rigid/local does not exist"); - fixrigid = dynamic_cast( modify->fix[ifix]); + fixrigid = dynamic_cast(modify->fix[ifix]); int flag = 0; if (strstr(fixrigid->style,"rigid/") == nullptr) flag = 1; diff --git a/src/RIGID/fix_ehex.cpp b/src/RIGID/fix_ehex.cpp index 6bbd1b7424..fd52de7d84 100644 --- a/src/RIGID/fix_ehex.cpp +++ b/src/RIGID/fix_ehex.cpp @@ -574,7 +574,7 @@ void FixEHEX::com_properties(double *vr, double *sfr, double *sfvr, double *K, d mi = (rmass) ? rmass[0] : mass[type[0]]; else mi = 1.0; - if ((*mr / mi) < 1.e-14) error->all(FLERR, "Fix ehex error mass of region is close to zero"); + if ((*mr / mi) < 1.e-14) error->all(FLERR, "Fix ehex error mass of region is close to zero"); // total kinetic energy of region diff --git a/src/RIGID/fix_rigid.cpp b/src/RIGID/fix_rigid.cpp index f21d46d576..f0bcf630b7 100644 --- a/src/RIGID/fix_rigid.cpp +++ b/src/RIGID/fix_rigid.cpp @@ -676,21 +676,21 @@ void FixRigid::init() // atom style pointers to particles that store extra info - avec_ellipsoid = dynamic_cast( atom->style_match("ellipsoid")); - avec_line = dynamic_cast( atom->style_match("line")); - avec_tri = dynamic_cast( atom->style_match("tri")); + avec_ellipsoid = dynamic_cast(atom->style_match("ellipsoid")); + avec_line = dynamic_cast(atom->style_match("line")); + avec_tri = dynamic_cast(atom->style_match("tri")); // warn if more than one rigid fix // if earlyflag, warn if any post-force fixes come after a rigid fix int count = 0; - for (auto ifix : modify->get_fix_list()) + for (auto &ifix : modify->get_fix_list()) if (ifix->rigid_flag) count++; if (count > 1 && me == 0) error->warning(FLERR,"More than one fix rigid"); if (earlyflag) { bool rflag = false; - for (auto ifix : modify->get_fix_list()) { + for (auto &ifix : modify->get_fix_list()) { if (ifix->rigid_flag) rflag = true; if ((comm->me == 0) && rflag && (ifix->setmask() & POST_FORCE) && !ifix->rigid_flag) error->warning(FLERR,"Fix {} with ID {} alters forces after fix rigid", @@ -713,7 +713,7 @@ void FixRigid::init() // error if a fix changing the box comes before rigid fix bool boxflag = false; - for (auto ifix : modify->get_fix_list()) { + for (auto &ifix : modify->get_fix_list()) { if (boxflag && utils::strmatch(ifix->style,"^rigid")) error->all(FLERR,"Rigid fixes must come before any box changing fix"); if (ifix->box_change) boxflag = true; @@ -737,7 +737,7 @@ void FixRigid::init() dtq = 0.5 * update->dt; if (utils::strmatch(update->integrate_style,"^respa")) - step_respa = (dynamic_cast( update->integrate))->step; + step_respa = (dynamic_cast(update->integrate))->step; // setup rigid bodies, using current atom info. if reinitflag is not set, // do the initialization only once, b/c properties may not be re-computable diff --git a/src/RIGID/fix_rigid_nh.cpp b/src/RIGID/fix_rigid_nh.cpp index 622a2f86b0..61491688e9 100644 --- a/src/RIGID/fix_rigid_nh.cpp +++ b/src/RIGID/fix_rigid_nh.cpp @@ -270,7 +270,7 @@ void FixRigidNH::init() for (int i = 0; i < modify->nfix; i++) if (strcmp(modify->fix[i]->style,"deform") == 0) { - int *dimflag = (dynamic_cast( modify->fix[i]))->dimflag; + int *dimflag = (dynamic_cast(modify->fix[i]))->dimflag; if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) || (p_flag[2] && dimflag[2])) error->all(FLERR,"Cannot use fix rigid npt/nph and fix deform on " diff --git a/src/RIGID/fix_rigid_nh_small.cpp b/src/RIGID/fix_rigid_nh_small.cpp index bd8db90827..ba4de80d15 100644 --- a/src/RIGID/fix_rigid_nh_small.cpp +++ b/src/RIGID/fix_rigid_nh_small.cpp @@ -268,7 +268,7 @@ void FixRigidNHSmall::init() for (int i = 0; i < modify->nfix; i++) if (strcmp(modify->fix[i]->style,"deform") == 0) { - int *dimflag = (dynamic_cast( modify->fix[i]))->dimflag; + int *dimflag = (dynamic_cast(modify->fix[i]))->dimflag; if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) || (p_flag[2] && dimflag[2])) error->all(FLERR,"Cannot use fix rigid npt/nph and fix deform on " diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp index ec3e58d5f5..d39102f5dc 100644 --- a/src/RIGID/fix_rigid_small.cpp +++ b/src/RIGID/fix_rigid_small.cpp @@ -432,9 +432,9 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : // atom style pointers to particles that store extra info - avec_ellipsoid = dynamic_cast( atom->style_match("ellipsoid")); - avec_line = dynamic_cast( atom->style_match("line")); - avec_tri = dynamic_cast( atom->style_match("tri")); + avec_ellipsoid = dynamic_cast(atom->style_match("ellipsoid")); + avec_line = dynamic_cast(atom->style_match("line")); + avec_tri = dynamic_cast(atom->style_match("tri")); // compute per body forces and torques inside final_integrate() by default @@ -529,13 +529,13 @@ void FixRigidSmall::init() // if earlyflag, warn if any post-force fixes come after a rigid fix int count = 0; - for (auto ifix : modify->get_fix_list()) + for (auto &ifix : modify->get_fix_list()) if (ifix->rigid_flag) count++; if (count > 1 && me == 0) error->warning(FLERR,"More than one fix rigid"); if (earlyflag) { bool rflag = false; - for (auto ifix : modify->get_fix_list()) { + for (auto &ifix : modify->get_fix_list()) { if (ifix->rigid_flag) rflag = true; if ((comm->me == 0) && rflag && (ifix->setmask() & POST_FORCE) && !ifix->rigid_flag) error->warning(FLERR,"Fix {} with ID {} alters forces after fix rigid/small", @@ -558,7 +558,7 @@ void FixRigidSmall::init() // error if a fix changing the box comes before rigid fix bool boxflag = false; - for (auto ifix : modify->get_fix_list()) { + for (auto &ifix : modify->get_fix_list()) { if (boxflag && utils::strmatch(ifix->style,"^rigid")) error->all(FLERR,"Rigid fixes must come before any box changing fix"); if (ifix->box_change) boxflag = true; @@ -582,7 +582,7 @@ void FixRigidSmall::init() dtq = 0.5 * update->dt; if (utils::strmatch(update->integrate_style,"^respa")) - step_respa = (dynamic_cast( update->integrate))->step; + step_respa = (dynamic_cast(update->integrate))->step; } /* ---------------------------------------------------------------------- diff --git a/src/RIGID/fix_shake.cpp b/src/RIGID/fix_shake.cpp index 6673472458..82f35eab59 100644 --- a/src/RIGID/fix_shake.cpp +++ b/src/RIGID/fix_shake.cpp @@ -360,7 +360,7 @@ void FixShake::init() // error if a fix changing the box comes before shake fix bool boxflag = false; - for (auto ifix : modify->get_fix_list()) { + for (auto &ifix : modify->get_fix_list()) { if (boxflag && utils::strmatch(ifix->style,pattern)) error->all(FLERR,"Fix {} must come before any box changing fix", style); if (ifix->box_change) boxflag = true; @@ -374,10 +374,10 @@ void FixShake::init() if (utils::strmatch(update->integrate_style,"^respa")) { if (update->whichflag > 0) { auto fixes = modify->get_fix_by_style("^RESPA"); - if (fixes.size() > 0) fix_respa = dynamic_cast( fixes.front()); + if (fixes.size() > 0) fix_respa = dynamic_cast(fixes.front()); else error->all(FLERR,"Run style respa did not create fix RESPA"); } - auto respa_style = dynamic_cast( update->integrate); + auto respa_style = dynamic_cast(update->integrate); nlevels_respa = respa_style->nlevels; loop_respa = respa_style->loop; step_respa = respa_style->step; @@ -3177,9 +3177,9 @@ void FixShake::shake_end_of_step(int vflag) { // apply correction to all rRESPA levels for (int ilevel = 0; ilevel < nlevels_respa; ilevel++) { - (dynamic_cast( update->integrate))->copy_flevel_f(ilevel); + (dynamic_cast(update->integrate))->copy_flevel_f(ilevel); FixShake::post_force_respa(vflag,ilevel,loop_respa[ilevel]-1); - (dynamic_cast( update->integrate))->copy_f_flevel(ilevel); + (dynamic_cast(update->integrate))->copy_f_flevel(ilevel); } if (!rattle) dtf_inner = step_respa[0] * force->ftm2v; } diff --git a/src/RIGID/fix_shake.h b/src/RIGID/fix_shake.h index 914b73ea34..2cfedcbf29 100644 --- a/src/RIGID/fix_shake.h +++ b/src/RIGID/fix_shake.h @@ -65,14 +65,14 @@ class FixShake : public Fix { double compute_scalar() override; protected: - int vflag_post_force; // store the vflag of last post_force call - int eflag_pre_reverse; // store the eflag of last pre_reverse call - int respa; // 0 = vel. Verlet, 1 = respa - int rattle; // 0 = SHAKE, 1 = RATTLE - double tolerance; // SHAKE tolerance - int max_iter; // max # of SHAKE iterations - int output_every; // SHAKE stat output every so often - bigint next_output; // timestep for next output + int vflag_post_force; // store the vflag of last post_force call + int eflag_pre_reverse; // store the eflag of last pre_reverse call + int respa; // 0 = vel. Verlet, 1 = respa + int rattle; // 0 = SHAKE, 1 = RATTLE + double tolerance; // SHAKE tolerance + int max_iter; // max # of SHAKE iterations + int output_every; // SHAKE stat output every so often + bigint next_output; // timestep for next output // settings from input command int *bond_flag, *angle_flag; // bond/angle types to constrain diff --git a/src/SHOCK/fix_msst.cpp b/src/SHOCK/fix_msst.cpp index 1a7ebde991..3b682f7df5 100644 --- a/src/SHOCK/fix_msst.cpp +++ b/src/SHOCK/fix_msst.cpp @@ -299,7 +299,7 @@ void FixMSST::init() if (dftb) { for (int i = 0; i < modify->nfix; i++) if (utils::strmatch(modify->fix[i]->style,"^external$")) - fix_external = dynamic_cast( modify->fix[i]); + fix_external = dynamic_cast(modify->fix[i]); if (fix_external == nullptr) error->all(FLERR,"Fix msst dftb cannot be used w/out fix external"); } diff --git a/src/SPIN/compute_spin.cpp b/src/SPIN/compute_spin.cpp index a6dfdf79d2..ba553335bb 100644 --- a/src/SPIN/compute_spin.cpp +++ b/src/SPIN/compute_spin.cpp @@ -112,11 +112,11 @@ void ComputeSpin::init() int count = 0; if (npairspin == 1) { count = 1; - spin_pairs[0] = dynamic_cast( force->pair_match("^spin",0,0)); + spin_pairs[0] = dynamic_cast(force->pair_match("^spin",0,0)); } else if (npairspin > 1) { for (int i = 0; ipair_match("^spin",0,i)) { - spin_pairs[count] = dynamic_cast( force->pair_match("^spin",0,i)); + spin_pairs[count] = dynamic_cast(force->pair_match("^spin",0,i)); count++; } } @@ -141,7 +141,7 @@ void ComputeSpin::init() for (iforce = 0; iforce < modify->nfix; iforce++) { if (utils::strmatch(modify->fix[iforce]->style,"^precession/spin")) { precession_spin_flag = 1; - lockprecessionspin = dynamic_cast( modify->fix[iforce]); + lockprecessionspin = dynamic_cast(modify->fix[iforce]); } } } diff --git a/src/SPIN/fix_langevin_spin.cpp b/src/SPIN/fix_langevin_spin.cpp index a29ce8aa2c..f8aacc0c5c 100644 --- a/src/SPIN/fix_langevin_spin.cpp +++ b/src/SPIN/fix_langevin_spin.cpp @@ -119,9 +119,9 @@ void FixLangevinSpin::init() void FixLangevinSpin::setup(int vflag) { if (utils::strmatch(update->integrate_style,"^respa")) { - (dynamic_cast( update->integrate))->copy_flevel_f(nlevels_respa-1); + (dynamic_cast(update->integrate))->copy_flevel_f(nlevels_respa-1); post_force_respa(vflag,nlevels_respa-1,0); - (dynamic_cast( update->integrate))->copy_f_flevel(nlevels_respa-1); + (dynamic_cast(update->integrate))->copy_f_flevel(nlevels_respa-1); } else post_force(vflag); } diff --git a/src/SPIN/fix_nve_spin.cpp b/src/SPIN/fix_nve_spin.cpp index e578462526..20240ab2ea 100644 --- a/src/SPIN/fix_nve_spin.cpp +++ b/src/SPIN/fix_nve_spin.cpp @@ -206,11 +206,11 @@ void FixNVESpin::init() int count1 = 0; if (npairspin == 1) { count1 = 1; - spin_pairs[0] = dynamic_cast( force->pair_match("^spin",0,0)); + spin_pairs[0] = dynamic_cast(force->pair_match("^spin",0,0)); } else if (npairspin > 1) { for (int i = 0; ipair_match("^spin",0,i)) { - spin_pairs[count1] = dynamic_cast( force->pair_match("^spin",0,i)); + spin_pairs[count1] = dynamic_cast(force->pair_match("^spin",0,i)); count1++; } } @@ -254,7 +254,7 @@ void FixNVESpin::init() for (iforce = 0; iforce < modify->nfix; iforce++) { if (utils::strmatch(modify->fix[iforce]->style,"^precession/spin")) { precession_spin_flag = 1; - lockprecessionspin[count2] = dynamic_cast( modify->fix[iforce]); + lockprecessionspin[count2] = dynamic_cast(modify->fix[iforce]); count2++; } } @@ -287,7 +287,7 @@ void FixNVESpin::init() for (iforce = 0; iforce < modify->nfix; iforce++) { if (utils::strmatch(modify->fix[iforce]->style,"^langevin/spin")) { maglangevin_flag = 1; - locklangevinspin[count2] = dynamic_cast( modify->fix[iforce]); + locklangevinspin[count2] = dynamic_cast(modify->fix[iforce]); count2++; } } @@ -301,7 +301,7 @@ void FixNVESpin::init() for (iforce = 0; iforce < modify->nfix; iforce++) { if (utils::strmatch(modify->fix[iforce]->style,"^setforce/spin")) { setforce_spin_flag = 1; - locksetforcespin = dynamic_cast( modify->fix[iforce]); + locksetforcespin = dynamic_cast(modify->fix[iforce]); } } diff --git a/src/SPIN/fix_precession_spin.cpp b/src/SPIN/fix_precession_spin.cpp index 6f4bc10b87..8902857433 100644 --- a/src/SPIN/fix_precession_spin.cpp +++ b/src/SPIN/fix_precession_spin.cpp @@ -273,7 +273,7 @@ void FixPrecessionSpin::init() K6h = K6/hbar; if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; + ilevel_respa = (dynamic_cast(update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -305,9 +305,9 @@ void FixPrecessionSpin::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); + (dynamic_cast(update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); + (dynamic_cast(update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/SPIN/neb_spin.cpp b/src/SPIN/neb_spin.cpp index 381d1827b3..c67ba36d59 100644 --- a/src/SPIN/neb_spin.cpp +++ b/src/SPIN/neb_spin.cpp @@ -172,7 +172,7 @@ void NEBSpin::run() if (fixes.size() != 1) error->all(FLERR,"NEBSpin requires use of exactly one fix neb/spin instance"); - fneb = dynamic_cast( fixes[0]); + fneb = dynamic_cast(fixes[0]); if (verbose) numall =7; else numall = 4; memory->create(all,nreplica,numall,"neb:all"); diff --git a/src/SPIN/pair_spin.cpp b/src/SPIN/pair_spin.cpp index d236e910c7..4ee6110659 100644 --- a/src/SPIN/pair_spin.cpp +++ b/src/SPIN/pair_spin.cpp @@ -96,7 +96,7 @@ void PairSpin::init_style() auto fixes = modify->get_fix_by_style("^nve/spin"); if (fixes.size() == 1) - lattice_flag = (dynamic_cast( fixes.front()))->lattice_flag; + lattice_flag = (dynamic_cast(fixes.front()))->lattice_flag; else if (fixes.size() > 1) error->warning(FLERR,"Using multiple instances of fix nve/spin or neb/spin"); diff --git a/src/SRD/fix_srd.cpp b/src/SRD/fix_srd.cpp index 0cec6fd794..544c92a702 100644 --- a/src/SRD/fix_srd.cpp +++ b/src/SRD/fix_srd.cpp @@ -61,17 +61,17 @@ enum { SHIFT_NO, SHIFT_YES, SHIFT_POSSIBLE }; #define MAXITER 20 static const char cite_fix_srd[] = - "fix srd command: doi:10.1063/1.3419070\n\n" - "@Article{Petersen10,\n" - " author = {M. K. Petersen and J. B. Lechman and S. J. Plimpton and\n" - " G. S. Grest and in 't Veld, P. J. and P. R. Schunk},\n" - " title = {Mesoscale Hydrodynamics via Stochastic Rotation\n" - " Dynamics: Comparison with {L}ennard-{J}ones Fluid},\n" - " journal = {J.~Chem.\\ Phys.},\n" - " year = 2010,\n" - " volume = 132,\n" - " pages = 174106\n" - "}\n\n"; + "fix srd command: doi:10.1063/1.3419070\n\n" + "@Article{Petersen10,\n" + " author = {M. K. Petersen and J. B. Lechman and S. J. Plimpton and\n" + " G. S. Grest and in 't Veld, P. J. and P. R. Schunk},\n" + " title = {Mesoscale Hydrodynamics via Stochastic Rotation\n" + " Dynamics: Comparison with {L}ennard-{J}ones Fluid},\n" + " journal = {J.~Chem.\\ Phys.},\n" + " year = 2010,\n" + " volume = 132,\n" + " pages = 174106\n" + "}\n\n"; //#define SRD_DEBUG 1 //#define SRD_DEBUG_ATOMID 58 diff --git a/src/UEF/compute_pressure_uef.cpp b/src/UEF/compute_pressure_uef.cpp index da35b7635d..feb524904d 100644 --- a/src/UEF/compute_pressure_uef.cpp +++ b/src/UEF/compute_pressure_uef.cpp @@ -57,7 +57,7 @@ void ComputePressureUef::init() if (i==modify->nfix) error->all(FLERR,"Can't use compute pressure/uef without defining a fix nvt/npt/uef"); ifix_uef=i; - (dynamic_cast( modify->fix[ifix_uef]))->get_ext_flags(ext_flags); + (dynamic_cast(modify->fix[ifix_uef]))->get_ext_flags(ext_flags); if (strcmp(temperature->style,"temp/uef") != 0) error->warning(FLERR,"The temperature used in compute pressure/ued is not of style temp/uef"); @@ -127,7 +127,7 @@ void ComputePressureUef::compute_vector() else { double r[3][3]; - ( dynamic_cast( modify->fix[ifix_uef]))->get_rot(r); + ( dynamic_cast(modify->fix[ifix_uef]))->get_rot(r); virial_rot(virial,r); } if (keflag) { @@ -158,7 +158,7 @@ void ComputePressureUef::compute_vector() ------------------------------------------------------------------------- */ void ComputePressureUef::update_rot() { - ( dynamic_cast( modify->fix[ifix_uef]))->get_rot(rot); + ( dynamic_cast(modify->fix[ifix_uef]))->get_rot(rot); } /* ---------------------------------------------------------------------- diff --git a/src/UEF/compute_temp_uef.cpp b/src/UEF/compute_temp_uef.cpp index 8d02317267..9b7e83f920 100644 --- a/src/UEF/compute_temp_uef.cpp +++ b/src/UEF/compute_temp_uef.cpp @@ -61,7 +61,7 @@ void ComputeTempUef::compute_vector() ComputeTemp::compute_vector(); if (rot_flag) { double rot[3][3]; - ( dynamic_cast( modify->fix[ifix_uef]))->get_rot(rot); + ( dynamic_cast(modify->fix[ifix_uef]))->get_rot(rot); virial_rot(vector,rot); } diff --git a/src/UEF/dump_cfg_uef.cpp b/src/UEF/dump_cfg_uef.cpp index c87e1632ef..f5803b499b 100644 --- a/src/UEF/dump_cfg_uef.cpp +++ b/src/UEF/dump_cfg_uef.cpp @@ -68,8 +68,8 @@ void DumpCFGUef::write_header(bigint n) // so molecules are not split across periodic box boundaries double box[3][3],rot[3][3]; - (dynamic_cast( modify->fix[ifix_uef]))->get_box(box); - (dynamic_cast( modify->fix[ifix_uef]))->get_rot(rot); + (dynamic_cast(modify->fix[ifix_uef]))->get_box(box); + (dynamic_cast(modify->fix[ifix_uef]))->get_rot(rot); // rot goes from "lab frame" to "upper triangular frame" // it's transpose takes the simulation box to the flow frame for (int i=0;i<3;i++) diff --git a/src/UEF/fix_nh_uef.cpp b/src/UEF/fix_nh_uef.cpp index 71b076bddb..ac866e945e 100644 --- a/src/UEF/fix_nh_uef.cpp +++ b/src/UEF/fix_nh_uef.cpp @@ -274,9 +274,9 @@ void FixNHUef::setup(int j) error->all(FLERR,"Initial box is not close enough to the expected uef box"); uefbox->get_rot(rot); - (dynamic_cast( temperature))->yes_rot(); - (dynamic_cast( pressure))->in_fix = true; - (dynamic_cast( pressure))->update_rot(); + (dynamic_cast(temperature))->yes_rot(); + (dynamic_cast(pressure))->in_fix = true; + (dynamic_cast(pressure))->update_rot(); FixNH::setup(j); } @@ -288,12 +288,12 @@ void FixNHUef::initial_integrate(int vflag) inv_rotate_x(rot); inv_rotate_v(rot); inv_rotate_f(rot); - (dynamic_cast( temperature))->no_rot(); + (dynamic_cast(temperature))->no_rot(); FixNH::initial_integrate(vflag); rotate_x(rot); rotate_v(rot); rotate_f(rot); - (dynamic_cast( temperature))->yes_rot(); + (dynamic_cast(temperature))->yes_rot(); } /* ---------------------------------------------------------------------- @@ -304,12 +304,12 @@ void FixNHUef::initial_integrate_respa(int vflag, int ilevel, int iloop) inv_rotate_x(rot); inv_rotate_v(rot); inv_rotate_f(rot); - (dynamic_cast( temperature))->no_rot(); + (dynamic_cast(temperature))->no_rot(); FixNH::initial_integrate_respa(vflag,ilevel,iloop); rotate_x(rot); rotate_v(rot); rotate_f(rot); - (dynamic_cast( temperature))->yes_rot(); + (dynamic_cast(temperature))->yes_rot(); } /* ---------------------------------------------------------------------- @@ -318,14 +318,14 @@ void FixNHUef::initial_integrate_respa(int vflag, int ilevel, int iloop) void FixNHUef::final_integrate() { // update rot here since it must directly follow the virial calculation - (dynamic_cast( pressure))->update_rot(); + (dynamic_cast(pressure))->update_rot(); inv_rotate_v(rot); inv_rotate_f(rot); - (dynamic_cast( temperature))->no_rot(); + (dynamic_cast(temperature))->no_rot(); FixNH::final_integrate(); rotate_v(rot); rotate_f(rot); - (dynamic_cast( temperature))->yes_rot(); + (dynamic_cast(temperature))->yes_rot(); } /* ---------------------------------------------------------------------- diff --git a/src/angle.cpp b/src/angle.cpp index 757da3c56f..7044459f9f 100644 --- a/src/angle.cpp +++ b/src/angle.cpp @@ -368,17 +368,17 @@ void Angle::ev_tally(int i, int j, int k, int nlocal, int newton_bond, double ea called by AngleAmoeba for its 4-body angle term ------------------------------------------------------------------------- */ -void Angle::ev_tally4(int i, int j, int k, int m, int nlocal, int newton_bond, - double eangle, +void Angle::ev_tally4(int i, int j, int k, int m, int nlocal, int newton_bond, double eangle, double *f1, double *f2, double *f3, double *f4) { - double eanglefourth,v[6]; + double eanglefourth, v[6]; if (eflag_either) { if (eflag_global) { - if (newton_bond) energy += eangle; + if (newton_bond) + energy += eangle; else { - eanglefourth = FOURTH*eangle; + eanglefourth = FOURTH * eangle; if (i < nlocal) energy += eanglefourth; if (j < nlocal) energy += eanglefourth; if (k < nlocal) energy += eanglefourth; @@ -386,7 +386,7 @@ void Angle::ev_tally4(int i, int j, int k, int m, int nlocal, int newton_bond, } } if (eflag_atom) { - eanglefourth = FOURTH*eangle; + eanglefourth = FOURTH * eangle; if (newton_bond || i < nlocal) eatom[i] += eanglefourth; if (newton_bond || j < nlocal) eatom[j] += eanglefourth; if (newton_bond || k < nlocal) eatom[k] += eanglefourth; @@ -396,12 +396,12 @@ void Angle::ev_tally4(int i, int j, int k, int m, int nlocal, int newton_bond, if (vflag_either) { double **x = atom->x; - v[0] = x[i][0]*f1[0] + x[j][0]*f2[0] + x[k][0]*f3[0] + x[m][0]*f4[0]; - v[1] = x[i][1]*f1[1] + x[j][1]*f2[1] + x[k][1]*f3[1] + x[m][1]*f4[1]; - v[2] = x[i][2]*f1[2] + x[j][2]*f2[2] + x[k][2]*f3[2] + x[m][2]*f4[2]; - v[3] = x[i][0]*f1[1] + x[j][0]*f2[1] + x[k][0]*f3[1] + x[m][0]*f4[1]; - v[4] = x[i][0]*f1[2] + x[j][0]*f2[2] + x[k][0]*f3[2] + x[m][0]*f4[2]; - v[5] = x[i][1]*f1[2] + x[j][1]*f2[2] + x[k][1]*f3[2] + x[m][1]*f4[2]; + v[0] = x[i][0] * f1[0] + x[j][0] * f2[0] + x[k][0] * f3[0] + x[m][0] * f4[0]; + v[1] = x[i][1] * f1[1] + x[j][1] * f2[1] + x[k][1] * f3[1] + x[m][1] * f4[1]; + v[2] = x[i][2] * f1[2] + x[j][2] * f2[2] + x[k][2] * f3[2] + x[m][2] * f4[2]; + v[3] = x[i][0] * f1[1] + x[j][0] * f2[1] + x[k][0] * f3[1] + x[m][0] * f4[1]; + v[4] = x[i][0] * f1[2] + x[j][0] * f2[2] + x[k][0] * f3[2] + x[m][0] * f4[2]; + v[5] = x[i][1] * f1[2] + x[j][1] * f2[2] + x[k][1] * f3[2] + x[m][1] * f4[2]; if (vflag_global) { if (newton_bond) { @@ -417,88 +417,87 @@ void Angle::ev_tally4(int i, int j, int k, int m, int nlocal, int newton_bond, if (j < nlocal) prefactor += 1.0; if (k < nlocal) prefactor += 1.0; if (m < nlocal) prefactor += 1.0; - virial[0] += prefactor*FOURTH*v[0]; - virial[1] += prefactor*FOURTH*v[1]; - virial[2] += prefactor*FOURTH*v[2]; - virial[3] += prefactor*FOURTH*v[3]; - virial[4] += prefactor*FOURTH*v[4]; - virial[5] += prefactor*FOURTH*v[5]; + virial[0] += prefactor * FOURTH * v[0]; + virial[1] += prefactor * FOURTH * v[1]; + virial[2] += prefactor * FOURTH * v[2]; + virial[3] += prefactor * FOURTH * v[3]; + virial[4] += prefactor * FOURTH * v[4]; + virial[5] += prefactor * FOURTH * v[5]; } } if (vflag_atom) { if (newton_bond || i < nlocal) { - vatom[i][0] += FOURTH*v[0]; - vatom[i][1] += FOURTH*v[1]; - vatom[i][2] += FOURTH*v[2]; - vatom[i][3] += FOURTH*v[3]; - vatom[i][4] += FOURTH*v[4]; - vatom[i][5] += FOURTH*v[5]; + vatom[i][0] += FOURTH * v[0]; + vatom[i][1] += FOURTH * v[1]; + vatom[i][2] += FOURTH * v[2]; + vatom[i][3] += FOURTH * v[3]; + vatom[i][4] += FOURTH * v[4]; + vatom[i][5] += FOURTH * v[5]; } if (newton_bond || j < nlocal) { - vatom[j][0] += FOURTH*v[0]; - vatom[j][1] += FOURTH*v[1]; - vatom[j][2] += FOURTH*v[2]; - vatom[j][3] += FOURTH*v[3]; - vatom[j][4] += FOURTH*v[4]; - vatom[j][5] += FOURTH*v[5]; + vatom[j][0] += FOURTH * v[0]; + vatom[j][1] += FOURTH * v[1]; + vatom[j][2] += FOURTH * v[2]; + vatom[j][3] += FOURTH * v[3]; + vatom[j][4] += FOURTH * v[4]; + vatom[j][5] += FOURTH * v[5]; } if (newton_bond || k < nlocal) { - vatom[k][0] += FOURTH*v[0]; - vatom[k][1] += FOURTH*v[1]; - vatom[k][2] += FOURTH*v[2]; - vatom[k][3] += FOURTH*v[3]; - vatom[k][4] += FOURTH*v[4]; - vatom[k][5] += FOURTH*v[5]; + vatom[k][0] += FOURTH * v[0]; + vatom[k][1] += FOURTH * v[1]; + vatom[k][2] += FOURTH * v[2]; + vatom[k][3] += FOURTH * v[3]; + vatom[k][4] += FOURTH * v[4]; + vatom[k][5] += FOURTH * v[5]; } if (newton_bond || m < nlocal) { - vatom[m][0] += FOURTH*v[0]; - vatom[m][1] += FOURTH*v[1]; - vatom[m][2] += FOURTH*v[2]; - vatom[m][3] += FOURTH*v[3]; - vatom[m][4] += FOURTH*v[4]; - vatom[m][5] += FOURTH*v[5]; + vatom[m][0] += FOURTH * v[0]; + vatom[m][1] += FOURTH * v[1]; + vatom[m][2] += FOURTH * v[2]; + vatom[m][3] += FOURTH * v[3]; + vatom[m][4] += FOURTH * v[4]; + vatom[m][5] += FOURTH * v[5]; } } } } - /* ---------------------------------------------------------------------- tally energy and virial into global and per-atom accumulators called by AngleAmoeba for its 2-body Urey-Bradley H-H bond term identical to Bond:ev_tally() ------------------------------------------------------------------------- */ -void Angle::ev_tally2(int i, int j, int nlocal, int newton_bond, - double ebond, double fbond, +void Angle::ev_tally2(int i, int j, int nlocal, int newton_bond, double ebond, double fbond, double delx, double dely, double delz) { - double ebondhalf,v[6]; + double ebondhalf, v[6]; if (eflag_either) { if (eflag_global) { - if (newton_bond) energy += ebond; + if (newton_bond) + energy += ebond; else { - ebondhalf = 0.5*ebond; + ebondhalf = 0.5 * ebond; if (i < nlocal) energy += ebondhalf; if (j < nlocal) energy += ebondhalf; } } if (eflag_atom) { - ebondhalf = 0.5*ebond; + ebondhalf = 0.5 * ebond; if (newton_bond || i < nlocal) eatom[i] += ebondhalf; if (newton_bond || j < nlocal) eatom[j] += ebondhalf; } } if (vflag_either) { - v[0] = delx*delx*fbond; - v[1] = dely*dely*fbond; - v[2] = delz*delz*fbond; - v[3] = delx*dely*fbond; - v[4] = delx*delz*fbond; - v[5] = dely*delz*fbond; + v[0] = delx * delx * fbond; + v[1] = dely * dely * fbond; + v[2] = delz * delz * fbond; + v[3] = delx * dely * fbond; + v[4] = delx * delz * fbond; + v[5] = dely * delz * fbond; if (vflag_global) { if (newton_bond) { @@ -510,40 +509,40 @@ void Angle::ev_tally2(int i, int j, int nlocal, int newton_bond, virial[5] += v[5]; } else { if (i < nlocal) { - virial[0] += 0.5*v[0]; - virial[1] += 0.5*v[1]; - virial[2] += 0.5*v[2]; - virial[3] += 0.5*v[3]; - virial[4] += 0.5*v[4]; - virial[5] += 0.5*v[5]; + virial[0] += 0.5 * v[0]; + virial[1] += 0.5 * v[1]; + virial[2] += 0.5 * v[2]; + virial[3] += 0.5 * v[3]; + virial[4] += 0.5 * v[4]; + virial[5] += 0.5 * v[5]; } if (j < nlocal) { - virial[0] += 0.5*v[0]; - virial[1] += 0.5*v[1]; - virial[2] += 0.5*v[2]; - virial[3] += 0.5*v[3]; - virial[4] += 0.5*v[4]; - virial[5] += 0.5*v[5]; + virial[0] += 0.5 * v[0]; + virial[1] += 0.5 * v[1]; + virial[2] += 0.5 * v[2]; + virial[3] += 0.5 * v[3]; + virial[4] += 0.5 * v[4]; + virial[5] += 0.5 * v[5]; } } } if (vflag_atom) { if (newton_bond || i < nlocal) { - vatom[i][0] += 0.5*v[0]; - vatom[i][1] += 0.5*v[1]; - vatom[i][2] += 0.5*v[2]; - vatom[i][3] += 0.5*v[3]; - vatom[i][4] += 0.5*v[4]; - vatom[i][5] += 0.5*v[5]; + vatom[i][0] += 0.5 * v[0]; + vatom[i][1] += 0.5 * v[1]; + vatom[i][2] += 0.5 * v[2]; + vatom[i][3] += 0.5 * v[3]; + vatom[i][4] += 0.5 * v[4]; + vatom[i][5] += 0.5 * v[5]; } if (newton_bond || j < nlocal) { - vatom[j][0] += 0.5*v[0]; - vatom[j][1] += 0.5*v[1]; - vatom[j][2] += 0.5*v[2]; - vatom[j][3] += 0.5*v[3]; - vatom[j][4] += 0.5*v[4]; - vatom[j][5] += 0.5*v[5]; + vatom[j][0] += 0.5 * v[0]; + vatom[j][1] += 0.5 * v[1]; + vatom[j][2] += 0.5 * v[2]; + vatom[j][3] += 0.5 * v[3]; + vatom[j][4] += 0.5 * v[4]; + vatom[j][5] += 0.5 * v[5]; } } } diff --git a/src/atom.cpp b/src/atom.cpp index 73db8117bf..f66570e57b 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -227,6 +227,7 @@ Atom::Atom(LAMMPS *_lmp) : Pointers(_lmp) // type labels lmap = nullptr; + types_style = NUMERIC; // custom atom arrays @@ -795,7 +796,7 @@ AtomVec *Atom::style_match(const char *style) { if (strcmp(atom_style,style) == 0) return avec; else if (strcmp(atom_style,"hybrid") == 0) { - auto avec_hybrid = dynamic_cast( avec); + auto avec_hybrid = dynamic_cast(avec); for (int i = 0; i < avec_hybrid->nstyles; i++) if (strcmp(avec_hybrid->keywords[i],style) == 0) return avec_hybrid->styles[i]; @@ -1200,7 +1201,7 @@ void Atom::data_atoms(int n, char *buf, tagint id_offset, tagint mol_offset, break; } case 1: { // type label - if (!atom->labelmapflag) + if (!labelmapflag) error->one(FLERR, "Invalid line in {}: {}", location, utils::trim(buf)); type[nlocal - 1] = lmap->find(typestr, Atom::ATOM); if (type[nlocal - 1] == -1) @@ -1277,9 +1278,9 @@ void Atom::data_bonds(int n, char *buf, int *count, tagint id_offset, *next = '\0'; auto values = Tokenizer(buf).as_vector(); int nwords = values.size(); - for (std::size_t i = 0; i < values.size(); ++i) { - if (utils::strmatch(values[i], "^#")) { - nwords = i; + for (std::size_t ii = 0; ii < values.size(); ++ii) { + if (utils::strmatch(values[ii], "^#")) { + nwords = ii; break; } } @@ -1368,9 +1369,9 @@ void Atom::data_angles(int n, char *buf, int *count, tagint id_offset, *next = '\0'; auto values = Tokenizer(buf).as_vector(); int nwords = values.size(); - for (std::size_t i = 0; i < values.size(); ++i) { - if (utils::strmatch(values[i], "^#")) { - nwords = i; + for (std::size_t ii = 0; ii < values.size(); ++ii) { + if (utils::strmatch(values[ii], "^#")) { + nwords = ii; break; } } @@ -1475,9 +1476,9 @@ void Atom::data_dihedrals(int n, char *buf, int *count, tagint id_offset, *next = '\0'; auto values = Tokenizer(buf).as_vector(); int nwords = values.size(); - for (std::size_t i = 0; i < values.size(); ++i) { - if (utils::strmatch(values[i], "^#")) { - nwords = i; + for (std::size_t ii = 0; ii < values.size(); ++ii) { + if (utils::strmatch(values[ii], "^#")) { + nwords = ii; break; } } @@ -1601,9 +1602,9 @@ void Atom::data_impropers(int n, char *buf, int *count, tagint id_offset, *next = '\0'; auto values = Tokenizer(buf).as_vector(); int nwords = values.size(); - for (std::size_t i = 0; i < values.size(); ++i) { - if (utils::strmatch(values[i], "^#")) { - nwords = i; + for (std::size_t ii = 0; ii < values.size(); ++ii) { + if (utils::strmatch(values[ii], "^#")) { + nwords = ii; break; } } @@ -1898,6 +1899,7 @@ void Atom::set_mass(const char *file, int line, const char *str, int type_offset } default: // invalid + itype = -1000000000; error->one(file, line, "Invalid {}: {}", location, utils::trim(str)); break; } @@ -2020,7 +2022,7 @@ int Atom::shape_consistency(int itype, double &shapex, double &shapey, double &s double one[3] = {-1.0, -1.0, -1.0}; double *shape; - auto avec_ellipsoid = dynamic_cast( style_match("ellipsoid")); + auto avec_ellipsoid = dynamic_cast(style_match("ellipsoid")); auto bonus = avec_ellipsoid->bonus; int flag = 0; @@ -2194,6 +2196,8 @@ void Atom::add_molecule_atom(Molecule *onemol, int iatom, int ilocal, tagint off void Atom::add_label_map() { + if (lmp->kokkos) + error->all(FLERR, "Label maps are currently not supported with Kokkos"); labelmapflag = 1; lmap = new LabelMap(lmp,ntypes,nbondtypes,nangletypes,ndihedraltypes,nimpropertypes); } diff --git a/src/atom.h b/src/atom.h index fe2a740fcf..70e064c0ff 100644 --- a/src/atom.h +++ b/src/atom.h @@ -33,7 +33,7 @@ class Atom : protected Pointers { enum { GROW = 0, RESTART = 1, BORDER = 2 }; enum { ATOMIC = 0, MOLECULAR = 1, TEMPLATE = 2 }; enum { ATOM = 0, BOND = 1, ANGLE = 2, DIHEDRAL = 3, IMPROPER = 4 }; - enum { NUMERIC = 0, LABELS = 1}; + enum { NUMERIC = 0, LABELS = 1 }; enum { MAP_NONE = 0, MAP_ARRAY = 1, MAP_HASH = 2, MAP_YES = 3 }; // atom counts @@ -166,9 +166,9 @@ class Atom : protected Pointers { // AMOEBA package - int *nspecial15; // # of 1-5 neighs - tagint **special15; // IDs of 1-5 neighs of each atom - int maxspecial15; // special15[nlocal][maxspecial15] + int *nspecial15; // # of 1-5 neighs + tagint **special15; // IDs of 1-5 neighs of each atom + int maxspecial15; // special15[nlocal][maxspecial15] // DIELECTRIC package @@ -331,8 +331,7 @@ class Atom : protected Pointers { void deallocate_topology(); - void data_atoms(int, char *, tagint, tagint, int, int, double *, - int, int *); + void data_atoms(int, char *, tagint, tagint, int, int, double *, int, int *); void data_vels(int, char *, tagint); void data_bonds(int, char *, int *, tagint, int, int, int *); void data_angles(int, char *, int *, tagint, int, int, int *); @@ -354,7 +353,7 @@ class Atom : protected Pointers { void add_molecule(int, char **); int find_molecule(const char *); - std::vectorget_molecule_by_id(const std::string &); + std::vector get_molecule_by_id(const std::string &); void add_molecule_atom(class Molecule *, int, int, tagint); void add_label_map(); diff --git a/src/atom_vec.cpp b/src/atom_vec.cpp index a01fad673d..586235d088 100644 --- a/src/atom_vec.cpp +++ b/src/atom_vec.cpp @@ -208,7 +208,7 @@ void AtomVec::grow(int n) if (n == 0) grow_nmax(); else - nmax = MAX(n,nmax); + nmax = MAX(n, nmax); atom->nmax = nmax; if (nmax < 0 || nmax > MAXSMALLINT) error->one(FLERR, "Per-processor system is too big"); @@ -1650,17 +1650,6 @@ void AtomVec::create_atom(int itype, double *coord) atom->nlocal++; } -/* ---------------------------------------------------------------------- - version of data_atom without extract option - temporary fix for Kokkos compilation -------------------------------------------------------------------------- */ - -void AtomVec::data_atom(double *coord, imageint imagetmp, const std::vector &values) -{ - std::string strtmp; - data_atom(coord, imagetmp, values, strtmp); -} - /* ---------------------------------------------------------------------- unpack one line from Atoms section of data file initialize other peratom quantities @@ -1705,7 +1694,7 @@ void AtomVec::data_atom(double *coord, imageint imagetmp, const std::vectortype) { // custom treatment of atom types + if (vec == atom->type) { // custom treatment of atom types extract = values[ivalue++]; continue; } @@ -1730,8 +1719,8 @@ void AtomVec::data_atom(double *coord, imageint imagetmp, const std::vectorone(FLERR, "Invalid atom ID {} in line {} of Atoms section of data file", - tag[nlocal], nlocal+1); + error->one(FLERR, "Invalid atom ID {} in line {} of Atoms section of data file", tag[nlocal], + nlocal + 1); // if needed, modify unpacked values or initialize other peratom values @@ -1825,8 +1814,9 @@ void AtomVec::write_data(FILE *fp, int n, double **buf) if (cols == 0) { if (atom->types_style == Atom::LABELS && atom->peratom[mdata_atom.index[nn]].name == "type") { - fmt::print(fp," {}",atom->lmap->typelabel[ubuf(buf[i][j++]).i-1]); - } else fmt::print(fp, " {}", ubuf(buf[i][j++]).i); + fmt::print(fp, " {}", atom->lmap->typelabel[ubuf(buf[i][j++]).i - 1]); + } else + fmt::print(fp, " {}", ubuf(buf[i][j++]).i); } else { for (m = 0; m < cols; m++) fmt::print(fp, " {}", ubuf(buf[i][j++]).i); } @@ -2036,8 +2026,7 @@ void AtomVec::write_bond(FILE *fp, int n, tagint **buf, int index) std::string typestr; for (int i = 0; i < n; i++) { typestr = std::to_string(buf[i][0]); - if (atom->types_style == Atom::LABELS) - typestr = atom->lmap->btypelabel[buf[i][0]-1]; + if (atom->types_style == Atom::LABELS) typestr = atom->lmap->btypelabel[buf[i][0] - 1]; fmt::print(fp, "{} {} {} {}\n", index, typestr, buf[i][1], buf[i][2]); index++; } @@ -2102,10 +2091,8 @@ void AtomVec::write_angle(FILE *fp, int n, tagint **buf, int index) std::string typestr; for (int i = 0; i < n; i++) { typestr = std::to_string(buf[i][0]); - if (atom->types_style == Atom::LABELS) - typestr = atom->lmap->atypelabel[buf[i][0]-1]; - fmt::print(fp, "{} {} {} {} {}\n", index, - typestr, buf[i][1], buf[i][2], buf[i][3]); + if (atom->types_style == Atom::LABELS) typestr = atom->lmap->atypelabel[buf[i][0] - 1]; + fmt::print(fp, "{} {} {} {} {}\n", index, typestr, buf[i][1], buf[i][2], buf[i][3]); index++; } } @@ -2167,10 +2154,9 @@ void AtomVec::write_dihedral(FILE *fp, int n, tagint **buf, int index) std::string typestr; for (int i = 0; i < n; i++) { typestr = std::to_string(buf[i][0]); - if (atom->types_style == Atom::LABELS) - typestr = atom->lmap->dtypelabel[buf[i][0]-1]; - fmt::print(fp, "{} {} {} {} {} {}\n", index, typestr, - buf[i][1], buf[i][2], buf[i][3], buf[i][4]); + if (atom->types_style == Atom::LABELS) typestr = atom->lmap->dtypelabel[buf[i][0] - 1]; + fmt::print(fp, "{} {} {} {} {} {}\n", index, typestr, buf[i][1], buf[i][2], buf[i][3], + buf[i][4]); index++; } } @@ -2232,10 +2218,9 @@ void AtomVec::write_improper(FILE *fp, int n, tagint **buf, int index) std::string typestr; for (int i = 0; i < n; i++) { typestr = std::to_string(buf[i][0]); - if (atom->types_style == Atom::LABELS) - typestr = atom->lmap->itypelabel[buf[i][0]-1]; - fmt::print(fp, "{} {} {} {} {} {}\n", index, typestr, - buf[i][1], buf[i][2], buf[i][3], buf[i][4]); + if (atom->types_style == Atom::LABELS) typestr = atom->lmap->itypelabel[buf[i][0] - 1]; + fmt::print(fp, "{} {} {} {} {} {}\n", index, typestr, buf[i][1], buf[i][2], buf[i][3], + buf[i][4]); index++; } } diff --git a/src/atom_vec.h b/src/atom_vec.h index c33a9e2dda..8101eadcc0 100644 --- a/src/atom_vec.h +++ b/src/atom_vec.h @@ -123,7 +123,6 @@ class AtomVec : protected Pointers { virtual void create_atom(int, double *); virtual void create_atom_post(int) {} - virtual void data_atom(double *, imageint, const std::vector &); virtual void data_atom(double *, imageint, const std::vector &, std::string &); virtual void data_atom_post(int) {} virtual void data_atom_bonus(int, const std::vector &) {} diff --git a/src/atom_vec_body.cpp b/src/atom_vec_body.cpp index f2eef1d207..0726468c4f 100644 --- a/src/atom_vec_body.cpp +++ b/src/atom_vec_body.cpp @@ -118,7 +118,7 @@ void AtomVecBody::process_args(int narg, char **arg) #undef BODY_CLASS } else - error->all(FLERR, utils::check_packages_for_style("body", arg[0], lmp).c_str()); + error->all(FLERR, utils::check_packages_for_style("body", arg[0], lmp)); bptr->avec = this; icp = bptr->icp; diff --git a/src/compute_angmom_chunk.cpp b/src/compute_angmom_chunk.cpp index a44e577de0..75e73d280d 100644 --- a/src/compute_angmom_chunk.cpp +++ b/src/compute_angmom_chunk.cpp @@ -185,8 +185,8 @@ void ComputeAngmomChunk::lock_enable() void ComputeAngmomChunk::lock_disable() { - cchunk = dynamic_cast(modify->get_compute_by_id(idchunk)); - if(cchunk) cchunk->lockcount--; + cchunk = dynamic_cast(modify->get_compute_by_id(idchunk)); + if (cchunk) cchunk->lockcount--; } /* ---------------------------------------------------------------------- diff --git a/src/compute_centroid_stress_atom.cpp b/src/compute_centroid_stress_atom.cpp index 1e11cd0f50..911f6f58ac 100644 --- a/src/compute_centroid_stress_atom.cpp +++ b/src/compute_centroid_stress_atom.cpp @@ -36,7 +36,8 @@ using namespace LAMMPS_NS; enum { NOBIAS, BIAS }; static const char cite_centroid_angle_improper_dihedral[] = - "compute centroid/stress/atom for angles, impropers and dihedrals: doi:10.1103/PhysRevE.99.051301\n\n" + "compute centroid/stress/atom for angles, impropers and dihedrals: " + "doi:10.1103/PhysRevE.99.051301\n\n" "@article{Surblys2019,\n" " title = {Application of Atomic Stress to Compute Heat Flux via Molecular\n" " Dynamics for Systems With Many-Body Interactions},\n" diff --git a/src/compute_chunk_atom.cpp b/src/compute_chunk_atom.cpp index f16ab05598..ccd5da433f 100644 --- a/src/compute_chunk_atom.cpp +++ b/src/compute_chunk_atom.cpp @@ -572,7 +572,7 @@ void ComputeChunkAtom::init() if ((idsflag == ONCE || lockcount) && !fixstore) { id_fix = utils::strdup(id + std::string("_COMPUTE_STORE")); fixstore = dynamic_cast( - modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 1", id_fix, group->names[igroup]))); + modify->add_fix(fmt::format("{} {} STORE/PERATOM 1 1", id_fix, group->names[igroup]))); } if ((idsflag != ONCE && !lockcount) && fixstore) { diff --git a/src/compute_chunk_spread_atom.cpp b/src/compute_chunk_spread_atom.cpp index a68174e058..34f39413f3 100644 --- a/src/compute_chunk_spread_atom.cpp +++ b/src/compute_chunk_spread_atom.cpp @@ -180,7 +180,7 @@ void ComputeChunkSpreadAtom::init() void ComputeChunkSpreadAtom::init_chunk() { - cchunk = dynamic_cast( modify->get_compute_by_id(idchunk)); + cchunk = dynamic_cast(modify->get_compute_by_id(idchunk)); if (!cchunk) error->all(FLERR,"Chunk/atom compute does not exist for compute chunk/spread/atom {}", idchunk); if (strcmp(cchunk->style,"chunk/atom") != 0) diff --git a/src/compute_com_chunk.cpp b/src/compute_com_chunk.cpp index 8124a7dccd..7a1308366e 100644 --- a/src/compute_com_chunk.cpp +++ b/src/compute_com_chunk.cpp @@ -75,7 +75,7 @@ void ComputeCOMChunk::init() int icompute = modify->find_compute(idchunk); if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for compute com/chunk"); - cchunk = dynamic_cast( modify->compute[icompute]); + cchunk = dynamic_cast(modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Compute com/chunk does not use chunk/atom compute"); } @@ -180,7 +180,7 @@ void ComputeCOMChunk::lock_disable() { int icompute = modify->find_compute(idchunk); if (icompute >= 0) { - cchunk = dynamic_cast( modify->compute[icompute]); + cchunk = dynamic_cast(modify->compute[icompute]); cchunk->lockcount--; } } diff --git a/src/compute_dipole_chunk.cpp b/src/compute_dipole_chunk.cpp index f1afcc01fd..3517fb1781 100644 --- a/src/compute_dipole_chunk.cpp +++ b/src/compute_dipole_chunk.cpp @@ -94,7 +94,7 @@ void ComputeDipoleChunk::init() if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for " "compute dipole/chunk"); - cchunk = dynamic_cast( modify->compute[icompute]); + cchunk = dynamic_cast(modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Compute dipole/chunk does not use chunk/atom compute"); @@ -232,7 +232,7 @@ void ComputeDipoleChunk::lock_disable() { int icompute = modify->find_compute(idchunk); if (icompute >= 0) { - cchunk = dynamic_cast( modify->compute[icompute]); + cchunk = dynamic_cast(modify->compute[icompute]); cchunk->lockcount--; } } diff --git a/src/compute_gyration_chunk.cpp b/src/compute_gyration_chunk.cpp index f79325274f..8dd28ca4e6 100644 --- a/src/compute_gyration_chunk.cpp +++ b/src/compute_gyration_chunk.cpp @@ -95,7 +95,7 @@ void ComputeGyrationChunk::init() if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for " "compute gyration/chunk"); - cchunk = dynamic_cast( modify->compute[icompute]); + cchunk = dynamic_cast(modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Compute gyration/chunk does not use chunk/atom compute"); } @@ -286,7 +286,7 @@ void ComputeGyrationChunk::lock_disable() { int icompute = modify->find_compute(idchunk); if (icompute >= 0) { - cchunk = dynamic_cast( modify->compute[icompute]); + cchunk = dynamic_cast(modify->compute[icompute]); cchunk->lockcount--; } } diff --git a/src/compute_inertia_chunk.cpp b/src/compute_inertia_chunk.cpp index ceca61c1b7..275ef66071 100644 --- a/src/compute_inertia_chunk.cpp +++ b/src/compute_inertia_chunk.cpp @@ -74,7 +74,7 @@ void ComputeInertiaChunk::init() if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for " "compute inertia/chunk"); - cchunk = dynamic_cast( modify->compute[icompute]); + cchunk = dynamic_cast(modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Compute inertia/chunk does not use chunk/atom compute"); } @@ -189,7 +189,7 @@ void ComputeInertiaChunk::lock_disable() { int icompute = modify->find_compute(idchunk); if (icompute >= 0) { - cchunk = dynamic_cast( modify->compute[icompute]); + cchunk = dynamic_cast(modify->compute[icompute]); cchunk->lockcount--; } } diff --git a/src/compute_msd_chunk.cpp b/src/compute_msd_chunk.cpp index c2ec394db9..14f8786db5 100644 --- a/src/compute_msd_chunk.cpp +++ b/src/compute_msd_chunk.cpp @@ -85,7 +85,7 @@ void ComputeMSDChunk::init() int icompute = modify->find_compute(idchunk); if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for compute msd/chunk"); - cchunk = dynamic_cast( modify->compute[icompute]); + cchunk = dynamic_cast(modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Compute msd/chunk does not use chunk/atom compute"); @@ -235,7 +235,7 @@ void ComputeMSDChunk::lock_disable() { int icompute = modify->find_compute(idchunk); if (icompute >= 0) { - cchunk = dynamic_cast( modify->compute[icompute]); + cchunk = dynamic_cast(modify->compute[icompute]); cchunk->lockcount--; } } diff --git a/src/compute_omega_chunk.cpp b/src/compute_omega_chunk.cpp index bf00dda6a8..0378fa19ef 100644 --- a/src/compute_omega_chunk.cpp +++ b/src/compute_omega_chunk.cpp @@ -81,7 +81,7 @@ void ComputeOmegaChunk::init() if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for " "compute omega/chunk"); - cchunk = dynamic_cast( modify->compute[icompute]); + cchunk = dynamic_cast(modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Compute omega/chunk does not use chunk/atom compute"); } @@ -313,7 +313,7 @@ void ComputeOmegaChunk::lock_disable() { int icompute = modify->find_compute(idchunk); if (icompute >= 0) { - cchunk = dynamic_cast( modify->compute[icompute]); + cchunk = dynamic_cast(modify->compute[icompute]); cchunk->lockcount--; } } diff --git a/src/compute_pressure.cpp b/src/compute_pressure.cpp index ad14b552a4..53ac58e505 100644 --- a/src/compute_pressure.cpp +++ b/src/compute_pressure.cpp @@ -202,7 +202,7 @@ void ComputePressure::init() vptr = new double*[nvirial]; nvirial = 0; if (pairhybridflag && force->pair) { - auto ph = dynamic_cast( force->pair); + auto ph = dynamic_cast(force->pair); ph->no_virial_fdotr_compute = 1; vptr[nvirial++] = pairhybrid->virial; } diff --git a/src/compute_property_atom.cpp b/src/compute_property_atom.cpp index 4d55549d99..e2b0c1e422 100644 --- a/src/compute_property_atom.cpp +++ b/src/compute_property_atom.cpp @@ -400,10 +400,10 @@ ComputePropertyAtom::~ComputePropertyAtom() void ComputePropertyAtom::init() { - avec_ellipsoid = dynamic_cast( atom->style_match("ellipsoid")); - avec_line = dynamic_cast( atom->style_match("line")); - avec_tri = dynamic_cast( atom->style_match("tri")); - avec_body = dynamic_cast( atom->style_match("body")); + avec_ellipsoid = dynamic_cast(atom->style_match("ellipsoid")); + avec_line = dynamic_cast(atom->style_match("line")); + avec_tri = dynamic_cast(atom->style_match("tri")); + avec_body = dynamic_cast(atom->style_match("body")); // NOTE: could reset custom vector/array indices here, like dump custom does // in case have been deleted diff --git a/src/compute_property_chunk.cpp b/src/compute_property_chunk.cpp index 3154e01516..46914ca358 100644 --- a/src/compute_property_chunk.cpp +++ b/src/compute_property_chunk.cpp @@ -115,7 +115,7 @@ void ComputePropertyChunk::init() if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for " "compute property/chunk"); - cchunk = dynamic_cast( modify->compute[icompute]); + cchunk = dynamic_cast(modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Compute property/chunk does not use chunk/atom compute"); } @@ -196,7 +196,7 @@ void ComputePropertyChunk::lock_disable() { int icompute = modify->find_compute(idchunk); if (icompute >= 0) { - cchunk = dynamic_cast( modify->compute[icompute]); + cchunk = dynamic_cast(modify->compute[icompute]); cchunk->lockcount--; } } diff --git a/src/compute_reduce_chunk.cpp b/src/compute_reduce_chunk.cpp index 5236917688..11604998c8 100644 --- a/src/compute_reduce_chunk.cpp +++ b/src/compute_reduce_chunk.cpp @@ -229,7 +229,7 @@ void ComputeReduceChunk::init_chunk() if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for " "compute reduce/chunk"); - cchunk = dynamic_cast( modify->compute[icompute]); + cchunk = dynamic_cast(modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Compute reduce/chunk does not use chunk/atom compute"); } @@ -451,7 +451,7 @@ void ComputeReduceChunk::lock_disable() { int icompute = modify->find_compute(idchunk); if (icompute >= 0) { - cchunk = dynamic_cast( modify->compute[icompute]); + cchunk = dynamic_cast(modify->compute[icompute]); cchunk->lockcount--; } } diff --git a/src/compute_temp_chunk.cpp b/src/compute_temp_chunk.cpp index bd17e3995d..c174c11ef9 100644 --- a/src/compute_temp_chunk.cpp +++ b/src/compute_temp_chunk.cpp @@ -164,7 +164,7 @@ void ComputeTempChunk::init() if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for " "compute temp/chunk"); - cchunk = dynamic_cast( modify->compute[icompute]); + cchunk = dynamic_cast(modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Compute temp/chunk does not use chunk/atom compute"); @@ -774,7 +774,7 @@ void ComputeTempChunk::lock_disable() { int icompute = modify->find_compute(idchunk); if (icompute >= 0) { - cchunk = dynamic_cast( modify->compute[icompute]); + cchunk = dynamic_cast(modify->compute[icompute]); cchunk->lockcount--; } } diff --git a/src/compute_torque_chunk.cpp b/src/compute_torque_chunk.cpp index 79c0ce5aed..01e91e0797 100644 --- a/src/compute_torque_chunk.cpp +++ b/src/compute_torque_chunk.cpp @@ -73,7 +73,7 @@ void ComputeTorqueChunk::init() if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for " "compute torque/chunk"); - cchunk = dynamic_cast( modify->compute[icompute]); + cchunk = dynamic_cast(modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Compute torque/chunk does not use chunk/atom compute"); } @@ -185,7 +185,7 @@ void ComputeTorqueChunk::lock_disable() { int icompute = modify->find_compute(idchunk); if (icompute >= 0) { - cchunk = dynamic_cast( modify->compute[icompute]); + cchunk = dynamic_cast(modify->compute[icompute]); cchunk->lockcount--; } } diff --git a/src/compute_vcm_chunk.cpp b/src/compute_vcm_chunk.cpp index 5ac73f8d1e..66e7dbeb48 100644 --- a/src/compute_vcm_chunk.cpp +++ b/src/compute_vcm_chunk.cpp @@ -73,7 +73,7 @@ void ComputeVCMChunk::init() int icompute = modify->find_compute(idchunk); if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for compute vcm/chunk"); - cchunk = dynamic_cast( modify->compute[icompute]); + cchunk = dynamic_cast(modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Compute vcm/chunk does not use chunk/atom compute"); } @@ -175,7 +175,7 @@ void ComputeVCMChunk::lock_disable() { int icompute = modify->find_compute(idchunk); if (icompute >= 0) { - cchunk = dynamic_cast( modify->compute[icompute]); + cchunk = dynamic_cast(modify->compute[icompute]); cchunk->lockcount--; } } diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp index 85e83d694f..9fb3916965 100644 --- a/src/create_atoms.cpp +++ b/src/create_atoms.cpp @@ -976,7 +976,7 @@ int CreateAtoms::add_quasirandom(const double vert[3][3], tagint molid) area = 0.5 * MathExtra::len3(temp); int nparticles = ceil(mesh_density * area); // estimate radius from number of particles and area - double rad = sqrt(area/MY_PI/nparticles); + double rad = sqrt(area / MY_PI / nparticles); for (int i = 0; i < nparticles; i++) { // Define point in unit square diff --git a/src/create_atoms.h b/src/create_atoms.h index dfd24ec1ba..826be1b8c4 100644 --- a/src/create_atoms.h +++ b/src/create_atoms.h @@ -67,8 +67,8 @@ class CreateAtoms : public Command { void add_single(); void add_random(); void add_mesh(const char *); - int add_bisection(const double [3][3], tagint); - int add_quasirandom(const double [3][3], tagint); + int add_bisection(const double[3][3], tagint); + int add_quasirandom(const double[3][3], tagint); void add_lattice(); void loop_lattice(int); void add_molecule(double *); diff --git a/src/create_box.cpp b/src/create_box.cpp index 163ac89394..679c1f31bd 100644 --- a/src/create_box.cpp +++ b/src/create_box.cpp @@ -143,19 +143,22 @@ void CreateBox::command(int narg, char **arg) atom->angle_per_atom = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "extra/dihedral/per/atom") == 0) { - if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "create_box extra/dihedral/per/atom", error); + if (iarg + 2 > narg) + utils::missing_cmd_args(FLERR, "create_box extra/dihedral/per/atom", error); if (!atom->avec->dihedrals_allow) error->all(FLERR, "No dihedrals allowed with atom style {}", atom->get_style()); atom->dihedral_per_atom = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "extra/improper/per/atom") == 0) { - if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "create_box extra/improper/per/atom", error); + if (iarg + 2 > narg) + utils::missing_cmd_args(FLERR, "create_box extra/improper/per/atom", error); if (!atom->avec->impropers_allow) error->all(FLERR, "No impropers allowed with atom style {}", atom->get_style()); atom->improper_per_atom = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else if (strcmp(arg[iarg], "extra/special/per/atom") == 0) { - if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "create_box extra/special/per/atom", error); + if (iarg + 2 > narg) + utils::missing_cmd_args(FLERR, "create_box extra/special/per/atom", error); force->special_extra = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); atom->maxspecial += force->special_extra; iarg += 2; diff --git a/src/delete_atoms.cpp b/src/delete_atoms.cpp index 9c50839c4a..f9a4197b71 100644 --- a/src/delete_atoms.cpp +++ b/src/delete_atoms.cpp @@ -358,7 +358,7 @@ void DeleteAtoms::delete_overlap(int narg, char **arg) for (ii = 0; ii < inum; ii++) { i = ilist[ii]; - if (!(mask[i] & (group1bit|group2bit))) continue; + if (!(mask[i] & (group1bit | group2bit))) continue; xtmp = x[i][0]; ytmp = x[i][1]; ztmp = x[i][2]; @@ -370,7 +370,7 @@ void DeleteAtoms::delete_overlap(int narg, char **arg) factor_lj = special_lj[sbmask(j)]; factor_coul = special_coul[sbmask(j)]; j &= NEIGHMASK; - if (!(mask[j] & (group1bit|group2bit))) continue; + if (!(mask[j] & (group1bit | group2bit))) continue; // if both weighting factors are 0, skip this pair // could be 0 and still be in neigh list for long-range Coulombics diff --git a/src/displace_atoms.cpp b/src/displace_atoms.cpp index 75298604c9..5dc862a023 100644 --- a/src/displace_atoms.cpp +++ b/src/displace_atoms.cpp @@ -263,10 +263,10 @@ void DisplaceAtoms::command(int narg, char **arg) // AtomVec pointers to retrieve per-atom storage of extra quantities - auto avec_ellipsoid = dynamic_cast( atom->style_match("ellipsoid")); - auto avec_line = dynamic_cast( atom->style_match("line")); - auto avec_tri = dynamic_cast( atom->style_match("tri")); - auto avec_body = dynamic_cast( atom->style_match("body")); + auto avec_ellipsoid = dynamic_cast(atom->style_match("ellipsoid")); + auto avec_line = dynamic_cast(atom->style_match("line")); + auto avec_tri = dynamic_cast(atom->style_match("tri")); + auto avec_body = dynamic_cast(atom->style_match("body")); double **x = atom->x; int *ellipsoid = atom->ellipsoid; diff --git a/src/domain.cpp b/src/domain.cpp index 48631a0899..8df73852c2 100644 --- a/src/domain.cpp +++ b/src/domain.cpp @@ -125,7 +125,7 @@ Domain::~Domain() { if (copymode) return; - for (auto reg : regions) delete reg; + for (auto ® : regions) delete reg; regions.clear(); delete lattice; delete region_map; @@ -182,7 +182,7 @@ void Domain::init() for (const auto &fix : fixes) if (utils::strmatch(fix->style,"^deform")) { deform_flag = 1; - if ((dynamic_cast( fix))->remapflag == Domain::V_REMAP) { + if ((dynamic_cast(fix))->remapflag == Domain::V_REMAP) { deform_vremap = 1; deform_groupbit = fix->groupbit; } @@ -190,7 +190,7 @@ void Domain::init() // region inits - for (auto reg : regions) reg->init(); + for (auto ® : regions) reg->init(); } /* ---------------------------------------------------------------------- diff --git a/src/dump.cpp b/src/dump.cpp index 247da8595a..e8134adc0f 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -373,12 +373,12 @@ void Dump::write() // use nmax to insure filewriter proc can receive info from others // limit nmax*size_one to int since used as arg in MPI calls - if (nmax > maxbuf) { + if (nmax*size_one > maxbuf) { if ((bigint) nmax * size_one > MAXSMALLINT) error->all(FLERR,"Too much per-proc info for dump"); - maxbuf = nmax; + maxbuf = nmax * size_one; memory->destroy(buf); - memory->create(buf,maxbuf*size_one,"dump:buf"); + memory->create(buf,maxbuf,"dump:buf"); } // insure ids buffer is sized for sorting @@ -467,7 +467,7 @@ void Dump::write() if (filewriter) { for (int iproc = 0; iproc < nclusterprocs; iproc++) { if (iproc) { - MPI_Irecv(buf,maxbuf*size_one,MPI_DOUBLE,me+iproc,0,world,&request); + MPI_Irecv(buf,maxbuf,MPI_DOUBLE,me+iproc,0,world,&request); MPI_Send(&tmp,0,MPI_INT,me+iproc,0,world); MPI_Wait(&request,&status); MPI_Get_count(&status,MPI_DOUBLE,&nlines); @@ -749,10 +749,10 @@ void Dump::sort() int nmax; MPI_Allreduce(&nme,&nmax,1,MPI_INT,MPI_MAX,world); - if (nmax > maxbuf) { - maxbuf = nmax; + if (nmax*size_one > maxbuf) { + maxbuf = nmax * size_one; memory->destroy(buf); - memory->create(buf,maxbuf*size_one,"dump:buf"); + memory->create(buf,maxbuf,"dump:buf"); } // copy data from bufsort to buf using index @@ -933,12 +933,12 @@ void Dump::balance() int nmax; MPI_Allreduce(&nme_balance,&nmax,1,MPI_INT,MPI_MAX,world); - if (nmax > maxbuf) maxbuf = nmax; + if (nmax*size_one > maxbuf) maxbuf = nmax*size_one; // allocate a second buffer for balanced data - double* buf_balance; - memory->create(buf_balance,maxbuf*size_one,"dump:buf_balance"); + double *buf_balance; + memory->create(buf_balance,maxbuf,"dump:buf_balance"); // compute from which procs I am receiving atoms // post recvs first @@ -1044,6 +1044,12 @@ void Dump::modify_params(int narg, char **arg) append_flag = utils::logical(FLERR,arg[iarg+1],false,lmp); iarg += 2; + } else if (strcmp(arg[iarg],"balance") == 0) { + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify balance", error); + if (nprocs > 1) + balance_flag = utils::logical(FLERR,arg[iarg+1],false,lmp); + iarg += 2; + } else if (strcmp(arg[iarg],"buffer") == 0) { if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify buffer", error); buffer_flag = utils::logical(FLERR,arg[iarg+1],false,lmp); @@ -1051,6 +1057,32 @@ void Dump::modify_params(int narg, char **arg) error->all(FLERR,"Dump_modify buffer yes not allowed for this style"); iarg += 2; + } else if (strcmp(arg[iarg],"colname") == 0) { + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify colname", error); + if (strcmp(arg[iarg+1],"default") == 0) { + for (auto &item : keyword_user) item.clear(); + iarg += 2; + } else { + if (iarg+3 > narg) utils::missing_cmd_args(FLERR, "dump_modify colname", error); + int icol = -1; + if (utils::is_integer(arg[iarg + 1])) { + icol = utils::inumeric(FLERR,arg[iarg + 1],false,lmp); + if (icol < 0) icol = keyword_user.size() + icol + 1; + icol--; + } else { + try { + icol = key2col.at(arg[iarg + 1]); + } catch (std::out_of_range &) { + icol = -1; + } + } + if ((icol < 0) || (icol >= (int)keyword_user.size())) + error->all(FLERR, "Incorrect dump_modify arguments: {} {} {}", + arg[iarg], arg[iarg+1], arg[iarg+2]); + keyword_user[icol] = arg[iarg+2]; + iarg += 3; + } + } else if (strcmp(arg[iarg],"delay") == 0) { if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify delay", error); delaystep = utils::bnumeric(FLERR,arg[iarg+1],false,lmp); @@ -1133,31 +1165,6 @@ void Dump::modify_params(int narg, char **arg) flush_flag = utils::logical(FLERR,arg[iarg+1],false,lmp); iarg += 2; - } else if (strcmp(arg[iarg],"colname") == 0) { - if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify colname", error); - if (strcmp(arg[iarg+1],"default") == 0) { - for (auto &item : keyword_user) item.clear(); - iarg += 2; - } else { - if (iarg+3 > narg) utils::missing_cmd_args(FLERR, "dump_modify colname", error); - int icol = -1; - if (utils::is_integer(arg[iarg + 1])) { - icol = utils::inumeric(FLERR,arg[iarg + 1],false,lmp); - if (icol < 0) icol = keyword_user.size() + icol + 1; - icol--; - } else { - try { - icol = key2col.at(arg[iarg + 1]); - } catch (std::out_of_range &) { - icol = -1; - } - } - if ((icol < 0) || (icol >= (int)keyword_user.size())) - error->all(FLERR, "Incorrect dump_modify arguments: {} {} {}", - arg[iarg], arg[iarg+1], arg[iarg+2]); - keyword_user[icol] = arg[iarg+2]; - iarg += 3; - } } else if (strcmp(arg[iarg],"format") == 0) { if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify format", error); @@ -1214,6 +1221,7 @@ void Dump::modify_params(int narg, char **arg) fileidx = 0; } iarg += 2; + } else if (strcmp(arg[iarg],"nfile") == 0) { if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify nfile", error); if (!multiproc) @@ -1276,12 +1284,6 @@ void Dump::modify_params(int narg, char **arg) } iarg += 2; - } else if (strcmp(arg[iarg],"balance") == 0) { - if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify blance", error); - if (nprocs > 1) - balance_flag = utils::logical(FLERR,arg[iarg+1],false,lmp); - iarg += 2; - } else if (strcmp(arg[iarg],"time") == 0) { if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify time", error); time_flag = utils::logical(FLERR,arg[iarg+1],false,lmp); @@ -1328,7 +1330,7 @@ void Dump::pbc_allocate() double Dump::memory_usage() { - double bytes = memory->usage(buf,size_one*maxbuf); + double bytes = memory->usage(buf,maxbuf); bytes += memory->usage(sbuf,maxsbuf); if (sort_flag) { if (sortcol == 0) bytes += memory->usage(ids,maxids); diff --git a/src/dump.h b/src/dump.h index 90866a3567..7d17288710 100644 --- a/src/dump.h +++ b/src/dump.h @@ -45,9 +45,15 @@ class Dump : protected Pointers { void init(); virtual void write(); - virtual int pack_forward_comm(int, int *, double *, int, int *) { return 0; } + virtual int pack_forward_comm(int, int *, double *, int, int *) + { + return 0; + } virtual void unpack_forward_comm(int, int, double *) {} - virtual int pack_reverse_comm(int, int, double *) { return 0; } + virtual int pack_reverse_comm(int, int, double *) + { + return 0; + } virtual void unpack_reverse_comm(int, int *, double *) {} void modify_params(int, char **); @@ -147,11 +153,17 @@ class Dump : protected Pointers { virtual void init_style() = 0; virtual void openfile(); - virtual int modify_param(int, char **) { return 0; } + virtual int modify_param(int, char **) + { + return 0; + } virtual void write_header(bigint) = 0; virtual int count(); virtual void pack(tagint *) = 0; - virtual int convert_string(int, double *) { return 0; } + virtual int convert_string(int, double *) + { + return 0; + } virtual void write_data(int, double *) = 0; virtual void write_footer() {} diff --git a/src/dump_atom.cpp b/src/dump_atom.cpp index ef567abdb2..8daf2d1d0a 100644 --- a/src/dump_atom.cpp +++ b/src/dump_atom.cpp @@ -131,10 +131,12 @@ int DumpAtom::modify_param(int narg, char **arg) if (strcmp(arg[0],"scale") == 0) { if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); scale_flag = utils::logical(FLERR,arg[1],false,lmp); + for (auto &item : keyword_user) item.clear(); return 2; } else if (strcmp(arg[0],"image") == 0) { if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); image_flag = utils::logical(FLERR,arg[1],false,lmp); + for (auto &item : keyword_user) item.clear(); return 2; } return 0; diff --git a/src/dump_image.cpp b/src/dump_image.cpp index 7a7f89801a..3f4e5c7457 100644 --- a/src/dump_image.cpp +++ b/src/dump_image.cpp @@ -332,17 +332,17 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : // error checks and setup for lineflag, triflag, bodyflag, fixflag if (lineflag) { - avec_line = dynamic_cast( atom->style_match("line")); + avec_line = dynamic_cast(atom->style_match("line")); if (!avec_line) error->all(FLERR,"Dump image line requires atom style line"); } if (triflag) { - avec_tri = dynamic_cast( atom->style_match("tri")); + avec_tri = dynamic_cast(atom->style_match("tri")); if (!avec_tri) error->all(FLERR,"Dump image tri requires atom style tri"); } if (bodyflag) { - avec_body = dynamic_cast( atom->style_match("body")); + avec_body = dynamic_cast(atom->style_match("body")); if (!avec_body) error->all(FLERR,"Dump image body yes requires atom style body"); } diff --git a/src/dump_local.h b/src/dump_local.h index ae49d6c479..da06092522 100644 --- a/src/dump_local.h +++ b/src/dump_local.h @@ -37,7 +37,7 @@ class DumpLocal : public Dump { int *vtype; // type of each vector (INT, DOUBLE) char **vformat; // format string for each vector element - char *columns; // column labels + char *columns; // column labels char *columns_default; int nfield; // # of keywords listed by user diff --git a/src/finish.cpp b/src/finish.cpp index 5300bf8ef7..b35fed0dde 100644 --- a/src/finish.cpp +++ b/src/finish.cpp @@ -346,7 +346,7 @@ void Finish::end(int flag) } #ifdef LMP_OPENMP - FixOMP *fixomp = dynamic_cast( modify->get_fix_by_id("package_omp")); + FixOMP *fixomp = dynamic_cast(modify->get_fix_by_id("package_omp")); // print thread breakdown only with full timer detail diff --git a/src/fix_adapt.cpp b/src/fix_adapt.cpp index 3fa6f4b8df..75817ec083 100644 --- a/src/fix_adapt.cpp +++ b/src/fix_adapt.cpp @@ -380,7 +380,7 @@ void FixAdapt::init() // if pair hybrid, test that ilo,ihi,jlo,jhi are valid for sub-style if (utils::strmatch(force->pair_style,"^hybrid")) { - auto pair = dynamic_cast( force->pair); + auto pair = dynamic_cast(force->pair); for (i = ad->ilo; i <= ad->ihi; i++) for (j = MAX(ad->jlo,i); j <= ad->jhi; j++) if (!pair->check_ijtype(i,j,pstyle)) diff --git a/src/fix_ave_chunk.cpp b/src/fix_ave_chunk.cpp index 9d378f2e0c..688c4676e1 100644 --- a/src/fix_ave_chunk.cpp +++ b/src/fix_ave_chunk.cpp @@ -466,7 +466,7 @@ void FixAveChunk::init() int icompute = modify->find_compute(idchunk); if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for fix ave/chunk"); - cchunk = dynamic_cast( modify->compute[icompute]); + cchunk = dynamic_cast(modify->compute[icompute]); if (biasflag) { int i = modify->find_compute(id_bias); diff --git a/src/fix_deform.cpp b/src/fix_deform.cpp index de24d9d652..bc6e61a69e 100644 --- a/src/fix_deform.cpp +++ b/src/fix_deform.cpp @@ -882,7 +882,7 @@ void FixDeform::end_of_step() if (mask[i] & groupbit) domain->x2lamda(x[i],x[i]); - for (auto ifix : rfix) + for (auto &ifix : rfix) ifix->deform(0); } @@ -921,7 +921,7 @@ void FixDeform::end_of_step() if (mask[i] & groupbit) domain->lamda2x(x[i],x[i]); - for (auto ifix : rfix) + for (auto &ifix : rfix) ifix->deform(1); } diff --git a/src/fix_enforce2d.cpp b/src/fix_enforce2d.cpp index cc3b79c45d..fc8240ae44 100644 --- a/src/fix_enforce2d.cpp +++ b/src/fix_enforce2d.cpp @@ -93,11 +93,11 @@ void FixEnforce2D::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - int nlevels_respa = (dynamic_cast( update->integrate))->nlevels; + int nlevels_respa = (dynamic_cast(update->integrate))->nlevels; for (int ilevel = 0; ilevel < nlevels_respa; ilevel++) { - (dynamic_cast( update->integrate))->copy_flevel_f(ilevel); + (dynamic_cast(update->integrate))->copy_flevel_f(ilevel); post_force_respa(vflag,ilevel,0); - (dynamic_cast( update->integrate))->copy_f_flevel(ilevel); + (dynamic_cast(update->integrate))->copy_f_flevel(ilevel); } } } diff --git a/src/fix_gravity.cpp b/src/fix_gravity.cpp index cf559043cf..7d8b5aa906 100644 --- a/src/fix_gravity.cpp +++ b/src/fix_gravity.cpp @@ -181,7 +181,7 @@ int FixGravity::setmask() void FixGravity::init() { if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; + ilevel_respa = (dynamic_cast(update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -245,9 +245,9 @@ void FixGravity::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); + (dynamic_cast(update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); + (dynamic_cast(update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/fix_indent.cpp b/src/fix_indent.cpp index f38ab5efa6..ab9ef08e30 100644 --- a/src/fix_indent.cpp +++ b/src/fix_indent.cpp @@ -155,7 +155,7 @@ void FixIndent::init() } if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; + ilevel_respa = (dynamic_cast(update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } } @@ -167,9 +167,9 @@ void FixIndent::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); + (dynamic_cast(update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); + (dynamic_cast(update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/fix_lineforce.cpp b/src/fix_lineforce.cpp index d9408efb48..fa284d3ed2 100644 --- a/src/fix_lineforce.cpp +++ b/src/fix_lineforce.cpp @@ -62,11 +62,11 @@ void FixLineForce::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - int nlevels_respa = (dynamic_cast( update->integrate))->nlevels; + int nlevels_respa = (dynamic_cast(update->integrate))->nlevels; for (int ilevel = 0; ilevel < nlevels_respa; ilevel++) { - (dynamic_cast( update->integrate))->copy_flevel_f(ilevel); + (dynamic_cast(update->integrate))->copy_flevel_f(ilevel); post_force_respa(vflag,ilevel,0); - (dynamic_cast( update->integrate))->copy_f_flevel(ilevel); + (dynamic_cast(update->integrate))->copy_f_flevel(ilevel); } } } diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp index 9f5915cf1e..a1b46c51fb 100644 --- a/src/fix_nh.cpp +++ b/src/fix_nh.cpp @@ -648,7 +648,7 @@ void FixNH::init() if (pstat_flag) for (int i = 0; i < modify->nfix; i++) if (strcmp(modify->fix[i]->style,"deform") == 0) { - int *dimflag = (dynamic_cast( modify->fix[i]))->dimflag; + int *dimflag = (dynamic_cast(modify->fix[i]))->dimflag; if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) || (p_flag[2] && dimflag[2]) || (p_flag[3] && dimflag[3]) || (p_flag[4] && dimflag[4]) || (p_flag[5] && dimflag[5])) @@ -719,8 +719,8 @@ void FixNH::init() else kspace_flag = 0; if (utils::strmatch(update->integrate_style,"^respa")) { - nlevels_respa = (dynamic_cast( update->integrate))->nlevels; - step_respa = (dynamic_cast( update->integrate))->step; + nlevels_respa = (dynamic_cast(update->integrate))->nlevels; + step_respa = (dynamic_cast(update->integrate))->step; dto = 0.5*step_respa[0]; } diff --git a/src/fix_nve.cpp b/src/fix_nve.cpp index a4c9060e6a..fd8c4a4099 100644 --- a/src/fix_nve.cpp +++ b/src/fix_nve.cpp @@ -55,7 +55,7 @@ void FixNVE::init() dtf = 0.5 * update->dt * force->ftm2v; if (utils::strmatch(update->integrate_style,"^respa")) - step_respa = (dynamic_cast( update->integrate))->step; + step_respa = (dynamic_cast(update->integrate))->step; } /* ---------------------------------------------------------------------- diff --git a/src/fix_nve_limit.cpp b/src/fix_nve_limit.cpp index fdebcf5bfe..0ce217168e 100644 --- a/src/fix_nve_limit.cpp +++ b/src/fix_nve_limit.cpp @@ -67,7 +67,7 @@ void FixNVELimit::init() ncount = 0; if (utils::strmatch(update->integrate_style,"^respa")) - step_respa = (dynamic_cast( update->integrate))->step; + step_respa = (dynamic_cast(update->integrate))->step; // warn if using fix shake, which will lead to invalid constraint forces diff --git a/src/fix_nvt_sllod.cpp b/src/fix_nvt_sllod.cpp index 8c5116c070..a721afd2ee 100644 --- a/src/fix_nvt_sllod.cpp +++ b/src/fix_nvt_sllod.cpp @@ -73,7 +73,7 @@ void FixNVTSllod::init() int i; for (i = 0; i < modify->nfix; i++) if (strncmp(modify->fix[i]->style,"deform",6) == 0) { - if ((dynamic_cast( modify->fix[i]))->remapflag != Domain::V_REMAP) + if ((dynamic_cast(modify->fix[i]))->remapflag != Domain::V_REMAP) error->all(FLERR,"Using fix nvt/sllod with inconsistent fix deform " "remap option"); break; diff --git a/src/fix_planeforce.cpp b/src/fix_planeforce.cpp index 0d91f2b90e..c58b87630a 100644 --- a/src/fix_planeforce.cpp +++ b/src/fix_planeforce.cpp @@ -62,11 +62,11 @@ void FixPlaneForce::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - int nlevels_respa = (dynamic_cast( update->integrate))->nlevels; + int nlevels_respa = (dynamic_cast(update->integrate))->nlevels; for (int ilevel = 0; ilevel < nlevels_respa; ilevel++) { - (dynamic_cast( update->integrate))->copy_flevel_f(ilevel); + (dynamic_cast(update->integrate))->copy_flevel_f(ilevel); post_force_respa(vflag,ilevel,0); - (dynamic_cast( update->integrate))->copy_f_flevel(ilevel); + (dynamic_cast(update->integrate))->copy_f_flevel(ilevel); } } } diff --git a/src/fix_property_atom.cpp b/src/fix_property_atom.cpp index 3e09815dfe..a6a1b997e3 100644 --- a/src/fix_property_atom.cpp +++ b/src/fix_property_atom.cpp @@ -30,8 +30,7 @@ enum { MOLECULE, CHARGE, RMASS, IVEC, DVEC, IARRAY, DARRAY }; /* ---------------------------------------------------------------------- */ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), - nvalue(0), styles(nullptr), index(nullptr), astyle(nullptr) + Fix(lmp, narg, arg), nvalue(0), styles(nullptr), index(nullptr), astyle(nullptr) { if (narg < 4) error->all(FLERR, "Illegal fix property/atom command"); @@ -300,12 +299,10 @@ void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf, tagint atom->dvector[index[j]][m] = values.next_double(); } else if (styles[j] == IARRAY) { ncol = cols[j]; - for (k = 0; k < ncol; k++) - atom->iarray[index[j]][m][k] = values.next_int(); + for (k = 0; k < ncol; k++) atom->iarray[index[j]][m][k] = values.next_int(); } else if (styles[j] == DARRAY) { ncol = cols[j]; - for (k = 0; k < ncol; k++) - atom->darray[index[j]][m][k] = values.next_double(); + for (k = 0; k < ncol; k++) atom->darray[index[j]][m][k] = values.next_double(); } } } @@ -566,12 +563,10 @@ void FixPropertyAtom::copy_arrays(int i, int j, int /*delflag*/) atom->dvector[index[nv]][j] = atom->dvector[index[nv]][i]; else if (styles[nv] == IARRAY) { ncol = cols[nv]; - for (k = 0; k < ncol; k++) - atom->iarray[index[nv]][j][k] = atom->iarray[index[nv]][i][k]; + for (k = 0; k < ncol; k++) atom->iarray[index[nv]][j][k] = atom->iarray[index[nv]][i][k]; } else if (styles[nv] == DARRAY) { ncol = cols[nv]; - for (k = 0; k < ncol; k++) - atom->darray[index[nv]][j][k] = atom->darray[index[nv]][i][k]; + for (k = 0; k < ncol; k++) atom->darray[index[nv]][j][k] = atom->darray[index[nv]][i][k]; } } } @@ -671,8 +666,7 @@ int FixPropertyAtom::unpack_border(int n, int first, double *buf) ncol = cols[nv]; last = first + n; for (i = first; i < last; i++) - for (k = 0; k < ncol; k++) - iarray[i][k] = (int) ubuf(buf[m++]).i; + for (k = 0; k < ncol; k++) iarray[i][k] = (int) ubuf(buf[m++]).i; } else if (styles[nv] == DARRAY) { double **darray = atom->darray[index[nv]]; ncol = cols[nv]; @@ -739,8 +733,7 @@ int FixPropertyAtom::unpack_exchange(int nlocal, double *buf) atom->dvector[index[nv]][nlocal] = buf[m++]; else if (styles[nv] == IARRAY) { ncol = cols[nv]; - for (k = 0; k < ncol; k++) - atom->iarray[index[nv]][nlocal][k] = (int) ubuf(buf[m++]).i; + for (k = 0; k < ncol; k++) atom->iarray[index[nv]][nlocal][k] = (int) ubuf(buf[m++]).i; } else if (styles[nv] == DARRAY) { ncol = cols[nv]; for (k = 0; k < ncol; k++) atom->darray[index[nv]][nlocal][k] = buf[m++]; @@ -776,12 +769,10 @@ int FixPropertyAtom::pack_restart(int i, double *buf) buf[m++] = atom->dvector[index[nv]][i]; else if (styles[nv] == IARRAY) { ncol = cols[nv]; - for (k = 0; k < ncol; k++) - buf[m++] = ubuf(atom->iarray[index[nv]][i][k]).d; + for (k = 0; k < ncol; k++) buf[m++] = ubuf(atom->iarray[index[nv]][i][k]).d; } else if (styles[nv] == DARRAY) { ncol = cols[nv]; - for (k = 0; k < ncol; k++) - buf[m++] = atom->darray[index[nv]][i][k]; + for (k = 0; k < ncol; k++) buf[m++] = atom->darray[index[nv]][i][k]; } } diff --git a/src/fix_recenter.cpp b/src/fix_recenter.cpp index 1f2fedc842..b5a1d39d1a 100644 --- a/src/fix_recenter.cpp +++ b/src/fix_recenter.cpp @@ -146,7 +146,7 @@ void FixRecenter::init() } if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = (dynamic_cast( update->integrate))->nlevels; + nlevels_respa = (dynamic_cast(update->integrate))->nlevels; } /* ---------------------------------------------------------------------- */ diff --git a/src/fix_restrain.cpp b/src/fix_restrain.cpp index e5440830f5..0dde6a7f39 100644 --- a/src/fix_restrain.cpp +++ b/src/fix_restrain.cpp @@ -186,7 +186,7 @@ int FixRestrain::setmask() void FixRestrain::init() { if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; + ilevel_respa = (dynamic_cast(update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } } @@ -198,9 +198,9 @@ void FixRestrain::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); + (dynamic_cast(update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); + (dynamic_cast(update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/fix_spring.cpp b/src/fix_spring.cpp index 46310ef181..ccc2b288a9 100644 --- a/src/fix_spring.cpp +++ b/src/fix_spring.cpp @@ -130,7 +130,7 @@ void FixSpring::init() if (styleflag == COUPLE) masstotal2 = group->mass(igroup2); if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; + ilevel_respa = (dynamic_cast(update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } } @@ -142,9 +142,9 @@ void FixSpring::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); + (dynamic_cast(update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); + (dynamic_cast(update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/fix_spring_chunk.cpp b/src/fix_spring_chunk.cpp index 7d316af50d..c727b14bad 100644 --- a/src/fix_spring_chunk.cpp +++ b/src/fix_spring_chunk.cpp @@ -108,7 +108,7 @@ void FixSpringChunk::init() idchunk, ccom->idchunk); if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; + ilevel_respa = (dynamic_cast(update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } } @@ -120,9 +120,9 @@ void FixSpringChunk::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); + (dynamic_cast(update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); + (dynamic_cast(update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/fix_spring_self.cpp b/src/fix_spring_self.cpp index 180f7427ec..2c62bdc3c0 100644 --- a/src/fix_spring_self.cpp +++ b/src/fix_spring_self.cpp @@ -122,7 +122,7 @@ int FixSpringSelf::setmask() void FixSpringSelf::init() { if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; + ilevel_respa = (dynamic_cast(update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } } @@ -134,9 +134,9 @@ void FixSpringSelf::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); + (dynamic_cast(update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); + (dynamic_cast(update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/fix_store_force.cpp b/src/fix_store_force.cpp index 8e696c075c..d63d5e67ea 100644 --- a/src/fix_store_force.cpp +++ b/src/fix_store_force.cpp @@ -70,7 +70,7 @@ int FixStoreForce::setmask() void FixStoreForce::init() { if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = (dynamic_cast( update->integrate))->nlevels; + nlevels_respa = (dynamic_cast(update->integrate))->nlevels; } /* ---------------------------------------------------------------------- */ @@ -80,9 +80,9 @@ void FixStoreForce::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - (dynamic_cast( update->integrate))->copy_flevel_f(nlevels_respa-1); + (dynamic_cast(update->integrate))->copy_flevel_f(nlevels_respa-1); post_force_respa(vflag,nlevels_respa-1,0); - (dynamic_cast( update->integrate))->copy_f_flevel(nlevels_respa-1); + (dynamic_cast(update->integrate))->copy_f_flevel(nlevels_respa-1); } } diff --git a/src/fix_viscous.cpp b/src/fix_viscous.cpp index f0c6faa419..65515f2802 100644 --- a/src/fix_viscous.cpp +++ b/src/fix_viscous.cpp @@ -82,7 +82,7 @@ void FixViscous::init() int max_respa = 0; if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = max_respa = (dynamic_cast( update->integrate))->nlevels-1; + ilevel_respa = max_respa = (dynamic_cast(update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,max_respa); } } @@ -94,9 +94,9 @@ void FixViscous::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); + (dynamic_cast(update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); + (dynamic_cast(update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/fix_wall.cpp b/src/fix_wall.cpp index 2156ac321c..0eee94b1f7 100644 --- a/src/fix_wall.cpp +++ b/src/fix_wall.cpp @@ -261,7 +261,7 @@ void FixWall::init() for (int m = 0; m < nwall; m++) precompute(m); if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; + ilevel_respa = (dynamic_cast(update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } } @@ -273,9 +273,9 @@ void FixWall::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) { if (!fldflag) post_force(vflag); } else { - (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); + (dynamic_cast(update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); + (dynamic_cast(update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/fmt/core.h b/src/fmt/core.h index 69e9296654..39000078c0 100644 --- a/src/fmt/core.h +++ b/src/fmt/core.h @@ -412,7 +412,10 @@ template auto convert_for_visit(T) -> monostate { return {}; } template FMT_CONSTEXPR auto to_unsigned(Int value) -> typename std::make_unsigned::type { +#if 0 + // LAMMPS customization: disable assertion to avoid bogus warnings FMT_ASSERT(std::is_unsigned::value || value >= 0, "negative value"); +#endif return static_cast::type>(value); } diff --git a/src/force.cpp b/src/force.cpp index 300c020c4b..3c5e6fe7c8 100644 --- a/src/force.cpp +++ b/src/force.cpp @@ -771,16 +771,21 @@ void Force::set_special(int narg, char **arg) if (iarg + 2 > narg) error->all(FLERR, "Illegal special_bonds command"); special_dihedral = utils::logical(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"one/five") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal special_bonds command"); - if (strcmp(arg[iarg+1],"no") == 0) special_onefive = 0; - else if (strcmp(arg[iarg+1],"yes") == 0) special_onefive = 1; - else error->all(FLERR,"Illegal special_bonds command"); + } else if (strcmp(arg[iarg], "one/five") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal special_bonds command"); + if (strcmp(arg[iarg + 1], "no") == 0) + special_onefive = 0; + else if (strcmp(arg[iarg + 1], "yes") == 0) + special_onefive = 1; + else + error->all(FLERR, "Illegal special_bonds command"); if (special_onefive && atom->nspecial15_flag == 0) - error->all(FLERR,"Cannot set special_bonds one/five if " + error->all(FLERR, + "Cannot set special_bonds one/five if " "atom style does not support it"); iarg += 2; - } else error->all(FLERR,"Illegal special_bonds command"); + } else + error->all(FLERR, "Illegal special_bonds command"); } for (int i = 1; i <= 3; i++) diff --git a/src/improper_deprecated.cpp b/src/improper_deprecated.cpp index 7b757e62e1..5012d1d2a3 100644 --- a/src/improper_deprecated.cpp +++ b/src/improper_deprecated.cpp @@ -17,11 +17,10 @@ #include "improper_deprecated.h" -#include "improper_hybrid.h" #include "comm.h" -#include "force.h" #include "error.h" - +#include "force.h" +#include "improper_hybrid.h" using namespace LAMMPS_NS; @@ -35,17 +34,15 @@ void ImproperDeprecated::settings(int, char **) // so when this is called, our style was just added at the end // of the list of substyles - if (utils::strmatch(my_style,"^hybrid")) { + if (utils::strmatch(my_style, "^hybrid")) { auto hybrid = dynamic_cast(force->improper); my_style = hybrid->keywords[hybrid->nstyles]; } if (my_style == "DEPRECATED") { if (lmp->comm->me == 0) - utils::logmesg(lmp,"\nImproper style 'DEPRECATED' is a dummy style\n\n"); + utils::logmesg(lmp, "\nImproper style 'DEPRECATED' is a dummy style\n\n"); return; } - error->all(FLERR,"This improper style is no longer available"); + error->all(FLERR, "This improper style is no longer available"); } - - diff --git a/src/input.cpp b/src/input.cpp index a641f300a3..09e5d6decb 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -212,7 +212,7 @@ void Input::file() mstart = m; - while (1) { + while (true) { if (maxline-m < 2) reallocate(line,maxline,0); // end of file reached, so break @@ -437,18 +437,18 @@ void Input::parse() } if (*ptr == '\'') { ptrmatch = strchr(ptr+1,'\''); - if (ptrmatch == NULL) + if (ptrmatch == nullptr) error->all(FLERR,"Unmatched single quote in command"); ptr = ptrmatch + 1; } else if (*ptr == '"') { if (strstr(ptr,"\"\"\"") == ptr) { ptrmatch = strstr(ptr+3,"\"\"\""); - if (ptrmatch == NULL) + if (ptrmatch == nullptr) error->all(FLERR,"Unmatched triple quote in command"); ptr = ptrmatch + 3; } else { ptrmatch = strchr(ptr+1,'"'); - if (ptrmatch == NULL) + if (ptrmatch == nullptr) error->all(FLERR,"Unmatched double quote in command"); ptr = ptrmatch + 1; } @@ -669,7 +669,7 @@ void Input::substitute(char *&str, char *&str2, int &max, int &max2, int flag) } else if (*ptr == '\'') { ptrmatch = strchr(ptr+1,'\''); - if (ptrmatch == NULL) + if (ptrmatch == nullptr) error->all(FLERR,"Unmatched single quote in command"); nchars = ptrmatch+1 - ptr; strncpy(ptr2,ptr,nchars); @@ -678,7 +678,7 @@ void Input::substitute(char *&str, char *&str2, int &max, int &max2, int flag) } else if (*ptr == '"') { if (strstr(ptr,"\"\"\"") == ptr) { ptrmatch = strstr(ptr+3,"\"\"\""); - if (ptrmatch == NULL) + if (ptrmatch == nullptr) error->all(FLERR,"Unmatched triple quote in command"); nchars = ptrmatch+3 - ptr; strncpy(ptr2,ptr,nchars); @@ -686,7 +686,7 @@ void Input::substitute(char *&str, char *&str2, int &max, int &max2, int flag) ptr2 += nchars; } else { ptrmatch = strchr(ptr+1,'"'); - if (ptrmatch == NULL) + if (ptrmatch == nullptr) error->all(FLERR,"Unmatched double quote in command"); nchars = ptrmatch+1 - ptr; strncpy(ptr2,ptr,nchars); diff --git a/src/label_map.h b/src/label_map.h index ae6a620caa..9354306c56 100644 --- a/src/label_map.h +++ b/src/label_map.h @@ -23,6 +23,7 @@ namespace LAMMPS_NS { class LabelMap : protected Pointers { friend class AtomVec; friend class ReadData; + public: LabelMap(LAMMPS *lmp, int, int, int, int, int); ~LabelMap(); @@ -31,7 +32,7 @@ class LabelMap : protected Pointers { void merge_lmap(LabelMap *, int); // copy another lmap into this one void create_lmap2lmap(LabelMap *, int); // index mapping between two lmaps int find(const std::string &, int) const; // find numeric type of type label - bool is_complete(int) const; // check if all types are assigned + bool is_complete(int) const; // check if all types are assigned // input/output for atom class label map diff --git a/src/lammps.h b/src/lammps.h index 4cdb873db9..811d313d91 100644 --- a/src/lammps.h +++ b/src/lammps.h @@ -62,14 +62,14 @@ class LAMMPS { int suffix_enable; // 1 if suffixes are enabled, 0 if disabled char *exename; // pointer to argv[0] - char ***packargs; // arguments for cmdline package commands - int num_package; // number of cmdline package commands + char ***packargs; // arguments for cmdline package commands + int num_package; // number of cmdline package commands - MPI_Comm external_comm; // MPI comm encompassing external programs - // when multiple programs launched by mpirun - // set by -mpicolor command line arg + MPI_Comm external_comm; // MPI comm encompassing external programs + // when multiple programs launched by mpirun + // set by -mpicolor command line arg - void *mdicomm; // for use with MDI code coupling library + void *mdicomm; // for use with MDI code coupling library const char *match_style(const char *style, const char *name); static const char *installed_packages[]; diff --git a/src/library.cpp b/src/library.cpp index 817965ea94..8fa8b4c17b 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -5071,7 +5071,7 @@ void lammps_set_fix_external_callback(void *handle, const char *id, FixExternalF if (strcmp("external",fix->style) != 0) lmp->error->all(FLERR,"Fix '{}' is not of style 'external'", id); - auto fext = dynamic_cast( fix); + auto fext = dynamic_cast(fix); fext->set_callback(callback, ptr); } END_CAPTURE @@ -5179,7 +5179,7 @@ void lammps_fix_external_set_energy_global(void *handle, const char *id, double if (strcmp("external",fix->style) != 0) lmp->error->all(FLERR,"Fix '{}' is not of style external!", id); - auto fext = dynamic_cast( fix); + auto fext = dynamic_cast(fix); fext->set_energy_global(eng); } END_CAPTURE @@ -5227,7 +5227,7 @@ void lammps_fix_external_set_virial_global(void *handle, const char *id, double if (strcmp("external",fix->style) != 0) lmp->error->all(FLERR,"Fix '{}' is not of style external!", id); - auto fext = dynamic_cast( fix); + auto fext = dynamic_cast(fix); fext->set_virial_global(virial); } END_CAPTURE @@ -5275,7 +5275,7 @@ void lammps_fix_external_set_energy_peratom(void *handle, const char *id, double if (strcmp("external",fix->style) != 0) lmp->error->all(FLERR,"Fix '{}' is not of style external!", id); - auto fext = dynamic_cast( fix); + auto fext = dynamic_cast(fix); fext->set_energy_peratom(eng); } END_CAPTURE @@ -5326,7 +5326,7 @@ void lammps_fix_external_set_virial_peratom(void *handle, const char *id, double if (strcmp("external",fix->style) != 0) lmp->error->all(FLERR,"Fix '{}' is not of style external!", id); - auto fext = dynamic_cast( fix); + auto fext = dynamic_cast(fix); fext->set_virial_peratom(virial); } END_CAPTURE @@ -5370,7 +5370,7 @@ void lammps_fix_external_set_vector_length(void *handle, const char *id, int len if (strcmp("external",fix->style) != 0) lmp->error->all(FLERR,"Fix '{}' is not of style external!", id); - auto fext = dynamic_cast( fix); + auto fext = dynamic_cast(fix); fext->set_vector_length(len); } END_CAPTURE @@ -5424,7 +5424,7 @@ void lammps_fix_external_set_vector(void *handle, const char *id, int idx, doubl if (strcmp("external",fix->style) != 0) lmp->error->all(FLERR,"Fix '{}' is not of style external!", id); - auto fext = dynamic_cast( fix); + auto fext = dynamic_cast(fix); fext->set_vector(idx, val); } END_CAPTURE diff --git a/src/lmptype.h b/src/lmptype.h index e02cd74734..2781de28a9 100644 --- a/src/lmptype.h +++ b/src/lmptype.h @@ -256,9 +256,9 @@ union ubuf { // declaration to lift aliasing restrictions -#if defined(__INTEL_COMPILER) || defined(__PGI) +#if defined(__INTEL_COMPILER) || (defined(__PGI) && !defined(__NVCOMPILER)) #define _noalias restrict -#elif defined(__GNUC__) || defined(__INTEL_LLVM_COMPILER) +#elif defined(__GNUC__) || defined(__INTEL_LLVM_COMPILER) || defined(__NVCOMPILER) #define _noalias __restrict #else #define _noalias diff --git a/src/math_special.h b/src/math_special.h index 98d489f251..6931a8e19e 100644 --- a/src/math_special.h +++ b/src/math_special.h @@ -110,21 +110,30 @@ namespace MathSpecial { * \param x argument * \return x*x */ - static inline double square(const double &x) { return x * x; } + static inline double square(const double &x) + { + return x * x; + } /*! Fast inline version of pow(x, 3.0) * * \param x argument * \return x*x */ - static inline double cube(const double &x) { return x * x * x; } + static inline double cube(const double &x) + { + return x * x * x; + } /* Fast inline version of pow(-1.0, n) * * \param n argument (integer) * \return -1 if n is odd, 1.0 if n is even */ - static inline double powsign(const int n) { return (n & 1) ? -1.0 : 1.0; } + static inline double powsign(const int n) + { + return (n & 1) ? -1.0 : 1.0; + } /* Fast inline version of pow(x,n) for integer n * diff --git a/src/min.cpp b/src/min.cpp index d00c0deca4..62333b215c 100644 --- a/src/min.cpp +++ b/src/min.cpp @@ -121,7 +121,7 @@ void Min::init() // create fix needed for storing atom-based quantities // will delete it at end of run - fix_minimize = dynamic_cast( modify->add_fix("MINIMIZE all MINIMIZE")); + fix_minimize = dynamic_cast(modify->add_fix("MINIMIZE all MINIMIZE")); // clear out extra global and per-atom dof // will receive requests for new per-atom dof during pair init() diff --git a/src/minimize.cpp b/src/minimize.cpp index f4743d1815..7412347c34 100644 --- a/src/minimize.cpp +++ b/src/minimize.cpp @@ -31,7 +31,8 @@ Minimize::Minimize(LAMMPS *lmp) : Command(lmp) {} void Minimize::command(int narg, char **arg) { - if (narg != 4) error->all(FLERR,"Illegal minimize command: expected 4 arguments but found {}", narg); + if (narg != 4) + error->all(FLERR, "Illegal minimize command: expected 4 arguments but found {}", narg); if (domain->box_exist == 0) error->all(FLERR, "Minimize command before simulation box is defined"); diff --git a/src/modify.cpp b/src/modify.cpp index 90399abec4..aa978641a1 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -1292,7 +1292,7 @@ Compute *Modify::add_compute(const std::string &computecmd, int trysuffix) void Modify::modify_compute(int narg, char **arg) { - if (narg < 2) utils::missing_cmd_args(FLERR, "compute_modify",error); + if (narg < 2) utils::missing_cmd_args(FLERR, "compute_modify", error); // lookup Compute ID diff --git a/src/molecule.cpp b/src/molecule.cpp index 3ec2a22757..df7d8ac415 100644 --- a/src/molecule.cpp +++ b/src/molecule.cpp @@ -767,9 +767,9 @@ void Molecule::types(char *line) readline(line); auto values = Tokenizer(utils::trim(line)).as_vector(); int nwords = values.size(); - for (std::size_t i = 0; i < values.size(); ++i) { - if (utils::strmatch(values[i], "^#")) { - nwords = i; + for (std::size_t ii = 0; ii < values.size(); ++ii) { + if (utils::strmatch(values[ii], "^#")) { + nwords = ii; break; } } @@ -1007,9 +1007,9 @@ void Molecule::bonds(int flag, char *line) readline(line); auto values = Tokenizer(utils::trim(line)).as_vector(); int nwords = values.size(); - for (std::size_t i = 0; i < values.size(); ++i) { - if (utils::strmatch(values[i], "^#")) { - nwords = i; + for (std::size_t ii = 0; ii < values.size(); ++ii) { + if (utils::strmatch(values[ii], "^#")) { + nwords = ii; break; } } @@ -1093,9 +1093,9 @@ void Molecule::angles(int flag, char *line) readline(line); auto values = Tokenizer(utils::trim(line)).as_vector(); int nwords = values.size(); - for (std::size_t i = 0; i < values.size(); ++i) { - if (utils::strmatch(values[i], "^#")) { - nwords = i; + for (std::size_t ii = 0; ii < values.size(); ++ii) { + if (utils::strmatch(values[ii], "^#")) { + nwords = ii; break; } } @@ -1194,9 +1194,9 @@ void Molecule::dihedrals(int flag, char *line) readline(line); auto values = Tokenizer(utils::trim(line)).as_vector(); int nwords = values.size(); - for (std::size_t i = 0; i < values.size(); ++i) { - if (utils::strmatch(values[i], "^#")) { - nwords = i; + for (std::size_t ii = 0; ii < values.size(); ++ii) { + if (utils::strmatch(values[ii], "^#")) { + nwords = ii; break; } } @@ -1309,9 +1309,9 @@ void Molecule::impropers(int flag, char *line) readline(line); auto values = Tokenizer(utils::trim(line)).as_vector(); int nwords = values.size(); - for (std::size_t i = 0; i < values.size(); ++i) { - if (utils::strmatch(values[i], "^#")) { - nwords = i; + for (std::size_t ii = 0; ii < values.size(); ++ii) { + if (utils::strmatch(values[ii], "^#")) { + nwords = ii; break; } } @@ -1680,9 +1680,9 @@ void Molecule::shaketype_read(char *line) readline(line); auto values = Tokenizer(utils::trim(line)).as_vector(); nmatch = values.size(); - for (std::size_t i = 0; i < values.size(); ++i) { - if (utils::strmatch(values[i], "^#")) { - nmatch = i; + for (std::size_t ii = 0; ii < values.size(); ++ii) { + if (utils::strmatch(values[ii], "^#")) { + nmatch = ii; break; } } diff --git a/src/neighbor.cpp b/src/neighbor.cpp index d7ac1b1e81..9e00ff014c 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -467,12 +467,12 @@ void Neighbor::init() int respa = 0; if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { - if ((dynamic_cast( update->integrate))->level_inner >= 0) respa = 1; - if ((dynamic_cast( update->integrate))->level_middle >= 0) respa = 2; + if ((dynamic_cast(update->integrate))->level_inner >= 0) respa = 1; + if ((dynamic_cast(update->integrate))->level_middle >= 0) respa = 2; } if (respa) { - double *cut_respa = (dynamic_cast( update->integrate))->cutoff; + double *cut_respa = (dynamic_cast(update->integrate))->cutoff; cut_inner_sq = (cut_respa[1] + skin) * (cut_respa[1] + skin); cut_middle_sq = (cut_respa[3] + skin) * (cut_respa[3] + skin); cut_middle_inside_sq = (cut_respa[0] - skin) * (cut_respa[0] - skin); diff --git a/src/neighbor.h b/src/neighbor.h index 7d1711c149..2725c67364 100644 --- a/src/neighbor.h +++ b/src/neighbor.h @@ -94,7 +94,7 @@ class Neighbor : protected Pointers { NeighList **lists; NeighRequest **requests; // from Pair,Fix,Compute,Command classes NeighRequest **old_requests; // copy of requests to compare to - int* j_sorted; // index of requests sorted by cutoff distance + int *j_sorted; // index of requests sorted by cutoff distance // data from topology neighbor lists diff --git a/src/npair_halffull_newtoff_trim.cpp b/src/npair_halffull_newtoff_trim.cpp index 28b285ddf3..af1f1d7304 100644 --- a/src/npair_halffull_newtoff_trim.cpp +++ b/src/npair_halffull_newtoff_trim.cpp @@ -37,8 +37,8 @@ void NPairHalffullNewtoffTrim::build(NeighList *list) { int i, j, ii, jj, n, jnum, joriginal; int *neighptr, *jlist; - double xtmp,ytmp,ztmp; - double delx,dely,delz,rsq; + double xtmp, ytmp, ztmp; + double delx, dely, delz, rsq; double **x = atom->x; diff --git a/src/npair_trim.cpp b/src/npair_trim.cpp index 01abeed636..82078ff1be 100644 --- a/src/npair_trim.cpp +++ b/src/npair_trim.cpp @@ -12,10 +12,10 @@ ------------------------------------------------------------------------- */ #include "npair_trim.h" -#include "neigh_list.h" #include "atom.h" #include "error.h" #include "my_page.h" +#include "neigh_list.h" using namespace LAMMPS_NS; @@ -33,10 +33,10 @@ void NPairTrim::build(NeighList *list) double cutsq_custom = cutoff_custom * cutoff_custom; - int ii,jj,n,jnum,joriginal; - int *neighptr,*jlist; - double xtmp,ytmp,ztmp; - double delx,dely,delz,rsq; + int ii, jj, n, jnum, joriginal; + int *neighptr, *jlist; + double xtmp, ytmp, ztmp; + double delx, dely, delz, rsq; double **x = atom->x; @@ -86,7 +86,6 @@ void NPairTrim::build(NeighList *list) firstneigh[i] = neighptr; numneigh[i] = n; ipage->vgot(n); - if (ipage->status()) - error->one(FLERR,"Neighbor list overflow, boost neigh_modify one"); + if (ipage->status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one"); } } diff --git a/src/pair.h b/src/pair.h index 048abb6bb9..2a68aea5fa 100644 --- a/src/pair.h +++ b/src/pair.h @@ -82,7 +82,7 @@ class Pair : protected Pointers { int tail_flag; // pair_modify flag for LJ tail correction double etail, ptail; // energy/pressure tail corrections double etail_ij, ptail_ij; - int trim_flag; // pair_modify flag for trimming neigh list + int trim_flag; // pair_modify flag for trimming neigh list int evflag; // energy,virial settings int eflag_either, eflag_global, eflag_atom; @@ -123,7 +123,7 @@ class Pair : protected Pointers { ExecutionSpace execution_space; unsigned int datamask_read, datamask_modify; - int kokkosable; // 1 if Kokkos pair + int kokkosable; // 1 if Kokkos pair int reverse_comm_device; // 1 if reverse comm on Device Pair(class LAMMPS *); diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp index 2ea749a3a3..a4a7528d14 100644 --- a/src/pair_hybrid.cpp +++ b/src/pair_hybrid.cpp @@ -116,7 +116,7 @@ void PairHybrid::compute(int eflag, int vflag) Respa *respa = nullptr; respaflag = 0; if (utils::strmatch(update->integrate_style,"^respa")) { - respa = dynamic_cast( update->integrate); + respa = dynamic_cast(update->integrate); if (respa->nhybrid_styles > 0) respaflag = 1; } diff --git a/src/pair_hybrid.h b/src/pair_hybrid.h index a326f0d80c..37b79e5917 100644 --- a/src/pair_hybrid.h +++ b/src/pair_hybrid.h @@ -70,11 +70,11 @@ class PairHybrid : public Pair { double radii2cut(double, double) override; protected: - int nstyles; // # of sub-styles - Pair **styles; // list of Pair style classes - double *cutmax_style; // max cutoff for each style - char **keywords; // style name of each Pair style - int *multiple; // 0 if style used once, else Mth instance + int nstyles; // # of sub-styles + Pair **styles; // list of Pair style classes + double *cutmax_style; // max cutoff for each style + char **keywords; // style name of each Pair style + int *multiple; // 0 if style used once, else Mth instance int outerflag; // toggle compute() when invoked by outer() int respaflag; // 1 if different substyles are assigned to diff --git a/src/pair_hybrid_scaled.cpp b/src/pair_hybrid_scaled.cpp index a059deb3fb..5c20bff5e2 100644 --- a/src/pair_hybrid_scaled.cpp +++ b/src/pair_hybrid_scaled.cpp @@ -277,7 +277,7 @@ void PairHybridScaled::settings(int narg, char **arg) styles = new Pair *[narg]; cutmax_style = new double[narg]; - memset(cutmax_style, 0.0, narg*sizeof(double)); + memset(cutmax_style, 0.0, narg * sizeof(double)); keywords = new char *[narg]; multiple = new int[narg]; diff --git a/src/read_data.cpp b/src/read_data.cpp index 64c409f0bb..63d291a5dc 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -169,7 +169,7 @@ void ReadData::command(int narg, char **arg) addflag = MERGE; else { if (atom->molecule_flag && (iarg + 3 > narg)) - utils::missing_cmd_args(FLERR, "read_data add", error); + utils::missing_cmd_args(FLERR, "read_data add", error); addflag = VALUE; bigint offset = utils::bnumeric(FLERR, arg[iarg + 1], false, lmp); if (offset > MAXTAGINT) @@ -209,7 +209,7 @@ void ReadData::command(int narg, char **arg) coeffflag = 0; iarg++; } else if (strcmp(arg[iarg], "extra/atom/types") == 0) { - if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "read_data extra/atom/types", error); + if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "read_data extra/atom/types", error); extra_atom_types = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); if (extra_atom_types < 0) error->all(FLERR, "Illegal read_data extra/atom/types value {}", extra_atom_types); @@ -265,7 +265,8 @@ void ReadData::command(int narg, char **arg) atom->extra_angle_per_atom); iarg += 2; } else if (strcmp(arg[iarg], "extra/dihedral/per/atom") == 0) { - if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "read_data extra/dihedral/per/atom", error); + if (iarg + 2 > narg) + utils::missing_cmd_args(FLERR, "read_data extra/dihedral/per/atom", error); if (atom->molecular == Atom::ATOMIC) error->all(FLERR, "No dihedrals allowed with atom style {}", atom->get_style()); atom->extra_dihedral_per_atom = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); @@ -274,7 +275,8 @@ void ReadData::command(int narg, char **arg) atom->extra_dihedral_per_atom); iarg += 2; } else if (strcmp(arg[iarg], "extra/improper/per/atom") == 0) { - if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "read_data extra/improper/per/atom", error); + if (iarg + 2 > narg) + utils::missing_cmd_args(FLERR, "read_data extra/improper/per/atom", error); if (atom->molecular == Atom::ATOMIC) error->all(FLERR, "No impropers allowed with atom style {}", atom->get_style()); atom->extra_improper_per_atom = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); @@ -283,12 +285,14 @@ void ReadData::command(int narg, char **arg) atom->extra_improper_per_atom); iarg += 2; } else if (strcmp(arg[iarg], "extra/special/per/atom") == 0) { - if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "read_data extra/special/per/atom", error); + if (iarg + 2 > narg) + utils::missing_cmd_args(FLERR, "read_data extra/special/per/atom", error); if (atom->molecular == Atom::ATOMIC) error->all(FLERR, "No bonded interactions allowed with atom style {}", atom->get_style()); force->special_extra = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); if (force->special_extra < 0) - error->all(FLERR, "Illegal read_data extra/special/per/atom value {}", force->special_extra); + error->all(FLERR, "Illegal read_data extra/special/per/atom value {}", + force->special_extra); iarg += 2; } else if (strcmp(arg[iarg], "group") == 0) { if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "read_data group", error); @@ -343,7 +347,8 @@ void ReadData::command(int narg, char **arg) } else { if (atom->labelmapflag) { if (comm->me == 0) - error->warning(FLERR, "Using read_data offset with a labelmap. Offsets will be only " + error->warning(FLERR, + "Using read_data offset with a labelmap. Offsets will be only " "applied to numeric types and not to type labels"); } } @@ -906,10 +911,8 @@ void ReadData::command(int narg, char **arg) // at end of 1st pass, error check for required sections // customize for new sections - if (nbonds && !bondflag) - error->one(FLERR, "Bonds section for {} bonds not found", nbonds); - if (nangles && !angleflag) - error->one(FLERR, "Angles section for {} angles not found", nangles); + if (nbonds && !bondflag) error->one(FLERR, "Bonds section for {} bonds not found", nbonds); + if (nangles && !angleflag) error->one(FLERR, "Angles section for {} angles not found", nangles); if (ndihedrals && !dihedralflag) error->one(FLERR, "Dihedrals section for {} dihedrals not found", ndihedrals); if (nimpropers && !improperflag) @@ -917,12 +920,9 @@ void ReadData::command(int narg, char **arg) if (nellipsoids && !ellipsoidflag) error->one(FLERR, "Ellipsoids section for {} ellipsoids not found", nellipsoids); - if (nlines && !lineflag) - error->one(FLERR, "Lines section for {} lines not found", nlines); - if (ntris && !triflag) - error->one(FLERR, "Triangles section for {} triangles not found", ntris); - if (nbodies && !bodyflag) - error->one(FLERR, "Bodies section for {} bodies not found", nbodies); + if (nlines && !lineflag) error->one(FLERR, "Lines section for {} lines not found", nlines); + if (ntris && !triflag) error->one(FLERR, "Triangles section for {} triangles not found", ntris); + if (nbodies && !bodyflag) error->one(FLERR, "Bodies section for {} bodies not found", nbodies); // break out of loop if no molecular topology in file // else make 2nd pass diff --git a/src/read_restart.cpp b/src/read_restart.cpp index 949e4e7057..98f594ac5c 100644 --- a/src/read_restart.cpp +++ b/src/read_restart.cpp @@ -451,7 +451,7 @@ void ReadRestart::command(int narg, char **arg) if (nextra) { memory->destroy(atom->extra); memory->create(atom->extra,atom->nmax,nextra,"atom:extra"); - auto fix = dynamic_cast( modify->get_fix_by_id("_read_restart")); + auto fix = dynamic_cast(modify->get_fix_by_id("_read_restart")); int *count = fix->count; double **extra = fix->extra; double **atom_extra = atom->extra; diff --git a/src/region.cpp b/src/region.cpp index d63fe25017..1f328df155 100644 --- a/src/region.cpp +++ b/src/region.cpp @@ -322,7 +322,7 @@ void Region::options(int narg, char **arg) else if (strcmp(arg[iarg + 1], "lattice") == 0) scaleflag = 1; else - error->all(FLERR, "Illegal region units: {}", arg[iarg+1]); + error->all(FLERR, "Illegal region units: {}", arg[iarg + 1]); iarg += 2; } else if (strcmp(arg[iarg], "side") == 0) { if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "region side", error); @@ -331,24 +331,24 @@ void Region::options(int narg, char **arg) else if (strcmp(arg[iarg + 1], "out") == 0) interior = 0; else - error->all(FLERR, "Illegal region side: {}", arg[iarg+1]); + error->all(FLERR, "Illegal region side: {}", arg[iarg + 1]); iarg += 2; } else if (strcmp(arg[iarg], "move") == 0) { if (iarg + 4 > narg) utils::missing_cmd_args(FLERR, "region move", error); if (strcmp(arg[iarg + 1], "NULL") != 0) { if (strstr(arg[iarg + 1], "v_") != arg[iarg + 1]) - error->all(FLERR, "Illegal region move x displacement variable: {}", arg[iarg+1]); + error->all(FLERR, "Illegal region move x displacement variable: {}", arg[iarg + 1]); xstr = utils::strdup(&arg[iarg + 1][2]); } if (strcmp(arg[iarg + 2], "NULL") != 0) { if (strstr(arg[iarg + 2], "v_") != arg[iarg + 2]) - error->all(FLERR, "Illegal region move y displacement variable: {}", arg[iarg+2]); + error->all(FLERR, "Illegal region move y displacement variable: {}", arg[iarg + 2]); ystr = utils::strdup(&arg[iarg + 2][2]); } if (strcmp(arg[iarg + 3], "NULL") != 0) { if (strstr(arg[iarg + 3], "v_") != arg[iarg + 3]) - error->all(FLERR, "Illegal region move z displacement variable: {}", arg[iarg+3]); + error->all(FLERR, "Illegal region move z displacement variable: {}", arg[iarg + 3]); zstr = utils::strdup(&arg[iarg + 3][2]); } moveflag = 1; @@ -375,7 +375,8 @@ void Region::options(int narg, char **arg) open_faces[iface - 1] = 1; openflag = 1; iarg += 2; - } else error->all(FLERR, "Illegal region command argument: {}", arg[iarg]); + } else + error->all(FLERR, "Illegal region command argument: {}", arg[iarg]); } // error check diff --git a/src/region_intersect.cpp b/src/region_intersect.cpp index 9dd624e7be..50c5f9fc68 100644 --- a/src/region_intersect.cpp +++ b/src/region_intersect.cpp @@ -27,7 +27,7 @@ RegIntersect::RegIntersect(LAMMPS *lmp, int narg, char **arg) : { nregion = 0; - if (narg < 5) utils::missing_cmd_args(FLERR, "region intersect", error);; + if (narg < 5) utils::missing_cmd_args(FLERR, "region intersect", error); int n = utils::inumeric(FLERR, arg[2], false, lmp); if (n < 2) error->all(FLERR, "Illegal region intersect n: {}", n); options(narg - (n + 3), &arg[n + 3]); diff --git a/src/region_union.cpp b/src/region_union.cpp index ebd1197d86..c14a9ef714 100644 --- a/src/region_union.cpp +++ b/src/region_union.cpp @@ -28,7 +28,7 @@ RegUnion::RegUnion(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg), { nregion = 0; - if (narg < 5) utils::missing_cmd_args(FLERR, "region union", error);; + if (narg < 5) utils::missing_cmd_args(FLERR, "region union", error); int n = utils::inumeric(FLERR, arg[2], false, lmp); if (n < 2) error->all(FLERR, "Illegal region union n: {}", n); options(narg - (n + 3), &arg[n + 3]); diff --git a/src/set.cpp b/src/set.cpp index 80c524f8a4..0131b1e16c 100644 --- a/src/set.cpp +++ b/src/set.cpp @@ -818,10 +818,10 @@ void Set::set(int keyword) // loop over selected atoms - auto avec_ellipsoid = dynamic_cast( atom->style_match("ellipsoid")); - auto avec_line = dynamic_cast( atom->style_match("line")); - auto avec_tri = dynamic_cast( atom->style_match("tri")); - auto avec_body = dynamic_cast( atom->style_match("body")); + auto avec_ellipsoid = dynamic_cast(atom->style_match("ellipsoid")); + auto avec_line = dynamic_cast(atom->style_match("line")); + auto avec_tri = dynamic_cast(atom->style_match("tri")); + auto avec_body = dynamic_cast(atom->style_match("body")); int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { @@ -1153,10 +1153,10 @@ void Set::setrandom(int keyword) { int i; - auto avec_ellipsoid = dynamic_cast( atom->style_match("ellipsoid")); - auto avec_line = dynamic_cast( atom->style_match("line")); - auto avec_tri = dynamic_cast( atom->style_match("tri")); - auto avec_body = dynamic_cast( atom->style_match("body")); + auto avec_ellipsoid = dynamic_cast(atom->style_match("ellipsoid")); + auto avec_line = dynamic_cast(atom->style_match("line")); + auto avec_tri = dynamic_cast(atom->style_match("tri")); + auto avec_body = dynamic_cast(atom->style_match("body")); double **x = atom->x; int seed = ivalue; diff --git a/src/special.cpp b/src/special.cpp index a7153b99d9..76091d10af 100644 --- a/src/special.cpp +++ b/src/special.cpp @@ -857,10 +857,10 @@ void Special::combine() utils::logmesg(lmp,"{:>6} = max # of special neighbors\n",atom->maxspecial); if (lmp->kokkos) { - auto atomKK = dynamic_cast( atom); + auto atomKK = dynamic_cast(atom); atomKK->modified(Host,SPECIAL_MASK); atomKK->sync(Device,SPECIAL_MASK); - auto memoryKK = dynamic_cast( memory); + auto memoryKK = dynamic_cast(memory); memoryKK->grow_kokkos(atomKK->k_special,atom->special, atom->nmax,atom->maxspecial,"atom:special"); atomKK->modified(Device,SPECIAL_MASK); diff --git a/src/special.h b/src/special.h index f344eac3ca..49be187ec4 100644 --- a/src/special.h +++ b/src/special.h @@ -28,7 +28,7 @@ class Special : protected Pointers { int me, nprocs; int maxall; int onefive_flag; - tagint **onetwo,**onethree,**onefour,**onefive; + tagint **onetwo, **onethree, **onefour, **onefive; // data used by rendezvous callback methods diff --git a/src/utils.cpp b/src/utils.cpp index 9e6aa8e5d1..6483997dc9 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -1129,7 +1129,7 @@ bool utils::is_integer(const std::string &str) { if (str.empty()) return false; - for (auto c : str) { + for (const auto &c : str) { if (isdigit(c) || c == '-' || c == '+') continue; return false; } @@ -1144,7 +1144,7 @@ bool utils::is_double(const std::string &str) { if (str.empty()) return false; - for (auto c : str) { + for (const auto &c : str) { if (isdigit(c)) continue; if (c == '-' || c == '+' || c == '.') continue; if (c == 'e' || c == 'E') continue; @@ -1161,7 +1161,7 @@ bool utils::is_id(const std::string &str) { if (str.empty()) return false; - for (auto c : str) { + for (const auto &c : str) { if (isalnum(c) || (c == '_')) continue; return false; } @@ -1178,7 +1178,7 @@ int utils::is_type(const std::string &str) bool numeric = true; int nstar = 0; - for (auto c : str) { + for (const auto &c : str) { if (isdigit(c)) continue; if (c == '*') { ++nstar; diff --git a/src/write_coeff.cpp b/src/write_coeff.cpp index f71cab0fdd..9dfdeb5141 100644 --- a/src/write_coeff.cpp +++ b/src/write_coeff.cpp @@ -41,7 +41,7 @@ void WriteCoeff::command(int narg, char **arg) if (domain->box_exist == 0) error->all(FLERR, "Write_coeff command before simulation box is defined"); - if (narg != 1) error->all(FLERR, "Illegal write_coeff command"); + if (narg != 1) utils::missing_cmd_args(FLERR, "write_coeff", error); char *file = utils::strdup(fmt::format("{}.tmp", arg[0])); @@ -167,6 +167,5 @@ void WriteCoeff::command(int narg, char **arg) fclose(two); platform::unlink(file); } - delete[] file; } diff --git a/src/write_data.cpp b/src/write_data.cpp index 447399c65f..2bc3a21627 100644 --- a/src/write_data.cpp +++ b/src/write_data.cpp @@ -57,7 +57,7 @@ void WriteData::command(int narg, char **arg) if (domain->box_exist == 0) error->all(FLERR,"Write_data command before simulation box is defined"); - if (narg < 1) error->all(FLERR,"Illegal write_data command"); + if (narg < 1) utils::missing_cmd_args(FLERR, "write_data", error); // if filename contains a "*", replace with current timestep @@ -73,16 +73,17 @@ void WriteData::command(int narg, char **arg) coeffflag = 1; fixflag = 1; lmapflag = 1; - atom->types_style = Atom::NUMERIC; + // store current (default) setting since we may change it. + int types_style = atom->types_style; int noinit = 0; int iarg = 1; while (iarg < narg) { if (strcmp(arg[iarg],"pair") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal write_data command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "write_data pair", error); if (strcmp(arg[iarg+1],"ii") == 0) pairflag = II; else if (strcmp(arg[iarg+1],"ij") == 0) pairflag = IJ; - else error->all(FLERR,"Illegal write_data command"); + else error->all(FLERR,"Unknown write_data pair option: {}", arg[iarg+1]); iarg += 2; } else if (strcmp(arg[iarg],"noinit") == 0) { noinit = 1; @@ -97,12 +98,12 @@ void WriteData::command(int narg, char **arg) lmapflag = 0; iarg++; } else if (strcmp(arg[iarg],"types") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal write_data command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "write_data types", error); if (strcmp(arg[iarg+1],"numeric") == 0) atom->types_style = Atom::NUMERIC; else if (strcmp(arg[iarg+1],"labels") == 0) atom->types_style = Atom::LABELS; - else error->all(FLERR,"Illegal write_data command"); + else error->all(FLERR,"Unknown write_data types option: {}", arg[iarg+1]); iarg += 2; - } else error->all(FLERR,"Illegal write_data command"); + } else error->all(FLERR,"Unknown write_data keyword: {}", arg[iarg]); } // init entire system since comm->exchange is done @@ -134,6 +135,8 @@ void WriteData::command(int narg, char **arg) } write(file); + // restore saved setting + atom->types_style = types_style; } /* ---------------------------------------------------------------------- diff --git a/src/write_dump.cpp b/src/write_dump.cpp index 98f7981f2e..a7f143aa43 100644 --- a/src/write_dump.cpp +++ b/src/write_dump.cpp @@ -33,7 +33,7 @@ using namespace LAMMPS_NS; void WriteDump::command(int narg, char **arg) { - if (narg < 3) error->all(FLERR, "Illegal write_dump command"); + if (narg < 3) utils::missing_cmd_args(FLERR, "write_dump", error); // modindex = index in args of "modify" keyword // will be narg if "modify" is not present @@ -46,10 +46,10 @@ void WriteDump::command(int narg, char **arg) // create dump command line with extra required args auto dumpargs = new char *[modindex + 2]; - dumpargs[0] = (char *) "WRITE_DUMP"; // dump id - dumpargs[1] = arg[0]; // group - dumpargs[2] = arg[1]; // dump style - dumpargs[3] = utils::strdup(std::to_string(MAX(update->ntimestep, 1))); // dump frequency + dumpargs[0] = (char *) "WRITE_DUMP"; // dump id + dumpargs[1] = arg[0]; // group + dumpargs[2] = arg[1]; // dump style + dumpargs[3] = utils::strdup(std::to_string(MAX(update->ntimestep, 1))); // dump frequency for (int i = 2; i < modindex; ++i) dumpargs[i + 2] = arg[i]; diff --git a/src/write_restart.cpp b/src/write_restart.cpp index 828d9e6057..2fe2f8d373 100644 --- a/src/write_restart.cpp +++ b/src/write_restart.cpp @@ -61,7 +61,7 @@ void WriteRestart::command(int narg, char **arg) { if (domain->box_exist == 0) error->all(FLERR,"Write_restart command before simulation box is defined"); - if (narg < 1) error->all(FLERR,"Illegal write_restart command"); + if (narg < 1) utils::missing_cmd_args(FLERR, "write_restart", error); // if filename contains a "*", replace with current timestep @@ -154,11 +154,11 @@ void WriteRestart::multiproc_options(int multiproc_caller, int mpiioflag_caller, int iarg = 0; while (iarg < narg) { if (strcmp(arg[iarg],"fileper") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal write_restart command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "write_restart", error); if (!multiproc) error->all(FLERR,"Cannot use write_restart fileper without % in restart file name"); int nper = utils::inumeric(FLERR,arg[iarg+1],false,lmp); - if (nper <= 0) error->all(FLERR,"Illegal write_restart command"); + if (nper <= 0) error->all(FLERR,"Invalue write_restart fileper value {}:", nper); multiproc = nprocs/nper; if (nprocs % nper) multiproc++; @@ -171,11 +171,11 @@ void WriteRestart::multiproc_options(int multiproc_caller, int mpiioflag_caller, iarg += 2; } else if (strcmp(arg[iarg],"nfile") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal write_restart command"); + if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "write_restart nfile", error); if (!multiproc) error->all(FLERR,"Cannot use write_restart nfile without % in restart file name"); int nfile = utils::inumeric(FLERR,arg[iarg+1],false,lmp); - if (nfile <= 0) error->all(FLERR,"Illegal write_restart command"); + if (nfile <= 0) error->all(FLERR,"Invalid write_restart nfile value {}", nfile); nfile = MIN(nfile,nprocs); multiproc = nfile; @@ -195,7 +195,7 @@ void WriteRestart::multiproc_options(int multiproc_caller, int mpiioflag_caller, } else if (strcmp(arg[iarg],"noinit") == 0) { noinit = 1; iarg++; - } else error->all(FLERR,"Illegal write_restart command"); + } else error->all(FLERR,"Unknown write_restart keyword: {}", arg[iarg]); } } @@ -221,7 +221,8 @@ void WriteRestart::write(const std::string &file) bigint nblocal = atom->nlocal; MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); if (natoms != atom->natoms && output->thermo->lostflag == Thermo::ERROR) - error->all(FLERR,"Atom count is inconsistent, cannot write restart file"); + error->all(FLERR,"Atom count is inconsistent: {} vs {}, cannot write restart file", + natoms, atom->natoms); // open single restart file or base file for multiproc case @@ -231,8 +232,7 @@ void WriteRestart::write(const std::string &file) fp = fopen(base.c_str(),"wb"); if (fp == nullptr) - error->one(FLERR, "Cannot open restart file {}: {}", - base, utils::getsyserror()); + error->one(FLERR, "Cannot open restart file {}: {}", base, utils::getsyserror()); } // proc 0 writes magic string, endian flag, numeric version @@ -294,8 +294,7 @@ void WriteRestart::write(const std::string &file) if (filewriter) { fp = fopen(multiname.c_str(),"wb"); if (fp == nullptr) - error->one(FLERR, "Cannot open restart file {}: {}", - multiname, utils::getsyserror()); + error->one(FLERR, "Cannot open restart file {}: {}", multiname, utils::getsyserror()); write_int(PROCSPERFILE,nclusterprocs); } } diff --git a/tools/singularity/almalinux9.def b/tools/singularity/almalinux9.def new file mode 100644 index 0000000000..3078779957 --- /dev/null +++ b/tools/singularity/almalinux9.def @@ -0,0 +1,112 @@ +BootStrap: docker +From: library/almalinux:9 + +%post + dnf -y install 'dnf-command(config-manager)' + dnf config-manager --set-enabled crb + dnf -y install epel-release dnf-utils + dnf -y update + dnf -y install vim-enhanced git file make cmake patch which file ninja-build \ + ccache gcc-c++ gcc-gfortran clang libomp-devel gdb valgrind libubsan libasan libtsan \ + eigen3-devel openblas-devel libpng-devel libjpeg-devel platform-python-devel \ + openmpi-devel mpich-devel fftw-devel gsl-devel hdf5-devel \ + netcdf-devel netcdf-cxx-devel netcdf-mpich-devel netcdf-openmpi-devel \ + enchant python3-virtualenv doxygen diffutils latexmk readline-devel \ + texlive-latex-fonts texlive-pslatex texlive-collection-latexrecommended \ + texlive-latex texlive-latexconfig doxygen-latex texlive-collection-latex \ + texlive-latex-bin texlive-lualatex-math texlive-fncychap texlive-tabulary \ + texlive-framed texlive-wrapfig texlive-upquote texlive-capt-of \ + texlive-needspace texlive-titlesec texlive-anysize texlive-dvipng \ + blas-devel lapack-devel libyaml-devel \ + yaml-cpp-devel zstd libzstd-devel python-unversioned-command + # voro++-devel openkim-models kim-api-devel + dnf clean all + + # we need to reset any module variables + # inherited from the host. + unset __LMOD_REF_COUNT__LMFILES_ + unset __LMOD_REF_COUNT_PATH + unset __LMOD_REF_COUNT_LD_LIBRARY_PATH + unset __LMOD_REF_COUNT_MANPATH + unset __LMOD_REF_COUNT_MODULEPATH + unset __LMOD_REF_COUNT_LOADEDMODULES + unset _LMFILES_ + unset MODULEPATH + unset MODULESHOME + unset MODULEPATH_ROOT + unset LOADEDMODULES + unset LMOD_SYSTEM_DEFAULT_MODULES + + # load MPI by default + . /etc/profile + module load mpi + + # manually install Plumed + mkdir plumed + cd plumed + version=2.8.0 + curl -L -o plumed.tar.gz https://github.com/plumed/plumed2/releases/download/v${version}/plumed-src-${version}.tgz + tar -xzf plumed.tar.gz + cd plumed-${version} + ./configure --disable-doc --prefix=/usr + make + make install + # fix up installation for CentOS and Fedora + mv -v /usr/lib64/pkgconfig/plumed* /usr/share/pkgconfig/ + cd ../../ + rm -rvf plumed + + # create missing readline pkgconfig file + cat > /usr/lib64/pkgconfig/readline.pc <$CUSTOM_PROMPT_ENV <natoms, 0); EXPECT_EQ(domain->box_exist, 0); EXPECT_EQ(atom->labelmapflag, 0); + EXPECT_EQ(atom->types_style, Atom::NUMERIC); ASSERT_EQ(atom->lmap, nullptr); TEST_FAILURE(".*ERROR: Labelmap command before simulation box is.*", command("labelmap atom 3 C1");); diff --git a/unittest/commands/test_regions.cpp b/unittest/commands/test_regions.cpp index 2ced0c45f5..a39212efa8 100644 --- a/unittest/commands/test_regions.cpp +++ b/unittest/commands/test_regions.cpp @@ -192,17 +192,25 @@ TEST_F(RegionTest, DeathTests) auto list = domain->get_region_list(); ASSERT_EQ(list.size(), 1); - TEST_FAILURE(".*ERROR: Illegal region block xlo: 1 >= xhi: 0.*", command("region reg1 block 1 0 0 1 0 1");); - TEST_FAILURE(".*ERROR: Illegal region cone open face: 4.*", command("region reg2 cone x 0 0 2 1 0 1 open 4");); - TEST_FAILURE(".*ERROR: Illegal region plane normal vector: 0 0 0.*", command("region reg3 plane 0 0 0 0 0 0 side out");); - TEST_FAILURE(".*ERROR: Illegal region prism non-zero xy tilt with infinite x size.*", command("region reg4 prism INF INF 0 1 0 1 0.1 0.2 0.3");); - TEST_FAILURE(".*ERROR: Illegal region sphere radius: -1.*", command("region reg5 sphere 0 0 0 -1");); - TEST_FAILURE(".*ERROR: Illegal region ellipsoid c: -2.*", command("region reg8 ellipsoid 0 0 0 2 1 -2");); - TEST_FAILURE(".*ERROR: Illegal region cylinder axis: xx.*", command("region reg9 cylinder xx 0 0 1 0 1 open 1 units box");); + TEST_FAILURE(".*ERROR: Illegal region block xlo: 1 >= xhi: 0.*", + command("region reg1 block 1 0 0 1 0 1");); + TEST_FAILURE(".*ERROR: Illegal region cone open face: 4.*", + command("region reg2 cone x 0 0 2 1 0 1 open 4");); + TEST_FAILURE(".*ERROR: Illegal region plane normal vector: 0 0 0.*", + command("region reg3 plane 0 0 0 0 0 0 side out");); + TEST_FAILURE(".*ERROR: Illegal region prism non-zero xy tilt with infinite x size.*", + command("region reg4 prism INF INF 0 1 0 1 0.1 0.2 0.3");); + TEST_FAILURE(".*ERROR: Illegal region sphere radius: -1.*", + command("region reg5 sphere 0 0 0 -1");); + TEST_FAILURE(".*ERROR: Illegal region ellipsoid c: -2.*", + command("region reg8 ellipsoid 0 0 0 2 1 -2");); + TEST_FAILURE(".*ERROR: Illegal region cylinder axis: xx.*", + command("region reg9 cylinder xx 0 0 1 0 1 open 1 units box");); TEST_FAILURE(".*ERROR: Unrecognized region style 'xxx'.*", command("region new1 xxx");); - //TEST_FAILURE(".*ERROR: Illegal region command.*", command("region new1 block 0 1");); - TEST_FAILURE(".*ERROR: Illegal region command: missing argument\\(s\\).*", command("region new1 block 0 1");); + // TEST_FAILURE(".*ERROR: Illegal region command.*", command("region new1 block 0 1");); + TEST_FAILURE(".*ERROR: Illegal region command: missing argument\\(s\\).*", + command("region new1 block 0 1");); TEST_FAILURE(".*ERROR: Delete region new3 does not exist.*", command("region new3 delete");); } @@ -223,16 +231,16 @@ TEST_F(RegionTest, Counts) command("region reg10 prism 0 5 0 5 -5 5 0.0 0.0 0.0"); // same as block END_HIDE_OUTPUT(); - auto x = atom->x; - auto reg1 = domain->get_region_by_id("reg1"); - auto reg2 = domain->get_region_by_id("reg2"); - auto reg3 = domain->get_region_by_id("reg3"); - auto reg4 = domain->get_region_by_id("reg4"); - auto reg5 = domain->get_region_by_id("reg5"); - auto reg6 = domain->get_region_by_id("reg6"); - auto reg7 = domain->get_region_by_id("reg7"); - auto reg8 = domain->get_region_by_id("reg8"); - auto reg9 = domain->get_region_by_id("reg9"); + auto x = atom->x; + auto reg1 = domain->get_region_by_id("reg1"); + auto reg2 = domain->get_region_by_id("reg2"); + auto reg3 = domain->get_region_by_id("reg3"); + auto reg4 = domain->get_region_by_id("reg4"); + auto reg5 = domain->get_region_by_id("reg5"); + auto reg6 = domain->get_region_by_id("reg6"); + auto reg7 = domain->get_region_by_id("reg7"); + auto reg8 = domain->get_region_by_id("reg8"); + auto reg9 = domain->get_region_by_id("reg9"); auto reg10 = domain->get_region_by_id("reg10"); int count1, count2, count3, count4, count5, count6, count7, count8, count9, count10; count1 = count2 = count3 = count4 = count5 = count6 = count7 = count8 = count9 = count10 = 0; diff --git a/unittest/commands/test_set_property.cpp b/unittest/commands/test_set_property.cpp index f5e290c671..092a0172fc 100644 --- a/unittest/commands/test_set_property.cpp +++ b/unittest/commands/test_set_property.cpp @@ -46,7 +46,7 @@ protected: void TearDown() override { LAMMPSTest::TearDown(); } - void atomic_system(const std::string &atom_style, const std::string units = "real") + void atomic_system(const std::string &atom_style, const std::string &units = "real") { BEGIN_HIDE_OUTPUT(); command("atom_style " + atom_style); @@ -313,10 +313,10 @@ TEST_F(SetTest, SpinPackage) command("set atom 1*2 spin/atom 0.5 0.1 0.5 -0.1"); command("set atom 8 spin/atom/random 23974 0.25"); END_HIDE_OUTPUT(); - constexpr double vx = 0.1; - constexpr double vy = 0.5; - constexpr double vz = -0.1; - const double norm = 1.0 / sqrt(vx * vx + vy * vy + vz * vz); + constexpr double vx = 0.1; + constexpr double vy = 0.5; + constexpr double vz = -0.1; + const double norm = 1.0 / sqrt(vx * vx + vy * vy + vz * vz); ASSERT_EQ(atom->sp[0][0], vx * norm); ASSERT_EQ(atom->sp[0][1], vy * norm); ASSERT_EQ(atom->sp[0][2], vz * norm); @@ -365,39 +365,39 @@ TEST_F(SetTest, EffPackage) ASSERT_NE(compute, nullptr); compute->compute_peratom(); - EXPECT_EQ(atom->spin[0],-1); - EXPECT_EQ(atom->spin[1],-1); - EXPECT_EQ(atom->spin[2],1); - EXPECT_EQ(atom->spin[3],1); - EXPECT_EQ(atom->spin[4],0); - EXPECT_EQ(atom->spin[5],2); - EXPECT_EQ(atom->spin[6],3); - EXPECT_EQ(atom->spin[7],3); - EXPECT_EQ(atom->eradius[0],0.5); - EXPECT_EQ(atom->eradius[1],1.0); - EXPECT_EQ(atom->eradius[2],0.5); - EXPECT_EQ(atom->eradius[3],1.0); - EXPECT_EQ(atom->eradius[4],0.5); - EXPECT_EQ(atom->eradius[5],1.0); - EXPECT_EQ(atom->eradius[6],0.5); - EXPECT_EQ(atom->eradius[7],1.0); + EXPECT_EQ(atom->spin[0], -1); + EXPECT_EQ(atom->spin[1], -1); + EXPECT_EQ(atom->spin[2], 1); + EXPECT_EQ(atom->spin[3], 1); + EXPECT_EQ(atom->spin[4], 0); + EXPECT_EQ(atom->spin[5], 2); + EXPECT_EQ(atom->spin[6], 3); + EXPECT_EQ(atom->spin[7], 3); + EXPECT_EQ(atom->eradius[0], 0.5); + EXPECT_EQ(atom->eradius[1], 1.0); + EXPECT_EQ(atom->eradius[2], 0.5); + EXPECT_EQ(atom->eradius[3], 1.0); + EXPECT_EQ(atom->eradius[4], 0.5); + EXPECT_EQ(atom->eradius[5], 1.0); + EXPECT_EQ(atom->eradius[6], 0.5); + EXPECT_EQ(atom->eradius[7], 1.0); - EXPECT_EQ(compute->array_atom[0][0],-1); - EXPECT_EQ(compute->array_atom[1][0],-1); - EXPECT_EQ(compute->array_atom[2][0],1); - EXPECT_EQ(compute->array_atom[3][0],1); - EXPECT_EQ(compute->array_atom[4][0],0); - EXPECT_EQ(compute->array_atom[5][0],2); - EXPECT_EQ(compute->array_atom[6][0],3); - EXPECT_EQ(compute->array_atom[7][0],3); - EXPECT_EQ(compute->array_atom[0][1],0.5); - EXPECT_EQ(compute->array_atom[1][1],1.0); - EXPECT_EQ(compute->array_atom[2][1],0.5); - EXPECT_EQ(compute->array_atom[3][1],1.0); - EXPECT_EQ(compute->array_atom[4][1],0.5); - EXPECT_EQ(compute->array_atom[5][1],1.0); - EXPECT_EQ(compute->array_atom[6][1],0.5); - EXPECT_EQ(compute->array_atom[7][1],1.0); + EXPECT_EQ(compute->array_atom[0][0], -1); + EXPECT_EQ(compute->array_atom[1][0], -1); + EXPECT_EQ(compute->array_atom[2][0], 1); + EXPECT_EQ(compute->array_atom[3][0], 1); + EXPECT_EQ(compute->array_atom[4][0], 0); + EXPECT_EQ(compute->array_atom[5][0], 2); + EXPECT_EQ(compute->array_atom[6][0], 3); + EXPECT_EQ(compute->array_atom[7][0], 3); + EXPECT_EQ(compute->array_atom[0][1], 0.5); + EXPECT_EQ(compute->array_atom[1][1], 1.0); + EXPECT_EQ(compute->array_atom[2][1], 0.5); + EXPECT_EQ(compute->array_atom[3][1], 1.0); + EXPECT_EQ(compute->array_atom[4][1], 0.5); + EXPECT_EQ(compute->array_atom[5][1], 1.0); + EXPECT_EQ(compute->array_atom[6][1], 0.5); + EXPECT_EQ(compute->array_atom[7][1], 1.0); TEST_FAILURE(".*ERROR on proc 0: Incorrect value for electron spin: 0.5.*", command("set atom * spin/electron 0.5");); diff --git a/unittest/commands/test_simple_commands.cpp b/unittest/commands/test_simple_commands.cpp index 5889f09eb0..54ffbb6950 100644 --- a/unittest/commands/test_simple_commands.cpp +++ b/unittest/commands/test_simple_commands.cpp @@ -41,8 +41,7 @@ using ::testing::ContainsRegex; using ::testing::ExitedWithCode; using ::testing::StrEq; -class SimpleCommandsTest : public LAMMPSTest { -}; +class SimpleCommandsTest : public LAMMPSTest {}; TEST_F(SimpleCommandsTest, UnknownCommand) { diff --git a/unittest/force-styles/test_angle_style.cpp b/unittest/force-styles/test_angle_style.cpp index 82a4731492..1a97368e0a 100644 --- a/unittest/force-styles/test_angle_style.cpp +++ b/unittest/force-styles/test_angle_style.cpp @@ -285,7 +285,7 @@ void generate_yaml_file(const char *outfile, const TestConfig &config) // run_stress stress = lmp->force->angle->virial; block = fmt::format("{:23.16e} {:23.16e} {:23.16e} {:23.16e} {:23.16e} {:23.16e}", stress[0], - stress[1], stress[2], stress[3], stress[4], stress[5]); + stress[1], stress[2], stress[3], stress[4], stress[5]); writer.emit_block("run_stress", block); block.clear(); diff --git a/unittest/force-styles/test_bond_style.cpp b/unittest/force-styles/test_bond_style.cpp index d0d8f26b6e..09ea62a909 100644 --- a/unittest/force-styles/test_bond_style.cpp +++ b/unittest/force-styles/test_bond_style.cpp @@ -285,7 +285,7 @@ void generate_yaml_file(const char *outfile, const TestConfig &config) // run_stress stress = lmp->force->bond->virial; block = fmt::format("{:23.16e} {:23.16e} {:23.16e} {:23.16e} {:23.16e} {:23.16e}", stress[0], - stress[1], stress[2], stress[3], stress[4], stress[5]); + stress[1], stress[2], stress[3], stress[4], stress[5]); writer.emit_block("run_stress", block); block.clear(); diff --git a/unittest/force-styles/test_dihedral_style.cpp b/unittest/force-styles/test_dihedral_style.cpp index 3f3e1248e8..74438da356 100644 --- a/unittest/force-styles/test_dihedral_style.cpp +++ b/unittest/force-styles/test_dihedral_style.cpp @@ -288,7 +288,7 @@ void generate_yaml_file(const char *outfile, const TestConfig &config) // run_stress stress = lmp->force->dihedral->virial; block = fmt::format("{:23.16e} {:23.16e} {:23.16e} {:23.16e} {:23.16e} {:23.16e}", stress[0], - stress[1], stress[2], stress[3], stress[4], stress[5]); + stress[1], stress[2], stress[3], stress[4], stress[5]); writer.emit_block("run_stress", block); block.clear(); diff --git a/unittest/force-styles/test_improper_style.cpp b/unittest/force-styles/test_improper_style.cpp index 3d2719f7d0..740b75552b 100644 --- a/unittest/force-styles/test_improper_style.cpp +++ b/unittest/force-styles/test_improper_style.cpp @@ -279,7 +279,7 @@ void generate_yaml_file(const char *outfile, const TestConfig &config) // run_stress stress = lmp->force->improper->virial; block = fmt::format("{:23.16e} {:23.16e} {:23.16e} {:23.16e} {:23.16e} {:23.16e}", stress[0], - stress[1], stress[2], stress[3], stress[4], stress[5]); + stress[1], stress[2], stress[3], stress[4], stress[5]); writer.emit_block("run_stress", block); block.clear(); diff --git a/unittest/force-styles/test_main.cpp b/unittest/force-styles/test_main.cpp index 0fc2fef47d..df6c79d4ef 100644 --- a/unittest/force-styles/test_main.cpp +++ b/unittest/force-styles/test_main.cpp @@ -12,16 +12,16 @@ ------------------------------------------------------------------------- */ #include "test_main.h" +#include "atom.h" +#include "error_stats.h" +#include "lammps.h" #include "pointers.h" #include "test_config.h" #include "test_config_reader.h" -#include "error_stats.h" #include "utils.h" #include "yaml_writer.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "lammps.h" -#include "atom.h" #include #include @@ -30,13 +30,14 @@ #include #include -using LAMMPS_NS::LAMMPS; using LAMMPS_NS::Atom; +using LAMMPS_NS::LAMMPS; +using LAMMPS_NS::tagint; using LAMMPS_NS::utils::split_words; using LAMMPS_NS::utils::trim; -using LAMMPS_NS::tagint; -void EXPECT_STRESS(const std::string & name, double * stress, const stress_t & expected_stress, double epsilon) +void EXPECT_STRESS(const std::string &name, double *stress, const stress_t &expected_stress, + double epsilon) { SCOPED_TRACE("EXPECT_STRESS: " + name); ErrorStats stats; @@ -49,10 +50,12 @@ void EXPECT_STRESS(const std::string & name, double * stress, const stress_t & e if (print_stats) std::cerr << name << " stats" << stats << std::endl; } -void EXPECT_FORCES(const std::string & name, Atom * atom, const std::vector & f_ref, double epsilon) { +void EXPECT_FORCES(const std::string &name, Atom *atom, const std::vector &f_ref, + double epsilon) +{ SCOPED_TRACE("EXPECT_FORCES: " + name); - double ** f = atom->f; - tagint * tag = atom->tag; + double **f = atom->f; + tagint *tag = atom->tag; const int nlocal = atom->nlocal; ASSERT_EQ(nlocal + 1, f_ref.size()); ErrorStats stats; @@ -64,10 +67,12 @@ void EXPECT_FORCES(const std::string & name, Atom * atom, const std::vector & x_ref, double epsilon) { +void EXPECT_POSITIONS(const std::string &name, Atom *atom, const std::vector &x_ref, + double epsilon) +{ SCOPED_TRACE("EXPECT_POSITIONS: " + name); - double ** x = atom->x; - tagint * tag = atom->tag; + double **x = atom->x; + tagint *tag = atom->tag; const int nlocal = atom->nlocal; ASSERT_EQ(nlocal + 1, x_ref.size()); ErrorStats stats; @@ -79,10 +84,12 @@ void EXPECT_POSITIONS(const std::string & name, Atom * atom, const std::vector & v_ref, double epsilon) { +void EXPECT_VELOCITIES(const std::string &name, Atom *atom, const std::vector &v_ref, + double epsilon) +{ SCOPED_TRACE("EXPECT_VELOCITIES: " + name); - double ** v = atom->v; - tagint * tag = atom->tag; + double **v = atom->v; + tagint *tag = atom->tag; const int nlocal = atom->nlocal; ASSERT_EQ(nlocal + 1, v_ref.size()); ErrorStats stats; diff --git a/unittest/force-styles/test_pair_style.cpp b/unittest/force-styles/test_pair_style.cpp index e56a5bba1c..6f1061a5eb 100644 --- a/unittest/force-styles/test_pair_style.cpp +++ b/unittest/force-styles/test_pair_style.cpp @@ -766,7 +766,7 @@ TEST(PairStyle, gpu) GTEST_SKIP(); const char *args_neigh[] = {"PairStyle", "-log", "none", "-echo", - "screen", "-nocite", "-sf", "gpu"}; + "screen", "-nocite", "-sf", "gpu"}; const char *args_noneigh[] = {"PairStyle", "-log", "none", "-echo", "screen", "-nocite", "-sf", "gpu", "-pk", "gpu", "0", "neigh", "no"}; diff --git a/unittest/force-styles/tests/fix-timestep-adapt_coul.yaml b/unittest/force-styles/tests/fix-timestep-adapt_coul.yaml index 9462c78d14..7169e6c2f9 100644 --- a/unittest/force-styles/tests/fix-timestep-adapt_coul.yaml +++ b/unittest/force-styles/tests/fix-timestep-adapt_coul.yaml @@ -6,6 +6,7 @@ skip_tests: prerequisites: ! | atom full fix adapt + kspace pppm pre_commands: ! | variable scale equal ramp(0.5,1.0) post_commands: ! | diff --git a/unittest/formats/test_atom_styles.cpp b/unittest/formats/test_atom_styles.cpp index c712ffd763..4b726bb030 100644 --- a/unittest/formats/test_atom_styles.cpp +++ b/unittest/formats/test_atom_styles.cpp @@ -2123,7 +2123,7 @@ TEST_F(AtomStyleTest, body_nparticle) "12.0 0.0 12.0 0.0 0.0 0.0\n" "0.0 1.0 0.0\n" "0.0 -3.0 0.0\n"; - FILE *fp = fopen("input_atom_styles.data", "w"); + FILE *fp = fopen("input_atom_styles.data", "w"); fputs(data_file, fp); fclose(fp); BEGIN_HIDE_OUTPUT(); @@ -4889,16 +4889,26 @@ TEST_F(AtomStyleTest, oxdna) command("set atom 8 shape 1.173984503142341 1.173984503142341 1.173984503142341"); command("set atom 9 shape 1.173984503142341 1.173984503142341 1.173984503142341"); command("set atom 10 shape 1.173984503142341 1.173984503142341 1.173984503142341"); - command("set atom 1 quat 0.120438343611269 -0.970540441176996 0.208676441957758 16.990727782866998"); - command("set atom 2 quat 0.122039415796829 -0.068232256412985 0.990177125658213 40.001729435287870"); - command("set atom 3 quat 0.052760168698289 0.030943512185297 0.998127679033382 69.627682451632380"); - command("set atom 4 quat -0.037622918613871 0.030623545471522 0.998822664169035 97.038820280300570"); - command("set atom 5 quat 0.055056042946138 0.077631917807377 0.995460756369964 137.7813218321917"); - command("set atom 6 quat 0.931128471673637 -0.355724722922553 -0.080372201291206 166.2836226291888"); - command("set atom 7 quat 0.753526078198930 -0.648440397941919 0.108275111595674 200.6802564250672"); - command("set atom 8 quat 0.553942138074214 -0.829580511279186 0.070315595507185 192.0355407659524"); - command("set atom 9 quat -0.373540155765431 0.913070802138105 -0.163613759548524 171.0789308260751"); - command("set atom 10 quat 0.027515673832457 0.998248649922676 -0.052369080773879 161.2621224558284"); + command("set atom 1 quat 0.120438343611269 -0.970540441176996 0.208676441957758 " + "16.990727782866998"); + command("set atom 2 quat 0.122039415796829 -0.068232256412985 0.990177125658213 " + "40.001729435287870"); + command( + "set atom 3 quat 0.052760168698289 0.030943512185297 0.998127679033382 69.627682451632380"); + command("set atom 4 quat -0.037622918613871 0.030623545471522 0.998822664169035 " + "97.038820280300570"); + command( + "set atom 5 quat 0.055056042946138 0.077631917807377 0.995460756369964 137.7813218321917"); + command("set atom 6 quat 0.931128471673637 -0.355724722922553 -0.080372201291206 " + "166.2836226291888"); + command( + "set atom 7 quat 0.753526078198930 -0.648440397941919 0.108275111595674 200.6802564250672"); + command( + "set atom 8 quat 0.553942138074214 -0.829580511279186 0.070315595507185 192.0355407659524"); + command("set atom 9 quat -0.373540155765431 0.913070802138105 -0.163613759548524 " + "171.0789308260751"); + command("set atom 10 quat 0.027515673832457 0.998248649922676 -0.052369080773879 " + "161.2621224558284"); command("bond_style oxdna2/fene"); command("bond_coeff * 2.0 0.25 0.7564"); command("special_bonds lj 0 1 1"); @@ -4910,14 +4920,24 @@ TEST_F(AtomStyleTest, oxdna) command("create_bonds single/bond 1 7 8"); command("create_bonds single/bond 1 8 9"); command("create_bonds single/bond 1 9 10"); - command("pair_style hybrid/overlay oxdna2/excv oxdna2/stk oxdna2/hbond oxdna2/xstk oxdna2/coaxstk oxdna2/dh"); + command("pair_style hybrid/overlay oxdna2/excv oxdna2/stk oxdna2/hbond oxdna2/xstk " + "oxdna2/coaxstk oxdna2/dh"); command("pair_coeff * * oxdna2/excv 2.0 0.7 0.675 2.0 0.515 0.5 2.0 0.33 0.32"); - command("pair_coeff * * oxdna2/stk seqdep 0.1 1.3523 2.6717 6.0 0.4 0.9 0.32 0.75 1.3 0 0.8 0.9 0 0.95 0.9 0 0.95 2.0 0.65 2.0 0.65"); - command("pair_coeff * * oxdna2/hbond seqdep 0.0 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45"); - command("pair_coeff 1 4 oxdna2/hbond seqdep 1.0678 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45"); - command("pair_coeff 2 3 oxdna2/hbond seqdep 1.0678 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45"); - command("pair_coeff * * oxdna2/xstk 47.5 0.575 0.675 0.495 0.655 2.25 0.791592653589793 0.58 1.7 1.0 0.68 1.7 1.0 0.68 1.5 0 0.65 1.7 0.875 0.68 1.7 0.875 0.68"); - command("pair_coeff * * oxdna2/coaxstk 58.5 0.4 0.6 0.22 0.58 2.0 2.891592653589793 0.65 1.3 0 0.8 0.9 0 0.95 0.9 0 0.95 40.0 3.116592653589793"); + command("pair_coeff * * oxdna2/stk seqdep 0.1 1.3523 2.6717 6.0 0.4 0.9 0.32 0.75 1.3 0 0.8 " + "0.9 0 0.95 0.9 0 0.95 2.0 0.65 2.0 0.65"); + command( + "pair_coeff * * oxdna2/hbond seqdep 0.0 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 " + "0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45"); + command( + "pair_coeff 1 4 oxdna2/hbond seqdep 1.0678 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 " + "0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45"); + command( + "pair_coeff 2 3 oxdna2/hbond seqdep 1.0678 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 " + "0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45"); + command("pair_coeff * * oxdna2/xstk 47.5 0.575 0.675 0.495 0.655 2.25 0.791592653589793 0.58 " + "1.7 1.0 0.68 1.7 1.0 0.68 1.5 0 0.65 1.7 0.875 0.68 1.7 0.875 0.68"); + command("pair_coeff * * oxdna2/coaxstk 58.5 0.4 0.6 0.22 0.58 2.0 2.891592653589793 0.65 1.3 0 " + "0.8 0.9 0 0.95 0.9 0 0.95 40.0 3.116592653589793"); command("pair_coeff * * oxdna2/dh 0.1 0.2 0.815"); END_HIDE_OUTPUT(); @@ -4974,14 +4994,24 @@ TEST_F(AtomStyleTest, oxdna) command("bond_style oxdna2/fene"); command("bond_coeff * 2.0 0.25 0.7564"); command("special_bonds lj 0 1 1"); - command("pair_style hybrid/overlay oxdna2/excv oxdna2/stk oxdna2/hbond oxdna2/xstk oxdna2/coaxstk oxdna2/dh"); + command("pair_style hybrid/overlay oxdna2/excv oxdna2/stk oxdna2/hbond oxdna2/xstk " + "oxdna2/coaxstk oxdna2/dh"); command("pair_coeff * * oxdna2/excv 2.0 0.7 0.675 2.0 0.515 0.5 2.0 0.33 0.32"); - command("pair_coeff * * oxdna2/stk seqdep 0.1 1.3523 2.6717 6.0 0.4 0.9 0.32 0.75 1.3 0 0.8 0.9 0 0.95 0.9 0 0.95 2.0 0.65 2.0 0.65"); - command("pair_coeff * * oxdna2/hbond seqdep 0.0 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45"); - command("pair_coeff 1 4 oxdna2/hbond seqdep 1.0678 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45"); - command("pair_coeff 2 3 oxdna2/hbond seqdep 1.0678 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45"); - command("pair_coeff * * oxdna2/xstk 47.5 0.575 0.675 0.495 0.655 2.25 0.791592653589793 0.58 1.7 1.0 0.68 1.7 1.0 0.68 1.5 0 0.65 1.7 0.875 0.68 1.7 0.875 0.68"); - command("pair_coeff * * oxdna2/coaxstk 58.5 0.4 0.6 0.22 0.58 2.0 2.891592653589793 0.65 1.3 0 0.8 0.9 0 0.95 0.9 0 0.95 40.0 3.116592653589793"); + command("pair_coeff * * oxdna2/stk seqdep 0.1 1.3523 2.6717 6.0 0.4 0.9 0.32 0.75 1.3 0 0.8 " + "0.9 0 0.95 0.9 0 0.95 2.0 0.65 2.0 0.65"); + command( + "pair_coeff * * oxdna2/hbond seqdep 0.0 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 " + "0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45"); + command( + "pair_coeff 1 4 oxdna2/hbond seqdep 1.0678 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 " + "0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45"); + command( + "pair_coeff 2 3 oxdna2/hbond seqdep 1.0678 8.0 0.4 0.75 0.34 0.7 1.5 0 0.7 1.5 0 0.7 1.5 0 " + "0.7 0.46 3.141592653589793 0.7 4.0 1.5707963267948966 0.45 4.0 1.5707963267948966 0.45"); + command("pair_coeff * * oxdna2/xstk 47.5 0.575 0.675 0.495 0.655 2.25 0.791592653589793 0.58 " + "1.7 1.0 0.68 1.7 1.0 0.68 1.5 0 0.65 1.7 0.875 0.68 1.7 0.875 0.68"); + command("pair_coeff * * oxdna2/coaxstk 58.5 0.4 0.6 0.22 0.58 2.0 2.891592653589793 0.65 1.3 0 " + "0.8 0.9 0 0.95 0.9 0 0.95 40.0 3.116592653589793"); command("pair_coeff * * oxdna2/dh 0.1 0.2 0.815"); ASSERT_THAT(std::string(lmp->atom->atom_style), Eq("hybrid")); diff --git a/unittest/formats/test_dump_atom.cpp b/unittest/formats/test_dump_atom.cpp index 6fe4d0e1ae..683578d04f 100644 --- a/unittest/formats/test_dump_atom.cpp +++ b/unittest/formats/test_dump_atom.cpp @@ -794,6 +794,13 @@ TEST_F(DumpAtomTest, colname) command("run 10 post no"); command("dump_modify id colname default"); command("run 10 post no"); + command("dump_modify id colname id AtomID colname 3 x-scaled colname -4 z-scaled"); + command("dump_modify id scale no image yes"); + command("run 10 post no"); + command("dump_modify id colname id AtomID colname 3 X colname -4 Z colname ix img_x"); + command("run 10 post no"); + command("dump_modify id colname default"); + command("run 10 post no"); command("undump id"); END_HIDE_OUTPUT(); @@ -810,6 +817,18 @@ TEST_F(DumpAtomTest, colname) for (int i = 0; i < expected.size(); ++i) ASSERT_THAT(values[i], Eq(expected[i])); + values = extract_items(dump_file, "ATOMS id type x y z ix iy iz"); + expected = {"1 1 0 0 0 0 0 0", "1 1 0 0 0 0 0 0"}; + ASSERT_EQ(values.size(), expected.size()); + for (int i = 0; i < expected.size(); ++i) + ASSERT_THAT(values[i], Eq(expected[i])); + + values = extract_items(dump_file, "ATOMS AtomID type X y Z img_x iy iz"); + expected = {"1 1 0 0 0 0 0 0"}; + ASSERT_EQ(values.size(), expected.size()); + for (int i = 0; i < expected.size(); ++i) + ASSERT_THAT(values[i], Eq(expected[i])); + delete_file(dump_file); } diff --git a/unittest/formats/test_dump_cfg.cpp b/unittest/formats/test_dump_cfg.cpp index acd839282d..2a295163ab 100644 --- a/unittest/formats/test_dump_cfg.cpp +++ b/unittest/formats/test_dump_cfg.cpp @@ -144,7 +144,7 @@ TEST_F(DumpCfgTest, no_unwrap_no_buffer_run0) ASSERT_THAT(lines[0], Eq("Number of particles = 32")); delete_file("dump_cfg_no_unwrap_no_buffer_run0.melt.cfg"); } -} +} // namespace LAMMPS_NS int main(int argc, char **argv) { diff --git a/unittest/formats/test_dump_custom.cpp b/unittest/formats/test_dump_custom.cpp index d1bae9d28f..3649dcfb02 100644 --- a/unittest/formats/test_dump_custom.cpp +++ b/unittest/formats/test_dump_custom.cpp @@ -384,7 +384,7 @@ TEST_F(DumpCustomTest, rerun_bin) ASSERT_NEAR(pe_2, pe_rerun, 1.0e-14); delete_file(dump_file); } -} +} // namespace LAMMPS_NS int main(int argc, char **argv) { MPI_Init(&argc, &argv); diff --git a/unittest/formats/test_dump_local.cpp b/unittest/formats/test_dump_local.cpp index 5735f4dc7c..5685504cab 100644 --- a/unittest/formats/test_dump_local.cpp +++ b/unittest/formats/test_dump_local.cpp @@ -238,7 +238,7 @@ TEST_F(DumpLocalTest, triclinic_run0) ASSERT_EQ(utils::split_words(lines[7]).size(), 3); delete_file(dump_file); } -} +} // namespace LAMMPS_NS int main(int argc, char **argv) { diff --git a/unittest/formats/test_dump_netcdf.cpp b/unittest/formats/test_dump_netcdf.cpp index 0b016d0efb..bf14f8aa54 100644 --- a/unittest/formats/test_dump_netcdf.cpp +++ b/unittest/formats/test_dump_netcdf.cpp @@ -387,7 +387,7 @@ TEST_F(DumpNetCDFTest, run0_mpi) } delete_file(dump_file); } -} +} // namespace LAMMPS_NS int main(int argc, char **argv) { diff --git a/unittest/formats/test_file_operations.cpp b/unittest/formats/test_file_operations.cpp index 6a3fef48b3..ef954b51f3 100644 --- a/unittest/formats/test_file_operations.cpp +++ b/unittest/formats/test_file_operations.cpp @@ -348,7 +348,7 @@ TEST_F(FileOperationsTest, write_restart) } TEST_FAILURE(".*ERROR: Illegal write_restart command.*", command("write_restart");); - TEST_FAILURE(".*ERROR: Illegal write_restart command.*", + TEST_FAILURE(".*ERROR: Unknown write_restart keyword: xxxx.*", command("write_restart test.restart xxxx");); TEST_FAILURE(".*ERROR on proc 0: Cannot open restart file some_crazy_dir/test.restart:" " No such file or directory.*", @@ -439,9 +439,17 @@ TEST_F(FileOperationsTest, write_data) ASSERT_FILE_EXISTS("charge.data"); ASSERT_EQ(count_lines("charge.data"), 30); - TEST_FAILURE(".*ERROR: Illegal write_data command.*", command("write_data");); - TEST_FAILURE(".*ERROR: Illegal write_data command.*", command("write_data test.data xxxx");); - TEST_FAILURE(".*ERROR: Illegal write_data command.*", command("write_data test.data pair xx");); + TEST_FAILURE(".*ERROR: Illegal write_data command: missing argument.*", command("write_data");); + TEST_FAILURE(".*ERROR: Unknown write_data keyword: xxxx.*", + command("write_data test.data xxxx");); + TEST_FAILURE(".*ERROR: Illegal write_data pair command: missing argument.*", + command("write_data test.data pair");); + TEST_FAILURE(".*ERROR: Unknown write_data pair option: xx.*", + command("write_data test.data pair xx");); + TEST_FAILURE(".*ERROR: Illegal write_data types command: missing argument.*", + command("write_data test.data types");); + TEST_FAILURE(".*ERROR: Unknown write_data types option: xx.*", + command("write_data test.data types xx");); TEST_FAILURE(".*ERROR on proc 0: Cannot open data file some_crazy_dir/test.data:" " No such file or directory.*", command("write_data some_crazy_dir/test.data");); diff --git a/unittest/formats/test_potential_file_reader.cpp b/unittest/formats/test_potential_file_reader.cpp index e9b633690e..9e07bbc951 100644 --- a/unittest/formats/test_potential_file_reader.cpp +++ b/unittest/formats/test_potential_file_reader.cpp @@ -57,8 +57,7 @@ constexpr int LAMMPS_NS::PairVashishta::NPARAMS_PER_LINE; constexpr int LAMMPS_NS::PairTersoffTable::NPARAMS_PER_LINE; #endif -class PotentialFileReaderTest : public LAMMPSTest { -}; +class PotentialFileReaderTest : public LAMMPSTest {}; // open for native units TEST_F(PotentialFileReaderTest, Sw_native) @@ -259,8 +258,7 @@ TEST_F(PotentialFileReaderTest, UnitConvert) delete reader; } -class OpenPotentialTest : public LAMMPSTest { -}; +class OpenPotentialTest : public LAMMPSTest {}; // open for native units TEST_F(OpenPotentialTest, Sw_native) diff --git a/unittest/fortran/CMakeLists.txt b/unittest/fortran/CMakeLists.txt index 1062766e43..c7174d8e6e 100644 --- a/unittest/fortran/CMakeLists.txt +++ b/unittest/fortran/CMakeLists.txt @@ -23,6 +23,10 @@ if(CMAKE_Fortran_COMPILER) endif() else() add_library(fmpi_stubs STATIC mpi_stubs.f90) + get_filename_component(_tmp_fc ${CMAKE_Fortran_COMPILER} NAME) + if (_tmp_fc STREQUAL "flang") + target_link_libraries(fmpi_stubs PUBLIC gfortran) + endif() add_library(MPI::MPI_Fortran ALIAS fmpi_stubs) endif() diff --git a/unittest/utils/test_platform.cpp b/unittest/utils/test_platform.cpp index 8101c1adc6..493a2749be 100644 --- a/unittest/utils/test_platform.cpp +++ b/unittest/utils/test_platform.cpp @@ -325,10 +325,10 @@ TEST(Platform, path_and_directory) ASSERT_FALSE(platform::path_is_directory("path_is_directory")); #if defined(_WIN32) - ASSERT_EQ(platform::mkdir("path_is_directory\\path_is_directory"),0); + ASSERT_EQ(platform::mkdir("path_is_directory\\path_is_directory"), 0); ASSERT_TRUE(platform::path_is_directory("path_is_directory\\path_is_directory")); #else - ASSERT_EQ(platform::mkdir("path_is_directory/path_is_directory"),0); + ASSERT_EQ(platform::mkdir("path_is_directory/path_is_directory"), 0); ASSERT_TRUE(platform::path_is_directory("path_is_directory/path_is_directory")); #endif platform::rmdir("path_is_directory"); diff --git a/unittest/utils/test_utils.cpp b/unittest/utils/test_utils.cpp index cff7375aeb..2881ad10de 100644 --- a/unittest/utils/test_utils.cpp +++ b/unittest/utils/test_utils.cpp @@ -152,7 +152,7 @@ TEST(Utils, join_words) words.resize(1); combined = utils::join_words(words, "/"); ASSERT_THAT(combined, StrEq("one")); - words.push_back(""); + words.emplace_back(""); combined = utils::join_words(words, "1"); ASSERT_THAT(combined, StrEq("one1")); }