## Overview

This page gives a description of input section that controls and modifies how a cell relaxation is done. The code does a fully general cell relaxation via stress-elimination, enforcing all user-specified symmetry, for 1D, 2D, and bulk 3D systems. The cell relaxation input section is optional; all the user need do is add a “do cell” instruction in the command options and the code will automatically attempt to relax the cell shape to give a cell with a zero stress tensor.

The default unit for the cell relaxation section is GPa for bulk 3D, 10^{-7} N/m for 1D, 10^{+2} N/m^{2} for 2D.

Current requirements for use of cell optimization (as of version 2.65):

- atomic coordinates must be in LATTICE units
- no scaling functions are allowed in the input

## Input options

The cell parameter input section can appear anywhere in the “run phase” section of the input file, begins with a “cell parameter” keyword and ends with a “end cell relaxation” keyword.

The following are the common input keywords in this section. All the keywords are optional, and can appear in any order within this section. The keywords must be left-justified, but all data input is free-format.

**cell optimization data**- begin cell opt input section- ...
**ucsteps**- number of cell steps*n_step_uc***uchistory**- max cell steps to include in blending history*n_hist_uc***uc_convergence**- max stress (GPa) convergence criterion*stress_conv*<!-- Still in code, but made redundant by "constraint**isotropic**- scaled isotropic volume optimization only (new to 2.62) -->**constraint**- specify*type of constraint*on cell relaxation (2.65)*ucconstraint*where uconstraint=[isotropic|vfixed|xrelax|xfixed|yrelax|yfixed|zrelax|zfixed]**pressure**- external pressure (GPa)*P***uniaxial_pressure**- external*x,y,z*axial pressures*P_x P_y P_z***stress**- external stress (ndim X ndim symmetric tensor)*s(1,1) s(2,1) s(3,1)*

s(1,2) s(2,2) s(3,2)

s(1,3) s(2,3) s(3,3)**ucmethod**- method for stress elimination*method_uc*(BROYDEN or STEEPEST)**str_broyden**- cutoff for switch to broyden (GPa)*stress_broy***bulk_modulus**- (in GPa; can improve initial cell update)*B*- ...
**end cell optimization**- end of cell opt input section

## Details

**Important**: The external stress is input as a 2×2 matrix for a 2D (slab) problem and 1×1 in a 1D-chain problem.- The default method for cell relaxation is a combination method: starts with STEEPEST (descent) and switches to BROYDEN when the maximum stress goes below
*stress_broy*. - Choose, at most, one of (pressure, uniaxial, stress) – all modify the same external stress tensor, and, used in combination, will do so unpredictably.

## Types of cell relaxation constraints

The code has some simple optimizations available. The isotropic constraint is the most immediate useful—one can do a c/a study for hcp, for example. The volume-fixed shape optimization is a little crude, and therefore might not be perfectly clean. The axial constraints are straightforward for orthorrhambic cells, but will be less useful otherwise.

- isotropic – does a shape conserving volume optimization of the cell.
- vfixed – does a volume-conserving cell-shape optimization.
- Ufixed – for U=(x,y, or z), does a cell optimization conserving the U axial dimension
- Urelax – for U=(x,y, or z), does a cell optimization relaxing the U axial dimension, but keeps the other axial dimensions fixed

## Troubleshooting

- The cell shape and stress are converging very slowly.
- The calculation may be making small steepest descent steps. The best option depends on the situation. Giving a smaller
**bulk_modulus**(default ~100) will expand the first cell update step size (and subsequent step sizes). If the stress is*decreasing,*then the calculation is likely in a basin (and converging) and stuck doing small steepest descent steps. If the stress is monotonically decreasing from the beginning, select BROYDEN as the**ucmethod**, or modify the stress (using**str_broyden**) at which the default combination method switches from steepest descent to Broyden. Note: with new cell optimizer (2.65), the cell relaxation should be better behaved.

- The calculation may be making small steepest descent steps. The best option depends on the situation. Giving a smaller
- The cell “blew up” on the first cell update step.I
- ncrease the
**bulk_modulus**input (default ~100) to reduce the step size on the first cell update.

- ncrease the
- Later (after the first step) the cell “blew up”.
- If you are not in a potential well, the second derivative matrix might be ill-behaved and Broyden will fail. Try using STEEPEST as the minimization method (starting with the last “good” cell shape).

- The minimization stalls and the cell will not converge further.
- Numerical noise – the convergence criterion might be smaller than the inaccuracy in the computed stress. Tighten force convergence criterion, and/or use a denser grid (to get more accurate stress).