minimage
Minimum-image convention for a periodic parallelepiped.
linkcell walks k-nearest neighbours. vesin builds cutoff pair lists.
Both need the same wrap: fold through H, pick one image, never the
self image. This crate is that wrap. Cell holds the 3x3 lattice and
a dump-cell origin. Constructors accept LAMMPS bounds plus xy, xz, yz tilts, a CON lattice or length-angle box, an ASE-style 3x3 cell,
and a vesin box.
It is a LODE library. The Rust crate is the implementation. The C ABI
(mi_*) is the hourglass waist, the same shape as
linkcell and
readcon-core. C++ is a
RAII header over that ABI.
Docs (orgmode first, HTML export): lode-org.github.io/minimage. Org catalog: lode-org.github.io.
Install
Rust:
cargo add minimage
C and C++ consumers take the staticlib (--features capi, on by
default) plus include/minimage.h or include/minimage.hpp. Meson,
CMake, and pkg-config all install that archive and those headers.
pip install minimage
=
assert < 1e-12
Meson
meson setup build
meson compile -C build
meson install -C build
As a wrap, Meson exposes minimage_dep:
[wrap-git]
url = https://github.com/lode-org/minimage.git
revision = v0.1.3
depth = 1
[provide]
minimage = minimage_dep
minimage_dep = dependency('minimage', fallback: ['minimage', 'minimage_dep'])
CMake
cmake -B build -DCMAKE_INSTALL_PREFIX=$PREFIX
cmake --build build
cmake --install build
find_package(minimage 0.1 REQUIRED)
target_link_libraries(app PRIVATE minimage::minimage)
pkg-config
pkg-config --cflags --libs minimage
Rust
use ;
let sim = ortho?;
let sheared = from_lammps_bounds?;
let left = ;
let right = ;
assert!;
let qs = ;
let mut out = ;
dist2_many?;
let pairs = ;
let mut kept = Vecnew;
reduce_pairs?;
assert_eq!;
Cell::from_ase, Cell::from_con, Cell::from_con_box, and
Cell::from_vesin take the same row-major 3x3 lattice. Displacement
is the wrapped vector from p to q.
License
MIT. See LICENSE.