# Which output file from CASTEP after geometry optimization is like with the CONTCAR from VASP?

I am trying to use the atomic positions in geometry optimized crystal structure to get the radial distribution function.

I know that some codes can read the positions of the atoms from the CONTCAR file (VASP), but I cannot get a similar file from CASTEP.

Can someone that works with CASTEP explain to me how to get the positions of the atoms after geometry optimization from CASTEP?

Thanks

The main structural output of a geometry optimization in Castep is in the file with the ".geom" extension. That file contains blocks with lattice parameters and atomic positions at each step of a geometry optimization, and the final structure would be the last block in the file. More details about this file can be found in the Castep manual here.

• Thank you so much, ProfM. Jul 8 at 9:04

As mentioned by @ProfM, you can use the last step of the .geom file.

Additionally, a particularly helpful parameter that I use is write_cell_structure. If set to true in your .param file, then CASTEP will output a formatted cell file for you with the optimised geometry. This will include the parameters used in the calculation, e.g pseudopotential string, kpoint grid, symmetries, etc.

In your .param file, add, write_cell_structure : true. The file will be named XX-out.cell with XX being your calculation prefix.

Others have explained how to get the information from CASTEP, and you could probably also use ASE to convert the files for you, but do you really need to generate a CONTCAR? Most tools I know accept input from many DFT codes directly, including CASTEP; for example MDANSE.

Even CASTEP's old MDTEP tool will give you an RDF, if that's all you want, although its user interface is definitely showing its age...