A Python library to parse MD trajectories from LAMMPS and ASE and measure the contact angle through different methods
Project description
wetting-angle-kit
wetting-angle-kit provides modular tools to parse MD trajectories (LAMMPS dump, XYZ, ASE) and compute droplet contact angles using two complementary approaches:
- Slicing Method (per-frame circle fit) – robust against transient shape changes.
- Binning Density Method – averages frames into a density field for a single representative angle.
The documentation is available here, you can find examples and tutorials.
Installation
Prerequisites
Before installing wetting-angle-kit, ensure you have the following prerequisites:
- Python 3.10 or higher: Make sure you have Python 3.10 or higher installed on your system.
- Conda: Ensure you have Conda installed. If not, you can install it from here.
Core (only to analyse simple xyz trajectories):
pip install wetting-angle-kit
With OVITO:
pip install wetting-angle-kit[ovito]
With ASE:
pip install wetting-angle-kit[ase]
All optional:
pip install wetting-angle-kit[all]
Install OVITO
OVITO must be installed first in the conda environment and using the following Conda command:
conda install --strict-channel-priority -c https://conda.ovito.org -c conda-forge ovito=3.11.3
Quick Start
from wetting_angle_kit.analysis import (
BinningTrajectoryAnalyzer,
SlicingTrajectoryAnalyzer,
)
from wetting_angle_kit.parsers import XYZParser, XYZWaterFinder
trajectory_file = "trajectory.xyz"
# Identify water oxygen atoms by neighbor count. ``particle_type_wall``
# lists the symbols of the substrate atoms so they are excluded.
finder = XYZWaterFinder(trajectory_file, particle_type_wall=["C"])
oxygen_ids = finder.get_water_oxygen_indices(frame_index=0)
parser = XYZParser(trajectory_file)
slicing = SlicingTrajectoryAnalyzer(
parser,
atom_indices=oxygen_ids,
droplet_geometry="spherical",
delta_gamma=5,
)
results = slicing.analyze(frame_range=range(0, 50))
print(results.mean_angle, results.std_angle)
binning = BinningTrajectoryAnalyzer(
parser,
atom_indices=oxygen_ids,
droplet_geometry="spherical",
)
results_binning = binning.analyze(frame_range=range(0, 200))
print(results_binning.mean_angle, results_binning.std_angle)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wetting_angle_kit-1.0.3.tar.gz.
File metadata
- Download URL: wetting_angle_kit-1.0.3.tar.gz
- Upload date:
- Size: 51.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
364ffc75bb2a65b3227cfcd90c27e98f8b883a1d2f4ae9a7db0cea40383b2556
|
|
| MD5 |
69ea8be138a168a54347ca7273182dd8
|
|
| BLAKE2b-256 |
848ac35f765a75cf7a7ce21fdc4252aff14a8ef1cc31d0fe81eaaa9fac14afbf
|
File details
Details for the file wetting_angle_kit-1.0.3-py3-none-any.whl.
File metadata
- Download URL: wetting_angle_kit-1.0.3-py3-none-any.whl
- Upload date:
- Size: 55.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
becb6dc74a8f7075da58717994136365a2a0d588f6f0698febd18ff158e7fd0b
|
|
| MD5 |
04ac4ec9719613bc13de65864ef12a2d
|
|
| BLAKE2b-256 |
38804414b6fa5738efd4907fdc9c0c78648e26be722959cea80e9fc0810a897c
|