generates the COUPLING property of sw object GENCOUPLING(obj, 'option1', value, ...) The function calculates equivalent bonds between magnetic atoms. These are determined either based on crystal symmetry or bond length (with tolDist tolerance). If the space group index of 0 is defined (obj.lattice.sym=0), the equivalent bonds will be based on bond length. For space group index larger than 0, the symmetry equivalent bonds will be determined. This can ve overwritten by the forceNoSym parameter to consider bond length. IMPORTANT! This function has to be used after the crystal structure is defined. The SW.ADDCOUPLING, SW.COUPLINGTABLE functions will only work afterwards. Input: obj sw class object. Options: forceNoSym If true, equivalent bonds are generated based on bond length with .tolDist tolerance. If false symmetry operators will be used if they are given (obj.lattice.sym>0). nUnitCell Edge length of the parallelepiped (same along a,b and c) withing the algorithm searches for nearest neighbors in lattice units. Default is 3. maxDistance Maximum bond length that will be stored in the obj.coupling property in units of Angstrom. Default is 8.0. maxBond Maximum number of generated inequivalent bonds. If zero, maxDistance is considered to limit the longest bond. Default is zero. tolDist Tolerance of distance, within two bonds are regarded equivalent, default is 1e-3 Angstrom. Only used, when no space group is defined. dMin Minimum bond length, below which an error is triggered. Default value is 0.5 Angstrom. Output: The obj.coupling field will be filled with values, depending on the crystal geometry. Example: cryst = sw; cryst.genlattice('lat_const',[3 3 5],'angled',[90 90 120]) cryst.addatom('r',[0 0 0]) cryst.gencoupling cryst.couplingtable(1:3) A triangular lattice is created in cryst and after using gencoupling() the couplingtable() function lists the 1st, 2nd and 3rd neighbor bonds. See also SW, SW.SYMMETRY, SW.NOSYM.