Skip to content

Commit

Permalink
Remove pair.spline
Browse files Browse the repository at this point in the history
  • Loading branch information
mphoward committed May 28, 2024
1 parent 0cbb7c2 commit 469107c
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 376 deletions.
111 changes: 0 additions & 111 deletions src/PairEvaluatorSpline.h

This file was deleted.

18 changes: 0 additions & 18 deletions src/PairPotentialSpline.cu

This file was deleted.

1 change: 0 additions & 1 deletion src/PairPotentials.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include "PairEvaluatorAshbaugh.h"
#include "PairEvaluatorColloid.h"
#include "PairEvaluatorHertz.h"
#include "PairEvaluatorSpline.h"

/*
* The code below handles python exports using a templated function, and so
Expand Down
1 change: 0 additions & 1 deletion src/module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ PYBIND11_MODULE(_azplugins, m)
azplugins::detail::export_ashbaugh_params(m);
azplugins::detail::export_pair_potential<azplugins::detail::PairEvaluatorColloid>(m, "PairPotentialColloid");
azplugins::detail::export_pair_potential<azplugins::detail::PairEvaluatorHertz>(m, "PairPotentialHertz");
azplugins::detail::export_pair_potential<azplugins::detail::PairEvaluatorSpline>(m, "PairPotentialSpline");

/* Anisotropic pair potentials */
azplugins::detail::export_aniso_pair_potential<azplugins::detail::AnisoPairEvaluatorTwoPatchMorse>(m, "AnisoPairPotentialTwoPatchMorse");
Expand Down
74 changes: 0 additions & 74 deletions src/pair.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@
ashbaugh
colloid
hertz
spline
two_patch_morse
.. autoclass:: ashbaugh
.. autoclass:: colloid
.. autoclass:: hertz
.. autoclass:: spline
.. autoclass:: two_patch_morse
"""
Expand Down Expand Up @@ -277,78 +275,6 @@ def __init__(self, r_cut, nlist, name=None):
def process_coeff(self, coeff):
return coeff['epsilon']

class spline(hoomd.md.pair.pair):
R""" Spline potential
Args:
r_cut (float): Default cutoff radius (in distance units).
nlist (:py:mod:`hoomd.md.nlist`): Neighbor list
name (str): Name of the force instance.
:py:class:`spline` is a spline potential of the form:
.. math::
:nowrap:
\begin{eqnarray*}
V(r) = & a &, r < r_{\rm s}\\
= & \frac{a(r_{\rm s}^2-r^2)^m (r_{\rm cut}^2 + m r^2 - (m+1) r_{\rm s}^2)}{(r_{\rm cut}^2-r_{\rm s}^2)^{m+1}} &, r_{\rm s} < r < r_{\rm cut} \\
= & 0 &, r \ge r_{\rm cut}
\end{eqnarray*}
Here, :math:`a` is the amplitude :math:`m`, the exponent, :math:`r_{\rm s}` and :math: `r_{\rm cut}` are the cutoff distances. The potential goes smoothly from a value of `a` at `r_{\rm s}` to zero at
`r_{\rm cut}`. The slope is determined by the exponent `m`, which needs to be greater or equal to 2.
The force goes to zero at both the cutoff value `r_{\rm cut}` and `r_{\rm s}`.
The following coefficients must be set per unique pair of particle types:
- :math:`a` - *amp* - value of the plateau (in energy units)
- :math:`m` - *exponent*
- :math:`r_{\mathrm{cut}}` - *r_cut* (in distance units)
- *optional*: defaults to the global r_cut specified in the pair command
- :math:`r_{\mathrm{s}}`- *r_start* (in distance units) value where the potential reaches its plateau value
Example::
nl = hoomd.md.nlist.cell()
s = azplugins.pair.spline(r_cut=3.0, nlist=nl)
s.pair_coeff.set('A', 'A', amp=1.0, r_start=1.0, m=2.0)
s.pair_coeff.set(['A','B'], 'B', amp=1.0, r_start=1.0, m=2.0, r_cut=3.0)
"""
def __init__(self, r_cut, nlist, name=None):
hoomd.util.print_status_line()

# initialize the base class
hoomd.md.pair.pair.__init__(self, r_cut, nlist, name)

# create the c++ mirror class
if not hoomd.context.exec_conf.isCUDAEnabled():
self.cpp_class = _azplugins.PairPotentialSpline
else:
self.cpp_class = _azplugins.PairPotentialSplineGPU
self.nlist.cpp_nlist.setStorageMode(_md.NeighborList.storageMode.full)
self.cpp_force = self.cpp_class(hoomd.context.current.system_definition, self.nlist.cpp_nlist, self.name)

hoomd.context.current.system.addCompute(self.cpp_force, self.force_name)

# setup the coefficent options
self.required_coeffs = ['amp', 'm', 'r_start']
self.r_cut=r_cut

def process_coeff(self, coeff):
amplitude = coeff['amp']
exponent = coeff['m']
r_start = coeff['r_start']
r_start_sq = r_start*r_start
if exponent<2.0:
hoomd.context.msg.error('azplugins.pair.spline: Exponent for spline needs to be >= 2.\n')
raise ValueError('Exponent for spline needs to be >= 2')
if r_start>=self.r_cut:
hoomd.context.msg.error('azplugins.pair.spline: r_start needs to be smaller than r_cut.\n')
raise ValueError('r_start needs to be smaller than r_cut')
return _hoomd.make_scalar3(amplitude, exponent,r_start_sq)

class two_patch_morse(hoomd.md.pair.ai_pair):
R""" Two patches with Morse potential
Expand Down
Loading

0 comments on commit 469107c

Please sign in to comment.