Skip to contents

Function to export all information concerning a given structure to a so-called coordinates file of type *_x.dat.

Usage

write_x(filename, sdata)

Arguments

filename

A character string. Prefix of the output ASCII file to include all structural information. The file name will be "[Prefix]_x.dat".

sdata

A named list, normally obtained through the use of function read_x. The list names correspond to different object types:

  • a. Real numeric. The size of the unit cell.

  • SG. Character string. Space group symbol; either "P1" or "P-1"

  • x0. Vector of real numerics indicating the expanded atomic positions in the unit cell.

  • Z. Vector of integers indicating the expanded atomic numbers for all atoms in the unit cell.

  • B. Vector of real numerics indicating the expanded B factors for all atoms in the unit cell.

  • occ. Vector of real numerics indicating the expanded occupancies for all atoms in the unit cell.

Value

This function does not return anything, but will create an ASCII file of name *_x.dat which contains all coordinates of the atoms in the structure and other type of information.

Examples

# Create an arbitrary structure in P1
a <- 23
SG <- "P1"
x0 <- c(2,11,16,19)
Z <- c(6,6,16,8)
B <- c(13,14,5,10)
occ <- c(1,1,1,1)
wd <- tempdir()
prfx <- file.path(wd,"test")
sdata <- standardise_sdata(a,SG,x0,Z,B,occ)
write_x(prfx,sdata)