castep-cell-io
Parse, build, and format CASTEP .cell and .param input files in Rust.
Quick start
[]
= "0.3"
= "0.1"
use ;
use CellDocument;
let input = read_to_string.unwrap;
let doc: CellDocument = parse.unwrap;
// Round-trip back to text
let output = to_string_many_spaced;
println!;
Building a .cell document
use ;
use LatticeCart;
use PositionsFrac;
let doc = default
.lattice
.positions
.build
.unwrap;
Crate layout
| Module | Contents |
|---|---|
cell::lattice_param |
LatticeCart, LatticeABC |
cell::positions |
PositionsFrac, PositionsAbs |
cell::bz_sampling_kpoints |
K-point types |
cell::species |
Species mass, pot, LCAO, Hubbard U |
cell::constraints |
Ionic / cell / nonlinear constraints |
param |
All .param keyword types |
units |
Unit enums (LengthUnit, EnergyUnit, …) |
The parsing and formatting engine lives in castep-cell-fmt.
License
MIT