lammps/lammps

[BUG] _fix mvv/dpd not working with pair_style mdpd_

luishcc opened this issue · 3 comments

Summary
It's seemingly a small issue with a an easy fix.
The command fix mvv/dpd raises the error: "Must use a dpd or edpd pair style with fix mvv/edpd" which is an error message for the mvv/edpd command.

LAMMPS Version and Platform

Stable 2Aug2023 - Ubuntu 22.04

Steps to Reproduce

atom_style mdpd
pair_style hybrid/overlay mdpd/rhosum mdpd 1.0 1.0 9872598
fix mvv all mvv/dpd 0.65

Further Information, Files, and Links

I was able to find the commit 8a1771a on March 2nd 2023 that introduce a check on pair_styles for the fix command and Lammps
versions prior to that date work well without raising any errors. The issue seems to be that it is checking for the wrong pair_style ( !force->pair_match("^edpd",0) ). Changing it to ^mdpd or just removing it from the source code apparently fixes the problem.

@luishcc thanks for your bug report. You are correct, that check is incorrect and it is also incomplete as it does not account for hybrid style setups.

I've tried to address this in commit 088c5d7 and also cherry-picked the commit into the "maintenance" branch, which contains backports of bugfixes to the stable version. https://github.com/lammps/lammps/tree/maintenance This will eventually be released as update 2 to the stable version (probably some time before christmas).

Please give it a try and let us know if that works for you.

Thanks @akohlmey for the quick reply! I've tested the new changes with my mdpd scripts and they are all working.

Thanks @luishcc for confirming.