xnn.ffnn.models.ffield.match_torsion#

xnn.ffnn.models.ffield.match_torsion(torp, tor, central_swaps=True)[source]#

The library torsion type that parameterizes a concrete torsion.

The lookup order is that of ReaxFF codes (LAMMPS pair_style reaxff): the exact type, its reversal l-k-j-i, then the X-j-k-X and X-k-j-X wildcards. With central_swaps the central-bond swaps i-k-j-l / l-j-k-i are tried as a last resort, so a type that a library spells only that way still finds parameters; they never shadow an exact, reversed or wildcard match. LAMMPS does not try them.

Parameters:
  • torp (list[str]) – Torsion types present in the library.

  • tor (str) – The concrete torsion type "i-j-k-l".

  • central_swaps (bool, optional) – Also try the central-bond swaps. Default True.

Returns:

The matching library type, or None when the torsion is not parameterized.

Return type:

str or None