Msm/dielectric pair and kspace style crashes

Using LAMMPS 29 Aug 2024 Update 1, I am trying to run the example file for dielectric package.
The input script (shown below) with lj/cut/coul/long pair style and pppm/dielectric kspace
style works fine.

variable    data index data.confined

newton off
units       lj
atom_style  dielectric
atom_modify map array
dimension   3
boundary    p p f

variable    method index gmres  

read_data   ${data}

group interface type 1
group ions type 2 3

group cations type 2
group anions  type 3

pair_style      lj/cut/coul/long/dielectric 10.0
pair_coeff      * * 1.0 1.0
pair_coeff      1 1 0.0 1.0

kspace_style    pppm/dielectric 0.0001
kspace_modify   slab 3

neigh_modify    every 1 delay 0 check yes one 5000


fix             1 ions nve
fix		3 interface polarize/bem/gmres 1 1.0e-4

thermo          1
thermo_style    custom step evdwl ecoul elong epair 
thermo_modify   flush yes

run             100

If I instead use lj/cut/coul/msm pair style with msm/dielectric kspace style, the simulation crashes with a segmentation fault.

I am uploading the data file (data.confined) and the two input scripts (in.msm and in.pppm)
data.confined (215.9 KB)
in.msm (678 Bytes)
in.pppm (703 Bytes)

Please try to apply this change, recompile LAMMPS, and run again:

  diff --git a/src/DIELECTRIC/msm_dielectric.cpp b/src/DIELECTRIC/msm_dielectric.cpp
  index fd09e40acc..2eb64743c2 100644
  --- a/src/DIELECTRIC/msm_dielectric.cpp
  +++ b/src/DIELECTRIC/msm_dielectric.cpp
  @@ -113,9 +110,11 @@ void MSMDielectric::compute(int eflag, int vflag)
     if (atom->nmax > nmax) {
       memory->destroy(part2grid);
       memory->destroy(efield);
  +    memory->destroy(phi);
       nmax = atom->nmax;
       memory->create(part2grid,nmax,3,"msm:part2grid");
       memory->create(efield,nmax,3,"msm:efield");
  +    memory->create(phi,nmax,"msm:phi");
     }
   
     // find grid points for all my particles

Sorry for the late reply, these changes work. Thank you.

1 Like