def lj_row_elem_excl

bend-prot@0.1.0.0 · bonded.bend:224

import bend-prot@0.1.0.0/bonded.bend as Bonded
import Base
import bend-prot@0.1.0.0/geom.bend as G
import bend-prot@0.1.0.0/protein.bend as P
import bend-prot@0.1.0.0/force.bend as F

224# Per-element rows/totals that also skip 1-2 and 1-3 pairs: the physically
225# meaningful combination (uniform rows blow up on bonded neighbors).
226def lj_row_elem_excl(+si: U32, +se: U32, +pi: G.Vec3, +ys: List<&2, P.Atom>, +c2: F32, +bonds: List<&2, U32>) -> F32:
227  match ys:
228    case Nil{}:
229      0.0
230    case h <> t:
231      match h:
232        case P.Atom{serial, +elem, +pj}:
233          (Bool.pick(F32, excluded(si, serial, bonds), 0.0, F.lj_pair_at(pi, pj, F.lj_combine_eps(F.lj_eps(se), F.lj_eps(elem)), F.lj_combine_sig2(F.lj_sig(se), F.lj_sig(elem)), c2)) + lj_row_elem_excl(si, se, pi, t, c2, bonds) : F32)

Uses (13)

Used by (4)