Skip to content

Commit

Permalink
Merge branch 'trunk-minor' into trunk-major
Browse files Browse the repository at this point in the history
  • Loading branch information
joaander committed Jul 15, 2024
2 parents 3be0a30 + 1101041 commit 8a8fea9
Show file tree
Hide file tree
Showing 28 changed files with 627 additions and 105 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 4.7.0
current_version = 4.8.0
commit = False
tag = False
parse = ^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))(?:\.(?P<number>0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)))?$
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ body:
attributes:
label: HOOMD-blue version
description: What version of HOOMD-blue are you using?
placeholder: 4.7.0
placeholder: 4.8.0
validations:
required: true
- type: markdown
Expand Down
5 changes: 1 addition & 4 deletions .github/ISSUE_TEMPLATE/release.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Release checklist
about: '[for maintainer use]'
title: 'Release 4.7.0'
title: 'Release 4.8.0'
labels: ''
assignees: 'joaander'

Expand All @@ -10,9 +10,6 @@ assignees: 'joaander'
Minor and major releases:

- [ ] Update tutorial submodule.
- [ ] Update actions versions.
- See current actions usage with: `rg --no-filename --hidden uses: | awk '{$1=$1;print}' | sort | uniq`
- Use global search and replace to update them to the latest tags
- [ ] Check for new or duplicate contributors since the last release:
`comm -13 (git log $(git describe --tags --abbrev=0) --format="%aN <%aE>" | sort | uniq | psub) (git log --format="%aN <%aE>" | sort | uniq | psub)`.
Add entries to `.mailmap` to remove duplicates.
Expand Down
2 changes: 2 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,5 @@ Simone Ciarella <s.ciarella@tue.nl> SCiarella <simoneciarella@gmail.com>
Simone Ciarella <s.ciarella@tue.nl> SCiarella <58949181+SCiarella@users.noreply.github.com>
Kieran Nehil-Puleo <nehilkieran@gmail.com> kierannp <nehilkieran@gmail.com>
Cristina Butu <icb2114@columbia.edu> crisbutu <129013261+crisbutu@users.noreply.github.com>
Joseph Burkhart <joaburkh@umich.edu> josephburkhart <joaburkh@umich.edu>
Joseph Burkhart <joaburkh@umich.edu> Joseph Burkhart <61951318+josephburkhart@users.noreply.github.com>
3 changes: 0 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ repos:
- id: check-yaml
exclude: (?:^.github/workflows/templates) # templates are not properly formatted yaml
- id: check-case-conflict
- id: fix-encoding-pragma
args:
- --remove
- id: mixed-line-ending
- repo: https://github.com/glotzerlab/fix-license-header
rev: v0.3.2
Expand Down
4 changes: 2 additions & 2 deletions BUILDING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Clone using Git_::

$ git clone --recursive https://github.com/glotzerlab/hoomd-blue

Release tarballs are also available as `GitHub release`_ assets: `Download hoomd-4.7.0.tar.gz`_.
Release tarballs are also available as `GitHub release`_ assets: `Download hoomd-4.8.0.tar.gz`_.

.. seealso::

Expand All @@ -158,7 +158,7 @@ Release tarballs are also available as `GitHub release`_ assets: `Download hoomd
Execute ``git submodule update --init`` to fetch the submodules each time you switch branches
and the submodules show as modified.

.. _Download hoomd-4.7.0.tar.gz: https://github.com/glotzerlab/hoomd-blue/releases/download/v4.7.0/hoomd-4.7.0.tar.gz
.. _Download hoomd-4.8.0.tar.gz: https://github.com/glotzerlab/hoomd-blue/releases/download/v4.8.0/hoomd-4.8.0.tar.gz
.. _GitHub release: https://github.com/glotzerlab/hoomd-blue/releases
.. _git book: https://git-scm.com/book
.. _Git: https://git-scm.com/
Expand Down
21 changes: 13 additions & 8 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,25 @@ Removed:
4.x
---

4.8.0 (not yet released)
^^^^^^^^^^^^^^^^^^^^^^^^
4.8.0 (2024-07-11)
^^^^^^^^^^^^^^^^^^

*Added*

* ``hoomd.mpcd`` reimplements the MPCD method for simulating hydrodynamic interactions.
See the migrating page for an overview and individual class and method documentation for more
information (`#1784 <https://github.com/glotzerlab/hoomd-blue/pull/1784>`__).
* MPCD tutorial.
* Support numpy 2.0
(`#1797 <https://github.com/glotzerlab/hoomd-blue/pull/1797>`__)
* ``hoomd.hpmc.external.External`` provides an abstract interface to external potentials
(`#1811 <https://github.com/glotzerlab/hoomd-blue/pull/1811>`__).
* ``hoomd.hpmc.external.Linear`` computes linear potential as a function of the distance from a point to a plane
(`#1811 <https://github.com/glotzerlab/hoomd-blue/pull/1811>`__).
* ``hoomd.hpmc.external.Linear`` computes the potential as a linear function of the distance from a
point to a plane (`#1811 <https://github.com/glotzerlab/hoomd-blue/pull/1811>`__).
* ``HPMCIntegrator.external_potentials`` sets the list of external potentials applied to the system
(`#1811 <https://github.com/glotzerlab/hoomd-blue/pull/1811>`__).
* ``hpmc.pair.ExpandedGaussian`` computes the expanded Gaussian pair potential in HPMC
(`#1817 <https://github.com/glotzerlab/hoomd-blue/pull/1817>`__).

