Better usage of the cluster class

Closes #555 (closed)

Purpose

The purpose of this MR is to make the relationship between the differnt C++ classes more logical, and to prepare for #562 (closed) and #565.

Changes

  1. Each Orbit now consists of a vector (instead of a vector of vectors of LatticeSites). These are called clusters instead of equivalent_clusters, since the latter seems redundant and possible even wrong if someone merges aggressively.
  2. A Cluster now knows about its LatticeSites as well as the Structure that these sites refer to. The structure is held in the form of a shared pointer.
  3. Since a Cluster knows about both the lattice sites and the structure, they can now be asked for the Cartesian coordinates of the sites, and a cluster can also compute its radius. This means we no longer need the C++ Geometry module.
  4. An important part of calculating a cluster vector is to build an orbit list for a supercell. When doing this, icet redefines lattice sites such that they refer to the supercell instead of the primitive structure. Previously this was done by an orbit list, but it is now instead in Cluster.

Controversial changes

  1. The representative cluster is created as a separate Cluster instance in each Orbit. It would probably be prettier to keep some sort of reference (pointer or index) to the cluster in _clusters (formerly _equivalent_cluster). But I couldn't find any way to do that in C++ without writing super-ugly code. Probably there is some nice solution though? The challenge is that _clusters get sorted every now and then.

Performance

I've seen no significant change in performance or memory consumption after these changes.

Edited by Magnus Rahm

Merge request reports

Loading