The code is available as a package on PyPI.
pip install smc-lammpsFrom Source Using uv (recommended)
git clone https://github.com/LucasDooms/SMC_LAMMPS.git
cd SMC_LAMMPS
uv sync --no-dev
# alternatively, to include optional dependencies
uv sync --all-groups
source .venv/bin/activateor use uv run <command> without activating the environment.
git clone https://github.com/LucasDooms/SMC_LAMMPS.git
cd SMC_LAMMPS
python3 -m venv .venv
source .venv/bin/activate
# get exact versions (recommended)
pip install -r requirements.txt
# or, install from pyproject.toml file
pip install -e .You will need a LAMMPS executable with the MOLECULE, EXTRA-MOLECULE, and RIGID packages.
See https://docs.lammps.org/Install.html for more information.
Simple example:
git clone https://github.com/lammps/lammps --depth=1000 mylammps
cd mylammps
git checkout stable # or release for a more recent version
mkdir build && cd build
cmake -D CMAKE_INSTALL_PREFIX="$HOME/lammps" -D PKG_MOLECULE=yes -D PKG_EXTRA-MOLECULE=yes -D PKG_RIGID=yes ../cmake
cmake --build . -j8
make
make install
export PATH="$HOME/lammps/bin:$PATH"To use the src/smc_lammps/post_process/visualize.py script, you will need VMD,
see https://www.ks.uiuc.edu/Development/Download/download.cgi?PackageName=VMD.
You can also use docker to run the code. First build the image
docker build -t smc-lammps .Now you can run an interactive session using
docker run -it -v .:/data smc-lammpsOr, to run directly (see Usage)
docker run -v .:/data smc-lammps smc-lammps ...Note: the docker image does not include VMD.
- Create a directory for your simulation using
smc-lammps mysim. - Define all parameters in
mysim/parameters.py(seesrc/smc_lammps/generate/default_parameters.pyfor all options). - Run
smc-lammps [flags] mysim, providing the directory of the parameters file. Use the-gflag to generate the required parameterfile and datafile.
smc-lammps mysim -grto generate and run.smc-lammps mysim -grpvto generate, run, post-process, and visualize.smc-lammps mysim -grvnto generate, run, and visualize while ignoring errors.smc-lammps mysim -vto visualize.smc-lammps mysim -vfto visualize a perspective following the SMC.smc-lammps mysim -cto continue a run from a restart file.
Show help with smc-lammps --help.
To get shell completion when using smc-lammps on the command-line run the following:
- For bash or zsh, use
eval "$(register-python-argcomplete smc-lammps)" - For fish, use
register-python-argcomplete --shell fish smc-lammps | source
Enable dev dependencies
uv sync --devRun all tests using
pytestBuild the documentation using
make -C docs html(or sphinx-build -b html docs/source docs/build/html)
Now open docs/build/html/index.html in a browser or use python -m http.server -d docs/build/html and browse to http://localhost:8000.
To view new changes made to the documentation automatically, you can use sphinx-autobuild
sphinx-autobuild -b html --watch src/smc_lammps docs/source docs/build/htmlRun the doctests using
make -C docs doctestOriginal code by Stefanos Nomidis (https://github.com/sknomidis/SMC_LAMMPS).
Modifications by Arwin Goossens.
All commits in this repository by Lucas Dooms.
Released under MIT license
