xnn.ffnn.models.amoeba_ewald.refresh_cell_terms#

xnn.ffnn.models.amoeba_ewald.refresh_cell_terms(cache, cells, batch, changed=False)[source]#

Bring the cell terms a step plan keeps for one mesh group (the influence_cache of MeshPlan: inverse cells, volumes, per-atom inverses and influence functions) to the cells cells (G, 3, 3), in place, so that a recorded step that reads them follows a changed cell (constant-pressure dynamics). batch gives the structure of every atom of the group. Reads the cells on the host, unless the caller found them changed; returns whether they had changed.

Parameters:
  • cache (dict) – The cache of the group.

  • cells (Tensor) – Lattice vectors as rows (G, 3, 3).

  • batch (Tensor) – Structure of every atom (N,), from zero to G - 1.

  • changed (bool, optional) – Remake the terms without comparing the cells (a read of the device), by default False.

Returns:

True when the kept terms described other cells and were recomputed.

Return type:

bool