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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Reasonable values of the threshhold and spring constant for some common bonds are below.<br />

Bond threshhold_length springconstant<br />

O-H 1.40 5<br />

C-O 1.79 5<br />

C-H 1.59 7<br />

C=O 1.58 10<br />

Pt sublimation 0.94 2<br />

Cu sublimation 0.97 2<br />

7.15.8 The FixInternals class<br />

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

This class allows to fix an arbitrary number of bond lengths, angles and dihedral angles. The defined constraints are<br />

satisfied self consistently. To define the constraints one needs to specify the atoms object on which the constraint<br />

works (needed for atomic masses), a list of bond, angle and dihedral constraints. Those constraint definitions<br />

are always list objects containing the value to be set and a list of atomic indices. The epsilon value specifies the<br />

accuracy to which the constraints are fullfilled.<br />

class constraints.FixInternals(atoms, bonds=[bond1, bond2], angles=[angle1], dihedrals=[dihedral1,<br />

dihedral2], epsilon=1.e-7)<br />

Example of use:<br />

>>> bond1 = [1.20, [1, 2]]<br />

>>> angle_indices1 = [2, 3, 4]<br />

>>> dihedral_indices1 = [2, 3, 4, 5]<br />

>>> angle1 = [atoms.get_angle(angle_indices1), angle_indices1]<br />

>>> dihedral1 = [atoms.get_dihedral(dihedral_indices1), \<br />

dihedral_indices1]<br />

>>> c = FixInternals(atoms, bonds=[bonds1], angles=[angles1], \<br />

dihedrals=[dihedral1])<br />

>>> atoms.set_onstraint(c)<br />

This example defines a bond an angle and a dihedral angle constraint to be fixed at the same time.<br />

7.15.9 Combining constraints<br />

It is possible to supply several constraints on an atoms object. For example one may wish to keep the distance<br />

between two nitrogen atoms fixed while relaxing it on a fixed ruthenium surface:<br />

>>> pos = [[0.00000, 0.00000, 9.17625],<br />

... [0.00000, 0.00000, 10.27625],<br />

... [1.37715, 0.79510, 5.00000],<br />

... [0.00000, 3.18039, 5.00000],<br />

... [0.00000, 0.00000, 7.17625],<br />

... [1.37715, 2.38529, 7.17625]]<br />

>>> unitcell = [5.5086, 4.7706, 15.27625]<br />

>>> atoms = Atoms(positions=pos,<br />

... symbols=’N2Ru4’,<br />

... cell=unitcell,<br />

... pbc=[True,True,False])<br />

>>> fa = FixAtoms(mask=[a.symbol == ’Ru’ for a in atoms])<br />

>>> fb = FixBondLength(0, 1)<br />

>>> atoms.set_constraint([fa, fb])<br />

When applying more than one constraint they are passed as a list in the set_constraint() method, and they<br />

will be applied one after the other.<br />

Important: If wanting to fix the length of more than one bond in the simulation, do not supply a list of<br />

FixBondLength instances; instead, use a single instance of FixBondLengths.<br />

7.15. Constraints 141

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

Saved successfully!

Ooh no, something went wrong!