package etomica.simulation;

import etomica.data.meter.MeterPressureTensor;
import etomica.space3d.Space3D;
import etomica.surfacetension.LJMC;
import org.openjdk.jmh.annotations.*;

import java.util.concurrent.TimeUnit;

@State(Scope.Benchmark)
@Fork(1)
public class BenchSimSurfacetensionLJMC {

    @Param({"1000", "20000"})
    private int numAtoms;

    private LJMC sim;
    private MeterPressureTensor meter;

    @Setup(Level.Iteration)
    public void setUp() {
        sim = new LJMC(Space3D.getInstance(), numAtoms, 1.1, 6);

        meter = new MeterPressureTensor(sim.potentialMaster, sim.space);
        meter.setBox(sim.box);
        meter.setTemperature(1.1);

    }

    @Benchmark
    @BenchmarkMode(Mode.Throughput)
    @OutputTimeUnit(TimeUnit.SECONDS)
    @Warmup(time = 1, iterations = 5)
    @Measurement(time = 1, timeUnit = TimeUnit.SECONDS)
    public void surfacetension() {
        sim.integrator.doStep();
    }
}

@@ -22,16 +22,126 @@
 ation;%0A%0A
+import etomica.data.AccumulatorAverageFixed;%0Aimport etomica.data.DataPumpListener;%0Aimport etomica.data.IData;%0A
 import e
@@ -779,16 +779,231 @@
 e(1.1);%0A
+        DataPumpListener pumpListener = new DataPumpListener(meter, new AccumulatorAverageFixed(10), 2 * numAtoms);%0A        sim.integrator.getEventManager().addListener(pumpListener);%0A        sim.integrator.reset();
 %0A    %7D%0A%0A
@@ -1153,17 +1153,17 @@
 (time = 
-1
+5
 , timeUn
@@ -1179,24 +1179,40 @@
 Unit.SECONDS
+, iterations = 5
 )%0A    public
@@ -1212,20 +1212,21 @@
  public 
-void
+IData
  surface
@@ -1266,20 +1266,52 @@
 r.doStep();%0A
+        return meter.getData();%0A
     %7D%0A%7D%0A

Add integrator reset to Surfacetension bench