This project is implemented in C++ and uses CMake for building. It focuses on simulating and analyzing particles and their interactions. The project utilizes k-d tree data structures for efficient spatial searches and nearest neighbor queries. You can learn more about k-d trees here.
Using k-d trees has significantly improved the performance of our tests, reducing the test time from hours to just 4 seconds for the same test file.
A k-d tree is a binary tree that is used to partition a k-dimensional space into regions. The tree is constructed by recursively partitioning the space into two half-spaces along the k-th dimension. The tree is used to efficiently perform nearest neighbor searches and range searches.
Implementation of the k-d tree is available in the MoleculeTree class.
The project includes several test cases to ensure the functionality of the Particles class. The tests are written using the Google Test framework.
- Description: Validates the atoms in the
Particlesclass. - Assertions:
- Checks that "O" and "H" are valid atoms.
- Ensures that "C" is not a valid atom.
- Verifies that the number of pages is 80.
- Description: Verifies the functionality of reading and processing molecular data from a file.
- Assertions:
- Reads data from a specified file and checks the consistency of neighbor molecules.
- Ensures the count of consistent neighbor molecules matches the expected size.
- Verifies the number of molecules in the file.
- Checks the number of atoms in the file.
- Ensures the number of pages is 80.