I am attaching 2 sets of test inputs. In gulp_1.gin, I have used a 3d periodic system with a ‘long enough’ cell parameter C (if say z coords range from 8 to 11, C is taken to be 50). In gulp_2.gin, I have a 2d periodic system with z in angs and x and y in frac. I have done single-point energy calc for both.
I have also done a similar calculation in lammps with a 2d periodic system. On matching, the energies from gulp_2.gin and lammps match. However, the value from gulp_1.gin is far from it.
How do I use a 3d periodic setup (cell, fractional) in representing a 2d setup? I thought a long enough Z/C would do the trick.
The reason why the 3-D cell with large c doesn’t give exactly the same energy as the 2-D cell is because you’ve used the “c6” keyword. For the 3-D case (it’s not implemented for 2-D) this means that an Ewald-style sum is used to converge the dispersion terms to the long-range limit. Therefore even if you make the c direction large it will still contribute to the energy via reciprocal space. If you remove the “c6” option then you’ll get the same energy for both cases. One thing to remember is that if you introduce charges into your model then making 2-D and 3-D agree can be hard for similar reasons and will depend on the dipole of the slab.