LAMMPS input script for a carbon atoms, initially in the liquid state (high temperature). The temperature of the system is decreased progressively until hexagonal rings form. The final state is an amorphous nanoporous structure of carbon.
This video has been made with this script.