Open mushroomfire opened 11 months ago
just noticed this issue, sorry. i have a new library now bosque that is faster.
triclinic is interesting. best i can come up with off the top of my head is coordinate transformation + weighted squared euclidean
or, since it's periodic, you should be able to just displace things until it's a box. here's a 2D example. it can be done in 3d as well
Thanks for your reply. I am unsure if this approach can maintain the calculation speed. In molecular dynamics (MD) simulation, there is a code that is capable of handling both triclinic and rectangular boxes with periodic or free boundaries, and it also offers high computational efficiency. I have provided a reference to this code for your convenience: https://gitlab.com/stuko/ovito/-/blob/master/src/ovito/particles/util/NearestNeighborFinder.cpp. Later on, I will also attempt to use Bosque.
Yes, definitely not ideal. Best of luck. If I can be of any help, make an issue on bosque and we can discuss there
Hi, FNNTW now supports periodic boundary conditions for a rectangular box, where the angles between the two line vectors are 90 degrees. Is it possible to make it more generalizable for a triclinic box? This feature proves useful in certain simulation domains. Let's consider the box below, where each row represents a box vector:
The rectangular box is like below:
A distance vector rij = np.array([x, y, z]) can be wrapped as below:
Maybe change the distance equation in codes can achieve this? Thank you very much!