Cell Commands

Cell Commands

Create, remove, modify, pack, and replicate the model's unit cell.

adjustcell

Syntax:

void adjustcell(parameter,  
 value); 
string  parameter;
double  value;

Adjust a single unit cell parameter (one of 'a', 'b', 'c', 'alpha', 'beta', 'gamma', or one of the matrix elements 'ax', 'ay', 'az', ..., 'cz') by the given 'value'. This does not set the specified 'parameter' to the given 'value'; instead the supplied 'value' is added to the existing value of the parameter.

For example:

adjustcell("alpha",5.0);

increases the cell angle 'alpha' by 5 degrees.

adjustcell("c",-10.0);

decreases the cell length 'c' by 10 Å.

cell

Syntax:

void cell(a,  
 b,  
 c,  
 alpha,  
 beta,  
 gamma); 
double  a;
double  b;
double  c;
double  alpha;
double  beta;
double  gamma;

Set cell lengths and angles of current model. This command will modify an existing cell or add a new cell to a model currently without a unit cell specification.

For example:

cell(20.0, 10.0, 10.0, 90.0, 90.0, 90.0);

sets the model's cell to be orthorhombic with side lengths 20x10x10 Å.

cellaxes

Syntax:

void cellaxes(ax,  
 ay,  
 az,  
 bx,  
 by,  
 bz,  
 cx,  
 cy,  
 cz); 
double  ax;
double  ay;
double  az;
double  bx;
double  by;
double  bz;
double  cx;
double  cy;
double  cz;

Set cell axes of current model. This command will modify an existing cell or add a new cell to a model currently without a unit cell specification.

For example:

cellaxes(15, 0, 0, 0, 15, 0, 0, 0, 15);

sets the model's cell to be cubic with side length 15 Å.

fold

Syntax:

void fold(); 

Fold all atoms so they are within the boundaries of the unit cell.

For example:

fold();

foldmolecules

Syntax:

void foldmolecules(); 

Fold all pattern molecules so the are unbroken across cell boundaries.

For example:

foldmolecules();

millercut

Syntax:

void millercut(h,  
 k,  
 l,  
 inside = FALSE); 
int  h;
int  k;
int  l;
bool  inside = FALSE;

Remove all atoms from the unit cell that lay 'outside' the specified Miller plane (and its mirror, if it has one). If the final parameter is given as TRUE, then atoms 'inside' the bounding Miller plane(s) are selected.

For example:

millercut(1,2,1,TRUE);

removes all atoms inside the two enclosing (121) planes.

pack

Syntax:

void pack(); 

Perform spacegroup packing on the current model.

For example:

pack();

printcell

Syntax:

void printcell(); 

Prints the cell parameters of the current model.

For example:

printcell();

replicate

Syntax:

void replicate(negx,  
 negy,  
 negz,  
 posx,  
 posy,  
 posz); 
double  negx;
double  negy;
double  negz;
double  posx;
double  posy;
double  posz;

Create a supercell of the current model, creating copies of the cell in each of the three cell axis directions. The number of cells to replicate in each positive and negative direction are specified as 'additional' cells beyond the original. So:

replicate(0, 0, 0, 0, 0, 0);

will do nothing at all to the model, while:

	
replicate(-5, 0, 0, 5, 0, 0);

will result in a supercell that consists of eleven copies of the original cell along the 'x' axis direction. Similarly,

replicate(0, 0, 0, 4, 4, 4);
replicate(-2, -2, -2, 2, 2, 2);

will both create a 5x5x5 arrangement of the original cell.

removecell

Syntax:

void removecell(); 

Clears any cell description (removes periodic boundary conditions) from the current model.

For example:

removecell();

scale

Syntax:

void scale(x,  
 y,  
 z,  
 calcenergy = FALSE); 
double  x;
double  y;
double  z;
bool  calcenergy = FALSE;

Scale unit cell and its constituent atoms by the scale factors x, y, and z. The optional calcenergy parameter calculates the energy difference resulting from the scaling operation.

For example:

scale(1.0, 2.0, 1.0);

doubles the length of the y-axis of the system. x- and z-axes remain unchanged.

scalemolecules

Syntax:

void scalemolecules(x,  
 y,  
 z,  
 calcenergy = FALSE); 
double  x;
double  y;
double  z;
bool  calcenergy = FALSE;

Scale unit cell and centres-of-geometry of molecules within it by the scale factors x, y, and z. Within individual molecules the relative distances between atoms stays the same, but the centres-of-geometry of other molecules do not. The optional calcenergy parameter calculates the energy difference resulting from the scaling operation.

For example:

scalemolecules(0.5, 0.5, 0.5);

halves the lengths of all axes, scaling the positions of the molecules to reflect the new size.

setcell

Syntax:

void setcell(parameter,  
 value); 
string  parameter;
double  value;

Set a single unit cell parameter one of 'a'/, 'b', 'c', 'alpha', 'beta', 'gamma', or one of the matrix elements 'ax', 'ay', 'az', ..., 'cz') to the given value.

For example:

setcell("beta", 101.0);

sets the cell angle 'beta' to 101 degrees.

setcell("a", 15.5);

sets the cell length 'a' to 15.5 Å.

spacegroup

Syntax:

void spacegroup(sg); 
int|string  sg;

Sets the spacegroup of the model, used for crystal packing.

For example:

spacegroup(12);

sets the model spacegroup to be C2/m (number 12).

spacegroup("P1/m");

sets the model spacegroup to P1/m.