module
Chem::VASP::Poscar
Defined in:
chem/formats/vasp/poscar.crClass Method Summary
-
.read(io : IO, guess_bonds : Bool = false, guess_names : Bool = false) : Structure
Returns the structure from io.
-
.read(path : Path | String, guess_bonds : Bool = false, guess_names : Bool = false) : Structure
Returns the structure from path.
-
.write(io : IO, structure : Structure, order : Array(Element) | Array(String) | Nil = nil, fractional : Bool = false, wrap : Bool = false) : Nil
Writes a structure to io.
-
.write(path : Path | String, structure : Structure, order : Array(Element) | Array(String) | Nil = nil, fractional : Bool = false, wrap : Bool = false) : Nil
Writes a structure to path.
Class Method Detail
Returns the structure from io.
Direct coordinates are always converted to Cartesian coordinates and both the unit cell vectors and atom positions are scaled by the scale factor.
Returns the structure from path.
Direct coordinates are always converted to Cartesian coordinates and both the unit cell vectors and atom positions are scaled by the scale factor.
Writes a structure to io. Raises Spatial::NotPeriodicError if the structure is not periodic.
If given, order specifies the element order in the output, otherwise the order of the first occurrence of each element in the structure is used.
order can be an array of Element instances or element symbols (as strings) for convenience.
Atom positions are written in direct (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).
order = [Chem::PeriodicTable::O, Chem::PeriodicTable::Na, Chem::PeriodicTable::Cl]
Chem::VASP::Poscar.write(io, structure, order)
# or
Chem::VASP::Poscar.write(io, structure, order: %w(O Na Cl))
Writes a structure to path. Raises Spatial::NotPeriodicError if the structure is not periodic.
If given, order specifies the element order in the output, otherwise the order of the first occurrence of each element in the structure is used.
order can be an array of Element instances or element symbols (as strings) for convenience.
Atom positions are written in direct (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).
order = [Chem::PeriodicTable::O, Chem::PeriodicTable::Na, Chem::PeriodicTable::Cl]
Chem::VASP::Poscar.write(io, structure, order)
# or
Chem::VASP::Poscar.write(io, structure, order: %w(O Na Cl))