Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 56 additions & 21 deletions examples/pages/src/examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,40 +53,75 @@ thermo 100
run 5000`,
},
{
name: "LJ Cluster (large, 1M atoms)",
every: 10,
script: `# ~1,000,188 atoms (63^3 fcc cells x 4) — runs in a Web Worker so
# the page stays responsive. Expect setup + 100 steps to take a few
# minutes and several hundred MB of memory.
name: "Maxwell–Boltzmann distribution (2D)",
every: 100,
script: `# Give every atom the same speed in a random direction, then let
# collisions do the rest: within a few hundred steps the velocity
# distribution relaxes to the Maxwell–Boltzmann form (Boltzmann's
# H-theorem in action). A 2D gas with the purely repulsive WCA
# potential (LJ cut at its minimum) so energy stays kinetic.
units lj
timestep 0.005
dimension 2
atom_style atomic
lattice fcc 0.8442
region box block 0 63 0 63 0 63
lattice sq 0.3
region box block 0 32 0 32 -0.1 0.1
create_box 1 box
create_atoms 1 box
mass 1 1.0
velocity all create 1.44 87287 loop geom
pair_style lj/cut 1.122462
pair_coeff 1 1 1.0 1.0
pair_modify shift yes
velocity all create 1.0 777 dist gaussian
variable v0 equal 1.5
variable s atom v_v0/sqrt(vx*vx+vy*vy)
variable ux atom vx*v_s
variable uy atom vy*v_s
velocity all set v_ux v_uy NULL
neighbor 0.3 bin
fix 1 all nve
fix 2d all enforce2d
thermo 200
run 4000`,
},
{
name: "Condensation quench (2D)",
every: 200,
script: `# Take a hot 2D Lennard-Jones vapor and suddenly cool it below its
# condensation point. The uniform gas becomes unstable, droplets
# nucleate everywhere and then coarsen — a first-order phase
# transition, with the potential energy tracking the latent heat.
units lj
dimension 2
atom_style atomic
lattice sq 0.3
region box block 0 40 0 40 -0.1 0.1
create_box 1 box
create_atoms 1 box
mass 1 1.0
velocity all create 1.0 8712 dist gaussian
pair_style lj/cut 2.5
pair_coeff 1 1 1.0 1.0 2.5
neighbor 0.3 bin
neigh_modify every 20 delay 0 check no
fix 1 all nve
thermo 10
run 100`,
fix lang all langevin 1.0 1.0 1.0 3216
fix 2d all enforce2d
thermo 1000
run 3000
# quench: drop the thermostat target below the condensation point
fix lang all langevin 0.4 0.4 1.0 3216
run 20000`,
},
{
name: "LJ Melt (KOKKOS, multithreaded)",
kokkos: true,
every: 200,
script: `# Runs on the KOKKOS (pthreads) build — pick a thread count in the
# dropdown above and compare the performance summary at the end.
# Styles get the /kk suffix automatically (-sf kk).
name: "LJ Cluster (large, 1M atoms)",
every: 10,
script: `# ~1,000,188 atoms (63^3 fcc cells x 4) — runs in a Web Worker so
# the page stays responsive. Expect setup + 100 steps to take a few
# minutes and several hundred MB of memory.
units lj
timestep 0.005
atom_style atomic
lattice fcc 0.8442
region box block 0 12 0 12 0 12
region box block 0 63 0 63 0 63
create_box 1 box
create_atoms 1 box
mass 1 1.0
Expand All @@ -96,8 +131,8 @@ pair_coeff 1 1 1.0 1.0 2.5
neighbor 0.3 bin
neigh_modify every 20 delay 0 check no
fix 1 all nve
thermo 500
run 10000`,
thermo 10
run 100`,
},
{
name: "Energy Minimization",
Expand Down