Avoid copying local orbit list every time a cluster vector is calculated

The cluster expansion calculator is based on "local orbit lists", one per "primitive cell". Previously the strategy for calculating a local cluster vector has been to

  1. Get the local orbit list corresponding to the current "offset"
  2. Remove the clusters not containing the current site
  3. Calculate cluster vector

Because of point 2, point 1 necessitated copying the whole local orbit list. That was obviously very time consuming, especially in systems with large primitive cells (such as clathrates).

This MR "merges" point 2 and 3, i.e., clusters that do not contain the current site are skipped "on the fly" when counting clusters. The benefit with this strategy is that no copy is needed because the local orbit list is never modified.

This yields a very nice speedup in systems with large primitive cells (see !515 (comment 710788067)).

Edited by Magnus Rahm

Merge request reports

Loading