Skip to content

Commit

Permalink
- Updated change_log
Browse files Browse the repository at this point in the history
 - Renamed IPL to InversePowerLawPotential in calculator and tests
 - Corrected spelling mistake
  • Loading branch information
jg1080@uni-freiburg.de committed Sep 10, 2020
1 parent e38f05c commit acc20d3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ v0.6.0 (10Sep20)
-----------------------

- Numerical computation of the Hessian matrix
- Calculator for polydisperse systems
- Calculator for polydisperse systems in which particles interact via a pair potential
- Analytic computation of Hessian for polydisperse systems
- Bug fix in tests eam_calculator_forces_hessian

Expand Down
2 changes: 1 addition & 1 deletion matscipy/calculators/polydisperse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@

from __future__ import absolute_import

from .calculator import IPL, Polydisperse
from .calculator import InversePowerLawPotential, Polydisperse
6 changes: 3 additions & 3 deletions matscipy/calculators/polydisperse/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
###


class IPL():
class InversePowerLawPotential():
"""
Functional form for a smoothed inverse-power-law potential (IPL)
with an exponent of 10.
with an repulsive exponent of 10.
Parameters
----------
Expand All @@ -64,7 +64,7 @@ class IPL():
q : int
Smooth the potential up to the q-th derivative.
For q=0 the potential is smoothed, for q=1 the potential
and its first derivative are zero at the cutoff.
and its first derivative are zero at the cutoff,...
Reference:
----------
Expand Down
14 changes: 7 additions & 7 deletions tests/polydisperse_calculator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/env pytho
#! /usr/bin/env python

# ======================================================================
# matscipy - Python materials science tools
Expand Down Expand Up @@ -41,7 +41,7 @@

import matscipytest
import matscipy.calculators.polydisperse as calculator
from matscipy.calculators.polydisperse import IPL, Polydisperse
from matscipy.calculators.polydisperse import InversePowerLawPotential, Polydisperse
from matscipy.hessian_finite_differences import fd_hessian

###
Expand All @@ -61,15 +61,15 @@ def test_forces_dimer(self):
)
atomic_configuration.set_array("size", np.array([1.3, 2.22]), dtype=float)
atomic_configuration.set_masses(masses=np.repeat(1.0, len(atomic_configuration)))
calc = Polydisperse(IPL(1.0, 1.4, 0.1, 3, 1, 2.22))
calc = Polydisperse(InversePowerLawPotential(1.0, 1.4, 0.1, 3, 1, 2.22))
atomic_configuration.set_calculator(calc)
f = atomic_configuration.get_forces()
fn = calc.calculate_numerical_forces(atomic_configuration, d=0.0001)
self.assertArrayAlmostEqual(f, fn, tol=self.tol)

def test_forces_random_structure(self):
atoms = FaceCenteredCubic('H', size=[2,2,2], latticeconstant=2.37126)
calc = Polydisperse(IPL(1.0, 1.4, 0.1, 3, 1, 2.22))
calc = Polydisperse(InversePowerLawPotential(1.0, 1.4, 0.1, 3, 1, 2.22))
atoms.set_masses(masses=np.repeat(1.0, len(atoms)))
atoms.set_array("size", np.random.uniform(1.0, 2.22, size=len(atoms)), dtype=float)
atoms.set_calculator(calc)
Expand All @@ -83,7 +83,7 @@ def test_symmetry_sparse(self):
"""
atoms = FaceCenteredCubic('H', size=[2,2,2], latticeconstant=2.37126)
calc = Polydisperse(IPL(1.0, 1.4, 0.1, 3, 1, 2.22))
calc = Polydisperse(InversePowerLawPotential(1.0, 1.4, 0.1, 3, 1, 2.22))
atoms.set_masses(masses=np.repeat(1.0, len(atoms)))
atoms.set_array("size", np.random.uniform(1.0, 2.22, size=len(atoms)), dtype=float)
atoms.set_calculator(calc)
Expand All @@ -98,7 +98,7 @@ def test_hessian_random_structure(self):
Test the computation of the Hessian matrix
"""
atoms = FaceCenteredCubic('H', size=[2,2,2], latticeconstant=2.37126)
calc = Polydisperse(IPL(1.0, 1.4, 0.1, 3, 1, 2.22))
calc = Polydisperse(InversePowerLawPotential(1.0, 1.4, 0.1, 3, 1, 2.22))
atoms.set_masses(masses=np.repeat(1.0, len(atoms)))
atoms.set_array("size", np.random.uniform(1.0, 2.22, size=len(atoms)), dtype=float)
atoms.set_calculator(calc)
Expand All @@ -118,7 +118,7 @@ def test_hessian_divide_by_masses(self):
atoms.set_array("size", np.random.uniform(1.0, 2.22, size=len(atoms)), dtype=float)
masses_n = np.random.randint(1, 10, size=len(atoms))
atoms.set_masses(masses=masses_n)
calc = Polydisperse(IPL(1.0, 1.4, 0.1, 3, 1, 2.22))
calc = Polydisperse(InversePowerLawPotential(1.0, 1.4, 0.1, 3, 1, 2.22))
atoms.set_calculator(calc)
dyn = FIRE(atoms)
dyn.run(fmax=1e-5)
Expand Down

0 comments on commit acc20d3

Please sign in to comment.