merge with third manybody table example and provide updated log files

This commit is contained in:
Axel Kohlmeyer
2022-06-01 15:04:07 -04:00
parent b9b0d7207c
commit 8a055fdcfa
15 changed files with 276 additions and 2399 deletions

View File

@ -1,65 +1,56 @@
Example for pair style threebody/table
Three examples inputs for pair styles threebody/table (in.spce and
in.spce2) and sw/angle/table (in.spce_sw). All inputs are for the
simulation of coarse-grained SPC/E water.
A water molecule is represented by one coarse-grained (CG) bead.
This example contains all required input files for the simulation of CG SPC/E water with
the user pair style threebody/table, as well as a run.sh script.
To run the example, you have to compile LAMMPS with the MANYBODY package, including pair_threebody_table.h and pair_threebody_table.cpp.
Running the simulations, you will reproduce results of the following publication:
C. Scherer, R. Scheid, D. Andrienko, and T. Bereau, Kernel-Based Machine Learning for Efficient Simulations of Molecular Liquids, J. Chem. Theor. Comp., 16(5):31943204, 2020, https://doi.org/10.1021/acs.jctc.9b01256
Here, a water molecule is represented by one coarse-grained (CG) bead. The example contains
two parts.
The three-body (force) tables for both parts (1-1-1.table and 1-1-2.table) have been parametrized with the kernel-based machine learning (ML) with the VOTCA package (https://gitlab.mpcdf.mpg.de/votca/votca).
For a general description of the table format have a look at the documentation of this pair style.
For a example on the parametrization, have a look at https://gitlab.mpcdf.mpg.de/votca/votca/-/tree/master/csg-examples/guide and
For the two threebody/table examples the three-body (force) tables are
in the files 1-1-1.table and 1-1-2.table. These have been parametrized
with the kernel-based machine learning (ML) with the VOTCA package
(https://gitlab.mpcdf.mpg.de/votca/votca). For a example on the
parametrization, have a look at
https://gitlab.mpcdf.mpg.de/votca/votca/-/tree/master/csg-examples/guide
and
https://gitlab.mpcdf.mpg.de/votca/votca/-/tree/master/csg-examples/ml.
In both cases, the parametrization is done according to a sample system, using the three-body forces of a Stillinger-Weber potential with tabulated angular forces (sw/angle/table). These then are learned with the covariant meshing technique with the settings files used in https://gitlab.mpcdf.mpg.de/votca/votca/-/tree/master/csg-examples/ml/3body/with_binning.
For the first part of example, the folder contains the contains the LAMMPS data file (spce.data) with the starting configuration of 1000 CG water molecules, an input file (spce.in) and a threebody file (spce.3b).
In both cases, the parametrization is done according to a sample system,
using the three-body forces of a Stillinger-Weber potential with
tabulated angular forces (sw/angle/table) (see in.spce_sw). These then
are learned with the covariant meshing technique with the settings files
used in
https://gitlab.mpcdf.mpg.de/votca/votca/-/tree/master/csg-examples/ml/3body/with_binning.
The lammps input file contains the lines specifying the pair style and coefficients:
The first example, in.spce uses the LAMMPS data file (data.spce) with
the starting configuration of 1000 CG water molecules, and a threebody
file (spce.3b) which loads the 1-1-1.table file.
- pair_style hybrid/overlay table linear 1200 threebody/table - use a combination of pair style table with 1200 linear table entries and the pair style threebody/table
- pair_coeff 1 1 table table_CG_CG.txt VOTCA - set the table name and keyword for the pair style table
- pair_coeff * * threebody/table spce.3b type - set the name of threebody file and bead type for the pair style threebody/table
A hybrid/overlay pair style is used to sum a tabulated pairwise
interaction (table_CG_CG.txt) with the tabulated threebody interactions.
The tabulated pair interaction is the effectively the same as in the
what is used by the in.spce_sw input using sw/angle/table pair style.
A hybrid pair style is used, where pair forces are calculated as a tabulated interaction (table_CG_CG.txt) and the pair style threebody/table is only used to calculate the three-body forces.
The tabulated pair interaction is the same as in the example of the sw/angle/table pair style: examples/PACKAGES/pair_sw_angle_table
IMPORTANT NOTE: The threebody tables are parameterized without storing
energies (the last column of the threebody table files is zero). This
is due to a current limitation of the paramerization procedure.
To run the simulation, one needs an additional threebody file (spce.3b).
It has the following structure:
This in.spce2 example uses the data.spce2 file and the threebody input
spce2.3b. This is essentially the same simulation as in in.spce only
the atom type of the first 100 CG water molecules has been changed from
1 to 2. This is done to demonstrate how to run a simulation with
different atom types.
- type - relates to keyword type in LAMMPS input file
- type - relates to keyword type in LAMMPS input file
- type - relates to keyword type in LAMMPS input file
- 3.7 - cutoff in Ang
- 1-1-1.table - name of 3-body force table
- ENTRY1 - keyword in 3-body force table for this interaction
- linear - interpolation is linear
- 12 - number of grid points in radial direction (automatically sets grid size, in this case to 1872)
For this (artificial) two-element simulation, the threebody file now
contain 8 entries for: type1 type1 type1, type1 type1 type2, type1 type2
type1, type1 type2 type2, type2 type1 type1, type2 type1 type2, type2
type2 type1, type2 type2 type2. Each entry has the same structure as
above. However, entries where the second and the third element are
different require a different force table (1-1-2.table) instead of
(1-1-1.table). 1-1-2.table contains exactly the force constants as
1-1-1.table. However it has to have the asymmetric structure where both
interparticle distances (r_ij and r_ik) are varied from rmin to rmax and
therefore contains "M = 2 * N * N * N" (2 * 12 * 12 * 12 = 3456)
entries.
As there is only one atom type (1), the force table is symmetric and contains "M = N * N * (N+1)" (12 * 12 * 13 = 1872) entries.
The LAMMPS simulation is a standard nvt simulation. A dump file is output with the positions and forces every 10 time steps.
You can calculate the pair distribution and compare it to the ones in the publication.
For the second part of the example, have a look at the LAMMPS data file (spce_2.data), the input file (spce_2.in) and the threebody file (spce_2.3b).
Running the second part, you will in fact perform the same MD simulation as in the first part of the example. However, the atom type of the first 100 CG water molecules has been changed from 1 to 2.
This is done to demonstrate how to run a simulation with different atom types.
Again, lammps input file (spce_2.in) contains the lines specifying the pair style and coefficients:
- pair_style hybrid/overlay table linear 1200 threebody/table - use a combination of pair style table with 1200 linear table entries and the pair style threebody/table
- pair_coeff 1 1 table table_CG_CG.txt VOTCA - set the table name and keyword for the pair style table
- pair_coeff * * threebody/table spce_2.3b type1 type2 - set the name of threebody file and bead type for the pair style threebody/table
Now, the atom type 1 is mapped to the element type1 and the atom type 2 is mapped to the element type2 in the threebody file (spce_2.3b).
For this (artificial) two-element simulation, the threebody file now contain 8 entries for: type1 type1 type1, type1 type1 type2, type1 type2 type1, type1 type2 type2, type2 type1 type1, type2 type1 type2, type2 type2 type1, type2 type2 type2.
Each entry has the same structure as above. However, entries where the second and the third element are different require a different force table (1-1-2.table) instead of (1-1-1.table).
1-1-2.table contains exactly the force constants as 1-1-1.table.
However it has to have the asymmetric structure where both interparticle distances (r_ij and r_ik) are varied from rmin to rmax and therefore contains "M = 2 * N * N * N" (2 * 12 * 12 * 12 = 3456) entries.
Now run the simulation. The theromodynamic output, as well as, the pair correlation function should be exactly the same as for the first part of the example.
The third example, in.spce_sw, contains the analytical twobody interactions
and replaces the threebody term of the Stillinger-Weber potential with an
angle/table style potential which is stored in the table_CG_CG_CG.txt file.

View File

@ -0,0 +1,20 @@
units real
atom_style atomic
read_data data.spce
pair_style hybrid/overlay table linear 1200 sw/angle/table
pair_coeff 1 1 table table_CG_CG.txt VOTCA
pair_coeff * * sw/angle/table spce.sw type
fix 1 all nvt temp 300.0 300.0 200.0
velocity all create 300 432567 dist uniform mom yes
timestep 2.0
thermo 100
#dump 2 all custom 10 spce_sw.dump id type x y z fx fy fz
run 1000

View File

@ -57,20 +57,20 @@ Per MPI rank memory allocation (min/avg/max) = 5.487 | 5.487 | 5.487 Mbytes
800 313.16537 -5466.4124 0 -4533.8594 489.99301
900 303.42954 -5506.3208 0 -4602.7595 360.05608
1000 299.50926 -5446.8981 0 -4555.0107 993.95615
Loop time of 5.12079 on 1 procs for 1000 steps with 1000 atoms
Loop time of 5.15787 on 1 procs for 1000 steps with 1000 atoms
Performance: 33.745 ns/day, 0.711 hours/ns, 195.282 timesteps/s
Performance: 33.502 ns/day, 0.716 hours/ns, 193.879 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 | 4.8109 | 4.8109 | 4.8109 | 0.0 | 93.95
Neigh | 0.27061 | 0.27061 | 0.27061 | 0.0 | 5.28
Comm | 0.020092 | 0.020092 | 0.020092 | 0.0 | 0.39
Output | 0.00020325 | 0.00020325 | 0.00020325 | 0.0 | 0.00
Modify | 0.011643 | 0.011643 | 0.011643 | 0.0 | 0.23
Other | | 0.007324 | | | 0.14
Pair | 4.8428 | 4.8428 | 4.8428 | 0.0 | 93.89
Neigh | 0.27527 | 0.27527 | 0.27527 | 0.0 | 5.34
Comm | 0.020461 | 0.020461 | 0.020461 | 0.0 | 0.40
Output | 0.00020949 | 0.00020949 | 0.00020949 | 0.0 | 0.00
Modify | 0.01198 | 0.01198 | 0.01198 | 0.0 | 0.23
Other | | 0.007163 | | | 0.14
Nlocal: 1000 ave 1000 max 1000 min
Histogram: 1 0 0 0 0 0 0 0 0 0

View File

@ -57,20 +57,20 @@ Per MPI rank memory allocation (min/avg/max) = 3.87 | 3.87 | 3.87 Mbytes
800 314.09436 -5467.6073 0 -4532.2879 522.73489
900 300.85843 -5503.7551 0 -4607.85 491.78041
1000 302.84638 -5468.3331 0 -4566.5083 338.05123
Loop time of 1.45119 on 4 procs for 1000 steps with 1000 atoms
Loop time of 1.60997 on 4 procs for 1000 steps with 1000 atoms
Performance: 119.075 ns/day, 0.202 hours/ns, 689.091 timesteps/s
98.3% CPU use with 4 MPI tasks x 1 OpenMP threads
Performance: 107.331 ns/day, 0.224 hours/ns, 621.131 timesteps/s
94.2% CPU use with 4 MPI tasks x 1 OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 1.2376 | 1.256 | 1.2833 | 1.5 | 86.55
Neigh | 0.06865 | 0.06984 | 0.071283 | 0.4 | 4.81
Comm | 0.084664 | 0.1133 | 0.13329 | 5.4 | 7.81
Output | 0.0001668 | 0.00034177 | 0.00086454 | 0.0 | 0.02
Modify | 0.0069024 | 0.0071705 | 0.0074503 | 0.3 | 0.49
Other | | 0.004489 | | | 0.31
Pair | 1.28 | 1.2942 | 1.3018 | 0.8 | 80.38
Neigh | 0.069763 | 0.070222 | 0.070788 | 0.2 | 4.36
Comm | 0.19379 | 0.20979 | 0.23226 | 3.6 | 13.03
Output | 0.0001711 | 0.00046947 | 0.0013621 | 0.0 | 0.03
Modify | 0.021613 | 0.030016 | 0.038718 | 4.8 | 1.86
Other | | 0.005309 | | | 0.33
Nlocal: 250 ave 257 max 240 min
Histogram: 1 0 0 0 0 1 0 0 1 1

View File

@ -57,20 +57,20 @@ Per MPI rank memory allocation (min/avg/max) = 5.487 | 5.487 | 5.487 Mbytes
800 313.16537 -5466.4124 0 -4533.8594 489.99301
900 303.42954 -5506.3208 0 -4602.7595 360.05608
1000 299.50926 -5446.8981 0 -4555.0107 993.95615
Loop time of 5.16704 on 1 procs for 1000 steps with 1000 atoms
Loop time of 5.16365 on 1 procs for 1000 steps with 1000 atoms
Performance: 33.443 ns/day, 0.718 hours/ns, 193.534 timesteps/s
99.7% CPU use with 1 MPI tasks x 1 OpenMP threads
Performance: 33.465 ns/day, 0.717 hours/ns, 193.661 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 | 4.8574 | 4.8574 | 4.8574 | 0.0 | 94.01
Neigh | 0.27015 | 0.27015 | 0.27015 | 0.0 | 5.23
Comm | 0.020112 | 0.020112 | 0.020112 | 0.0 | 0.39
Output | 0.0002118 | 0.0002118 | 0.0002118 | 0.0 | 0.00
Modify | 0.011792 | 0.011792 | 0.011792 | 0.0 | 0.23
Other | | 0.007409 | | | 0.14
Pair | 4.8443 | 4.8443 | 4.8443 | 0.0 | 93.81
Neigh | 0.27931 | 0.27931 | 0.27931 | 0.0 | 5.41
Comm | 0.020302 | 0.020302 | 0.020302 | 0.0 | 0.39
Output | 0.00022712 | 0.00022712 | 0.00022712 | 0.0 | 0.00
Modify | 0.011944 | 0.011944 | 0.011944 | 0.0 | 0.23
Other | | 0.007616 | | | 0.15
Nlocal: 1000 ave 1000 max 1000 min
Histogram: 1 0 0 0 0 0 0 0 0 0

View File

@ -10,7 +10,7 @@ Reading data file ...
1 by 2 by 2 MPI processor grid
reading atoms ...
1000 atoms
read_data CPU = 0.002 seconds
read_data CPU = 0.004 seconds
pair_style hybrid/overlay table linear 1200 threebody/table
@ -57,20 +57,20 @@ Per MPI rank memory allocation (min/avg/max) = 3.87 | 3.87 | 3.87 Mbytes
800 314.09436 -5467.6073 0 -4532.2879 522.73489
900 300.85843 -5503.7551 0 -4607.85 491.78041
1000 302.84638 -5468.3331 0 -4566.5083 338.05123
Loop time of 1.4686 on 4 procs for 1000 steps with 1000 atoms
Loop time of 1.54853 on 4 procs for 1000 steps with 1000 atoms
Performance: 117.663 ns/day, 0.204 hours/ns, 680.919 timesteps/s
98.1% CPU use with 4 MPI tasks x 1 OpenMP threads
Performance: 111.590 ns/day, 0.215 hours/ns, 645.773 timesteps/s
96.0% CPU use with 4 MPI tasks x 1 OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 1.2491 | 1.2757 | 1.3162 | 2.3 | 86.87
Neigh | 0.06817 | 0.069468 | 0.071025 | 0.5 | 4.73
Comm | 0.069929 | 0.11236 | 0.14069 | 8.1 | 7.65
Output | 0.00016417 | 0.00050711 | 0.0015318 | 0.0 | 0.03
Modify | 0.0057514 | 0.0061681 | 0.0066503 | 0.5 | 0.42
Other | | 0.004366 | | | 0.30
Pair | 1.2599 | 1.2908 | 1.3259 | 2.1 | 83.36
Neigh | 0.069097 | 0.071294 | 0.075502 | 0.9 | 4.60
Comm | 0.12731 | 0.15884 | 0.19196 | 5.7 | 10.26
Output | 0.00017674 | 0.0026016 | 0.0098653 | 8.2 | 0.17
Modify | 0.0093453 | 0.011999 | 0.014575 | 2.3 | 0.77
Other | | 0.01295 | | | 0.84
Nlocal: 250 ave 257 max 240 min
Histogram: 1 0 0 0 0 1 0 0 1 1

View File

@ -0,0 +1,87 @@
LAMMPS (4 May 2022)
using 1 OpenMP thread(s) per MPI task
units real
atom_style atomic
read_data data.spce
Reading data file ...
orthogonal box = (0 0 0) to (31.0648 31.0648 31.0648)
1 by 1 by 1 MPI processor grid
reading atoms ...
1000 atoms
read_data CPU = 0.001 seconds
pair_style hybrid/overlay table linear 1200 sw/angle/table
pair_coeff 1 1 table table_CG_CG.txt VOTCA
pair_coeff * * sw/angle/table spce.sw type
fix 1 all nvt temp 300.0 300.0 200.0
velocity all create 300 432567 dist uniform mom yes
timestep 2.0
thermo 100
#dump 2 all custom 10 spce_sw.dump id type x y z fx fy fz
run 1000
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 14
ghost atom cutoff = 14
binsize = 7, bins = 5 5 5
2 neighbor lists, perpetual/occasional/extra = 2 0 0
(1) pair table, perpetual, half/full from (2)
attributes: half, newton on
pair build: halffull/newton
stencil: none
bin: none
(2) pair sw/angle/table, perpetual
attributes: full, newton on
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 5.487 | 5.487 | 5.487 Mbytes
Step Temp E_pair E_mol TotEng Press
0 300 -4572.9581 0 -3679.6093 -402.23914
100 286.5642 -4508.6912 0 -3655.352 -610.63256
200 291.59063 -4465.6368 0 -3597.3297 -218.54913
300 298.40301 -4460.64 0 -3572.0468 302.96636
400 305.99618 -4460.1128 0 -3548.9084 -68.022415
500 301.94233 -4440.337 0 -3541.2043 179.36975
600 308.95709 -4485.8412 0 -3565.8197 -95.917517
700 291.69015 -4489.4465 0 -3620.843 -56.044939
800 294.95653 -4496.904 0 -3618.5738 563.3456
900 295.50533 -4478.1134 0 -3598.149 89.234288
1000 308.63559 -4471.1612 0 -3552.0971 906.33706
Loop time of 5.39753 on 1 procs for 1000 steps with 1000 atoms
Performance: 32.015 ns/day, 0.750 hours/ns, 185.270 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 | 5.0954 | 5.0954 | 5.0954 | 0.0 | 94.40
Neigh | 0.26201 | 0.26201 | 0.26201 | 0.0 | 4.85
Comm | 0.020497 | 0.020497 | 0.020497 | 0.0 | 0.38
Output | 0.00021869 | 0.00021869 | 0.00021869 | 0.0 | 0.00
Modify | 0.011849 | 0.011849 | 0.011849 | 0.0 | 0.22
Other | | 0.007577 | | | 0.14
Nlocal: 1000 ave 1000 max 1000 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost: 5862 ave 5862 max 5862 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs: 191262 ave 191262 max 191262 min
Histogram: 1 0 0 0 0 0 0 0 0 0
FullNghs: 382524 ave 382524 max 382524 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Total # of neighbors = 382524
Ave neighs/atom = 382.524
Neighbor list builds = 26
Dangerous builds = 0
Total wall time: 0:00:05

View File

@ -0,0 +1,87 @@
LAMMPS (4 May 2022)
using 1 OpenMP thread(s) per MPI task
units real
atom_style atomic
read_data data.spce
Reading data file ...
orthogonal box = (0 0 0) to (31.0648 31.0648 31.0648)
1 by 2 by 2 MPI processor grid
reading atoms ...
1000 atoms
read_data CPU = 0.001 seconds
pair_style hybrid/overlay table linear 1200 sw/angle/table
pair_coeff 1 1 table table_CG_CG.txt VOTCA
pair_coeff * * sw/angle/table spce.sw type
fix 1 all nvt temp 300.0 300.0 200.0
velocity all create 300 432567 dist uniform mom yes
timestep 2.0
thermo 100
#dump 2 all custom 10 spce_sw.dump id type x y z fx fy fz
run 1000
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 14
ghost atom cutoff = 14
binsize = 7, bins = 5 5 5
2 neighbor lists, perpetual/occasional/extra = 2 0 0
(1) pair table, perpetual, half/full from (2)
attributes: half, newton on
pair build: halffull/newton
stencil: none
bin: none
(2) pair sw/angle/table, perpetual
attributes: full, newton on
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 3.87 | 3.87 | 3.87 Mbytes
Step Temp E_pair E_mol TotEng Press
0 300 -4572.9581 0 -3679.6093 -402.23914
100 286.5642 -4508.6912 0 -3655.352 -610.63256
200 291.59063 -4465.6368 0 -3597.3297 -218.54913
300 298.40301 -4460.64 0 -3572.0468 302.96636
400 305.99618 -4460.1128 0 -3548.9084 -68.022415
500 301.94233 -4440.337 0 -3541.2043 179.36975
600 308.95709 -4485.8412 0 -3565.8197 -95.917517
700 291.69015 -4489.4465 0 -3620.843 -56.044939
800 294.95653 -4496.904 0 -3618.5738 563.3456
900 295.50533 -4478.1134 0 -3598.149 89.234292
1000 308.63559 -4471.1612 0 -3552.0971 906.33708
Loop time of 1.57073 on 4 procs for 1000 steps with 1000 atoms
Performance: 110.012 ns/day, 0.218 hours/ns, 636.646 timesteps/s
97.1% CPU use with 4 MPI tasks x 1 OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 1.3064 | 1.3347 | 1.3706 | 2.0 | 84.97
Neigh | 0.065344 | 0.070299 | 0.07737 | 1.7 | 4.48
Comm | 0.117 | 0.15297 | 0.18685 | 6.5 | 9.74
Output | 0.00016937 | 0.00055648 | 0.0017097 | 0.0 | 0.04
Modify | 0.0073414 | 0.0079027 | 0.0085343 | 0.6 | 0.50
Other | | 0.0043 | | | 0.27
Nlocal: 250 ave 254 max 247 min
Histogram: 1 1 0 0 0 1 0 0 0 1
Nghost: 3473.25 ave 3490 max 3450 min
Histogram: 1 0 0 0 0 1 0 1 0 1
Neighs: 47815.5 ave 48520 max 47134 min
Histogram: 1 0 1 0 0 0 1 0 0 1
FullNghs: 95631 ave 97203 max 94083 min
Histogram: 1 0 1 0 0 0 1 0 0 1
Total # of neighbors = 382524
Ave neighs/atom = 382.524
Neighbor list builds = 26
Dangerous builds = 0
Total wall time: 0:00:01

View File

@ -0,0 +1,18 @@
type
type
type
1 #epsilon in kcal/mol
1 #sigma in dimensionless
3.7 # a in Ang
1.0 #lambda dimensionless
0.8 #gamma in Ang
0.0 #costheta0 dimensionless
0 #two body part A=0
0 #two body part B=0
0 #two body part p=0
0 #two body part q=0
0.0 # use the standard Stillinger-Weber cutoff
table_CG_CG_CG.txt
VOTCA
linear
1001

File diff suppressed because it is too large Load Diff