원클릭으로
forcefield-validation
Implementing/debugging forcefields (UFF, SPFF) — invariants, switch semantics, buffer parity
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Implementing/debugging forcefields (UFF, SPFF) — invariants, switch semantics, buffer parity
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Before writing new code — search existing implementations, topical audits, READMEs, file-header caveats
After implementing — update file headers, README, topical audits; note duplication
Navigate and debug OrbitalWar / SpaceCraft — design, truss sim, combat, radiosity, orbits; hub to docs and tests
Diagnostic plots/visualizations — shared utilities, output paths, plot style conventions
Dedicated documentation work — OKF format, topical audits, extract-overview and inline-doc workflows
Writing new code — inventory-first, module-vs-script placement, no-new-files, STOP triggers for duplication
| name | forcefield-validation |
| description | Implementing/debugging forcefields (UFF, SPFF) — invariants, switch semantics, buffer parity |
| trigger | {"glob":["**/SPFF*","**/UFF*","**/common_resources/**/*.dat","**/common_resources/**/*.xyz","**/common_resources/**/*.mol"]} |
Apply these before SPFF/UFF-specific checks:
NaN (or inf, or a sentinel like 1e20).NaN with semantics like "pinned" — use a separate flag (fixmask).assert np.isfinite(pos[real]).all() and crash with a structured dump if it fails.For every forward mapping, verify the backward mapping exists and is consistent:
neighs[i,k] = j → bkSlots[j,slot] = i → revSlot[i,k] = slot_in_jEXCLUDE_BOND, COLLIDE, IGNORE_FAR).When no reference exists, verify physical reasonableness:
|sum(m_i * v_i)| < tol after one step with no external forces.|sum(r_i × p_i) + sum(I_i * ω_i)| < tol for rotation-capable nodes.dpos_mom, dquat_mom, vel, omega).Test subsystems independently before enabling both:
ENABLE_COLL=1, ENABLE_PORT=0ENABLE_COLL=0, ENABLE_PORT=1pyBall/SPFF_multi.py (wrapper for C++ SPFFmulti_lib.cpp)iParalel=0 (C++ CPU), iParalel=2 (C++ OpenCL), pyBall/OCL/UFF.py (Python OpenCL)AtomTypes.dat, BondTypes.dat, AngleTypes.dat in common_resources/0=keep, >0=force-on, <0=force-off. Passing 0 does nothing.
setSwitchesUFF(DoBond, DoAngle, DoDihedral, DoInversion, DoAssemble, ...). bSubtractBondNonBond must align with setSwitchesUFF_NB.setSwitches2(..., SPFF, Angles, PiSigma, PiPiI). bSPFF is base class flag (True even for UFF). Check bUFF to distinguish.init_buffers(bUFF=...) to populate C++ buffers/ibuffers maps. Read ndims first for shapes.bonParams, angParams, a2f. CPU angParams layout is [K, c0, c1, c2, c3]; kernels expect split angParams1=[c0..c3] and angParams2_w=[K].apos (Pi-orbitals at natoms:natoms+nnode), bkNeighs (Back Neighbors), Ksp/Kpp.apos contains atoms AND pi-nodes. Loop bounds: natoms vs natoms+nnode.nnode=natoms, allocates one pi slot per atom. Caps have Ksp/Kpp=0 but occupy nvecs. bkNeighs sized nSystems*nvecs.cleanF → getSPFFf4 → updateAtomsSPFFf4(dt=0) to assemble recoil from fneigh via bkNeighs without moving atoms. Set bSubtractVdW=0 when NonBonded off. Propagate switches to ffls[isys]. Copy fapos back to shared buffers.