Skip to main content

cemd

PyPI Tests Documentation Python 3.11+ Licence: GPL-3.0-only

cemd builds atomistic models of cements, clays, carbonates and oxide glasses, and writes them out ready for LAMMPS.

It covers the whole path from a crystal structure to a simulation input: assembling the solid, cutting surfaces and pores, filling them with a solution, assigning atom types from force-field rules, resolving the parameters, and analyzing the result.

Whether the system is a clay interlayer, a calcite surface in brine, an oxide glass or a cement hydrate, the pieces are the same: a solid, a solution, a set of atom types and a LAMMPS data file at the end.

What it does

Build. Every builder is a blueprint you configure once and reuse:

  • CSHBuilder — C-S-H and C-A-S-H from tobermorite, at a target Ca/Si and H2O/Si ratio

  • AFBuilder — AFm/AFt phases

  • SurfaceBuilder — surface slabs from Miller indices, ranked by how many bonds each termination breaks

  • SolutionBuilder — electrolytes from molarities or explicit counts, packed to a target density

  • GlassBuilder — amorphous oxide melts

  • Splitter — cut a system open along an axis and fill the gap with a solution

Type and parameterize. set_topology() applies force-field typing rules (ClayFF, CSHFF and your own), set_ff_from_database() resolves the parameters. The bundled database holds ClayFF, CSHFF2014, IFF (CHARMM and CVFF flavours), GROMOS 54A7/ATB, Raiteri 2015, Guillot & Sator 2007, and the usual water models (SPC, SPC/E, SPC/Fw, TIP3P, TIP4P-2005, TIP4P-EW).

Analyse. Silicate network statistics (Ca/Si, H2O/Si, Qn distribution, mean chain length), radial distribution functions, density and diffusion profiles, mean-squared displacement, electrostatic potential.

Read and write. Reads LAMMPS data files (.data, .lmp), PDB, CIF, moltemplate (.lt) and SDF; writes LAMMPS data files and PDB. It also fetches structures directly from PubChem and the COD, builds them from SMILES, and converts to and from MDAnalysis and pymatgen objects.

Inspect. An optional PySide6/PyVista interface for viewing and editing structures interactively.

Two examples

A mineral surface in contact with an electrolyte – the archetypal interface problem:

from cemd import AtomicSystem
from cemd.build import SolutionBuilder, SurfaceBuilder

calcite = AtomicSystem.from_file("calcite.cif")
slabs, *_ = SurfaceBuilder(calcite).build((1, 0, 4), min_slab_size=12.0)

brine = SolutionBuilder(density=1.0, molarities={"Na": 0.5, "Cl": 0.5})
system = slabs[0].add_liquid_layer(brine, thickness=20.0)

system.set_topology("clayff")
system.write("calcite_brine.data")

And a cement hydrate, where cemd does what nothing else does – build the C-S-H at a target Ca/Si, then measure where it can be cut before opening a pore, since under CSHFF the silicate framework carries no explicit bond to guide you:

from cemd.build import CSHBuilder, SolutionBuilder, Splitter

csh = CSHBuilder(cs_ratio=1.5, ws_ratio=1.0).build(model="tob11a_merlino.cif")
csh.set_types_from_elements()
csh.set_topology("cshff")

pore = SolutionBuilder(density=1.0, counts={"Na": 8, "HO": 8})
system = Splitter(csh, coordinate=17.0, axis="z", gap_size=25.0) \
    .add_solution(pore, padding=2.0) \
    .split()

system.write("csh_nanopore.data")

Installation

Python 3.11 or later. Install into an environment of its own: cemd pulls in pymatgen, MDAnalysis and RDKit, which pin versions of their own, and keeping them apart from your other work avoids resolving one project’s constraints against another’s.

conda create -n cemd python=3.11
conda activate cemd

pip install cemd

A plain virtual environment works just as well if you do not use conda:

python -m venv cemd
source cemd/bin/activate              # cemd\Scripts\activate on Windows

pip install cemd

For the graphical interface, which then opens with cemd-gui:

pip install "cemd[gui]"
cemd-gui

To work on cemd itself, clone it and install editable, which points the environment at your working copy rather than copying the code:

git clone https://github.com/cemd-dev/cemd.git
cd cemd
pip install -e ".[dev,gui,docs]"

The installation guide covers conda environments and the prerequisites in more detail.

Everything comes with it, including Packmol – every builder that packs molecules into a volume shells out to that binary, and pip puts it in the environment alongside the Python dependencies (MDAnalysis, pymatgen, RDKit, NumPy, SciPy, pandas, matplotlib, Dask). Should no wheel match your platform, install Packmol yourself and put it on your $PATH.

Documentation

https://cemd-dev.github.io/cemd/

The user guide covers building, analysis and the force-field database, and four worked tutorials go from a calcite surface to a C-S-H nanopore filled with an alkaline pore solution. Every output shown in them was captured from a real run.

To build the documentation locally:

sphinx-build -b html docs docs/_build/html

Tests

pytest

The suite runs against the real bundled data and force fields rather than mocks. Tests that shell out to Packmol are skipped when it is not installed.

Citing

See CITATION.cff.

License

GPL-3.0-only. See LICENCE.

Metadata

Release files for cemd 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cemd 0.1.0
File Size Uploaded
cemd-0.1.0.tar.gz 411.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cemd 0.1.0
File Interpreter ABI Platform
cemd-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 912.0 kB

Release files / cemd-0.1.0.tar.gz

Download URL cemd-0.1.0.tar.gz
Size 411.8 kB
Tags Source
SHA-256 checksum
How to use checksums
04b13175d9f91c6228c17b16d69c8a5b44a95ea36cf97c4bbdb3e7766312a71e
BLAKE2b-256 checksum
How to use checksums
92a91849a9fc09fc1e546db9c66292b15763bed23d5faa740b9509fa4385fdd4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.

Transparency log

Release files / cemd-0.1.0-py3-none-any.whl

Download URL cemd-0.1.0-py3-none-any.whl
Size 500.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d540c8627453bcb2a992ce4ded9765e7826c22cddbeed45fb367043fd921f127
BLAKE2b-256 checksum
How to use checksums
1fc32d6cf57baa26eef9e69b39240b91486a10db8f15cab7957151a7a26cd931
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page