Unverified Commit bc3a84b4 authored by Steve Plimpton's avatar Steve Plimpton Committed by GitHub
Browse files

Merge pull request #727 from lammps/fix-gcmc-examples

new example scripts for fix gcmc
parents 83ec9815 e4b14213
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -67,6 +67,15 @@ variable tfac equal 5.0/3.0 # (3 trans + 2 rot)/(3 trans)
fix             mygcmc all gcmc 100 100 0 0 54341 ${temp} ${mu} ${disp} mol &
                co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt

# atom counts

variable 	carbon atom "type==1"
variable        oxygen atom "type==2"
group 		carbon dynamic all var carbon
group 	        oxygen dynamic all var oxygen
variable        nC equal count(carbon)
variable        nO equal count(oxygen)

# output

variable	tacc equal f_mygcmc[2]/(f_mygcmc[1]+0.1)
@@ -74,7 +83,7 @@ variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+0.1)
variable	dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1)
variable	racc equal f_mygcmc[8]/(f_mygcmc[7]+0.1)
compute_modify  thermo_temp dynamic/dof yes
thermo_style    custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc
thermo_style    custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc v_nC v_nO
thermo          1000

# run
+10 −1
Original line number Diff line number Diff line
@@ -72,6 +72,15 @@ variable tfac equal 5.0/3.0 # (3 trans + 2 rot)/(3 trans)
fix             mygcmc all gcmc 100 100 0 0 54341 ${temp} ${mu} ${disp} mol &
                h2omol tfac_insert ${tfac} group h2o shake wshake

# atom counts

variable 	oxygen atom "type==1"
variable 	hydrogen atom "type==2"
group 	        oxygen dynamic all var oxygen
group 		hydrogen dynamic all var hydrogen
variable        nO equal count(oxygen)
variable        nH equal count(hydrogen)

# output

variable	tacc equal f_mygcmc[2]/(f_mygcmc[1]+0.1)
@@ -79,7 +88,7 @@ variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+0.1)
variable	dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1)
variable	racc equal f_mygcmc[8]/(f_mygcmc[7]+0.1)
compute_modify  thermo_temp dynamic/dof yes
thermo_style    custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc
thermo_style    custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc v_nO v_nH
thermo          1000

# run
+9 −2
Original line number Diff line number Diff line
@@ -33,6 +33,12 @@ mass * 1.0

fix             mygcmc all gcmc 1 100 100 1 29494 ${temp} ${mu} ${disp}

# atom count

variable 	type1 atom "type==1"
group 		type1 dynamic all var type1
variable        n1 equal count(type1)

# averaging

variable	rho equal density
@@ -40,10 +46,11 @@ variable p equal press
variable	nugget equal 1.0e-8
variable        lambda equal 1.0
variable     	muex equal ${mu}-${temp}*ln(density*${lambda}+${nugget})
fix 		ave all ave/time 10 100 1000 v_rho v_p v_muex ave one file rho_vs_p.dat
fix 		ave all ave/time 10 100 1000 v_rho v_p v_muex v_n1 ave one file rho_vs_p.dat
variable	rhoav equal f_ave[1]
variable	pav equal f_ave[2]
variable	muexav equal f_ave[3]
variable	n1av equal f_ave[4]

# output

@@ -51,7 +58,7 @@ variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+${nugget})
variable	iacc equal f_mygcmc[4]/(f_mygcmc[3]+${nugget})
variable	dacc equal f_mygcmc[6]/(f_mygcmc[5]+${nugget})
compute_modify  thermo_temp dynamic yes
thermo_style    custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_rhoav v_pav v_muexav
thermo_style    custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_rhoav v_pav v_muexav v_n1av
thermo          1000

# run
+48 −36
Original line number Diff line number Diff line
LAMMPS (6 Jul 2017)
LAMMPS (23 Oct 2017)
  using 1 OpenMP thread(s) per MPI task
# GCMC for CO2 molecular fluid, rigid/small/nvt dynamics
# Rigid CO2 TraPPE model
@@ -46,6 +46,7 @@ Read molecule co2mol:
  0 impropers with 0 types
create_atoms   	0 box mol co2mol 464563 units box
Created 24 atoms
  Time spent = 0.00196958 secs

# rigid CO2 TraPPE model

@@ -87,6 +88,17 @@ fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 ${disp} mol
fix             mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol                 co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt
fix             mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol                 co2mol tfac_insert 1.66666666666667 group co2 rigid myrigidnvt

# atom counts

