forked from lijiext/lammps
Merge branch 'master' into user-cgdna
This commit is contained in:
commit
c6f637f78f
|
@ -322,13 +322,14 @@ endif()
|
|||
include(Packages/KSPACE)
|
||||
include(Packages/PYTHON)
|
||||
include(Packages/VORONOI)
|
||||
include(Packages/USER-SCAFACOS)
|
||||
include(Packages/USER-PLUMED)
|
||||
include(Packages/USER-COLVARS)
|
||||
include(Packages/USER-MOLFILE)
|
||||
include(Packages/USER-NETCDF)
|
||||
include(Packages/USER-SMD)
|
||||
include(Packages/USER-QUIP)
|
||||
include(Packages/USER-PLUMED)
|
||||
include(Packages/USER-QMMM)
|
||||
include(Packages/USER-QUIP)
|
||||
include(Packages/USER-SCAFACOS)
|
||||
include(Packages/USER-SMD)
|
||||
include(Packages/USER-VTK)
|
||||
include(Packages/KIM)
|
||||
include(Packages/LATTE)
|
||||
|
@ -418,8 +419,7 @@ endforeach()
|
|||
##############################################
|
||||
# add lib sources of (simple) enabled packages
|
||||
############################################
|
||||
foreach(SIMPLE_LIB POEMS USER-ATC USER-AWPMD USER-COLVARS USER-H5MD
|
||||
USER-QMMM)
|
||||
foreach(SIMPLE_LIB POEMS USER-ATC USER-AWPMD USER-H5MD USER-QMMM)
|
||||
if(PKG_${SIMPLE_LIB})
|
||||
string(REGEX REPLACE "^USER-" "" PKG_LIB "${SIMPLE_LIB}")
|
||||
string(TOLOWER "${PKG_LIB}" PKG_LIB)
|
||||
|
@ -433,10 +433,6 @@ foreach(SIMPLE_LIB POEMS USER-ATC USER-AWPMD USER-COLVARS USER-H5MD
|
|||
target_include_directories(awpmd PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/awpmd/systems/interact ${LAMMPS_LIB_SOURCE_DIR}/awpmd/ivutils/include)
|
||||
elseif(PKG_LIB STREQUAL h5md)
|
||||
target_include_directories(h5md PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/h5md/include ${HDF5_INCLUDE_DIRS})
|
||||
elseif(PKG_LIB STREQUAL colvars)
|
||||
target_compile_options(colvars PRIVATE -DLEPTON)
|
||||
target_include_directories(colvars PRIVATE ${LAMMPS_LIB_SOURCE_DIR}/colvars/lepton/include)
|
||||
target_include_directories(colvars PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/colvars)
|
||||
else()
|
||||
target_include_directories(${PKG_LIB} PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB})
|
||||
endif()
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
if(PKG_USER-COLVARS)
|
||||
|
||||
set(COLVARS_SOURCE_DIR ${LAMMPS_LIB_SOURCE_DIR}/colvars)
|
||||
|
||||
file(GLOB COLVARS_SOURCES ${COLVARS_SOURCE_DIR}/[^.]*.cpp)
|
||||
|
||||
# Build Lepton by default
|
||||
set(COLVARS_LEPTON_DEFAULT ON)
|
||||
# but not if C++11 is disabled per user request
|
||||
if(DEFINED DISABLE_CXX11_REQUIREMENT)
|
||||
if(DISABLE_CXX11_REQUIREMENT)
|
||||
set(COLVARS_LEPTON_DEFAULT OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(COLVARS_LEPTON "Build and link the Lepton library" ${COLVARS_LEPTON_DEFAULT})
|
||||
|
||||
# Verify that the user's choice is consistent
|
||||
if(DEFINED DISABLE_CXX11_REQUIREMENT)
|
||||
if((DISABLE_CXX11_REQUIREMENT) AND (COLVARS_LEPTON))
|
||||
message(FATAL_ERROR "Building the Lepton library requires C++11 or later.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(COLVARS_LEPTON)
|
||||
set(LEPTON_DIR ${LAMMPS_LIB_SOURCE_DIR}/colvars/lepton)
|
||||
file(GLOB LEPTON_SOURCES ${LEPTON_DIR}/src/[^.]*.cpp)
|
||||
add_library(lepton STATIC ${LEPTON_SOURCES})
|
||||
target_include_directories(lepton PRIVATE ${LEPTON_DIR}/include)
|
||||
endif()
|
||||
|
||||
add_library(colvars STATIC ${COLVARS_SOURCES})
|
||||
target_include_directories(colvars PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/colvars)
|
||||
list(APPEND LAMMPS_LINK_LIBS colvars)
|
||||
|
||||
if(COLVARS_LEPTON)
|
||||
list(APPEND LAMMPS_LINK_LIBS lepton)
|
||||
target_compile_options(colvars PRIVATE -DLEPTON)
|
||||
target_include_directories(colvars PUBLIC ${LEPTON_DIR}/include)
|
||||
endif()
|
||||
|
||||
endif()
|
|
@ -87,6 +87,7 @@ Miscellaneous tools :h3
|
|||
"emacs"_#emacs,
|
||||
"i-pi"_#ipi,
|
||||
"kate"_#kate,
|
||||
"singularity"_#singularity_tool,
|
||||
"vim"_#vim :tb(c=5,ea=c,a=l)
|
||||
|
||||
:line
|
||||
|
@ -542,6 +543,15 @@ Ivanov, at University of Iceland (ali5 at hi.is).
|
|||
|
||||
:line
|
||||
|
||||
singularity tool :h4,link(singularity_tool)
|
||||
|
||||
The singularity sub-directory contains container definitions files
|
||||
that can be used to build container images for building and testing
|
||||
LAMMPS on specific OS variants using the "Singularity"_https://sylabs.io
|
||||
container software. Contributions for additional variants are welcome.
|
||||
|
||||
:line
|
||||
|
||||
vim tool :h4,link(vim)
|
||||
|
||||
The files in the tools/vim directory are add-ons to the VIM editor
|
||||
|
|
|
@ -84,3 +84,6 @@ package"_Build_package.html doc page for more info.
|
|||
:link(Theodorou)
|
||||
[(Theodorou)] Theodorou, Suter, Macromolecules, 18, 1206 (1985).
|
||||
|
||||
:link(Mattice)
|
||||
[(Mattice)] Mattice, Suter, Conformational Theory of Large Molecules, Wiley, New York, 1994.
|
||||
|
||||
|
|
|
@ -1582,6 +1582,7 @@ Materias
|
|||
mathbf
|
||||
matlab
|
||||
matplotlib
|
||||
Mattice
|
||||
Mattox
|
||||
Mattson
|
||||
maxangle
|
||||
|
|
|
@ -14,10 +14,10 @@ neighbor 1 bin
|
|||
|
||||
timestep 0.1
|
||||
|
||||
fix nve all nve
|
||||
fix lang all langevin 10 10 1 26488 gjf vfull
|
||||
fix nve all nve
|
||||
|
||||
thermo 200
|
||||
run 50000
|
||||
run 5000
|
||||
|
||||
|
||||
|
|
|
@ -14,10 +14,10 @@ neighbor 1 bin
|
|||
|
||||
timestep 0.1
|
||||
|
||||
fix nve all nve
|
||||
fix lang all langevin 10 10 1 26488 gjf vhalf
|
||||
fix nve all nve
|
||||
|
||||
thermo 200
|
||||
run 50000
|
||||
run 5000
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,125 @@
|
|||
LAMMPS (19 Sep 2019)
|
||||
using 1 OpenMP thread(s) per MPI task
|
||||
# GJF-2GJ thermostat
|
||||
|
||||
units metal
|
||||
atom_style full
|
||||
|
||||
boundary p p p
|
||||
read_data argon.lmp
|
||||
orthogonal box = (0 0 0) to (32.146 32.146 32.146)
|
||||
1 by 1 by 1 MPI processor grid
|
||||
reading atoms ...
|
||||
864 atoms
|
||||
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.000150019 secs
|
||||
read_data CPU = 0.001946 secs
|
||||
|
||||
include ff-argon.lmp
|
||||
#############################
|
||||
#Atoms types - mass - charge#
|
||||
#############################
|
||||
#@ 1 atom types #!THIS LINE IS NECESSARY DON'T SPEND HOURS FINDING THAT OUT!#
|
||||
|
||||
variable Ar equal 1
|
||||
|
||||
#############
|
||||
#Atom Masses#
|
||||
#############
|
||||
|
||||
mass ${Ar} 39.903
|
||||
mass 1 39.903
|
||||
|
||||
###########################
|
||||
#Pair Potentials - Tersoff#
|
||||
###########################
|
||||
|
||||
pair_style lj/cubic
|
||||
pair_coeff * * 0.0102701 3.42
|
||||
|
||||
|
||||
velocity all create 10 2357 mom yes dist gaussian
|
||||
|
||||
neighbor 1 bin
|
||||
|
||||
timestep 0.1
|
||||
|
||||
fix lang all langevin 10 10 1 26488 gjf vfull
|
||||
fix nve all nve
|
||||
|
||||
thermo 200
|
||||
run 5000
|
||||
Neighbor list info ...
|
||||
update every 1 steps, delay 10 steps, check yes
|
||||
max neighbors/atom: 2000, page size: 100000
|
||||
master list distance cutoff = 6.94072
|
||||
ghost atom cutoff = 6.94072
|
||||
binsize = 3.47036, bins = 10 10 10
|
||||
1 neighbor lists, perpetual/occasional/extra = 1 0 0
|
||||
(1) pair lj/cubic, 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) = 6.875 | 6.875 | 6.875 Mbytes
|
||||
Step Temp E_pair E_mol TotEng Press
|
||||
0 11.080223 -56.207655 0 -54.97164 37.215524
|
||||
200 8.2588471 -55.073602 0 -54.152316 339.80416
|
||||
400 8.1427292 -55.072244 0 -54.16391 338.91883
|
||||
600 8.7595618 -55.066739 0 -54.089596 344.25426
|
||||
800 8.550633 -55.148315 0 -54.194479 318.9385
|
||||
1000 8.5394337 -55.125709 0 -54.173122 326.59471
|
||||
1200 8.565973 -55.114892 0 -54.159345 328.5193
|
||||
1400 8.2092914 -55.109233 0 -54.193475 329.56161
|
||||
1600 8.209495 -55.138161 0 -54.22238 321.39971
|
||||
1800 8.4039924 -55.13355 0 -54.196072 322.64214
|
||||
2000 8.4548937 -55.062994 0 -54.119838 343.29888
|
||||
2200 8.3775139 -55.13364 0 -54.199116 323.63744
|
||||
2400 8.537332 -55.163702 0 -54.21135 315.62864
|
||||
2600 8.672488 -55.112054 0 -54.144625 330.1106
|
||||
2800 8.3000218 -55.147275 0 -54.221396 318.73112
|
||||
3000 8.3552421 -55.135164 0 -54.203124 323.53075
|
||||
3200 8.4126798 -55.135753 0 -54.197306 321.48817
|
||||
3400 8.4986413 -55.135408 0 -54.187372 323.42951
|
||||
3600 8.38431 -55.103932 0 -54.16865 330.68929
|
||||
3800 8.8262454 -55.103648 0 -54.119067 332.97779
|
||||
4000 7.9658136 -55.120402 0 -54.231803 324.9595
|
||||
4200 8.2265544 -55.129011 0 -54.211327 323.87069
|
||||
4400 8.1253738 -55.153089 0 -54.246691 316.304
|
||||
4600 8.2010823 -55.124053 0 -54.20921 325.98402
|
||||
4800 8.5512149 -55.075877 0 -54.121976 338.30137
|
||||
5000 8.4737659 -55.158604 0 -54.213343 316.22418
|
||||
Loop time of 2.73236 on 1 procs for 5000 steps with 864 atoms
|
||||
|
||||
Performance: 15810.507 ns/day, 0.002 hours/ns, 1829.920 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.4262 | 1.4262 | 1.4262 | 0.0 | 52.20
|
||||
Bond | 0.00042836 | 0.00042836 | 0.00042836 | 0.0 | 0.02
|
||||
Neigh | 0.12819 | 0.12819 | 0.12819 | 0.0 | 4.69
|
||||
Comm | 0.058611 | 0.058611 | 0.058611 | 0.0 | 2.15
|
||||
Output | 0.00047283 | 0.00047283 | 0.00047283 | 0.0 | 0.02
|
||||
Modify | 1.0924 | 1.0924 | 1.0924 | 0.0 | 39.98
|
||||
Other | | 0.02605 | | | 0.95
|
||||
|
||||
Nlocal: 864 ave 864 max 864 min
|
||||
Histogram: 1 0 0 0 0 0 0 0 0 0
|
||||
Nghost: 1593 ave 1593 max 1593 min
|
||||
Histogram: 1 0 0 0 0 0 0 0 0 0
|
||||
Neighs: 18143 ave 18143 max 18143 min
|
||||
Histogram: 1 0 0 0 0 0 0 0 0 0
|
||||
|
||||
Total # of neighbors = 18143
|
||||
Ave neighs/atom = 20.9988
|
||||
Ave special neighs/atom = 0
|
||||
Neighbor list builds = 158
|
||||
Dangerous builds = 5
|
||||
|
||||
|
||||
Total wall time: 0:00:02
|
|
@ -0,0 +1,125 @@
|
|||
LAMMPS (19 Sep 2019)
|
||||
using 1 OpenMP thread(s) per MPI task
|
||||
# GJF-2GJ thermostat
|
||||
|
||||
units metal
|
||||
atom_style full
|
||||
|
||||
boundary p p p
|
||||
read_data argon.lmp
|
||||
orthogonal box = (0 0 0) to (32.146 32.146 32.146)
|
||||
1 by 2 by 2 MPI processor grid
|
||||
reading atoms ...
|
||||
864 atoms
|
||||
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.000556268 secs
|
||||
read_data CPU = 0.003817 secs
|
||||
|
||||
include ff-argon.lmp
|
||||
#############################
|
||||
#Atoms types - mass - charge#
|
||||
#############################
|
||||
#@ 1 atom types #!THIS LINE IS NECESSARY DON'T SPEND HOURS FINDING THAT OUT!#
|
||||
|
||||
variable Ar equal 1
|
||||
|
||||
#############
|
||||
#Atom Masses#
|
||||
#############
|
||||
|
||||
mass ${Ar} 39.903
|
||||
mass 1 39.903
|
||||
|
||||
###########################
|
||||
#Pair Potentials - Tersoff#
|
||||
###########################
|
||||
|
||||
pair_style lj/cubic
|
||||
pair_coeff * * 0.0102701 3.42
|
||||
|
||||
|
||||
velocity all create 10 2357 mom yes dist gaussian
|
||||
|
||||
neighbor 1 bin
|
||||
|
||||
timestep 0.1
|
||||
|
||||
fix lang all langevin 10 10 1 26488 gjf vfull
|
||||
fix nve all nve
|
||||
|
||||
thermo 200
|
||||
run 5000
|
||||
Neighbor list info ...
|
||||
update every 1 steps, delay 10 steps, check yes
|
||||
max neighbors/atom: 2000, page size: 100000
|
||||
master list distance cutoff = 6.94072
|
||||
ghost atom cutoff = 6.94072
|
||||
binsize = 3.47036, bins = 10 10 10
|
||||
1 neighbor lists, perpetual/occasional/extra = 1 0 0
|
||||
(1) pair lj/cubic, 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) = 6.808 | 6.808 | 6.808 Mbytes
|
||||
Step Temp E_pair E_mol TotEng Press
|
||||
0 11.080228 -56.207655 0 -54.971639 37.215541
|
||||
200 8.4818184 -55.127334 0 -54.181174 324.96159
|
||||
400 8.5960916 -55.09236 0 -54.133453 334.83136
|
||||
600 8.1607556 -55.073136 0 -54.162791 339.035
|
||||
800 8.8350489 -55.133382 0 -54.147819 324.48149
|
||||
1000 8.5692704 -55.118463 0 -54.162548 327.26328
|
||||
1200 8.4174147 -55.126297 0 -54.187322 324.4248
|
||||
1400 8.6362603 -55.123075 0 -54.159688 326.7798
|
||||
1600 8.222512 -55.153799 0 -54.236565 317.8147
|
||||
1800 8.324523 -55.116698 0 -54.188085 327.35373
|
||||
2000 7.9615959 -55.155825 0 -54.267697 315.37215
|
||||
2200 8.495968 -55.083943 0 -54.136205 336.67775
|
||||
2400 7.7926986 -55.044816 0 -54.175529 344.87758
|
||||
2600 8.1551351 -55.069404 0 -54.159687 339.60901
|
||||
2800 8.2593599 -55.084151 0 -54.162807 336.54935
|
||||
3000 8.2860869 -55.110296 0 -54.185971 328.99074
|
||||
3200 8.4074534 -55.123576 0 -54.185712 326.06823
|
||||
3400 8.6694364 -55.128925 0 -54.161836 324.67512
|
||||
3600 8.5718984 -55.129861 0 -54.173653 325.20586
|
||||
3800 8.508102 -55.099093 0 -54.150001 333.91437
|
||||
4000 8.2966658 -55.117782 0 -54.192276 327.13516
|
||||
4200 8.7641728 -55.135792 0 -54.158136 324.00844
|
||||
4400 8.8827909 -55.096369 0 -54.10548 335.08467
|
||||
4600 8.7666577 -55.127213 0 -54.149279 326.15539
|
||||
4800 8.6670762 -55.163395 0 -54.19657 316.48383
|
||||
5000 8.1893094 -55.073756 0 -54.160226 337.95271
|
||||
Loop time of 0.870594 on 4 procs for 5000 steps with 864 atoms
|
||||
|
||||
Performance: 49621.267 ns/day, 0.000 hours/ns, 5743.202 timesteps/s
|
||||
96.5% CPU use with 4 MPI tasks x 1 OpenMP threads
|
||||
|
||||
MPI task timing breakdown:
|
||||
Section | min time | avg time | max time |%varavg| %total
|
||||
---------------------------------------------------------------
|
||||
Pair | 0.33582 | 0.35125 | 0.3724 | 2.3 | 40.35
|
||||
Bond | 0.00030267 | 0.00031316 | 0.00033538 | 0.0 | 0.04
|
||||
Neigh | 0.034246 | 0.03479 | 0.035904 | 0.4 | 4.00
|
||||
Comm | 0.15068 | 0.17419 | 0.19191 | 3.6 | 20.01
|
||||
Output | 0.00044776 | 0.00054703 | 0.00083177 | 0.0 | 0.06
|
||||
Modify | 0.27679 | 0.28079 | 0.28849 | 0.9 | 32.25
|
||||
Other | | 0.02871 | | | 3.30
|
||||
|
||||
Nlocal: 216 ave 216 max 216 min
|
||||
Histogram: 4 0 0 0 0 0 0 0 0 0
|
||||
Nghost: 888.75 ave 899 max 876 min
|
||||
Histogram: 1 0 1 0 0 0 0 0 0 2
|
||||
Neighs: 4536 ave 4737 max 4335 min
|
||||
Histogram: 2 0 0 0 0 0 0 0 0 2
|
||||
|
||||
Total # of neighbors = 18144
|
||||
Ave neighs/atom = 21
|
||||
Ave special neighs/atom = 0
|
||||
Neighbor list builds = 178
|
||||
Dangerous builds = 11
|
||||
|
||||
|
||||
Total wall time: 0:00:00
|
|
@ -0,0 +1,125 @@
|
|||
LAMMPS (19 Sep 2019)
|
||||
using 1 OpenMP thread(s) per MPI task
|
||||
# GJF-2GJ thermostat
|
||||
|
||||
units metal
|
||||
atom_style full
|
||||
|
||||
boundary p p p
|
||||
read_data argon.lmp
|
||||
orthogonal box = (0 0 0) to (32.146 32.146 32.146)
|
||||
1 by 1 by 1 MPI processor grid
|
||||
reading atoms ...
|
||||
864 atoms
|
||||
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.000147804 secs
|
||||
read_data CPU = 0.00194898 secs
|
||||
|
||||
include ff-argon.lmp
|
||||
#############################
|
||||
#Atoms types - mass - charge#
|
||||
#############################
|
||||
#@ 1 atom types #!THIS LINE IS NECESSARY DON'T SPEND HOURS FINDING THAT OUT!#
|
||||
|
||||
variable Ar equal 1
|
||||
|
||||
#############
|
||||
#Atom Masses#
|
||||
#############
|
||||
|
||||
mass ${Ar} 39.903
|
||||
mass 1 39.903
|
||||
|
||||
###########################
|
||||
#Pair Potentials - Tersoff#
|
||||
###########################
|
||||
|
||||
pair_style lj/cubic
|
||||
pair_coeff * * 0.0102701 3.42
|
||||
|
||||
|
||||
velocity all create 10 2357 mom yes dist gaussian
|
||||
|
||||
neighbor 1 bin
|
||||
|
||||
timestep 0.1
|
||||
|
||||
fix lang all langevin 10 10 1 26488 gjf vhalf
|
||||
fix nve all nve
|
||||
|
||||
thermo 200
|
||||
run 5000
|
||||
Neighbor list info ...
|
||||
update every 1 steps, delay 10 steps, check yes
|
||||
max neighbors/atom: 2000, page size: 100000
|
||||
master list distance cutoff = 6.94072
|
||||
ghost atom cutoff = 6.94072
|
||||
binsize = 3.47036, bins = 10 10 10
|
||||
1 neighbor lists, perpetual/occasional/extra = 1 0 0
|
||||
(1) pair lj/cubic, 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) = 6.5 | 6.5 | 6.5 Mbytes
|
||||
Step Temp E_pair E_mol TotEng Press
|
||||
0 11.080223 -56.207655 0 -54.97164 37.215524
|
||||
200 9.8808568 -55.073602 0 -53.971378 345.62207
|
||||
400 9.8712816 -55.072244 0 -53.971088 345.11889
|
||||
600 10.528988 -55.066739 0 -53.892214 350.60093
|
||||
800 10.167171 -55.148315 0 -54.014152 324.73679
|
||||
1000 10.029026 -55.125709 0 -54.006956 331.93766
|
||||
1200 10.194424 -55.114892 0 -53.977688 334.36032
|
||||
1400 9.3473846 -55.109233 0 -54.066518 333.64378
|
||||
1600 9.7774071 -55.138161 0 -54.047477 327.02358
|
||||
1800 9.9814275 -55.13355 0 -54.020107 328.30017
|
||||
2000 10.2515 -55.062994 0 -53.919424 349.74304
|
||||
2200 9.8126922 -55.13364 0 -54.039019 328.78521
|
||||
2400 10.044314 -55.163702 0 -54.043244 321.03397
|
||||
2600 10.543316 -55.112054 0 -53.935932 336.82099
|
||||
2800 9.7874375 -55.147275 0 -54.055472 324.06626
|
||||
3000 9.7703821 -55.135164 0 -54.045263 328.60665
|
||||
3200 10.141958 -55.135753 0 -54.004402 327.69084
|
||||
3400 10.160576 -55.135408 0 -54.00198 329.39063
|
||||
3600 10.044652 -55.103932 0 -53.983436 336.64469
|
||||
3800 10.662403 -55.103648 0 -53.914241 339.56382
|
||||
4000 9.2921047 -55.120402 0 -54.083853 329.71671
|
||||
4200 9.8744553 -55.129011 0 -54.027501 329.78147
|
||||
4400 9.4085964 -55.153089 0 -54.103546 320.90673
|
||||
4600 9.5463801 -55.124053 0 -54.05914 330.80941
|
||||
4800 10.223884 -55.075877 0 -53.935387 344.30099
|
||||
5000 9.6243338 -55.158604 0 -54.084996 320.3511
|
||||
Loop time of 2.29551 on 1 procs for 5000 steps with 864 atoms
|
||||
|
||||
Performance: 18819.358 ns/day, 0.001 hours/ns, 2178.166 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.4393 | 1.4393 | 1.4393 | 0.0 | 62.70
|
||||
Bond | 0.0004441 | 0.0004441 | 0.0004441 | 0.0 | 0.02
|
||||
Neigh | 0.12136 | 0.12136 | 0.12136 | 0.0 | 5.29
|
||||
Comm | 0.059342 | 0.059342 | 0.059342 | 0.0 | 2.59
|
||||
Output | 0.00046968 | 0.00046968 | 0.00046968 | 0.0 | 0.02
|
||||
Modify | 0.64937 | 0.64937 | 0.64937 | 0.0 | 28.29
|
||||
Other | | 0.02522 | | | 1.10
|
||||
|
||||
Nlocal: 864 ave 864 max 864 min
|
||||
Histogram: 1 0 0 0 0 0 0 0 0 0
|
||||
Nghost: 1593 ave 1593 max 1593 min
|
||||
Histogram: 1 0 0 0 0 0 0 0 0 0
|
||||
Neighs: 18143 ave 18143 max 18143 min
|
||||
Histogram: 1 0 0 0 0 0 0 0 0 0
|
||||
|
||||
Total # of neighbors = 18143
|
||||
Ave neighs/atom = 20.9988
|
||||
Ave special neighs/atom = 0
|
||||
Neighbor list builds = 158
|
||||
Dangerous builds = 5
|
||||
|
||||
|
||||
Total wall time: 0:00:02
|
|
@ -0,0 +1,125 @@
|
|||
LAMMPS (19 Sep 2019)
|
||||
using 1 OpenMP thread(s) per MPI task
|
||||
# GJF-2GJ thermostat
|
||||
|
||||
units metal
|
||||
atom_style full
|
||||
|
||||
boundary p p p
|
||||
read_data argon.lmp
|
||||
orthogonal box = (0 0 0) to (32.146 32.146 32.146)
|
||||
1 by 2 by 2 MPI processor grid
|
||||
reading atoms ...
|
||||
864 atoms
|
||||
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.000315903 secs
|
||||
read_data CPU = 0.0653752 secs
|
||||
|
||||
include ff-argon.lmp
|
||||
#############################
|
||||
#Atoms types - mass - charge#
|
||||
#############################
|
||||
#@ 1 atom types #!THIS LINE IS NECESSARY DON'T SPEND HOURS FINDING THAT OUT!#
|
||||
|
||||
variable Ar equal 1
|
||||
|
||||
#############
|
||||
#Atom Masses#
|
||||
#############
|
||||
|
||||
mass ${Ar} 39.903
|
||||
mass 1 39.903
|
||||
|
||||
###########################
|
||||
#Pair Potentials - Tersoff#
|
||||
###########################
|
||||
|
||||
pair_style lj/cubic
|
||||
pair_coeff * * 0.0102701 3.42
|
||||
|
||||
|
||||
velocity all create 10 2357 mom yes dist gaussian
|
||||
|
||||
neighbor 1 bin
|
||||
|
||||
timestep 0.1
|
||||
|
||||
fix lang all langevin 10 10 1 26488 gjf vhalf
|
||||
fix nve all nve
|
||||
|
||||
thermo 200
|
||||
run 5000
|
||||
Neighbor list info ...
|
||||
update every 1 steps, delay 10 steps, check yes
|
||||
max neighbors/atom: 2000, page size: 100000
|
||||
master list distance cutoff = 6.94072
|
||||
ghost atom cutoff = 6.94072
|
||||
binsize = 3.47036, bins = 10 10 10
|
||||
1 neighbor lists, perpetual/occasional/extra = 1 0 0
|
||||
(1) pair lj/cubic, 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) = 6.433 | 6.433 | 6.433 Mbytes
|
||||
Step Temp E_pair E_mol TotEng Press
|
||||
0 11.080228 -56.207655 0 -54.971639 37.215541
|
||||
200 9.8046716 -55.127334 0 -54.033608 329.70647
|
||||
400 10.174622 -55.09236 0 -53.957366 340.49331
|
||||
600 9.9812299 -55.073136 0 -53.959714 345.56477
|
||||
800 10.512874 -55.133382 0 -53.960655 330.4996
|
||||
1000 9.9587885 -55.118463 0 -54.007545 332.24728
|
||||
1200 10.236607 -55.126297 0 -53.984388 330.94998
|
||||
1400 10.134679 -55.123075 0 -53.992537 332.15441
|
||||
1600 9.8934078 -55.153799 0 -54.050174 323.80795
|
||||
1800 10.064966 -55.116698 0 -53.993936 333.59644
|
||||
2000 9.6736107 -55.155825 0 -54.076719 321.5129
|
||||
2200 10.264537 -55.083943 0 -53.938918 343.02135
|
||||
2400 9.5640032 -55.044816 0 -53.977937 351.23099
|
||||
2600 9.6581077 -55.069404 0 -53.992028 344.99996
|
||||
2800 9.9622575 -55.084151 0 -53.972846 342.6574
|
||||
3000 9.8724909 -55.110296 0 -54.009005 334.68094
|
||||
3200 10.032027 -55.123576 0 -54.004488 331.89534
|
||||
3400 10.221132 -55.128925 0 -53.988742 330.24082
|
||||
3600 10.085802 -55.129861 0 -54.004774 330.63601
|
||||
3800 10.098545 -55.099093 0 -53.972585 339.61905
|
||||
4000 10.000257 -55.117782 0 -54.002238 333.24569
|
||||
4200 10.20477 -55.135792 0 -53.997435 329.17565
|
||||
4400 10.545132 -55.096369 0 -53.920044 341.04725
|
||||
4600 10.376108 -55.127213 0 -53.969743 331.92825
|
||||
4800 10.247392 -55.163395 0 -54.020283 322.15219
|
||||
5000 9.7753102 -55.073756 0 -53.983305 343.64146
|
||||
Loop time of 1.19785 on 4 procs for 5000 steps with 864 atoms
|
||||
|
||||
Performance: 36064.674 ns/day, 0.001 hours/ns, 4174.152 timesteps/s
|
||||
88.6% CPU use with 4 MPI tasks x 1 OpenMP threads
|
||||
|
||||
MPI task timing breakdown:
|
||||
Section | min time | avg time | max time |%varavg| %total
|
||||
---------------------------------------------------------------
|
||||
Pair | 0.36387 | 0.38652 | 0.44086 | 5.1 | 32.27
|
||||
Bond | 0.00028847 | 0.00030833 | 0.000338 | 0.0 | 0.03
|
||||
Neigh | 0.033934 | 0.034959 | 0.036917 | 0.6 | 2.92
|
||||
Comm | 0.39292 | 0.47821 | 0.52198 | 7.3 | 39.92
|
||||
Output | 0.00050343 | 0.0012343 | 0.0023338 | 1.9 | 0.10
|
||||
Modify | 0.1605 | 0.17963 | 0.19457 | 2.9 | 15.00
|
||||
Other | | 0.117 | | | 9.77
|
||||
|
||||
Nlocal: 216 ave 216 max 216 min
|
||||
Histogram: 4 0 0 0 0 0 0 0 0 0
|
||||
Nghost: 888.75 ave 899 max 876 min
|
||||
Histogram: 1 0 1 0 0 0 0 0 0 2
|
||||
Neighs: 4536 ave 4737 max 4335 min
|
||||
Histogram: 2 0 0 0 0 0 0 0 0 2
|
||||
|
||||
Total # of neighbors = 18144
|
||||
Ave neighs/atom = 21
|
||||
Ave special neighs/atom = 0
|
||||
Neighbor list builds = 178
|
||||
Dangerous builds = 11
|
||||
|
||||
|
||||
Total wall time: 0:00:01
|
|
@ -52,25 +52,29 @@ LEPTON_SRCS = \
|
|||
lepton/src/ParsedExpression.cpp lepton/src/ExpressionProgram.cpp \
|
||||
lepton/src/Operation.cpp lepton/src/Parser.cpp
|
||||
|
||||
LEPTON_OBJS = \
|
||||
lepton/src/CompiledExpression.o lepton/src/ExpressionTreeNode.o \
|
||||
lepton/src/ParsedExpression.o lepton/src/ExpressionProgram.o \
|
||||
lepton/src/Operation.o lepton/src/Parser.o
|
||||
|
||||
COLVARS_OBJS = $(COLVARS_SRCS:.cpp=.o) $(LEPTON_OBJS)
|
||||
# Allow to selectively turn off Lepton
|
||||
ifeq ($(ENABLE_LEPTON),no)
|
||||
LEPTON_INCFLAGS =
|
||||
COLVARS_OBJS = $(COLVARS_SRCS:.cpp=.o)
|
||||
else
|
||||
LEPTON_INCFLAGS = -Ilepton/include -DLEPTON
|
||||
COLVARS_OBJS = $(COLVARS_SRCS:.cpp=.o) $(LEPTON_SRCS:.cpp=.o)
|
||||
endif
|
||||
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) $(CXXFLAGS) $(COLVARS_INCFLAGS) -Ilepton/include -DLEPTON -c -o $@ $<
|
||||
$(CXX) $(CXXFLAGS) $(COLVARS_INCFLAGS) $(LEPTON_INCFLAGS) -c -o $@ $<
|
||||
|
||||
$(COLVARS_LIB): Makefile.deps $(COLVARS_OBJS)
|
||||
$(AR) $(ARFLAGS) $(COLVARS_LIB) $(COLVARS_OBJS) $(LEPTON_OBJS)
|
||||
$(AR) $(ARFLAGS) $(COLVARS_LIB) $(COLVARS_OBJS)
|
||||
|
||||
|
||||
Makefile.deps: $(COLVARS_SRCS)
|
||||
@echo > $@
|
||||
@for src in $^ ; do \
|
||||
obj=`basename $$src .cpp`.o ; \
|
||||
$(CXX) -MM $(COLVARS_INCFLAGS) -Ilepton/include -DLEPTON \
|
||||
$(CXX) -MM $(COLVARS_INCFLAGS) $(LEPTON_INCFLAGS) \
|
||||
-MT '$$(COLVARS_OBJ_DIR)'$$obj $$src >> $@ ; \
|
||||
done
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ COLVARS_LIB = libcolvars.a
|
|||
COLVARS_OBJ_DIR =
|
||||
|
||||
CXX = g++
|
||||
CXXFLAGS = -O2 -g -Wall -fPIC -funroll-loops
|
||||
CXXFLAGS = -std=c++0x -O2 -g -Wall -fPIC -funroll-loops
|
||||
AR = ar
|
||||
ARFLAGS = -rscv
|
||||
SHELL = /bin/sh
|
||||
|
|
|
@ -50,6 +50,9 @@ settings in Makefile.common should work.
|
|||
Note: some Colvars functions use the Lepton mathematical expression parser,
|
||||
which is here included (no additional steps required). For more details, see:
|
||||
https://simtk.org/projects/lepton
|
||||
Starting from 2019-06-02, Lepton requires C++11. Please see:
|
||||
https://colvars.github.io/README-c++11.html
|
||||
https://lammps.sandia.gov/doc/Build_settings.html#cxx11
|
||||
|
||||
|
||||
## Documentation
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
* Biological Structures at Stanford, funded under the NIH Roadmap for *
|
||||
* Medical Research, grant U54 GM072970. See https://simtk.org. *
|
||||
* *
|
||||
* Portions copyright (c) 2013-2016 Stanford University and the Authors. *
|
||||
* Portions copyright (c) 2013-2019 Stanford University and the Authors. *
|
||||
* Authors: Peter Eastman *
|
||||
* Contributors: *
|
||||
* *
|
||||
|
@ -52,9 +52,9 @@ class ParsedExpression;
|
|||
* A CompiledExpression is a highly optimized representation of an expression for cases when you want to evaluate
|
||||
* it many times as quickly as possible. You should treat it as an opaque object; none of the internal representation
|
||||
* is visible.
|
||||
*
|
||||
*
|
||||
* A CompiledExpression is created by calling createCompiledExpression() on a ParsedExpression.
|
||||
*
|
||||
*
|
||||
* WARNING: CompiledExpression is NOT thread safe. You should never access a CompiledExpression from two threads at
|
||||
* the same time.
|
||||
*/
|
||||
|
@ -99,10 +99,11 @@ private:
|
|||
mutable std::vector<double> workspace;
|
||||
mutable std::vector<double> argValues;
|
||||
std::map<std::string, double> dummyVariables;
|
||||
void* jitCode;
|
||||
double (*jitCode)();
|
||||
#ifdef LEPTON_USE_JIT
|
||||
void generateJitCode();
|
||||
void generateSingleArgCall(asmjit::X86Compiler& c, asmjit::X86XmmVar& dest, asmjit::X86XmmVar& arg, double (*function)(double));
|
||||
void generateSingleArgCall(asmjit::X86Compiler& c, asmjit::X86Xmm& dest, asmjit::X86Xmm& arg, double (*function)(double));
|
||||
void generateTwoArgCall(asmjit::X86Compiler& c, asmjit::X86Xmm& dest, asmjit::X86Xmm& arg1, asmjit::X86Xmm& arg2, double (*function)(double, double));
|
||||
std::vector<double> constants;
|
||||
asmjit::JitRuntime runtime;
|
||||
#endif
|
||||
|
|
|
@ -72,6 +72,38 @@ public:
|
|||
virtual CustomFunction* clone() const = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* This class is an implementation of CustomFunction that does no computation. It just returns
|
||||
* 0 for the value and derivatives. This is useful when using the parser to analyze expressions
|
||||
* rather than to evaluate them. You can just create PlaceholderFunctions to represent any custom
|
||||
* functions that may appear in expressions.
|
||||
*/
|
||||
|
||||
class LEPTON_EXPORT PlaceholderFunction : public CustomFunction {
|
||||
public:
|
||||
/**
|
||||
* Create a Placeholder function.
|
||||
*
|
||||
* @param numArgs the number of arguments the function expects
|
||||
*/
|
||||
PlaceholderFunction(int numArgs) : numArgs(numArgs) {
|
||||
}
|
||||
int getNumArguments() const {
|
||||
return numArgs;
|
||||
}
|
||||
double evaluate(const double* arguments) const {
|
||||
return 0.0;
|
||||
}
|
||||
double evaluateDerivative(const double* arguments, const int* derivOrder) const {
|
||||
return 0.0;
|
||||
}
|
||||
CustomFunction* clone() const {
|
||||
return new PlaceholderFunction(numArgs);
|
||||
};
|
||||
private:
|
||||
int numArgs;
|
||||
};
|
||||
|
||||
} // namespace Lepton
|
||||
|
||||
#endif /*LEPTON_CUSTOM_FUNCTION_H_*/
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
* Biological Structures at Stanford, funded under the NIH Roadmap for *
|
||||
* Medical Research, grant U54 GM072970. See https://simtk.org. *
|
||||
* *
|
||||
* Portions copyright (c) 2009 Stanford University and the Authors. *
|
||||
* Portions copyright (c) 2009-2018 Stanford University and the Authors. *
|
||||
* Authors: Peter Eastman *
|
||||
* Contributors: *
|
||||
* *
|
||||
|
@ -65,6 +65,14 @@ public:
|
|||
* Get an Operation in this program.
|
||||
*/
|
||||
const Operation& getOperation(int index) const;
|
||||
/**
|
||||
* Change an Operation in this program.
|
||||
*
|
||||
* The Operation must have been allocated on the heap with the "new" operator.
|
||||
* The ExpressionProgram assumes ownership of it and will delete it when it
|
||||
* is no longer needed.
|
||||
*/
|
||||
void setOperation(int index, Operation* operation);
|
||||
/**
|
||||
* Get the size of the stack needed to execute this program. This is the largest number of elements present
|
||||
* on the stack at any point during evaluation.
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
* Biological Structures at Stanford, funded under the NIH Roadmap for *
|
||||
* Medical Research, grant U54 GM072970. See https://simtk.org. *
|
||||
* *
|
||||
* Portions copyright (c) 2009-2015 Stanford University and the Authors. *
|
||||
* Portions copyright (c) 2009-2019 Stanford University and the Authors. *
|
||||
* Authors: Peter Eastman *
|
||||
* Contributors: *
|
||||
* *
|
||||
|
@ -63,7 +63,7 @@ public:
|
|||
* can be used when processing or analyzing parsed expressions.
|
||||
*/
|
||||
enum Id {CONSTANT, VARIABLE, CUSTOM, ADD, SUBTRACT, MULTIPLY, DIVIDE, POWER, NEGATE, SQRT, EXP, LOG,
|
||||
SIN, COS, SEC, CSC, TAN, COT, ASIN, ACOS, ATAN, SINH, COSH, TANH, ERF, ERFC, STEP, DELTA, SQUARE, CUBE, RECIPROCAL,
|
||||
SIN, COS, SEC, CSC, TAN, COT, ASIN, ACOS, ATAN, ATAN2, SINH, COSH, TANH, ERF, ERFC, STEP, DELTA, SQUARE, CUBE, RECIPROCAL,
|
||||
ADD_CONSTANT, MULTIPLY_CONSTANT, POWER_CONSTANT, MIN, MAX, ABS, FLOOR, CEIL, SELECT};
|
||||
/**
|
||||
* Get the name of this Operation.
|
||||
|
@ -137,6 +137,7 @@ public:
|
|||
class Asin;
|
||||
class Acos;
|
||||
class Atan;
|
||||
class Atan2;
|
||||
class Sinh;
|
||||
class Cosh;
|
||||
class Tanh;
|
||||
|
@ -226,6 +227,11 @@ class LEPTON_EXPORT Operation::Custom : public Operation {
|
|||
public:
|
||||
Custom(const std::string& name, CustomFunction* function) : name(name), function(function), isDerivative(false), derivOrder(function->getNumArguments(), 0) {
|
||||
}
|
||||
Custom(const std::string& name, CustomFunction* function, const std::vector<int>& derivOrder) : name(name), function(function), isDerivative(false), derivOrder(derivOrder) {
|
||||
for (int order : derivOrder)
|
||||
if (order != 0)
|
||||
isDerivative = true;
|
||||
}
|
||||
Custom(const Custom& base, int derivIndex) : name(base.name), function(base.function->clone()), isDerivative(true), derivOrder(base.derivOrder) {
|
||||
derivOrder[derivIndex]++;
|
||||
}
|
||||
|
@ -684,6 +690,28 @@ public:
|
|||
ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
|
||||
};
|
||||
|
||||
class LEPTON_EXPORT Operation::Atan2 : public Operation {
|
||||
public:
|
||||
Atan2() {
|
||||
}
|
||||
std::string getName() const {
|
||||
return "atan2";
|
||||
}
|
||||
Id getId() const {
|
||||
return ATAN2;
|
||||
}
|
||||
int getNumArguments() const {
|
||||
return 2;
|
||||
}
|
||||
Operation* clone() const {
|
||||
return new Atan2();
|
||||
}
|
||||
double evaluate(double* args, const std::map<std::string, double>& variables) const {
|
||||
return std::atan2(args[0], args[1]);
|
||||
}
|
||||
ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
|
||||
};
|
||||
|
||||
class LEPTON_EXPORT Operation::Sinh : public Operation {
|
||||
public:
|
||||
Sinh() {
|
||||
|
@ -989,7 +1017,7 @@ public:
|
|||
double evaluate(double* args, const std::map<std::string, double>& variables) const {
|
||||
if (isIntPower) {
|
||||
// Integer powers can be computed much more quickly by repeated multiplication.
|
||||
|
||||
|
||||
int exponent = intValue;
|
||||
double base = args[0];
|
||||
if (exponent < 0) {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* Biological Structures at Stanford, funded under the NIH Roadmap for *
|
||||
* Medical Research, grant U54 GM072970. See https://simtk.org. *
|
||||
* *
|
||||
* Portions copyright (c) 2013-2016 Stanford University and the Authors. *
|
||||
* Portions copyright (c) 2013-2019 Stanford University and the Authors. *
|
||||
* Authors: Peter Eastman *
|
||||
* Contributors: *
|
||||
* *
|
||||
|
@ -84,17 +84,17 @@ CompiledExpression& CompiledExpression::operator=(const CompiledExpression& expr
|
|||
void CompiledExpression::compileExpression(const ExpressionTreeNode& node, vector<pair<ExpressionTreeNode, int> >& temps) {
|
||||
if (findTempIndex(node, temps) != -1)
|
||||
return; // We have already processed a node identical to this one.
|
||||
|
||||
|
||||
// Process the child nodes.
|
||||
|
||||
|
||||
vector<int> args;
|
||||
for (int i = 0; i < node.getChildren().size(); i++) {
|
||||
compileExpression(node.getChildren()[i], temps);
|
||||
args.push_back(findTempIndex(node.getChildren()[i], temps));
|
||||
}
|
||||
|
||||
|
||||
// Process this node.
|
||||
|
||||
|
||||
if (node.getOperation().getId() == Operation::VARIABLE) {
|
||||
variableIndices[node.getOperation().getName()] = (int) workspace.size();
|
||||
variableNames.insert(node.getOperation().getName());
|
||||
|
@ -108,7 +108,7 @@ void CompiledExpression::compileExpression(const ExpressionTreeNode& node, vecto
|
|||
arguments[stepIndex].push_back(0); // The value won't actually be used. We just need something there.
|
||||
else {
|
||||
// If the arguments are sequential, we can just pass a pointer to the first one.
|
||||
|
||||
|
||||
bool sequential = true;
|
||||
for (int i = 1; i < args.size(); i++)
|
||||
if (args[i] != args[i-1]+1)
|
||||
|
@ -148,12 +148,12 @@ void CompiledExpression::setVariableLocations(map<string, double*>& variableLoca
|
|||
variablePointers = variableLocations;
|
||||
#ifdef LEPTON_USE_JIT
|
||||
// Rebuild the JIT code.
|
||||
|
||||
|
||||
if (workspace.size() > 0)
|
||||
generateJitCode();
|
||||
#else
|
||||
// Make a list of all variables we will need to copy before evaluating the expression.
|
||||
|
||||
|
||||
variablesToCopy.clear();
|
||||
for (map<string, int>::const_iterator iter = variableIndices.begin(); iter != variableIndices.end(); ++iter) {
|
||||
map<string, double*>::iterator pointer = variablePointers.find(iter->first);
|
||||
|
@ -165,13 +165,13 @@ void CompiledExpression::setVariableLocations(map<string, double*>& variableLoca
|
|||
|
||||
double CompiledExpression::evaluate() const {
|
||||
#ifdef LEPTON_USE_JIT
|
||||
return ((double (*)()) jitCode)();
|
||||
return jitCode();
|
||||
#else
|
||||
for (int i = 0; i < variablesToCopy.size(); i++)
|
||||
*variablesToCopy[i].first = *variablesToCopy[i].second;
|
||||
|
||||
// Loop over the operations and evaluate each one.
|
||||
|
||||
|
||||
for (int step = 0; step < operation.size(); step++) {
|
||||
const vector<int>& args = arguments[step];
|
||||
if (args.size() == 1)
|
||||
|
@ -188,34 +188,36 @@ double CompiledExpression::evaluate() const {
|
|||
|
||||
#ifdef LEPTON_USE_JIT
|
||||
static double evaluateOperation(Operation* op, double* args) {
|
||||
map<string, double>* dummyVariables = NULL;
|
||||
return op->evaluate(args, *dummyVariables);
|
||||
static map<string, double> dummyVariables;
|
||||
return op->evaluate(args, dummyVariables);
|
||||
}
|
||||
|
||||
void CompiledExpression::generateJitCode() {
|
||||
X86Compiler c(&runtime);
|
||||
c.addFunc(kFuncConvHost, FuncBuilder0<double>());
|
||||
vector<X86XmmVar> workspaceVar(workspace.size());
|
||||
CodeHolder code;
|
||||
code.init(runtime.getCodeInfo());
|
||||
X86Compiler c(&code);
|
||||
c.addFunc(FuncSignature0<double>());
|
||||
vector<X86Xmm> workspaceVar(workspace.size());
|
||||
for (int i = 0; i < (int) workspaceVar.size(); i++)
|
||||
workspaceVar[i] = c.newXmmVar(kX86VarTypeXmmSd);
|
||||
X86GpVar argsPointer(c);
|
||||
workspaceVar[i] = c.newXmmSd();
|
||||
X86Gp argsPointer = c.newIntPtr();
|
||||
c.mov(argsPointer, imm_ptr(&argValues[0]));
|
||||
|
||||
|
||||
// Load the arguments into variables.
|
||||
|
||||
|
||||
for (set<string>::const_iterator iter = variableNames.begin(); iter != variableNames.end(); ++iter) {
|
||||
map<string, int>::iterator index = variableIndices.find(*iter);
|
||||
X86GpVar variablePointer(c);
|
||||
X86Gp variablePointer = c.newIntPtr();
|
||||
c.mov(variablePointer, imm_ptr(&getVariableReference(index->first)));
|
||||
c.movsd(workspaceVar[index->second], x86::ptr(variablePointer, 0, 0));
|
||||
}
|
||||
|
||||
// Make a list of all constants that will be needed for evaluation.
|
||||
|
||||
|
||||
vector<int> operationConstantIndex(operation.size(), -1);
|
||||
for (int step = 0; step < (int) operation.size(); step++) {
|
||||
// Find the constant value (if any) used by this operation.
|
||||
|
||||
|
||||
Operation& op = *operation[step];
|
||||
double value;
|
||||
if (op.getId() == Operation::CONSTANT)
|
||||
|
@ -232,9 +234,9 @@ void CompiledExpression::generateJitCode() {
|
|||
value = 1.0;
|
||||
else
|
||||
continue;
|
||||
|
||||
|
||||
// See if we already have a variable for this constant.
|
||||
|
||||
|
||||
for (int i = 0; i < (int) constants.size(); i++)
|
||||
if (value == constants[i]) {
|
||||
operationConstantIndex[step] = i;
|
||||
|
@ -245,33 +247,33 @@ void CompiledExpression::generateJitCode() {
|
|||
constants.push_back(value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Load constants into variables.
|
||||
|
||||
vector<X86XmmVar> constantVar(constants.size());
|
||||
|
||||
vector<X86Xmm> constantVar(constants.size());
|
||||
if (constants.size() > 0) {
|
||||
X86GpVar constantsPointer(c);
|
||||
X86Gp constantsPointer = c.newIntPtr();
|
||||
c.mov(constantsPointer, imm_ptr(&constants[0]));
|
||||
for (int i = 0; i < (int) constants.size(); i++) {
|
||||
constantVar[i] = c.newXmmVar(kX86VarTypeXmmSd);
|
||||
constantVar[i] = c.newXmmSd();
|
||||
c.movsd(constantVar[i], x86::ptr(constantsPointer, 8*i, 0));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Evaluate the operations.
|
||||
|
||||
|
||||
for (int step = 0; step < (int) operation.size(); step++) {
|
||||
Operation& op = *operation[step];
|
||||
vector<int> args = arguments[step];
|
||||
if (args.size() == 1) {
|
||||
// One or more sequential arguments. Fill out the list.
|
||||
|
||||
|
||||
for (int i = 1; i < op.getNumArguments(); i++)
|
||||
args.push_back(args[0]+i);
|
||||
}
|
||||
|
||||
|
||||
// Generate instructions to execute this operation.
|
||||
|
||||
|
||||
switch (op.getId()) {
|
||||
case Operation::CONSTANT:
|
||||
c.movsd(workspaceVar[target[step]], constantVar[operationConstantIndex[step]]);
|
||||
|
@ -292,6 +294,9 @@ void CompiledExpression::generateJitCode() {
|
|||
c.movsd(workspaceVar[target[step]], workspaceVar[args[0]]);
|
||||
c.divsd(workspaceVar[target[step]], workspaceVar[args[1]]);
|
||||
break;
|
||||
case Operation::POWER:
|
||||
generateTwoArgCall(c, workspaceVar[target[step]], workspaceVar[args[0]], workspaceVar[args[1]], pow);
|
||||
break;
|
||||
case Operation::NEGATE:
|
||||
c.xorps(workspaceVar[target[step]], workspaceVar[target[step]]);
|
||||
c.subsd(workspaceVar[target[step]], workspaceVar[args[0]]);
|
||||
|
@ -323,6 +328,9 @@ void CompiledExpression::generateJitCode() {
|
|||
case Operation::ATAN:
|
||||
generateSingleArgCall(c, workspaceVar[target[step]], workspaceVar[args[0]], atan);
|
||||
break;
|
||||
case Operation::ATAN2:
|
||||
generateTwoArgCall(c, workspaceVar[target[step]], workspaceVar[args[0]], workspaceVar[args[1]], atan2);
|
||||
break;
|
||||
case Operation::SINH:
|
||||
generateSingleArgCall(c, workspaceVar[target[step]], workspaceVar[args[0]], sinh);
|
||||
break;
|
||||
|
@ -374,12 +382,12 @@ void CompiledExpression::generateJitCode() {
|
|||
break;
|
||||
default:
|
||||
// Just invoke evaluateOperation().
|
||||
|
||||
|
||||
for (int i = 0; i < (int) args.size(); i++)
|
||||
c.movsd(x86::ptr(argsPointer, 8*i, 0), workspaceVar[args[i]]);
|
||||
X86GpVar fn(c, kVarTypeIntPtr);
|
||||
X86Gp fn = c.newIntPtr();
|
||||
c.mov(fn, imm_ptr((void*) evaluateOperation));
|
||||
X86CallNode* call = c.call(fn, kFuncConvHost, FuncBuilder2<double, Operation*, double*>());
|
||||
CCFuncCall* call = c.call(fn, FuncSignature2<double, Operation*, double*>());
|
||||
call->setArg(0, imm_ptr(&op));
|
||||
call->setArg(1, imm_ptr(&argValues[0]));
|
||||
call->setRet(0, workspaceVar[target[step]]);
|
||||
|
@ -387,14 +395,24 @@ void CompiledExpression::generateJitCode() {
|
|||
}
|
||||
c.ret(workspaceVar[workspace.size()-1]);
|
||||
c.endFunc();
|
||||
jitCode = c.make();
|
||||
c.finalize();
|
||||
runtime.add(&jitCode, &code);
|
||||
}
|
||||
|
||||
void CompiledExpression::generateSingleArgCall(X86Compiler& c, X86XmmVar& dest, X86XmmVar& arg, double (*function)(double)) {
|
||||
X86GpVar fn(c, kVarTypeIntPtr);
|
||||
void CompiledExpression::generateSingleArgCall(X86Compiler& c, X86Xmm& dest, X86Xmm& arg, double (*function)(double)) {
|
||||
X86Gp fn = c.newIntPtr();
|
||||
c.mov(fn, imm_ptr((void*) function));
|
||||
X86CallNode* call = c.call(fn, kFuncConvHost, FuncBuilder1<double, double>());
|
||||
CCFuncCall* call = c.call(fn, FuncSignature1<double, double>());
|
||||
call->setArg(0, arg);
|
||||
call->setRet(0, dest);
|
||||
}
|
||||
|
||||
void CompiledExpression::generateTwoArgCall(X86Compiler& c, X86Xmm& dest, X86Xmm& arg1, X86Xmm& arg2, double (*function)(double, double)) {
|
||||
X86Gp fn = c.newIntPtr();
|
||||
c.mov(fn, imm_ptr((void*) function));
|
||||
CCFuncCall* call = c.call(fn, FuncSignature2<double, double, double>());
|
||||
call->setArg(0, arg1);
|
||||
call->setArg(1, arg2);
|
||||
call->setRet(0, dest);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* Biological Structures at Stanford, funded under the NIH Roadmap for *
|
||||
* Medical Research, grant U54 GM072970. See https://simtk.org. *
|
||||
* *
|
||||
* Portions copyright (c) 2009-2013 Stanford University and the Authors. *
|
||||
* Portions copyright (c) 2009-2018 Stanford University and the Authors. *
|
||||
* Authors: Peter Eastman *
|
||||
* Contributors: *
|
||||
* *
|
||||
|
@ -84,6 +84,11 @@ const Operation& ExpressionProgram::getOperation(int index) const {
|
|||
return *operations[index];
|
||||
}
|
||||
|
||||
void ExpressionProgram::setOperation(int index, Operation* operation) {
|
||||
delete operations[index];
|
||||
operations[index] = operation;
|
||||
}
|
||||
|
||||
int ExpressionProgram::getStackSize() const {
|
||||
return stackSize;
|
||||
}
|
||||
|
|
|
@ -3,15 +3,15 @@
|
|||
|
||||
/*
|
||||
* Up to version 11 (VC++ 2012), Microsoft does not support the
|
||||
* standard C99 erf() and erfc() functions so we have to fake them here.
|
||||
* standard C99 erf() and erfc() functions so we have to fake them here.
|
||||
* These were added in version 12 (VC++ 2013), which sets _MSC_VER=1800
|
||||
* (VC11 has _MSC_VER=1700).
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(_MSC_VER)
|
||||
#define M_PI 3.14159265358979323846264338327950288
|
||||
|
||||
#if _MSC_VER <= 1700 // 1700 is VC11, 1800 is VC12
|
||||
#if _MSC_VER <= 1700 // 1700 is VC11, 1800 is VC12
|
||||
/***************************
|
||||
* erf.cpp
|
||||
* author: Steve Strand
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* Biological Structures at Stanford, funded under the NIH Roadmap for *
|
||||
* Medical Research, grant U54 GM072970. See https://simtk.org. *
|
||||
* *
|
||||
* Portions copyright (c) 2009-2015 Stanford University and the Authors. *
|
||||
* Portions copyright (c) 2009-2019 Stanford University and the Authors. *
|
||||
* Authors: Peter Eastman *
|
||||
* Contributors: *
|
||||
* *
|
||||
|
@ -202,6 +202,16 @@ ExpressionTreeNode Operation::Atan::differentiate(const std::vector<ExpressionTr
|
|||
childDerivs[0]);
|
||||
}
|
||||
|
||||
ExpressionTreeNode Operation::Atan2::differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const {
|
||||
return ExpressionTreeNode(new Operation::Divide(),
|
||||
ExpressionTreeNode(new Operation::Subtract(),
|
||||
ExpressionTreeNode(new Operation::Multiply(), children[1], childDerivs[0]),
|
||||
ExpressionTreeNode(new Operation::Multiply(), children[0], childDerivs[1])),
|
||||
ExpressionTreeNode(new Operation::Add(),
|
||||
ExpressionTreeNode(new Operation::Square(), children[0]),
|
||||
ExpressionTreeNode(new Operation::Square(), children[1])));
|
||||
}
|
||||
|
||||
ExpressionTreeNode Operation::Sinh::differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const {
|
||||
return ExpressionTreeNode(new Operation::Multiply(),
|
||||
ExpressionTreeNode(new Operation::Cosh(),
|
||||
|
|
|
@ -271,6 +271,16 @@ ExpressionTreeNode ParsedExpression::substituteSimplerExpression(const Expressio
|
|||
return ExpressionTreeNode(new Operation::MultiplyConstant(-dynamic_cast<const Operation::MultiplyConstant*>(&node.getOperation())->getValue()), children[0].getChildren()[0]);
|
||||
break;
|
||||
}
|
||||
case Operation::SQRT:
|
||||
{
|
||||
if (children[0].getOperation().getId() == Operation::SQUARE) // sqrt(square(x)) = abs(x)
|
||||
return ExpressionTreeNode(new Operation::Abs(), children[0].getChildren()[0]);
|
||||
}
|
||||
case Operation::SQUARE:
|
||||
{
|
||||
if (children[0].getOperation().getId() == Operation::SQRT) // square(sqrt(x)) = x
|
||||
return children[0].getChildren()[0];
|
||||
}
|
||||
default:
|
||||
{
|
||||
// If operation ID is not one of the above,
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* Biological Structures at Stanford, funded under the NIH Roadmap for *
|
||||
* Medical Research, grant U54 GM072970. See https://simtk.org. *
|
||||
* *
|
||||
* Portions copyright (c) 2009-2015 Stanford University and the Authors. *
|
||||
* Portions copyright (c) 2009-2019 Stanford University and the Authors. *
|
||||
* Authors: Peter Eastman *
|
||||
* Contributors: *
|
||||
* *
|
||||
|
@ -66,7 +66,7 @@ private:
|
|||
|
||||
string Parser::trim(const string& expression) {
|
||||
// Remove leading and trailing spaces.
|
||||
|
||||
|
||||
int start, end;
|
||||
for (start = 0; start < (int) expression.size() && isspace(expression[start]); start++)
|
||||
;
|
||||
|
@ -313,6 +313,7 @@ Operation* Parser::getFunctionOperation(const std::string& name, const map<strin
|
|||
opMap["asin"] = Operation::ASIN;
|
||||
opMap["acos"] = Operation::ACOS;
|
||||
opMap["atan"] = Operation::ATAN;
|
||||
opMap["atan2"] = Operation::ATAN2;
|
||||
opMap["sinh"] = Operation::SINH;
|
||||
opMap["cosh"] = Operation::COSH;
|
||||
opMap["tanh"] = Operation::TANH;
|
||||
|
@ -368,6 +369,8 @@ Operation* Parser::getFunctionOperation(const std::string& name, const map<strin
|
|||
return new Operation::Acos();
|
||||
case Operation::ATAN:
|
||||
return new Operation::Atan();
|
||||
case Operation::ATAN2:
|
||||
return new Operation::Atan2();
|
||||
case Operation::SINH:
|
||||
return new Operation::Sinh();
|
||||
case Operation::COSH:
|
||||
|
|
|
@ -740,19 +740,14 @@ void PairKIM::kim_init()
|
|||
kimerror = KIM_ComputeArguments_SetArgumentPointerInteger(pargs,
|
||||
KIM_COMPUTE_ARGUMENT_NAME_numberOfParticles,
|
||||
&lmps_local_tot_num_atoms);
|
||||
if (KIM_SupportStatus_NotEqual(kim_model_support_for_energy,
|
||||
KIM_SUPPORT_STATUS_notSupported))
|
||||
kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble(pargs,
|
||||
KIM_COMPUTE_ARGUMENT_NAME_partialEnergy,
|
||||
&(eng_vdwl));
|
||||
if (kimerror) error->all(FLERR,"Unable to set KIM argument pointer");
|
||||
|
||||
kimerror = KIM_ComputeArguments_SetCallbackPointer(pargs,
|
||||
KIM_COMPUTE_CALLBACK_NAME_GetNeighborList,
|
||||
KIM_LANGUAGE_NAME_cpp,
|
||||
reinterpret_cast<KIM_Function *>(get_neigh),
|
||||
reinterpret_cast<void *>(this));
|
||||
|
||||
if (kimerror) error->all(FLERR,"Unable to register KIM pointers");
|
||||
if (kimerror) error->all(FLERR,"Unable to set KIM call back pointer");
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
@ -763,6 +758,26 @@ void PairKIM::set_argument_pointers()
|
|||
kimerror = KIM_ComputeArguments_SetArgumentPointerDouble(
|
||||
pargs, KIM_COMPUTE_ARGUMENT_NAME_coordinates, &(atom->x[0][0]));
|
||||
|
||||
// Set KIM pointer appropriately for Energy
|
||||
if (KIM_SupportStatus_NotEqual(kim_model_support_for_energy,
|
||||
KIM_SUPPORT_STATUS_notSupported))
|
||||
{
|
||||
if (KIM_SupportStatus_Equal(kim_model_support_for_energy,
|
||||
KIM_SUPPORT_STATUS_required)
|
||||
|| (eflag_global == 1))
|
||||
{
|
||||
kimerror = kimerror ||
|
||||
KIM_ComputeArguments_SetArgumentPointerDouble(
|
||||
pargs,KIM_COMPUTE_ARGUMENT_NAME_partialEnergy,&(eng_vdwl));
|
||||
}
|
||||
else
|
||||
{
|
||||
kimerror = kimerror ||
|
||||
KIM_ComputeArguments_SetArgumentPointerDouble(
|
||||
pargs,KIM_COMPUTE_ARGUMENT_NAME_partialEnergy,
|
||||
reinterpret_cast<double * const>(NULL));
|
||||
}
|
||||
}
|
||||
// Set KIM pointer appropriately for particalEnergy
|
||||
if (KIM_SupportStatus_Equal(kim_model_support_for_particleEnergy,
|
||||
KIM_SUPPORT_STATUS_required)
|
||||
|
|
|
@ -205,7 +205,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
|
|||
}
|
||||
|
||||
// reallocate flangevin if necessary
|
||||
if (tallyflag) {
|
||||
if (tallyflag || osflag) {
|
||||
if (nlocal > maxatom1) {
|
||||
memoryKK->destroy_kokkos(k_flangevin,flangevin);
|
||||
maxatom1 = atomKK->nmax;
|
||||
|
@ -229,7 +229,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
|
|||
FSUM s_fsum;
|
||||
if (tstyle == ATOM)
|
||||
if (gjfflag)
|
||||
if (tallyflag)
|
||||
if (tallyflag || osflag)
|
||||
if (tbiasflag == BIAS)
|
||||
if (rmass.data())
|
||||
if (zeroflag) {
|
||||
|
@ -300,7 +300,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
|
|||
Kokkos::parallel_for(nlocal,post_functor);
|
||||
}
|
||||
else
|
||||
if (tallyflag)
|
||||
if (tallyflag || osflag)
|
||||
if (tbiasflag == BIAS)
|
||||
if (rmass.data())
|
||||
if (zeroflag) {
|
||||
|
@ -372,7 +372,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
|
|||
}
|
||||
else
|
||||
if (gjfflag)
|
||||
if (tallyflag)
|
||||
if (tallyflag || osflag)
|
||||
if (tbiasflag == BIAS)
|
||||
if (rmass.data())
|
||||
if (zeroflag) {
|
||||
|
@ -443,7 +443,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
|
|||
Kokkos::parallel_for(nlocal,post_functor);
|
||||
}
|
||||
else
|
||||
if (tallyflag)
|
||||
if (tallyflag || osflag)
|
||||
if (tbiasflag == BIAS)
|
||||
if (rmass.data())
|
||||
if (zeroflag) {
|
||||
|
@ -525,7 +525,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
|
|||
// set modify flags for the views modified in post_force functor
|
||||
if (gjfflag) k_franprev.template modify<DeviceType>();
|
||||
if (gjfflag) k_lv.template modify<DeviceType>();
|
||||
if (tallyflag) k_flangevin.template modify<DeviceType>();
|
||||
if (tallyflag || osflag) k_flangevin.template modify<DeviceType>();
|
||||
|
||||
// set total force to zero
|
||||
if (zeroflag) {
|
||||
|
|
|
@ -112,19 +112,15 @@ void ComputeGyrationShape::compute_vector()
|
|||
}
|
||||
|
||||
// compute the shape parameters of the gyration tensor
|
||||
double sq_eigen_x = MathSpecial::square(evalues[0]);
|
||||
double sq_eigen_y = MathSpecial::square(evalues[1]);
|
||||
double sq_eigen_z = MathSpecial::square(evalues[2]);
|
||||
|
||||
double nominator = MathSpecial::square(sq_eigen_x)
|
||||
+ MathSpecial::square(sq_eigen_y)
|
||||
+ MathSpecial::square(sq_eigen_z);
|
||||
double denominator = MathSpecial::square(sq_eigen_x+sq_eigen_y+sq_eigen_z);
|
||||
double nominator = MathSpecial::square(evalues[0])
|
||||
+ MathSpecial::square(evalues[1])
|
||||
+ MathSpecial::square(evalues[2]);
|
||||
double denominator = MathSpecial::square(evalues[0]+evalues[1]+evalues[2]);
|
||||
|
||||
vector[0] = evalues[0];
|
||||
vector[1] = evalues[1];
|
||||
vector[2] = evalues[2];
|
||||
vector[3] = sq_eigen_z - 0.5*(sq_eigen_x + sq_eigen_y);
|
||||
vector[4] = sq_eigen_y - sq_eigen_x;
|
||||
vector[5] = 0.5*(3*nominator/denominator - 1.0);
|
||||
vector[3] = evalues[0] - 0.5*(evalues[1] + evalues[2]);
|
||||
vector[4] = evalues[1] - evalues[2];
|
||||
vector[5] = 1.5*nominator/denominator - 0.5;
|
||||
}
|
||||
|
|
|
@ -111,14 +111,17 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) :
|
|||
iarg += 2;
|
||||
} else if (strcmp(arg[iarg],"gjf") == 0) {
|
||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix langevin command");
|
||||
if (strcmp(arg[iarg+1],"no") == 0) {gjfflag = 0; osflag = 0;}
|
||||
if (strcmp(arg[iarg+1],"no") == 0) {
|
||||
gjfflag = 0;
|
||||
osflag = 0;
|
||||
}
|
||||
else if (strcmp(arg[iarg+1],"vfull") == 0) {
|
||||
gjfflag = 1;
|
||||
osflag = 1;
|
||||
gjfflag = 1;
|
||||
osflag = 1;
|
||||
}
|
||||
else if (strcmp(arg[iarg+1],"vhalf") == 0) {
|
||||
gjfflag = 1;
|
||||
osflag = 0;
|
||||
gjfflag = 1;
|
||||
osflag = 0;
|
||||
}
|
||||
else error->all(FLERR,"Illegal fix langevin command");
|
||||
iarg += 2;
|
||||
|
@ -229,7 +232,7 @@ int FixLangevin::setmask()
|
|||
|
||||
void FixLangevin::init()
|
||||
{
|
||||
if (gjfflag){
|
||||
if (gjfflag) {
|
||||
if (t_period*2 == update->dt)
|
||||
error->all(FLERR,"Fix langevin gjf cannot have t_period equal to dt/2");
|
||||
|
||||
|
@ -323,7 +326,7 @@ void FixLangevin::init()
|
|||
|
||||
void FixLangevin::setup(int vflag)
|
||||
{
|
||||
if (gjfflag){
|
||||
if (gjfflag) {
|
||||
double dtfm;
|
||||
double dt = update->dt;
|
||||
double **v = atom->v;
|
||||
|
@ -373,7 +376,7 @@ void FixLangevin::setup(int vflag)
|
|||
post_force_respa(vflag,nlevels_respa-1,0);
|
||||
((Respa *) update->integrate)->copy_f_flevel(nlevels_respa-1);
|
||||
}
|
||||
if (gjfflag){
|
||||
if (gjfflag) {
|
||||
double dtfm;
|
||||
double dt = update->dt;
|
||||
double **f = atom->f;
|
||||
|
@ -420,7 +423,7 @@ void FixLangevin::initial_integrate(int /* vflag */)
|
|||
int nlocal = atom->nlocal;
|
||||
|
||||
for (int i = 0; i < nlocal; i++)
|
||||
if (mask[i] & groupbit){
|
||||
if (mask[i] & groupbit) {
|
||||
f[i][0] /= gjfa;
|
||||
f[i][1] /= gjfa;
|
||||
f[i][2] /= gjfa;
|
||||
|
@ -473,7 +476,7 @@ void FixLangevin::post_force(int /*vflag*/)
|
|||
if (zeroflag) post_force_templated<1,1,0,0,0,1>();
|
||||
else post_force_templated<1,1,0,0,0,0>();
|
||||
else
|
||||
if (tallyflag)
|
||||
if (tallyflag || osflag)
|
||||
if (tbiasflag == BIAS)
|
||||
if (rmass)
|
||||
if (zeroflag) post_force_templated<1,0,1,1,1,1>();
|
||||
|
@ -505,7 +508,7 @@ void FixLangevin::post_force(int /*vflag*/)
|
|||
else post_force_templated<1,0,0,0,0,0>();
|
||||
else
|
||||
if (gjfflag)
|
||||
if (tallyflag)
|
||||
if (tallyflag || osflag)
|
||||
if (tbiasflag == BIAS)
|
||||
if (rmass)
|
||||
if (zeroflag) post_force_templated<0,1,1,1,1,1>();
|
||||
|
@ -536,7 +539,7 @@ void FixLangevin::post_force(int /*vflag*/)
|
|||
if (zeroflag) post_force_templated<0,1,0,0,0,1>();
|
||||
else post_force_templated<0,1,0,0,0,0>();
|
||||
else
|
||||
if (tallyflag)
|
||||
if (tallyflag || osflag)
|
||||
if (tbiasflag == BIAS)
|
||||
if (rmass)
|
||||
if (zeroflag) post_force_templated<0,0,1,1,1,1>();
|
||||
|
@ -660,12 +663,11 @@ void FixLangevin::post_force_templated()
|
|||
gamma2 = gfactor2[type[i]] * tsqrt;
|
||||
}
|
||||
|
||||
if (Tp_GJF){
|
||||
if (Tp_GJF) {
|
||||
fran[0] = gamma2*random->gaussian();
|
||||
fran[1] = gamma2*random->gaussian();
|
||||
fran[2] = gamma2*random->gaussian();
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
fran[0] = gamma2*(random->uniform()-0.5);
|
||||
fran[1] = gamma2*(random->uniform()-0.5);
|
||||
fran[2] = gamma2*(random->uniform()-0.5);
|
||||
|
@ -729,7 +731,7 @@ void FixLangevin::post_force_templated()
|
|||
}
|
||||
|
||||
if (Tp_TALLY) {
|
||||
if (Tp_GJF){
|
||||
if (Tp_GJF) {
|
||||
fdrag[0] = gamma1*lv[i][0]/gjfsib/gjfsib;
|
||||
fdrag[1] = gamma1*lv[i][1]/gjfsib/gjfsib;
|
||||
fdrag[2] = gamma1*lv[i][2]/gjfsib/gjfsib;
|
||||
|
@ -938,8 +940,8 @@ void FixLangevin::end_of_step()
|
|||
|
||||
energy_onestep = 0.0;
|
||||
|
||||
if (tallyflag){
|
||||
if (gjfflag){
|
||||
if (tallyflag) {
|
||||
if (gjfflag) {
|
||||
for (int i = 0; i < nlocal; i++)
|
||||
if (mask[i] & groupbit) {
|
||||
if (tbiasflag)
|
||||
|
@ -957,19 +959,18 @@ void FixLangevin::end_of_step()
|
|||
flangevin[i][2]*v[i][2];
|
||||
}
|
||||
|
||||
if (gjfflag){
|
||||
if (gjfflag) {
|
||||
double tmp[3];
|
||||
for (int i = 0; i < nlocal; i++)
|
||||
if (mask[i] & groupbit){
|
||||
if (mask[i] & groupbit) {
|
||||
tmp[0] = v[i][0];
|
||||
tmp[1] = v[i][1];
|
||||
tmp[2] = v[i][2];
|
||||
if (!osflag){
|
||||
if (!osflag) {
|
||||
v[i][0] = lv[i][0];
|
||||
v[i][1] = lv[i][1];
|
||||
v[i][2] = lv[i][2];
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
if (atom->rmass) {
|
||||
dtfm = force->ftm2v * 0.5 * dt / rmass[i];
|
||||
} else {
|
||||
|
@ -1064,16 +1065,15 @@ double FixLangevin::compute_scalar()
|
|||
|
||||
if (update->ntimestep == update->beginstep) {
|
||||
energy_onestep = 0.0;
|
||||
if (!gjfflag){
|
||||
if (!gjfflag) {
|
||||
for (int i = 0; i < nlocal; i++)
|
||||
if (mask[i] & groupbit)
|
||||
energy_onestep += flangevin[i][0]*v[i][0] + flangevin[i][1]*v[i][1] +
|
||||
flangevin[i][2]*v[i][2];
|
||||
energy = 0.5*energy_onestep*update->dt;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
for (int i = 0; i < nlocal; i++)
|
||||
if (mask[i] & groupbit){
|
||||
if (mask[i] & groupbit) {
|
||||
if (tbiasflag)
|
||||
temperature->remove_bias(i, lv[i]);
|
||||
energy_onestep += flangevin[i][0]*lv[i][0] + flangevin[i][1]*lv[i][1] +
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
# Singularity container definitions for compiling/testing LAMMPS
|
||||
|
||||
The *.def files in this folder can be used to build container images
|
||||
for [Singularity](https://sylabs.io) suitable for compiling and testing
|
||||
LAMMPS on a variety of OS variants with support for most standard packages
|
||||
and building/spellchecking the manual. This allows to test and debug
|
||||
LAMMPS code on different OS variants than what is locally installed on
|
||||
your development workstation, e.g. when bugs are reported that can only
|
||||
be reproduced on a specific OS or with specific (mostly older) versions
|
||||
of tools, compilers, or libraries.
|
||||
|
||||
Here is a workflow for testing a compilation of LAMMPS with a CentOS 7.x container.
|
||||
|
||||
```
|
||||
cd some/work/directory
|
||||
git clone --depth 500 git://github.com/lammps/lammps.git lammps
|
||||
mkdir build-centos7
|
||||
cd build-centos7
|
||||
sudo singularity build centos7.sif ../tools/singularity/centos7.def
|
||||
singularity shell centos7.sif
|
||||
cmake -C ../cmake/presets/most.cmake -D CMAKE_CXX_FLAGS="-O3 -g -fopenmp -std=c++11" ../cmake
|
||||
make
|
||||
```
|
||||
|
||||
| Currently available: | |
|
||||
| --- | --- |
|
||||
| centos7.def | CentOS 7.x with EPEL enabled |
|
||||
| ubuntu18.04.def | Ubuntu 18.04LTS with default MPI == OpenMPI |
|
|
@ -0,0 +1,10 @@
|
|||
BootStrap: library
|
||||
From: centos:7
|
||||
|
||||
%post
|
||||
yum -y install epel-release
|
||||
yum -y update
|
||||
yum -y install vim-enhanced ccache gcc-c++ gcc-gfortran clang gdb valgrind-openmpi make cmake cmake3 patch which file git libpng-devel libjpeg-devel openmpi-devel mpich-devel python-devel python-virtualenv fftw-devel voro++-devel eigen3-devel gsl-devel openblas-devel enchant
|
||||
|
||||
%labels
|
||||
Author akohlmey
|
|
@ -0,0 +1,9 @@
|
|||
BootStrap: docker
|
||||
From: ubuntu:18.04
|
||||
|
||||
%post
|
||||
apt-get update -y
|
||||
env DEBIAN_FRONTEND=noninteractive apt-get install -y make cmake git gcc g++ gfortran libfftw3-dev libjpeg-dev libpng-dev libblas-dev liblapack-dev mpi-default-bin mpi-default-dev libeigen3-dev libgsl-dev libopenblas-dev virtualenv python-dev enchant vim-nox ccache voro++-dev
|
||||
|
||||
%labels
|
||||
Author akohlmey
|
Loading…
Reference in New Issue