Kspace error with hybrid dipole

Hi,

I am trying to simulate a Stockmayer fluid system with tabular potential.

The force field that I want to set up is sum of LJ + dipole + tabular interactions. So, I set up this using hybrid/overlay pair_style as below.

pair_style hybrid/overlay table linear 1000 lj/cut/dipole/long 0.9
pair_coeff 1 1 lj/cut/dipole/long 0.6 0.3
pair_coeff 1 1 table cg_cg.pot TEST 0.9
kspace_style ewald/disp 1.0e-4

However, this leads to the error:

KSpace style is incompatible with Pair style

I checked the documentation, and I do not see any such restriction on using KSpace style with hybrid/overlay and lj/cut/dipole/long?

I appreciate any help to resolve this issue.

Thanks,

Sikandar

Hi,

I am trying to simulate a Stockmayer fluid system with tabular potential.

The force field that I want to set up is sum of LJ + dipole + tabular
interactions. So, I set up this using hybrid/overlay pair_style as below.

pair_style hybrid/overlay table linear 1000 lj/cut/dipole/long 0.9
pair_coeff 1 1 lj/cut/dipole/long 0.6 0.3
pair_coeff 1 1 table cg_cg.pot TEST 0.9
kspace_style ewald/disp 1.0e-4

However, this leads to the error:

KSpace style is incompatible with Pair style

I checked the documentation, and I do not see any such restriction on
using KSpace style with hybrid/overlay and lj/cut/dipole/long?

​the logic in LAMMPS is the other way around. since there are so many
permutations of possible inputs, it is impossible to mention all
incompatibilities, thus if the documentation does not explicitly say that
something is supported, it may not be supported.

the problem in your case is the following: in order to determine
compatibility between ​short range coulomb and long-range coulomb solver,
there has to be a flag set in the pair style. pair style lj/cut/dipole/long
*does* set that flag. however, since you are using pair style
hybrid/overlay, this flag needs to be propagated from the sub_style and
that has not been implemented (yet).

​try making the following change to pair_hybrid.cpp and recompile and see
if that resolves the issue.

diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp
index 490b3a5..7ca6c0f 100644
--- a/src/pair_hybrid.cpp
+++ b/src/pair_hybrid.cpp
@@ -318,7 +318,7 @@ void PairHybrid::flags()
   // manybody_flag = 1 if any sub-style is set
   // no_virial_fdotr_compute = 1 if any sub-style is set
   // ghostneigh = 1 if any sub-style is set
- // ewaldflag, pppmflag, msmflag, dispersionflag, tip4pflag = 1
+ // ewaldflag, pppmflag, msmflag, dipoleflag, dispersionflag, tip4pflag =
1
   // if any sub-style is set
   // compute_flag = 1 if any sub-style is set

@@ -333,6 +333,7 @@ void PairHybrid::flags()
     if (styles[m]->ewaldflag) ewaldflag = 1;
     if (styles[m]->pppmflag) pppmflag = 1;
     if (styles[m]->msmflag) msmflag = 1;
+ if (styles[m]->dipoleflag) dipoleflag = 1;
     if (styles[m]->dispersionflag) dispersionflag = 1;
     if (styles[m]->tip4pflag) tip4pflag = 1;
     if (styles[m]->compute_flag) compute_flag = 1;

Hi Axel,

Thank you very much. With your patch the error is gone!

Thanks,

Sikandar