msg-byu / enumlib

Derivative structure enumeration library
MIT License
59 stars 34 forks source link

Updates to the supercell code. #63

Closed wsmorgan closed 6 years ago

wsmorgan commented 6 years ago

Updated the supercell.py function so that it returns the points group size for the lattice, the rmax, and the volume factor for the supercells. Also updated it to make the input cell primitive.

wsmorgan commented 6 years ago

I've added several comments throughout the python and the fortran code explaining anything that may not have made sense. Global change log is:

1) Fixed a bug Conrad found where fortran was rounding some of the hnf entries down to zero, this was fixed using NINT.

2) Added more outputs, rmax (the norm of the largest vector for the lattice), pgs (the order of the lattice point group), and dets (the determinant of the HNF), to the code to make determining the metric easier (some of these may go away later and most of them will likely be computed in another location once we determine the correct metric for returning the HNFs).

3) In the fortran code temporary variables were declared for the atom types and positions, this was necessary because F90wrap does not work when there are pointers in the subroutine call and make_primitive requires points, and because simply setting the pointers to be equal to the input variables results in a segmentation fault during runtime.