*Changed*

Expand All @@ -58,21 +61,23 @@ Removed:
`#1816 <https://github.com/glotzerlab/hoomd-blue/pull/1816>`__).
* Ensure that Gaussian-type pair potentials have positive sigma values
(`#1810 <https://github.com/glotzerlab/hoomd-blue/pull/1810>`__).
* Demonstrate ``Step`` and ``AngularStep`` in the tutorial "Modelling Patchy Particles".
* Fixed typographical errors in all tutorials.

*Fixed*

* Issue a proper error message when ``ALJ.shape`` is not set for all particle types
* Issue the proper error message when ``ALJ.shape`` is not set for all particle types
(`#1808 <https://github.com/glotzerlab/hoomd-blue/pull/1808>`__).
* Correctly apply brownian torque when elements of the inertia tensor are 0
* Correctly apply Brownian torque when elements of the inertia tensor are 0
(`#1825 <https://github.com/glotzerlab/hoomd-blue/pull/1825>`__).


*Deprecated*

* ``HPMCIntegrator.external_potential`` - use ``HPMCIntegrator.external_potentials``
(`#1811 <https://github.com/glotzerlab/hoomd-blue/pull/1811>`__).
* ``hoomd.hpmc.external.user.CPPExternalPotential`` - use ``hoomd.hpmc.external.Linear`` or write a custom component in C++
(`#1811 <https://github.com/glotzerlab/hoomd-blue/pull/1811>`__).
* ``hoomd.hpmc.external.user.CPPExternalPotential`` - use ``hoomd.hpmc.external.Linear`` or write a
custom component in C++ (`#1811 <https://github.com/glotzerlab/hoomd-blue/pull/1811>`__).

*Removed*

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ add_subdirectory (CMake)

################################
## Version information
set(HOOMD_VERSION_RAW "4.7.0")
set(HOOMD_VERSION_RAW "4.8.0")
string(REGEX MATCH "(.*)\\.(.*)\\.(.*)$" _hoomd_version_match ${HOOMD_VERSION_RAW})
set(HOOMD_VERSION_MAJOR ${CMAKE_MATCH_1})
set(HOOMD_VERSION_MINOR ${CMAKE_MATCH_2})
Expand Down
8 changes: 4 additions & 4 deletions INSTALLING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ Serial CPU and single GPU builds
*linux-64*, *osx-64*, and *osx-arm64* platforms. Install the ``hoomd`` package from the conda-forge_
channel into a conda environment::

$ mamba install hoomd=4.7.0
$ mamba install hoomd=4.8.0

.. _conda-forge: https://conda-forge.org/docs/user/introduction.html

``conda`` auto-detects whether your system has a GPU and attempts to install the appropriate
package. Override this and force the GPU enabled package installation with::

$ export CONDA_OVERRIDE_CUDA="12.0"
$ mamba install "hoomd=4.7.0=*gpu*" "cuda-version=12.0"
$ mamba install "hoomd=4.8.0=*gpu*" "cuda-version=12.0"

Similarly, you can force CPU only package installation with::

$ mamba install "hoomd=4.7.0=*cpu*"
$ mamba install "hoomd=4.8.0=*cpu*"

.. note::

Expand All @@ -42,7 +42,7 @@ Similarly, you can force CPU only package installation with::
.. note::

Run time compilation is no longer available on conda-forge builds starting with HOOMD-blue
4.7.0.
4.8.0.

.. tip::

