![]() |
(git:21ef868)
|
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. More...
Functions/Subroutines | |
| subroutine, public | nnp_neighbor_interface_prepare (nnp) |
| Ensure pair-routing metadata and reusable workspaces are ready for the current NNP model. | |
| subroutine, public | 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_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_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_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. | |
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.
| subroutine, public nnp_neighbor_interface::nnp_neighbor_interface_prepare | ( | type(nnp_type), intent(inout) | nnp | ) |
Ensure pair-routing metadata and reusable workspaces are ready for the current NNP model.
| nnp | NNP environment whose neighbor_interface_state will be (re)built if needed. |
Definition at line 46 of file nnp_neighbor_interface.F.
| subroutine, public nnp_neighbor_interface::nnp_neighbor_interface_reset_neighbor | ( | type(nnp_type), intent(inout) | nnp, |
| integer, intent(in) | 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.
| nnp | NNP environment whose neighbor_interface_state will have its counters cleared. |
| ind | central-element index (1..nnpn_ele) whose workspace is reset. |
Definition at line 77 of file nnp_neighbor_interface.F.
| subroutine, public nnp_neighbor_interface::nnp_grp_grow_dgdr | ( | type(nnp_dgdr_grp_type), intent(inout) | grp, |
| integer, intent(in) | 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.
| grp | per-element dGdr group whose data slab is reallocated if undersized |
| n_needed | minimum required capacity (third dim of grpdata) |
Definition at line 378 of file nnp_neighbor_interface.F.
| subroutine, public nnp_neighbor_interface::nnp_neigh_grp_grow | ( | type(nnp_neigh_grp_type), intent(inout) | grp, |
| integer, intent(in) | 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.
| grp | per-species-pair neighbour group whose (ind, dist) buffers grow |
| n_needed | minimum required entry count |
Definition at line 402 of file nnp_neighbor_interface.F.
| subroutine, public nnp_neighbor_interface::nnp_workspace_grow_caches | ( | type(nnp_neighbor_workspace_type), intent(inout) | workspace, |
| integer, intent(in) | 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.
| workspace | per-element workspace whose fc_cache1/dfc_cache1/fc_cache2/dfc_cache2 grow |
| n_needed | minimum required cache length |
Definition at line 442 of file nnp_neighbor_interface.F.