diff --git a/.gitignore b/.gitignore index eabb101..0243e1f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ dist/ pylj/__pycache__/ pylj/tests/__pycache__/ pylj.egg-info/ -examples/ +pylj/comp.cpython-37m-darwin.so diff --git a/pylj/pairwise.py b/pylj/pairwise.py index c7c08df..3db4d97 100644 --- a/pylj/pairwise.py +++ b/pylj/pairwise.py @@ -125,6 +125,55 @@ def second_law(f, m, d1, d2): """ return (f * d1 / d2) / m +def lennard_jones_energy(A, B, dr): + """pairwise.lennard_jones_energy has been deprecated, please use + forcefields.lennard_jones instead + + Calculate the energy of a pair of particles at a given distance. + + Parameters + ---------- + A: float + The value of the A parameter for the Lennard-Jones potential. + B: float + The value of the B parameter for the Lennard-Jones potential. + dr: float + The distance between the two particles. + + Returns + ------- + float: + The potential energy between the two particles. + """ + print("pairwise.lennard_jones_energy has been deprecated, please use " + "forcefields.lennard_jones instead") + return A * np.power(dr, -12) - B * np.power(dr, -6) + + +def lennard_jones_force(A, B, dr): + """pairwise.lennard_jones_energy has been deprecated, please use + forcefields.lennard_jones with force=True instead + + Calculate the force between a pair of particles at a given distance. + + Parameters + ---------- + A: float + The value of the A parameter for the Lennard-Jones potential. + B: float + The value of the B parameter for the Lennard-Jones potential. + dr: float + The distance between the two particles. + + Returns + ------- + float: + The force between the two particles. + """ + print("pairwise.lennard_jones_energy has been deprecated, please use " + "forcefields.lennard_jones with force=True instead") + return 12 * A * np.power(dr, -13) - 6 * B * np.power(dr, -7) + def compute_energy(particles, box_length, cut_off, constants, forcefield): r"""Calculates the total energy of the simulation.