Expand Down
2 changes: 2 additions & 0 deletions hoomd/hpmc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ set(_hpmc_sources module.cc
ExternalPotentialLinear.cc
PairPotential.cc
PairPotentialLennardJones.cc
PairPotentialExpandedGaussian.cc
PairPotentialStep.cc
PairPotentialUnion.cc
PairPotentialAngularStep.cc
Expand Down Expand Up @@ -85,6 +86,7 @@ set(_hpmc_headers
OBBTree.h
PairPotential.h
PairPotentialLennardJones.h
PairPotentialExpandedGaussian.h
PairPotentialStep.h
PairPotentialUnion.h
PairPotentialAngularStep.h
Expand Down
98 changes: 98 additions & 0 deletions hoomd/hpmc/PairPotentialExpandedGaussian.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
// Copyright (c) 2009-2024 The Regents of the University of Michigan.
// Part of HOOMD-blue, released under the BSD 3-Clause License.

#include "PairPotentialExpandedGaussian.h"

namespace hoomd
{
namespace hpmc
{

PairPotentialExpandedGaussian::PairPotentialExpandedGaussian(
std::shared_ptr<SystemDefinition> sysdef)
: PairPotential(sysdef), m_params(m_type_param_index.getNumElements())
{
}

LongReal PairPotentialExpandedGaussian::energy(const LongReal r_squared,
const vec3<LongReal>& r_ij,
const unsigned int type_i,
const quat<LongReal>& q_i,
const LongReal charge_i,
const unsigned int type_j,
const quat<LongReal>& q_j,
const LongReal charge_j) const
{
unsigned int param_index = m_type_param_index(type_i, type_j);
const auto& param = m_params[param_index];

LongReal r = fast::sqrt(r_squared);
LongReal rmd_2 = (r - param.delta) * (r - param.delta);
LongReal rmd_over_sigma_2 = rmd_2 / param.sigma_2;
LongReal exp_val = fast::exp(-LongReal(1.0) / LongReal(2.0) * rmd_over_sigma_2);
LongReal energy = param.epsilon * exp_val;

if (m_mode == shift || (m_mode == xplor && param.r_on_squared >= param.r_cut_squared))
{
LongReal r_cut = fast::sqrt(param.r_cut_squared);
LongReal rcutmd_2 = (r_cut - param.delta) * (r_cut - param.delta);
LongReal rcutmd_over_sigma_2 = rcutmd_2 / param.sigma_2;
energy -= param.epsilon * fast::exp(-LongReal(1.0) / LongReal(2.0) * rcutmd_over_sigma_2);
}

if (m_mode == xplor && r_squared > param.r_on_squared)
{
LongReal a = param.r_cut_squared - param.r_on_squared;
LongReal denominator = a * a * a;

LongReal b = param.r_cut_squared - r_squared;
LongReal numerator = b * b
* (param.r_cut_squared + LongReal(2.0) * r_squared
- LongReal(3.0) * param.r_on_squared);
energy *= numerator / denominator;
}

return energy;
}

void PairPotentialExpandedGaussian::setParamsPython(pybind11::tuple typ, pybind11::dict params)
{
auto pdata = m_sysdef->getParticleData();
auto type_i = pdata->getTypeByName(typ[0].cast<std::string>());
auto type_j = pdata->getTypeByName(typ[1].cast<std::string>());
unsigned int param_index_1 = m_type_param_index(type_i, type_j);
m_params[param_index_1] = ParamType(params);
unsigned int param_index_2 = m_type_param_index(type_j, type_i);
m_params[param_index_2] = ParamType(params);

notifyRCutChanged();
}

pybind11::dict PairPotentialExpandedGaussian::getParamsPython(pybind11::tuple typ)
{
auto pdata = m_sysdef->getParticleData();
auto type_i = pdata->getTypeByName(typ[0].cast<std::string>());
auto type_j = pdata->getTypeByName(typ[1].cast<std::string>());
unsigned int param_index = m_type_param_index(type_i, type_j);
return m_params[param_index].asDict();
}

namespace detail
{
void exportPairPotentialExpandedGaussian(pybind11::module& m)
{
pybind11::class_<PairPotentialExpandedGaussian,
PairPotential,
std::shared_ptr<PairPotentialExpandedGaussian>>(
m,
"PairPotentialExpandedGaussian")
.def(pybind11::init<std::shared_ptr<SystemDefinition>>())
.def("setParams", &PairPotentialExpandedGaussian::setParamsPython)
.def("getParams", &PairPotentialExpandedGaussian::getParamsPython)
.def_property("mode",
&PairPotentialExpandedGaussian::getMode,
&PairPotentialExpandedGaussian::setMode);
}
} // end namespace detail
} // end namespace hpmc
} // end namespace hoomd
Loading

0 comments on commit 8a8fea9

Please sign in to comment.