variable 	carbon atom "type==1"
variable        oxygen atom "type==2"
group 		carbon dynamic all var carbon
dynamic group carbon defined
group 	        oxygen dynamic all var oxygen
dynamic group oxygen defined
variable        nC equal count(carbon)
variable        nO equal count(oxygen)

# output

variable	tacc equal f_mygcmc[2]/(f_mygcmc[1]+0.1)
@@ -94,7 +106,7 @@ variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+0.1)
variable	dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1)
variable	racc equal f_mygcmc[8]/(f_mygcmc[7]+0.1)
compute_modify  thermo_temp dynamic/dof yes
thermo_style    custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc
thermo_style    custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc v_nC v_nO
thermo          1000

# run
@@ -124,45 +136,45 @@ Neighbor list info ...
      stencil: half/bin/3d/newton
      bin: standard
Per MPI rank memory allocation (min/avg/max) = 15.62 | 15.62 | 15.62 Mbytes
Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_racc 
       0    364.27579    4238.8631   -9.6809388    13.391989    0.5846359       24            0            0            0            0 
Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_racc v_nC v_nO 
       0    364.27579    4238.8631   -9.6809388    13.391989    0.5846359       24            0            0            0            0            8           16 
WARNING: Using kspace solver on system with no charge (../kspace.cpp:289)
    1000    420.43475    1722.4052   -9.6956123    15.456579    0.5846359       24   0.20879341   0.20713005            0            0 
    2000    302.29516   -547.83641   -22.017674     14.11699   0.73079488       30    0.1742478    0.1678018            0            0 
    3000     316.6934   -1080.2672   -8.2218891    10.069364   0.51155641       21   0.13544917   0.13720634            0            0 
    4000    246.81618   -679.83642   -14.577244     10.29997   0.65771539       27    0.1568939   0.15860229            0            0 
    5000    260.22849   -896.29914   -16.097593    10.859684   0.65771539       27   0.13138744   0.13547049            0            0 
    6000    291.70796     -1521.99   -22.303136    13.622574   0.73079488       30   0.12615476   0.12717694            0            0 
    7000    236.02638   -599.92186   -27.580831    13.367447   0.87695385       36     0.119703   0.12145398            0            0 
    8000    321.45341    688.10577    -10.09204    11.817696    0.5846359       24   0.10917411   0.11032646            0            0 
    9000    502.85382   -302.31056  -0.22330142   0.99927447  0.073079488        3    0.1254105   0.12905828            0            0 
   10000    249.98239    -510.0091   -32.815145    15.399767   0.95003334       39    0.1274504   0.12875623            0            0 
   11000    247.59424   -1129.0274   -25.320205    12.792544   0.80387436       33   0.11739076   0.11916784            0            0 
   12000            0    -20.39554  -0.14872889           -0            0        0    0.1254933   0.12920375            0            0 
   13000    1272.2738   -474.79484  -0.29450485    8.8489483   0.14615898        6   0.13767133   0.14112496            0            0 
   14000    516.54246   -36.296516   -5.0012009    11.291243   0.36539744       15   0.15632744   0.15955377            0            0 
   15000    307.09233    1951.9301   -14.820362    12.815375   0.65771539       27   0.15393544   0.15716192            0            0 
   16000    198.31989   -559.48443   -30.459487    11.231925   0.87695385       36    0.1482565   0.15025652            0            0 
   17000    246.99311    657.85683   -18.579206     11.53442   0.73079488       30   0.14143958   0.14375423            0            0 
   18000    467.13468    167.03738   -1.0945268     5.569759   0.21923846        9   0.13847359   0.14098533            0            0 
   19000    359.54027   -1413.5407   -12.156233    13.217895    0.5846359       24   0.15169146   0.15294205            0            0 
   20000    227.79597   -1204.5652    -23.24144    10.637925   0.73079488       30   0.14917199   0.15022946            0            0 
Loop time of 20.153 on 1 procs for 20000 steps with 30 atoms

