/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// Source file generated by Etomica

package etomica.simulation.prototypes;

import etomica.action.BoxImposePbc;
import etomica.action.activity.ActivityIntegrate;
import etomica.atom.AtomType;
import etomica.box.Box;
import etomica.config.ConfigurationLattice;
import etomica.integrator.IntegratorHard;
import etomica.lattice.LatticeCubicFcc;
import etomica.listener.IntegratorListenerAction;
import etomica.potential.P2HardSphere;
import etomica.potential.PotentialMaster;
import etomica.potential.PotentialMasterMonatomic;
import etomica.simulation.Simulation;
import etomica.space3d.Space3D;
import etomica.species.SpeciesSpheresMono;

public class HSMD3DNoNbr extends Simulation {

    private static final long serialVersionUID = 1L;
    public Box box;
    public IntegratorHard integrator;
    public SpeciesSpheresMono species;
    public P2HardSphere potential;

    public HSMD3DNoNbr() {
        super(Space3D.getInstance());
        PotentialMaster potentialMaster = new PotentialMasterMonatomic(this);

        int numAtoms = 256;
        double sigma = 1.0;
        double l = 14.4573 * Math.pow((numAtoms / 2020.0), 1.0 / 3.0);

        integrator = new IntegratorHard(this, potentialMaster, space);
        integrator.setIsothermal(false);
        integrator.setTimeStep(0.01);

        ActivityIntegrate activityIntegrate = new ActivityIntegrate(integrator);
        activityIntegrate.setSleepPeriod(1);
        getController().addAction(activityIntegrate);
        species = new SpeciesSpheresMono(this, space);
        species.setIsDynamic(true);
        addSpecies(species);
        potential = new P2HardSphere(space, sigma, false);
        potentialMaster.addPotential(potential, new AtomType[]{species.getLeafType(), species.getLeafType()});

        box = new Box(space);
        addBox(box);
        box.setNMolecules(species, numAtoms);
        box.getBoundary().setBoxSize(space.makeVector(new double[]{l, l, l}));
//        box.setBoundary(new BoundaryTruncatedOctahedron(space));
        integrator.setBox(box);
        integrator.getEventManager().addListener(new IntegratorListenerAction(new BoxImposePbc(box, space)));
        new ConfigurationLattice(new LatticeCubicFcc(space), space).initializeCoordinates(box);
    }

    public static void main(String[] args) {
        HSMD3DNoNbr simulation = new HSMD3DNoNbr();
        simulation.getController().actionPerformed();
        System.out.println("Simulation run ok");


    }
}//end of class

@@ -460,16 +460,59 @@
 attice;%0A
+import etomica.graphics.SimulationGraphic;%0A
 import e
@@ -885,42 +885,65 @@
 o;%0A%0A
-public class HSMD3DNoNbr extends S
+/**%0A * Three-dimensional hard-sphere molecular dynamics s
 imul
@@ -952,63 +952,132 @@
 ion 
-%7B%0A%0A    private static final long serialVersionUID = 1L;
+with no%0A * neighbor listing.%0A *%0A * @author David Kofke and Andrew Schultz%0A */%0Apublic class HSMD3DNoNbr extends Simulation %7B%0A
 %0A   
@@ -2693,17 +2693,17 @@
         
-s
+S
 imulatio
@@ -2707,94 +2707,187 @@
 tion
-.getController().actionPerformed();%0A        System.out.println(%22Simulation run ok%22);%0A%0A
+Graphic simGraphic = new SimulationGraphic(simulation, SimulationGraphic.TABBED_PANE, simulation.getSpace(), simulation.getController());%0A        simGraphic.makeAndDisplayFrame();
 %0A   

add class javadoc, make main method run GUI simulation