ttadano / alamode

Ab initio simulator for thermal transport and lattice anharmonicity
http://sourceforge.net/projects/alamode
MIT License
143 stars 54 forks source link

Optimized PERIODIC_IMAGE_CONV=1 #170

Closed r-masuki closed 9 months ago

r-masuki commented 9 months ago

Optimized the memory usage in generating the constraints when PERIODIC_IMAGE_CONV=1.

I have changed the implementation of Constraint::get_constraint_translation_for_periodic_images to allocate memory only for the necessary periodic images, while the memory was allocated for all possible periodic images in the original implementation. This change in the implementation lead to a speedup of the code, and the execution time of PERIODIC_IMAGE_CONV=1 is now comparable to that of PERIODIC_IMAGE_CONV=0.