-
-
Notifications
You must be signed in to change notification settings - Fork 10
Add Large diffusion example (250k atoms, KOKKOS) #379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a6189f4
a0f36bc
eac213a
291ec63
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| # Large system: run with KOKKOS multithreading (Atomify detects this line) | ||
| suffix kk | ||
|
|
||
| # Atomify commands start with #/ | ||
|
|
||
| # Move camera to a nice position | ||
| #/camera position 50.0 72.7 221.7 | ||
| #/camera target 45.7 51.3 35.0 | ||
|
|
||
| # Set atom size and color | ||
| #/atom 1 1.0 #ffffff | ||
| #/atom 2 1.5 #ff0000 | ||
|
|
||
| variable L equal 50.0 | ||
| variable Lhalf equal $(0.5*v_L) | ||
| variable thickness equal 2.0 | ||
|
|
||
| units lj | ||
| atom_style atomic | ||
| lattice fcc 0.5 | ||
|
|
||
| # Create regions to place atoms | ||
| variable left equal 0.5*$L-0.5*${thickness} | ||
| variable right equal 0.5*$L+0.5*${thickness} | ||
|
Comment on lines
+23
to
+24
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In LAMMPS, equal-style variables should reference other variables using the |
||
| region system block 0 $L 0 $L 0 ${Lhalf} | ||
| region boxinside block ${left} ${right} 0 $L 0 ${Lhalf} | ||
| region boxoutside block ${left} ${right} 0 $L 0 ${Lhalf} side out | ||
|
|
||
| # Create a box with 2 atom types in the region system | ||
| create_box 2 system | ||
| # Create atoms of type 1 inside the inner region | ||
| create_atoms 1 region boxinside | ||
| # Create atoms of type 2 inside the outer region | ||
| create_atoms 2 region boxoutside | ||
|
|
||
| # Set atom masses | ||
| mass 1 1.0 | ||
| mass 2 4.0 | ||
|
|
||
| # Give initial velocity, T=3.00, seed = 1337 | ||
| velocity all create 3.00 1337 loop geom | ||
|
|
||
| # Choose LJ with 2.5sigma cutoff | ||
| pair_style lj/cut 2.5 | ||
| pair_coeff * * 1.0 1.0 2.5 | ||
| neigh_modify every 1 delay 0 check yes | ||
|
|
||
| # Create two groups for computing diffusion coefficients | ||
| group light type 1 | ||
| group heavy type 2 | ||
|
|
||
| # Measure mean square displacement and diffusion coefficient | ||
| compute msd_light light msd com yes | ||
| variable diffusion_coeff_light equal c_msd_light[4]/6/(step*dt+1.0e-6) | ||
| variable msd_light equal c_msd_light[4] | ||
|
|
||
| compute msd_heavy heavy msd com yes | ||
| variable msd_heavy equal c_msd_heavy[4] | ||
| variable diffusion_coeff_heavy equal c_msd_heavy[4]/6/(step*dt+1.0e-6) | ||
|
|
||
| thermo 100 | ||
| thermo_style custom step v_diffusion_coeff_light v_msd_light v_diffusion_coeff_heavy v_msd_heavy | ||
| fix 1 all nve | ||
| compute displace all displace/atom | ||
| run 10000 | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -21,6 +21,26 @@ | |||||
| } | ||||||
| ] | ||||||
| }, | ||||||
| { | ||||||
| "id": "large_diffusion", | ||||||
| "title": "Large diffusion", | ||||||
| "description": "A large version of the diffusion example (~250,000 atoms) that runs multithreaded with KOKKOS. The white atoms have mass 1 while the red atoms have mass 4.", | ||||||
| "analysisDescription": "# About this simulation\nWe simulate two Lennard Jones particle types with masses 1.0 and 4.0. The diffusion coefficient [https://en.wikipedia.org/wiki/Mass_diffusivity](scales like) D$\\propto 1/\\sqrt{m}$, so we should see a factor 2 higher diffusion coefficient for the small molecules.", | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The markdown link syntax in
Suggested change
|
||||||
| "imageUrl": "diffusion/large_diffusion/large_diffusion.png", | ||||||
| "inputScript": "large_diffusion.in", | ||||||
| "keywords": [ | ||||||
| "lennard jones", | ||||||
| "diffusion", | ||||||
| "kokkos", | ||||||
| "large" | ||||||
| ], | ||||||
| "files": [ | ||||||
| { | ||||||
| "fileName": "large_diffusion.in", | ||||||
| "url": "diffusion/large_diffusion/large_diffusion.in" | ||||||
| } | ||||||
| ] | ||||||
| }, | ||||||
| { | ||||||
| "id": "2d-msd-diffusion", | ||||||
| "title": "2D diffusion coefficient MSD", | ||||||
|
|
@@ -40,34 +60,34 @@ | |||||
| "url": "diffusion/2d-msd-diffusion/2d-msd-diffusion.in" | ||||||
| }, | ||||||
| { | ||||||
| "fileName": "2d-msd-diffusion.ipynb", | ||||||
| "url": "diffusion/2d-msd-diffusion/2d-msd-diffusion.ipynb" | ||||||
| } | ||||||
| "fileName": "2d-msd-diffusion.ipynb", | ||||||
| "url": "diffusion/2d-msd-diffusion/2d-msd-diffusion.ipynb" | ||||||
| } | ||||||
| ] | ||||||
| }, | ||||||
| { | ||||||
| "id": "2d-vacf-diffusion", | ||||||
| "title": "2D diffusion coefficient VACF", | ||||||
| "description": "We measure the diffusion coefficient using the velocity auto correlation function.", | ||||||
| "analysisDescription": "# About this simulation\nWe measure the diffusion coefficient using the velocity auto correlation function.", | ||||||
| "analysisScript": "2d-vacf-diffusion.ipynb", | ||||||
| "imageUrl": "diffusion/2d-vacf-diffusion/2d-vacf-diffusion.png", | ||||||
| "inputScript": "2d-vacf-diffusion.in", | ||||||
| "keywords": [ | ||||||
| "lennard jones", | ||||||
| "diffusion", | ||||||
| "velocity autocorrelation function" | ||||||
| ], | ||||||
| "files": [ | ||||||
| { | ||||||
| "fileName": "2d-vacf-diffusion.in", | ||||||
| "url": "diffusion/2d-vacf-diffusion/2d-vacf-diffusion.in" | ||||||
| }, | ||||||
| { | ||||||
| "fileName": "2d-vacf-diffusion.ipynb", | ||||||
| "url": "diffusion/2d-vacf-diffusion/2d-vacf-diffusion.ipynb" | ||||||
| } | ||||||
| ] | ||||||
| "id": "2d-vacf-diffusion", | ||||||
| "title": "2D diffusion coefficient VACF", | ||||||
| "description": "We measure the diffusion coefficient using the velocity auto correlation function.", | ||||||
| "analysisDescription": "# About this simulation\nWe measure the diffusion coefficient using the velocity auto correlation function.", | ||||||
| "analysisScript": "2d-vacf-diffusion.ipynb", | ||||||
| "imageUrl": "diffusion/2d-vacf-diffusion/2d-vacf-diffusion.png", | ||||||
| "inputScript": "2d-vacf-diffusion.in", | ||||||
| "keywords": [ | ||||||
| "lennard jones", | ||||||
| "diffusion", | ||||||
| "velocity autocorrelation function" | ||||||
| ], | ||||||
| "files": [ | ||||||
| { | ||||||
| "fileName": "2d-vacf-diffusion.in", | ||||||
| "url": "diffusion/2d-vacf-diffusion/2d-vacf-diffusion.in" | ||||||
| }, | ||||||
| { | ||||||
| "fileName": "2d-vacf-diffusion.ipynb", | ||||||
| "url": "diffusion/2d-vacf-diffusion/2d-vacf-diffusion.ipynb" | ||||||
| } | ||||||
| ] | ||||||
| }, | ||||||
| { | ||||||
| "id": "proteinfolding", | ||||||
|
|
@@ -1410,4 +1430,4 @@ | |||||
| ] | ||||||
| } | ||||||
| ] | ||||||
| } | ||||||
| } | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In LAMMPS, using immediate evaluation
$(...)inside anequalstyle variable definition is redundant and can be simplified. DefiningLhalfas a standard formula0.5*v_Lis cleaner and more idiomatic.