List of functions¶
-
class
sw
¶
-
sw.
genlattice
(obj, 'option1', value1, 'option2', value2...)¶ Generates crystal lattice from given parameters.
Input
- obj
- sw class object.
Options
- angled
- \(\alpha, \beta, \gamma\) angles in degree, row vector with three elements.
- angle
- \(\alpha, \beta, \gamma\) angles in radian, row vector with three elements.
- lat_const
- \(a, b, c\) lattice parameters, row vector with three elements.
- sym
- Space group index, or space group name (string).
Description
Alternatively the lattice parameters can be given directly when the sw object is created using: sw(inpStr), where struct contains the fields with initial parameters, e.g.:
inpStr.lattice.lat_const = [3 3 4];
The sym option points to the appropriate line in the symmetry.dat file, where every line defines a space group by its generators. The first 230 lines contains all crystallographic space groups with standard setting from the International Tables of Crystallography. Additional lines can be added to the symmetry.dat file using the
sw_addsym()
function. Every line in the symmetry.dat file can be referenced by either its line index or by its label (string).If the sym option is 0, no symmetry will be used. The
gencoupling()
method will determine the equivalent bonds based on bond length.Output
The
lattice
field will be changed based on the input, the lattice constants stored directly and the optional space group string is converted to the integer type index.Example
crystal = sw; crystal.genlattice('lat_const',[3 3 4],'angled',[90 90 120],'sym','P 6') crystal.genlattice('lat_const',[3 3 4],'angled',[90 90 120],'sym',168)
The two lines are equivalent, both will create hexagonal lattice, with P 6 space group.