[scale E]

The Rietveld scale factor, can be applied to all phase types     .

[scale_pks E]…

Used for applying intensity corrections to phase peaks. The following example defines a Lorentz-Polarisation correction:

scale_pks = (1+Cos(c Deg)^2 Cos(2 Th)^2)/(Sin(Th)^2 Cos(Th));

scale_pks is used for example in the LP_Factor, Preferred_Orientation and Absorption_With_Sample_Thickness_mm_Intensity macros.


Initialises the random number generator with a seed based on the computer clock.

[site $site [x E] [y E] [z E] ]…

[occ $atom E [beq E]]…

[num_posns #] [rand_xyz !E] [inter !E #]

Defines a site where $site is a User defined string used to identify the site.

x, y, and z defines the fractional atomic coordinates, see also section 7.7.

occ and beq defines the site occupancy factor and the equivalent isotropic temperature factor beq. $atom corresponds to a valid atom symbol or isotope the data of which is contained in the file ATMSCAT.CPP for x-ray data and NEUTSCAT.CPP for neutron_data.

num_posns corresponds to the number of unique equivalent position generated from the space group; num_posns is updated on termination of refinement.

inter corresponds to the sum of all GRS interactions which are a function of the site. The value of inter can represent the site electrostatic potential depending on the type of GRS interactions defined.

Definition of a site fully occupied by aluminium:

site Al1  x 0       y 0       z 0.3521  occ Al+3 1    beq 0.3

Definition of a site occupied by two cations:

site Fe2  x 0.9283  y 0.25    z 0.9533  occ Fe+3 0.5  beq 0.25

                                        occ Al+3 0.5  beq 0.25

[sites_distance N] | [sites_angle N] | [sites_flatten N [sites_flatten_tol !E]]…

[site_to_restrain $site [ #ep [ #n1 #n2 #n3 ] ] ]…

When used in equations the name N of sites_distance and sites_angle returns the distance in Å between two sites and angle in degrees between three sites respectively. The sites are defined by site_to_restrain.In particular N can be used in penalty equations to restrain bond lengths.

N of sites_flatten returns a restraint term that decreases as the sites become coplanar; it is defined as follows:


where tol corresponds to sites_flatten_tol, n corresponds to the number of sites defined with the site_to_restrain keyword, b are Cartesian unit length vectors between the sites and the geometric centre of the sites.

#eq, #n1, #n2 and #n3 correspond to the site equivalent position and fractional offsets to add to the sites. This is useful if the structure is already known and constraints are required, for example, in the bond length output (see append_bond_lengths):

Zr1:0  O1:20  0  0 -1  2.08772

       O1:7   0 -1  0  2.08772  89.658

       O1:10  0  0 -1  2.08772  90.342   90.342

       O1:15 -1  0  0  2.08772  180.000  89.658   89.658

       O1:18 -1  0  0  2.08772  90.342   89.658   180.000 90.342    


P1:0   O1:4   0  0  0  1.52473

       O1:8   0  0  0  1.52473  112.923

       O1:0   0  0  0  1.52473  112.923  112.923

       O2:0   0  0  0  1.59001  105.749  105.749  105.749

Example constraints using macros could look like the following:

Angle_Restrain(O1 P1 O1 8, 112, 112.92311, 0, 0.001)

Angle_Restrain(O1 18 -1 0 0 Zr1 O1 10 0 0 -1, 89, 89.65750, 0, 0.001)

Distance_Restrain(Zr1 O1 20 0 0 -1, 2.08, 2.08772, 0, 1)

BENZENE.INP demonstrates the use of the restraint macros Distance_Restrain, Angle_Restrain and Flatten. OpenGL viewing is recommended. Note, for more than 6 sites then sites_flatten becomes computationally expensive.

[sites_geometry $Name]…

[site_to_restrain $site [ #ep [ #n1 #n2 #n3 ] ] ]…

sites_geometry defines a grouping of up to  four sites; $Name is the name given to ths grouping. The sites that are part of the group is defined using site_to_restrain, for example:

sites_geometry some_name

load site_to_restrain { C1 C2 C3 C4 }

Three functions, Sites_Geometry_Distance($Name), Sites_Geometry_Angle($Name) and Sites_Geometry_Dihedral_Angle($Name) can be used in equations to obtain the distance between sites C1 and C2, the angle between C1-C2-C3 and the dihedral angle formed between the planes C1-C2-C3 and C2-C3-C4. The convention used are the same as for z-matrices, see  example SITES_GEOMETRY_1.INP:

If $Name contains only two sites then only Sites_Geometry_Distance($Name) can be used. Three sites defined additionally allows the use of Sites_Geometry_Angle($Name) and four sites defined additionally allows the use of Sites_Geometry_Dihedral_Angle($Name).

Examples SITES_GEOMETRY_1.INP and SITES_GEOMETRY_2.INP demonstartes the use of sites_geometry.

[siv_s1_s2 # #]

Defines the S1 and S2 integration limits for the spherical interaction volume of the GRS series.

[smooth #num_pts_left_right]

Performs a Savitzky-Golay smoothing on the observed data. The smoothing encompasses (2 * #num_pts_left_right + 1) points.

[spherical_harmonics_hkl $name]…

[sh_Cij_prm $Yij E]…

[sh_alpha !E]

[sh_order #]

Defines a hkl dependent symmetrized spherical harmonics series (see section 7.9.2). $name defines the name given to the series and when used in equations it returns the value of the spherical harmonics series.

sh_Cij_prm is the spherical harmonics coefficients, which can be defined by the User, or, alternatively if there are no coefficients defined then the sh_Cij_prm parameters are generated. Only the coefficients allowed by the selection rules of the point group are generated (Järvinen, 1993). At the end of refinement the generated sh_Cij_prm parameters are appended to sh_order. This allows for control over the sh_Cij_prm parameters in subsequent refinements. $Yij corresponds to valid symmetrized harmonics that has survived symmetrization. It is internally generated when there are no sh_Cij_prm parameters defined by the User.

sh_alpha corresponds to the angle in degrees between the polar axis and the scattering vector; sh_alpha defaults to zero degrees which is required for symmetric reflection as is the case for Bragg-Brentano geometry.

sh_order corresponds to the order of the spherical harmonic series which are even numbers ranging from 2 to 8 for non-cubic and from 2 to 10 for cubic systems.

The PO_Spherical_Harmonics macro simplifies the use of spherical_harmonics_hkl. CLAY.INP demonstrates the use of spherical_harmonics_hkl for describing anisotropic peak shapes.

[stacked_hats_conv [whole_hat E [hat_height E]]…[half_hat E [hat_height E]…]…

Defines hat sizes for generating an aberration function comprising a summation of hat functions. whole_hat defines a hat with an X axis extent of ±whole_hat/2. half_hat defines a hat with an X-axis range of half_hat to zero if half_hat<0; or zero to half_hat if half_hat> 0. hat_height defines the height of the hat; it defaults to 1. stacked_hats is used for example to describe tube tails using the Tube_Tails macro.

[start_X !E] [finish_X !E]

Defines the start and finish X region to fit to.


Defines a new structure node.

[str_hkl_angle N h k l]…

Defines a parameter name and a vector normal to the plane defined by h, k and l. When the parameter name is used in an equation, it returns angles (in radians) between itself and the normal to the planes defined by hkls; see the Preferred_Orientation and PO_Two_Directions  macros. An example in two directions is as follows:

[swap_sites $sites_1 $sites_2]…

swap_sites attempts to find a lower  by swapping sites defined in $sites_1 with those defined in $sites_2. The swapping continues until all swaps are performed. Outline of the algorithm:

While swap_site processes still to be processed {

k = 0


Randomize the cation configuration according to swap_sites.

Find the local minimum of

k = k + 1

If (k+1) > (k) then reset site positions

While (k+1) > (k) or all swap possibility exhausted


Starting from a particular cation configuration, a single swap of two different cation species does not exhaust all possible cation configurations. For example, three sites A, B and C have the six possible configurations of ABC, ACB, BAC, CAB, BCA, CBA. Swapping any two from the starting configuration of ABC results in the possible configurations of BAC, CBA, ACB with CAB and BCA absent. The absent configurations can be obtained by a double swap where, for example, the swapping of A and C yields CBA and then the swapping of A and B yields CAB. Thus all possible configurations can be visited if in between swapping steps are realized by the simulated annealing process.

Swapping the Zr sites with and Ca sites in the example above can be performed as follows:

swap_sites Ca Zr

If the sites were named Ca1, Ca2, Ca3, Zr1, Zr2, Zr3 then the following could be used:

swap_sites Ca* Zr*

Personal Tools