Performance: 85.744 ns/day, 0.280 hours/ns, 992.408 timesteps/s
99.3% CPU use with 1 MPI tasks x 1 OpenMP threads
    1000    420.43475    1722.4052   -9.6956123    15.456579    0.5846359       24   0.20879341   0.20713005            0            0            8           16 
    2000    302.29516   -547.83641   -22.017674     14.11699   0.73079488       30    0.1742478    0.1678018            0            0           10           20 
    3000     316.6934   -1080.2672   -8.2218891    10.069364   0.51155641       21   0.13544917   0.13720634            0            0            7           14 
    4000    246.81618   -679.83642   -14.577244     10.29997   0.65771539       27    0.1568939   0.15860229            0            0            9           18 
    5000    260.22849   -896.29914   -16.097593    10.859684   0.65771539       27   0.13138744   0.13547049            0            0            9           18 
    6000    291.70796     -1521.99   -22.303136    13.622574   0.73079488       30   0.12615476   0.12717694            0            0           10           20 
    7000    236.02638   -599.92186   -27.580831    13.367447   0.87695385       36     0.119703   0.12145398            0            0           12           24 
    8000    321.45341    688.10577    -10.09204    11.817696    0.5846359       24   0.10917411   0.11032646            0            0            8           16 
    9000    502.85382   -302.31056  -0.22330142   0.99927447  0.073079488        3    0.1254105   0.12905828            0            0            1            2 
   10000    249.98239    -510.0091   -32.815145    15.399767   0.95003334       39    0.1274504   0.12875623            0            0           13           26 
   11000    247.59424   -1129.0274   -25.320205    12.792544   0.80387436       33   0.11739076   0.11916784            0            0           11           22 
   12000            0    -20.39554  -0.14872889           -0            0        0    0.1254933   0.12920375            0            0            0            0 
   13000    1272.2738   -474.79484  -0.29450485    8.8489483   0.14615898        6   0.13767133   0.14112496            0            0            2            4 
   14000    516.54246   -36.296516   -5.0012009    11.291243   0.36539744       15   0.15632744   0.15955377            0            0            5           10 
   15000    307.09233    1951.9301   -14.820362    12.815375   0.65771539       27   0.15393544   0.15716192            0            0            9           18 
   16000    198.31989   -559.48443   -30.459487    11.231925   0.87695385       36    0.1482565   0.15025652            0            0           12           24 
   17000    246.99311    657.85683   -18.579206     11.53442   0.73079488       30   0.14143958   0.14375423            0            0           10           20 
   18000    467.13468    167.03738   -1.0945268     5.569759   0.21923846        9   0.13847359   0.14098533            0            0            3            6 
   19000    359.54027   -1413.5407   -12.156233    13.217895    0.5846359       24   0.15169146   0.15294205            0            0            8           16 
   20000    227.79597   -1204.5652    -23.24144    10.637925   0.73079488       30   0.14917199   0.15022946            0            0           10           20 
Loop time of 20.6928 on 1 procs for 20000 steps with 30 atoms

Performance: 83.507 ns/day, 0.287 hours/ns, 966.519 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    | 2.5352     | 2.5352     | 2.5352     |   0.0 | 12.58
Bond    | 0.026112   | 0.026112   | 0.026112   |   0.0 |  0.13
Kspace  | 0.25       | 0.25       | 0.25       |   0.0 |  1.24
Neigh   | 0.10364    | 0.10364    | 0.10364    |   0.0 |  0.51
Comm    | 0.22907    | 0.22907    | 0.22907    |   0.0 |  1.14
Output  | 0.0013065  | 0.0013065  | 0.0013065  |   0.0 |  0.01
Modify  | 16.957     | 16.957     | 16.957     |   0.0 | 84.14
Other   |            | 0.05061    |            |       |  0.25
Pair    | 2.5462     | 2.5462     | 2.5462     |   0.0 | 12.30
Bond    | 0.029783   | 0.029783   | 0.029783   |   0.0 |  0.14
Kspace  | 0.26167    | 0.26167    | 0.26167    |   0.0 |  1.26
Neigh   | 0.10705    | 0.10705    | 0.10705    |   0.0 |  0.52
Comm    | 0.23409    | 0.23409    | 0.23409    |   0.0 |  1.13
Output  | 0.0013416  | 0.0013416  | 0.0013416  |   0.0 |  0.01
Modify  | 17.458     | 17.458     | 17.458     |   0.0 | 84.37
Other   |            | 0.05433    |            |       |  0.26

Nlocal:    30 ave 30 max 30 min
Histogram: 1 0 0 0 0 0 0 0 0 0
+49 −37
Original line number Diff line number Diff line
LAMMPS (6 Jul 2017)
LAMMPS (23 Oct 2017)
  using 1 OpenMP thread(s) per MPI task
# GCMC for CO2 molecular fluid, rigid/small/nvt dynamics
# Rigid CO2 TraPPE model
@@ -46,6 +46,7 @@ Read molecule co2mol:
  0 impropers with 0 types
create_atoms   	0 box mol co2mol 464563 units box
Created 24 atoms
  Time spent = 0.00261331 secs

# rigid CO2 TraPPE model

