CellListMap.jl icon indicating copy to clipboard operation
CellListMap.jl copied to clipboard

Make the high-level interface more flexible

Open efaulhaber opened this issue 1 year ago • 1 comments

we strongly encourage the use of the PeriodicSystems interface

From the docs, it seems that the high-level PeriodicSystems interface is supposed to be used for most purposes. However, it neither supports non-periodic boxes nor coordinate matrices.

The underlying low-level interface supports both of these, so this is just due to too strict type requirements in the PeriodicSystems interface:

  • unitcell must be an abstract vector or matrix and can't be a Limits, even though it's supported by Box.
  • xpositions must be a vector of vectors, even though the CellList supports matrices as well.

efaulhaber avatar May 01 '23 10:05 efaulhaber

In version 0.8.23 the PeriodicySystems interface accepts any AbstractVector{<:AbstractVector} as input coordinates, so at least one can reinterpret(reshape, SVector{3,Float64}, m::Matrix), for example, and use matrices as inputs, indirectly.

I will work on generalizing the interface for matrices and check the limitations of the unitcell as well at some point, to make the interface as flexible as the low level one.

lmiq avatar Sep 14 '23 23:09 lmiq

On version 0.8.28 matrices are supported as input coordinates in the PeriodicSystems interface. Note that matrices cannot be resized, so the number of particles cannot change when using this.

Missing still the support for non-periodic systems.

lmiq avatar Apr 30 '24 16:04 lmiq

Non-periodic systems will be supported in the high-level interface in v0.8.30 by simply not providing a unitcell, or setting unitcell = nothing.

Because of this feature and other code rearrangements, probably I will be settling the interface to be ParticleSystem instead of the now somewhat misnomer PeriodicSystem, for a nearby 1.0 release.

Also the necessity of loading the PeriodicSystems submodule was removed, now using CellListMap provides access to all the functionality. The submodule was kept for now for backward compatibility of the 0.8 series, with a warning.

lmiq avatar May 02 '24 00:05 lmiq