(git:21ef868)
Loading...
Searching...
No Matches
nnp_neighbor_interface.F File Reference

Go to the source code of this file.

Modules

module  nnp_neighbor_interface
 Per-nnp persistent neighbour-interface state for the NNP hot path. Separates neighbour bookkeeping from the ACSF and network loops: species-pair routing is precomputed once and per-element work buffers are reused. State lives on the parent nnp_type, so each &NNP force_eval keeps its own copy and the lifetime tracks nnp_env_release.
 

Functions/Subroutines

subroutine, public nnp_neighbor_interface::nnp_neighbor_interface_prepare (nnp)
 Ensure pair-routing metadata and reusable workspaces are ready for the current NNP model.
 
subroutine, public nnp_neighbor_interface::nnp_neighbor_interface_reset_neighbor (nnp, ind)
 Reset per-group neighbour counters for one central element before refilling the reusable buffers. Zeroes n_rad/n_ang1/n_ang2; the (ind, dist) slabs are kept allocated and overwritten in place by the next push.
 
subroutine, public nnp_neighbor_interface::nnp_grp_grow_dgdr (grp, n_needed)
 Ensure a per-group dG/dr buffer holds n_needed neighbours, growing by 1.5x (with an additive floor) so reallocation amortizes to O(1) over a trajectory. grpdata is allocated on return (cap >= 1), so callers can ASSOCIATE-bind it even for a zero-trip loop.
 
subroutine, public nnp_neighbor_interface::nnp_neigh_grp_grow (grp, n_needed)
 Ensure a per-group (ind, dist) neighbour buffer holds n_needed entries. Called from inside the linked-cell push loop, so existing entries are preserved on grow via MOVE_ALLOC. 1.5x growth amortizes reallocation to O(1) over a trajectory.
 
subroutine, public nnp_neighbor_interface::nnp_workspace_grow_caches (workspace, n_needed)
 Ensure the four per-element angular cutoff caches hold at least n_needed entries. These 1D scratch arrays are reused across angular groups within one nnp_calc_acsf call, so the peak is MAX_s(n_ang1) and MAX_s(n_ang2). 1.5x lazy growth.