Simplified cluster expansion calculator initialization

The ClusterExpansionCalculator has a very complex constructor, which to some extent repeats what LocalOrbitListGenerator and OrbitList do. This MR simplfies this constructor a lot by using existing functionality, which also makes it clearer how the local orbit lists in ClusterExpansionCalculator differ from other kinds of local orbit lists.

Furthermore, local orbit lists were partially created in OrbitList.cpp. I moved some of the code to LocalOrbitListGenerator, since the purpose of having a local orbit list generator should be to generate local orbit lists.

Other changes:

  • I renamed primitiveStructure to just structure in OrbitList. The reason for this change is that I found it quite confusing what kind of structure I should expect if the OrbitList refers to supercell. In such orbit lists, the structure was not even used, so now all orbit lists but the primitive one are initialized completely without a structure. Not sure if it is bad practice to have private member variables that are never initialized, but there were already several such variables in OrbitList...
  • I simplfied the initialization of LocalOrbitListGenerator and added quite detailed comments.

Performance

The purpose of this MR is not to improve performance, but initialization of a ClusterExpansionCalculator seems 10-20 % faster. I've seen no other significant changes in performance or memory consumption.

Edited by Magnus Rahm

Merge request reports

Loading