Ewald summation for 2d periodic systems

I am trying to evaluate long ranged dipolar interactions using ewald summation in a 2d system but it is not directly computable in LAMMPS. However we can introduce a slab correction factor for a quasi 2d system, but then i encounter lost atoms error. How can i come out this situation?

Lost atoms can have many reasons and thus there is not a simple, single response that would tell you what to do. First you have to figure out when exactly during the simulation atoms are lost and how many and where. Some general explanations are here: 11.2. Error and warning details — LAMMPS documentation

Beyond that, you can search through the forum and you should find numerous discussions about lost atoms and lost bonds and similar errors. Not all of the advice given will be applicable to your situation, but there should be some that does.

If you want more specific advice, you have to furnish a (complete) small test system input deck that reproduces your problem quickly. With a vague description like your post only vague answers are possible.