@@ -87,6 +88,17 @@ fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 ${disp} mol
fix             mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol                 co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt
fix             mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol                 co2mol tfac_insert 1.66666666666667 group co2 rigid myrigidnvt

# atom counts

variable 	carbon atom "type==1"
variable        oxygen atom "type==2"
group 		carbon dynamic all var carbon
dynamic group carbon defined
group 	        oxygen dynamic all var oxygen
dynamic group oxygen defined
variable        nC equal count(carbon)
variable        nO equal count(oxygen)

# output

variable	tacc equal f_mygcmc[2]/(f_mygcmc[1]+0.1)
@@ -94,7 +106,7 @@ variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+0.1)
variable	dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1)
variable	racc equal f_mygcmc[8]/(f_mygcmc[7]+0.1)
compute_modify  thermo_temp dynamic/dof yes
thermo_style    custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc
thermo_style    custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc v_nC v_nO
thermo          1000

# run
@@ -124,45 +136,45 @@ Neighbor list info ...
      stencil: half/bin/3d/newton
      bin: standard
Per MPI rank memory allocation (min/avg/max) = 15.41 | 15.41 | 15.41 Mbytes
Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_racc 
       0    386.52184    23582.465   -3.2433417    14.209828    0.5846359       24            0            0            0            0 
Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_racc v_nC v_nO 
       0    386.52184    23582.465   -3.2433417    14.209828    0.5846359       24            0            0            0            0            8           16 
WARNING: Using kspace solver on system with no charge (../kspace.cpp:289)
    1000    335.66829   -3.7743052   -4.6268612    7.3374649   0.36539744       15   0.20601899   0.20787963            0            0 
    2000    459.73529    238.91592  -0.42937831    5.4815343   0.21923846        9   0.30392058   0.30105616            0            0 
    3000    255.47773   -479.67802   -36.850434    15.738299   0.95003334       39   0.22220744    0.2197582            0            0 
    4000    182.70803   -1059.2262   -43.044833    12.163134    1.0231128       42   0.16781689   0.16716177            0            0 
    5000    234.00907   -1821.0444    -46.04795    15.578317    1.0231128       42   0.13498091   0.13704201            0            0 
    6000    163.42759   -774.67294   -49.686261    11.691518    1.0961923       45   0.11401677   0.11296973            0            0 
    7000    171.64616   -355.23516   -49.323434     12.27947    1.0961923       45  0.098302308  0.098552065            0            0 
    8000    251.29791   -905.47863   -37.841209    15.480807   0.95003334       39  0.086856972   0.08638658            0            0 
    9000    143.69498   -849.95393   -49.073188    10.279858    1.0961923       45  0.078261061  0.077955243            0            0 
   10000    239.35727   -1158.1879   -43.562047    15.934355    1.0231128       42  0.070789792  0.070807529            0            0 
   11000    169.51213   -1574.7885   -51.125228    12.126803    1.0961923       45  0.065008734   0.06498871            0            0 
   12000    181.39739    160.11631   -46.850937    12.977068    1.0961923       45  0.059648717  0.059514803            0            0 
   13000    164.14601   -1107.7629   -50.726722    11.742914    1.0961923       45  0.055207333  0.055097701            0            0 
   14000    287.26285    418.51463   -41.664766    19.123497    1.0231128       42  0.051346789  0.051222285            0            0 
   15000    256.94593   -532.36615   -41.651618    17.105257    1.0231128       42  0.047870301  0.047861685            0            0 
   16000    166.92132    151.15933   -39.957018     11.11219    1.0231128       42  0.045205599  0.045042211            0            0 
   17000    163.22452   -1299.8119   -42.677558    10.866089    1.0231128       42  0.043122086  0.042993687            0            0 
   18000    158.01154    475.77329   -48.803162    11.304057    1.0961923       45  0.041016683  0.040647229            0            0 
   19000    138.49297   -1585.1508   -47.517099    9.9077098    1.0961923       45  0.038929287  0.038436764            0            0 
   20000    173.84439   -1362.6301   -53.002743    12.436731    1.0961923       45  0.036973919  0.036523816            0            0 
Loop time of 31.8386 on 4 procs for 20000 steps with 45 atoms

