Commit 67962b15 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

a bunch refactoring changes in the python pair style and the examples

- make all python potential classes derived from LAMMPSPairPotential
  which contains shared functionality. We currently don't check
  for supported atom types. may want to add that again later.
- keep track of skipped atom types in the C++ code.
- add test against units setting. must set self.units='...' in constructor
- make compute_force method consistent with Pair::single() in LAMMPS and return force/r instead of force.
- rename potentials.py to py_pot.py
- update test runs. some small tweaks.
parent 1d48f287
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3,11 +3,11 @@ atom_style full

read_data	data.spce

pair_style	hybrid/overlay python 12.0 coul/long 12.0
pair_style	hybrid/overlay coul/long 12.0 python 12.0
kspace_style	pppm 1.0e-6

pair_coeff	* * coul/long
pair_coeff	* * python potentials.LJCutSPCE OW NULL
pair_coeff	* * python py_pot.LJCutSPCE OW NULL

pair_modify     table 0

+3 −3
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ mass * 1.0
velocity	all create 3.0 87287

pair_style	hybrid lj/cut 2.5 python 2.5
pair_coeff	* * python potentials.LJCutMelt lj NULL
pair_coeff	* * python py_pot.LJCutMelt lj NULL
pair_coeff      * 2 lj/cut 1.0 1.0

neighbor	0.3 bin
@@ -31,7 +31,7 @@ clear
read_restart    hybrid.restart

pair_style	hybrid lj/cut 2.5 python 2.5
pair_coeff	* * python potentials.LJCutMelt lj NULL
pair_coeff	* * python py_pot.LJCutMelt lj NULL
pair_coeff      * 2 lj/cut 1.0 1.0

fix		1 all nve
@@ -47,7 +47,7 @@ atom_style atomic
read_data       hybrid.data

pair_style	hybrid lj/cut 2.5 python 2.5
pair_coeff	* * python potentials.LJCutMelt lj NULL
pair_coeff	* * python py_pot.LJCutMelt lj NULL
pair_coeff      * 2 lj/cut 1.0 1.0

neighbor	0.3 bin
+3 −3
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ mass * 1.0
velocity	all create 3.0 87287

pair_style	python 2.5
pair_coeff	* * potentials.LJCutMelt lj
pair_coeff	* * py_pot.LJCutMelt lj

neighbor	0.3 bin
neigh_modify	every 20 delay 0 check no
@@ -30,7 +30,7 @@ clear
read_restart    melt.restart

pair_style	python 2.5
pair_coeff	* * potentials.LJCutMelt lj
pair_coeff	* * py_pot.LJCutMelt lj

fix		1 all nve

@@ -45,7 +45,7 @@ atom_style atomic
read_data       melt.data

pair_style	python 2.5
pair_coeff	* * potentials.LJCutMelt lj
pair_coeff	* * py_pot.LJCutMelt lj

neighbor	0.3 bin
neigh_modify	every 20 delay 0 check no
+2 −2
Original line number Diff line number Diff line
@@ -3,11 +3,11 @@ atom_style full

read_data	data.spce

pair_style	hybrid/overlay python 12.0 coul/long 12.0
pair_style	hybrid/overlay coul/long 12.0 python 12.0
kspace_style	pppm 1.0e-6

pair_coeff	* * coul/long
pair_coeff	* * python potentials.LJCutSPCE OW NULL
pair_coeff	* * python py_pot.LJCutSPCE OW NULL

bond_style	harmonic
angle_style	harmonic
+3 −3
Original line number Diff line number Diff line
@@ -12,12 +12,12 @@ mass * 1.0
velocity	all create 3.0 87287

pair_style	python 2.5
pair_coeff	* * potentials.LJCutMelt lj
pair_coeff	* * py_pot.LJCutMelt lj

# generate tabulated potential from python variant
pair_write      1 1 10000 rsq 0.01 2.5 lj_1_1.table LJ
pair_write      1 1 2000 rsq 0.01 2.5 lj_1_1.table LJ

pair_style      table linear 10000
pair_style      table linear 2000
pair_coeff      1 1 lj_1_1.table LJ

neighbor	0.3 bin
Loading