LAMMPS from scratch
Understand how LAMMPS works: run it in your browser, read its engine, change its code and check every change with a hand calculation.
S
Start here
Run LAMMPS in your browser, change one line, and check the result by hand.
0
A zero-programming primer
Just enough terminal, building and reading C++ to follow the rest.
A
Input handling
How LAMMPS turns a text file into actions, checked line by line.
B
How LAMMPS is organized
One small core plus hundreds of interchangeable styles.
- A tour of the source tree
- The conductor: the LAMMPS class
- Styles: the plug-in design
- The families of styles
- Packages
- How atoms are stored
- Running in parallel
- Finding your way in the code
C
The main engine: one timestep
The loop every LAMMPS run goes through, traced for two atoms by hand.
- From run 250 to the loop
- The loop, line by line
- Hooks and fix masks
- One timestep for two atoms, by hand
- Energy and virial bookkeeping
- Setup, multiple runs and rerun
- The other loops: RESPA and minimize
- The timing table
D
Modules and their algorithms
Each module read in the code, then reproduced by hand.
- Units and constants
- Domain and periodic boundaries
- Neighbour lists
- Communication between processors
- Pair style lj/cut
- Mixing rules and special bonds
- Coulomb and Ewald
- Bonds, angles and dihedrals
- The integrator: fix nve
- Thermostats
- Barostats
- Thermo output: temperature and pressure
- Constraints: SHAKE and RATTLE
- Minimization
- Computes for analysis
- Time averaging and correlations
- Groups, regions and variables
- Dumps, restarts and output
E
Change the code, check by hand
Predict, change, rebuild, run, compare to the digit.
- Hello from inside the engine
- Clone a pair style
- Change the formula (Mie potential)
- Add a parameter (soft core)
- A broken integrator on purpose
- Write a thermostat
- Write a compute
- Watch the neighbour list decide
- A new bond style
- Same style, no rebuild: a plugin
- Test it like the developers
- Check from Python
F
Useful extras
Not needed to run simulations, but worth knowing.
- Python and the library interface
- Plugins
- Unit tests and regression
- Debugging
- Performance
- Restarts and system surgery
- Rerun and post-processing
- Multi-replica methods
- Machine-learning potentials
- Reproducibility
- Tools and contributing