m3g / CellListMap.jl

Flexible implementation of cell lists to map the calculations of particle-pair dependent functions, such as forces, energies, neighbor lists, etc.
https://m3g.github.io/CellListMap.jl/
MIT License
87 stars 4 forks source link

Make the high-level interface more flexible #85

Closed efaulhaber closed 4 months ago

efaulhaber commented 1 year ago

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:

lmiq commented 12 months ago

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 commented 4 months ago

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 commented 4 months ago

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.