/**
 * The 2D heat equation.
 */
package edu.colorado.csdms.heat;

import java.util.List;

/**
 * Solve the heat equation on a grid.
 */
public class Heat {

  private List<Integer> shape;
  private List<Double> spacing;
  private List<Double> origin;
  private Double alpha;
  private Double time;
  private Double timeStep;
  private List<Double> temperature;
  private List<Double> nextTemperature;

  /**
   * Create a new Heat model.
   * 
   * @param nRows the number of rows in the solution grid
   * @param nCols the number of columns in the solution grid
   * @param dx distance between columns in grid
   * @param dy distance between rows in grid
   * @param xStart coordinates of lower left corner of grid
   * @param yStart coordinates of lower left corner of grid
   * @param alpha parameter in heat equation
   */
  public Heat(Integer nRows, Integer nCols, Double dx, Double dy,
      Double xStart, Double yStart, Double alpha) {

    this.shape.add(0, nRows);
    this.shape.add(1, nCols);
    this.spacing.add(0, dx);
    this.spacing.add(1, dy);
    this.origin.add(0, xStart);
    this.origin.add(1, yStart);
    this.alpha = alpha;
    this.time = 0.0;

    Double minSpacing = Math.min(this.spacing.get(0), this.spacing.get(1));
    this.timeStep = Math.pow(minSpacing, 2.0) / (4.0 * this.alpha);

    // Double ran = Math.random();
  }

  /**
   * Create a Heat model from settings in a file.
   * 
   * @param fileName a YAML file with Heat model settings
   */
  public Heat(String fileName) {
    ;
  }

  public List<Integer> getShape() {
    return shape;
  }

  public void setShape(List<Integer> shape) {
    this.shape = shape;
  }

  public List<Double> getSpacing() {
    return spacing;
  }

  public void setSpacing(List<Double> spacing) {
    this.spacing = spacing;
  }

  public List<Double> getOrigin() {
    return origin;
  }

  public void setOrigin(List<Double> origin) {
    this.origin = origin;
  }

  public Double getAlpha() {
    return alpha;
  }

  public void setAlpha(Double alpha) {
    this.alpha = alpha;
  }

  public Double getTime() {
    return time;
  }

  public void setTime(Double time) {
    this.time = time;
  }

  public Double getTimeStep() {
    return timeStep;
  }

  public void setTimeStep(Double timeStep) {
    this.timeStep = timeStep;
  }

  public List<Double> getTemperature() {
    return temperature;
  }

  public void setTemperature(List<Double> temperature) {
    this.temperature = temperature;
  }

  public List<Double> getNextTemperature() {
    return nextTemperature;
  }

  public void setNextTemperature(List<Double> nextTemperature) {
    this.nextTemperature = nextTemperature;
  }

  /**
   * Calculate new temperatures for the next time step.
   */
  public void advanceInTime() {
    ;
  }

  /**
   * @param args
   */
  public static void main(String[] args) {
    ;
  }

}

@@ -60,16 +60,69 @@
 .heat;%0A%0A
+import java.util.ArrayList;%0Aimport java.util.Arrays;%0A
 import j
@@ -411,48 +411,8 @@
 ure;
-%0A  private List%3CDouble%3E nextTemperature;
 %0A%0A  
@@ -961,62 +961,66 @@
     
-this.shape.add(0, nRows);%0A    this.shape.add(1
+shape = new ArrayList%3CInteger%3E(Arrays.asList(nRows
 , nCols)
 ;%0A  
@@ -1019,121 +1019,126 @@
 ols)
+)
 ;%0A    
-this.
 spacing
-.add(0, dx);%0A    this.spacing.add(1
+ = new ArrayList%3CDouble%3E(Arrays.asList(dx
 , dy)
+)
 ;%0A    
-this.
 origin
-.add(0, xStart);%0A    this.origin.add(1
+ = new ArrayList%3CDouble%3E(Arrays.asList(xStart
 , yS
@@ -1142,16 +1142,17 @@
  yStart)
+)
 ;%0A    th
@@ -2506,200 +2506,8 @@
  %7D%0A%0A
-  public List%3CDouble%3E getNextTemperature() %7B%0A    return nextTemperature;%0A  %7D%0A%0A  public void setNextTemperature(List%3CDouble%3E nextTemperature) %7B%0A    this.nextTemperature = nextTemperature;%0A  %7D%0A%0A
   /*

Remove nextTemperature property