@@ -0,0 +1,1345 @@
+package etomica.potential.ewald;%0A%0Aimport etomica.potential.Potential2SoftSpherical;%0Aimport etomica.space.Space;%0Aimport etomica.space3d.Space3D;%0A%0Aimport static etomica.math.SpecialFunctions.erfc;%0A%0Apublic class P2Ewald1Real extends Potential2SoftSpherical %7B%0A    private final double qiqj;%0A    private final double alpha;%0A%0A    private static final double SQRT_PI = Math.sqrt(Math.PI);%0A%0A    public P2Ewald1Real(double qiqj, double alpha) %7B%0A        super(Space3D.getInstance());%0A        this.qiqj = qiqj;%0A        this.alpha = alpha;%0A    %7D%0A%0A    @Override%0A    public double du(double r2) %7B%0A        double r = Math.sqrt(r2);%0A        return -qiqj * (2 * SQRT_PI * Math.exp(-alpha*alpha*r2) *alpha + erfc(alpha*r)/r);%0A    %7D%0A%0A    @Override%0A    public void udu(double r2, double%5B%5D u, double%5B%5D du) %7B%0A        double r = Math.sqrt(r2);%0A        u%5B0%5D += qiqj*erfc(alpha*r)/r;%0A        du%5B0%5D += -qiqj* 2 * SQRT_PI * Math.exp(-alpha*alpha*r2) * alpha;%0A    %7D%0A%0A    @Override%0A    public double d2u(double r2) %7B%0A        double r = Math.sqrt(r2);%0A        return -qiqj * (2 * SQRT_PI * Math.exp(-alpha*alpha*r2) *(alpha*(1 - alpha*alpha*2*r)) + erfc(alpha*r)/r);%0A    %7D%0A%0A    @Override%0A    public double uInt(double rC) %7B%0A        return 0;%0A    %7D%0A%0A    @Override%0A    public double u(double r2) %7B%0A        double r = Math.sqrt(r2);%0A        return qiqj*erfc(alpha*r)/r;%0A    %7D%0A%7D%0A

Add Ewald electrostatic potential