18.11.2012 Views

ASE Manual Release 3.6.1.2825 CAMd - CampOS Wiki

ASE Manual Release 3.6.1.2825 CAMd - CampOS Wiki

ASE Manual Release 3.6.1.2825 CAMd - CampOS Wiki

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>ASE</strong> <strong>Manual</strong>, <strong>Release</strong> 3.6.1.2828<br />

.keyword.clear() Can be used on any option like calc.param.keyword.clear() or<br />

calc.cell.keyword.clear() to return to the CASTEP default.<br />

.initialize() Creates all needed input in the _directory. This can then copied to and run in a place<br />

without <strong>ASE</strong> or even python.<br />

.set_pspot(’’) This automatically sets the pseudo-potential for all present species to<br />

_.usp. Make sure that _castep_pp_path is set correctly.<br />

print(calc) Prints a short summary of the calculator settings and atoms.<br />

ase.io.castep.read_seed(’path-to/seed’) Given you have a combination of<br />

seed.{param,cell,castep} this will return an atoms object with the last ionic positions in the .castep<br />

file and all other settings parsed from the .cell and .param file. If no .castep file is found the positions are<br />

taken from the .cell file. The output directory will be set to the same directory, only the label is preceded<br />

by ‘copy_of_’ to avoid overwriting.<br />

Notes/Issues:<br />

• Currently only the FixAtoms constraint is fully supported for reading and writing.<br />

• There is no support for the CASTEP unit system. Units of eV and Angstrom are used throughout. In particular<br />

when converting total energies from different calculators, one should check that the same CODATA<br />

version is used for constants and conversion factors, respectively.<br />

Example:<br />

#!/usr/bin/python<br />

"""This simple demo calculates the total energy of CO molecules<br />

using once LDA and once PBE as xc-functional. Obviously<br />

some parts in this scripts are longer than necessary, but are shown<br />

to demonstrate some more features."""<br />

import ase<br />

import ase.calculators.castep, ase.io.castep<br />

calc = ase.calculators.castep.Castep()<br />

directory = ’CASTEP_<strong>ASE</strong>_DEMO’<br />

# include interface settings in .param file<br />

calc._export_settings = True<br />

# reuse the same directory<br />

calc._directory = directory<br />

calc._rename_existing_dir = False<br />

calc._label = ’CO_LDA’<br />

# necessary for tasks with changing positions<br />

# such as GeometryOptimization or MolecularDynamics<br />

calc._set_atoms = True<br />

# Param settings<br />

calc.param.xc_functional = ’LDA’<br />

calc.param.cut_off_energy = 400<br />

# Prevent CASTEP from writing *wvfn* files<br />

calc.param.num_dump_cycles = 0<br />

# Cell settings<br />

calc.cell.kpoint_mp_grid = ’1 1 1’<br />

calc.cell.fix_com = False<br />

calc.cell.fix_all_cell = True<br />

7.14. Calculators 133

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!