xnn.ffnn.models.ffield.resolve_torsion#

xnn.ffnn.models.ffield.resolve_torsion(p, torp, tor, key)[source]#

Look up a torsion parameter, resolving reversal and wildcards.

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. As a last resort the central-bond swaps i-k-j-l / l-j-k-i are tried, so a type that a library spells only that way still finds parameters; they never shadow an exact, reversed or wildcard match. Unmatched types get 0.0.

Parameters:
  • p (dict) – Flat parameter dictionary.

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

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

  • key (str) – Parameter name (one of P_TORSION).

Returns:

The resolved parameter value.

Return type:

float