Package org.openpixi.pixi.physics

Examples of org.openpixi.pixi.physics.Simulation


    stt.setGridCellsX(100);
    stt.setGridCellsY(100);
    stt.setGridSolver(new SimpleSolver());
    stt.setInterpolator(new ChargeConservingCIC());

    this.s = new Simulation(stt);
    this.g = s.grid;
    g.resetCurrent();
   
    this.poisolver = new PoissonSolverFFTPeriodic();
  }
View Full Code Here


    stt.setGridCellsX(100);
    stt.setGridCellsY(100);
    stt.setGridSolver(new SimpleSolver());
    stt.setInterpolator(new ChargeConservingCIC());

    Simulation s = new Simulation(stt);
    PoissonSolverCalculations.output(s.grid);
  }
View Full Code Here

    p.setVy((y2 - y1) / stt.getTimeStep());
    p.setMass(1);
    p.setCharge(charge);
    stt.addParticle(p);

    Simulation s = new Simulation(stt);
    s.prepareAllParticles();

    // Advance particle
    s.particlePush();

    // The simulation always creates its own copy of particles
    // (in fact the setting class does so)
    // and we would like to obtain the reference to our initial particle p.
    p = s.particles.get(0);

    //Remember old values after boundary check
    double sx = p.getPrevX();
    double sy = p.getPrevY();

    // Calculate current
    s.getInterpolation().interpolateToGrid(s.particles, s.grid, s.tstep);

    double jx = GridTestCommon.getJxSum(s.grid);
    double jy = GridTestCommon.getJySum(s.grid);

    if (VERBOSE) System.out.println("Total current " + text + ": jx = " + jx + ", jy = " + jy
View Full Code Here

    ConstantForce force = new ConstantForce();
    force.ex = ex;
    force.bz = bz;
    stt.addForce(force);

    Simulation s = new Simulation(stt);
    s.prepareAllParticles();

    // The simulation always creates its own copy of particles
    // (in fact the setting class does so)
    // and we would like to obtain the reference to our initial particle p.
    p = s.particles.get(0);

    // Advance particle
    s.particlePush();

    //Remember old values after boundary check
    double sx = p.getPrevX();
    double sy = p.getPrevY();

    // Calculate current
    s.getInterpolation().interpolateToGrid(s.particles, s.grid, s.tstep);

    double jx = GridTestCommon.getJxSum(s.grid);
    double jy = GridTestCommon.getJySum(s.grid);

    if (VERBOSE) System.out.println("Total current " + text + ": jx = " + jx + ", jy = " + jy
View Full Code Here

    defaultSettings.setParticleSolver(new Boris());
                defaultSettings.setInterpolator(new ChargeConservingCIC());
                defaultSettings.setOCLParticleSolver("boris");
                defaultSettings.setOCLGridInterpolator("charge conserving CIC");
               
    Simulation sequentialSimulation = new Simulation(defaultSettings);

    Settings openCLSettings = ClassCopier.copy(defaultSettings);
    Simulation openCLSimulation = new Simulation(openCLSettings);

    sequentialSimulation.run();
    openCLSimulation.run();

    ParticleComparator comparator = new ParticleComparator();
    comparator.compare(sequentialSimulation.particles, openCLSimulation.particles);
  }
View Full Code Here

    defaultSettings.setParticleSolver(new LeapFrogDamped());
                defaultSettings.setInterpolator(new ChargeConservingCIC());
                defaultSettings.setOCLParticleSolver("leap frog damped");
                defaultSettings.setOCLGridInterpolator("charge conserving CIC");
               
    Simulation sequentialSimulation = new Simulation(defaultSettings);

    Settings openCLSettings = ClassCopier.copy(defaultSettings);
    Simulation openCLSimulation = new Simulation(openCLSettings);

    sequentialSimulation.run();
    openCLSimulation.run();

    ParticleComparator comparator = new ParticleComparator();
    comparator.compare(sequentialSimulation.particles, openCLSimulation.particles);
  }
View Full Code Here

    defaultSettings.setParticleSolver(new Euler());
                defaultSettings.setInterpolator(new ChargeConservingCIC());
                defaultSettings.setOCLParticleSolver("euler");
                defaultSettings.setOCLGridInterpolator("charge conserving CIC");
               
    Simulation sequentialSimulation = new Simulation(defaultSettings);

    Settings openCLSettings = ClassCopier.copy(defaultSettings);
    Simulation openCLSimulation = new Simulation(openCLSettings);

    sequentialSimulation.run();
    openCLSimulation.run();

    ParticleComparator comparator = new ParticleComparator();
    comparator.compare(sequentialSimulation.particles, openCLSimulation.particles);
  }
View Full Code Here

    settings.setParticleSolver(new Boris());
    settings.setNumOfNodes(numOfNodes);
    settings.setIplServer(iplServer);

    if (numOfNodes == 1) {
      Simulation simulation = new Simulation(settings);
      simulation.run();
      ProfileInfo.printProfileInfo();
    }
    else if (numOfNodes > 1) {
      assert iplServer != null;
      Node node = new Node(settings);
View Full Code Here

    stt.setSimulationWidth(10);
    stt.setSimulationHeight(10);
    stt.setGridSolver(new SimpleSolver());
    stt.setInterpolator(new ChargeConservingCIC());
   
    this.s = new Simulation(stt);
    this.g = s.grid;
    this.g.resetCurrent();
   
    this.poisolver = new PoissonSolverFFTPeriodic();
  }
View Full Code Here

    p.setVy((y2 - y1) / stt.getTimeStep());
    p.setMass(1);
    p.setCharge(charge);
    stt.addParticle(p);

    Simulation s = new Simulation(stt);
    s.prepareAllParticles();

    // The simulation always creates its own copy of particles
    // (in fact the setting class does so)
    // and we would like to obtain the reference to our initial particle p.
    p = s.particles.get(0);

    // Advance particle
    s.particlePush();

    //Remember old values after boundary check
    double sx = p.getPrevX();
    double sy = p.getPrevY();

    // Calculate current
    s.getInterpolation().interpolateToGrid(s.particles, s.grid, s.tstep);

    double jx = GridTestCommon.getJxSum(s.grid);
    double jy = GridTestCommon.getJySum(s.grid);

    if (VERBOSE) System.out.println("Total current " + text + ": jx = " + jx + ", jy = " + jy
View Full Code Here

TOP

Related Classes of org.openpixi.pixi.physics.Simulation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.