module Chem::JDFTx

Defined in:

chem/formats/jdftx.cr

Class Method Summary

Class Method Detail

def self.read(io : IO, guess_bonds : Bool = false, guess_names : Bool = false) : Structure #

Reads the structure from io.

If io is a file, a sibling .lattice file is read for the unit cell.


[View source]
def self.read(path : Path | String, guess_bonds : Bool = false, guess_names : Bool = false) : Structure #

Reads the structure from path.

If path is a file, a sibling .lattice file is read for the unit cell.


[View source]
def self.write(io : IO, structure : Structure, fractional : Bool = false, wrap : Bool = false, single_file : Bool = true) : Nil #

Writes a structure to io.

Atom positions are written in fractional coordinates if fractional is true, Cartesian otherwise. Additionally, atom positions may be wrapped into the unit cell during writing if wrap is true (original positions are not modified). Raises Spatial::NotPeriodicError if fractional is true and the structure is not periodic.

Unit cell and atoms are written to the same file if single_file is true, otherwise the lattice is written to a sibling .lattice file.


[View source]
def self.write(path : Path | String, structure : Structure, fractional : Bool = false, wrap : Bool = false, single_file : Bool = true) : Nil #

Writes a structure to path.

Atom positions are written in fractional coordinates if fractional is true, Cartesian otherwise. Additionally, atom positions may be wrapped into the unit cell during writing if wrap is true (original positions are not modified). Raises Spatial::NotPeriodicError if fractional is true and the structure is not periodic.

Unit cell and atoms are written to the same file if single_file is true, otherwise the lattice is written to a sibling .lattice file.


[View source]