Package org.openpixi.pixi.ui.util

Examples of org.openpixi.pixi.ui.util.WriteFile


    File file2 = new File("\\potential.dat");
    file2.delete();
   
    //creates new file "efield.dat" in working directory and writes
    //field data to it
    WriteFile fieldFile = new WriteFile("efeld", "");
    for (int i = 0; i < g.getNumCellsX(); i++) {
      for(int j = 0; j < g.getNumCellsY(); j++) {
        fieldFile.writeLine(i*g.getCellWidth() + "\t" + j*g.getCellHeight() +
            "\t" + g.getEx(i, j) + "\t" + g.getEy(i, j));
      }
    }
    fieldFile.closeFstream();
   
    WriteFile potentialFile = new WriteFile("potential", "");
    for (int i = 0; i < g.getNumCellsX(); i++) {
      for(int j = 0; j < g.getNumCellsY(); j++) {
        potentialFile.writeLine(i*g.getCellWidth() + "\t" + j*g.getCellHeight()  + "\t" + g.getPhi(i, j));
      }
    }
    potentialFile.closeFstream();
   
    //YOU NEED GNUPLOT FOR THIS http://www.gnuplot.info/
    //NEEDS TO BE IN YOUR EXECUTION PATH (i.e. PATH variable on windows)
    //plots the above output as vector field
    try {
View Full Code Here

TOP

Related Classes of org.openpixi.pixi.ui.util.WriteFile

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.