Performance: 54.274 ns/day, 0.442 hours/ns, 628.168 timesteps/s
98.5% CPU use with 4 MPI tasks x 1 OpenMP threads
    1000    335.66829   -3.7743052   -4.6268612    7.3374649   0.36539744       15   0.20601899   0.20787963            0            0            5           10 
    2000    459.73529    238.91592  -0.42937831    5.4815343   0.21923846        9   0.30392058   0.30105616            0            0            3            6 
    3000    255.47773   -479.67802   -36.850434    15.738299   0.95003334       39   0.22220744    0.2197582            0            0           13           26 
    4000    182.70803   -1059.2262   -43.044833    12.163134    1.0231128       42   0.16781689   0.16716177            0            0           14           28 
    5000    234.00907   -1821.0444    -46.04795    15.578317    1.0231128       42   0.13498091   0.13704201            0            0           14           28 
    6000    163.42759   -774.67294   -49.686261    11.691518    1.0961923       45   0.11401677   0.11296973            0            0           15           30 
    7000    171.64616   -355.23516   -49.323434     12.27947    1.0961923       45  0.098302308  0.098552065            0            0           15           30 
    8000    251.29791   -905.47863   -37.841209    15.480807   0.95003334       39  0.086856972   0.08638658            0            0           13           26 
    9000    143.69498   -849.95393   -49.073188    10.279858    1.0961923       45  0.078261061  0.077955243            0            0           15           30 
   10000    239.35727   -1158.1879   -43.562047    15.934355    1.0231128       42  0.070789792  0.070807529            0            0           14           28 
   11000    169.51213   -1574.7885   -51.125228    12.126803    1.0961923       45  0.065008734   0.06498871            0            0           15           30 
   12000    181.39739    160.11631   -46.850937    12.977068    1.0961923       45  0.059648717  0.059514803            0            0           15           30 
   13000    164.14601   -1107.7629   -50.726722    11.742914    1.0961923       45  0.055207333  0.055097701            0            0           15           30 
   14000    287.26285    418.51463   -41.664766    19.123497    1.0231128       42  0.051346789  0.051222285            0            0           14           28 
   15000    256.94593   -532.36615   -41.651618    17.105257    1.0231128       42  0.047870301  0.047861685            0            0           14           28 
   16000    166.92132    151.15933   -39.957018     11.11219    1.0231128       42  0.045205599  0.045042211            0            0           14           28 
   17000    163.22452   -1299.8119   -42.677558    10.866089    1.0231128       42  0.043122086  0.042993687            0            0           14           28 
   18000    158.01154    475.77329   -48.803162    11.304057    1.0961923       45  0.041016683  0.040647229            0            0           15           30 
   19000    138.49297   -1585.1508   -47.517099    9.9077098    1.0961923       45  0.038929287  0.038436764            0            0           15           30 
   20000    173.84439   -1362.6301   -53.002743    12.436731    1.0961923       45  0.036973919  0.036523816            0            0           15           30 
Loop time of 32.4481 on 4 procs for 20000 steps with 45 atoms

Performance: 53.254 ns/day, 0.451 hours/ns, 616.369 timesteps/s
98.4% 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.1546     | 1.6687     | 2.1338     |  29.5 |  5.24
Bond    | 0.019769   | 0.020369   | 0.02132    |   0.4 |  0.06
Kspace  | 0.53392    | 0.99911    | 1.5116     |  37.8 |  3.14
Neigh   | 0.06737    | 0.067842   | 0.068412   |   0.2 |  0.21
Comm    | 1.9408     | 1.9582     | 1.9733     |   1.1 |  6.15
Output  | 0.0019503  | 0.0020472  | 0.0022476  |   0.3 |  0.01
Modify  | 26.974     | 26.99      | 27.001     |   0.2 | 84.77
Other   |            | 0.1322     |            |       |  0.42
Pair    | 1.1687     | 1.6702     | 2.1864     |  30.8 |  5.15
Bond    | 0.018828   | 0.020035   | 0.020975   |   0.6 |  0.06
Kspace  | 0.57506    | 1.0931     | 1.5898     |  37.7 |  3.37
Neigh   | 0.068863   | 0.069524   | 0.070128   |   0.2 |  0.21
Comm    | 2.0735     | 2.0865     | 2.0979     |   0.7 |  6.43
Output  | 0.0025017  | 0.0025966  | 0.0027781  |   0.2 |  0.01
Modify  | 27.335     | 27.344     | 27.363     |   0.2 | 84.27
Other   |            | 0.1621     |            |       |  0.50

Nlocal:    11.25 ave 14 max 8 min
Histogram: 1 0 0 0 0 1 1 0 0 1
@@ -177,4 +189,4 @@ Ave special neighs/atom = 2
Neighbor list builds = 20394
Dangerous builds = 0

Total wall time: 0:00:31
Total wall time: 0:00:32
Loading