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

import java.util.ArrayList;
import java.util.Arrays;
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;

  /**
   * 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) {

    shape = new ArrayList<Integer>(Arrays.asList(nRows, nCols));
    spacing = new ArrayList<Double>(Arrays.asList(dx, dy));
    origin = new ArrayList<Double>(Arrays.asList(xStart, 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 using default parameter values.
   */
  public Heat() {
    this(10, 20, 1.0, 1.0, 0.0, 0.0, 1.0);
  }

  /**
   * 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;
  }

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

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

}

@@ -382,28 +382,26 @@
 private 
-List%3CD
+d
 ouble
-%3E
+%5B%5D%5B%5D
  tempera
@@ -1167,29 +1167,24 @@
  alpha;%0A    
-this.
 time = 0.0;%0A
@@ -1217,21 +1217,16 @@
 ath.min(
-this.
 spacing.
@@ -1233,21 +1233,16 @@
 get(0), 
-this.
 spacing.
@@ -1250,29 +1250,24 @@
 et(1));%0A    
-this.
 timeStep = M
@@ -1325,35 +1325,201 @@
  // 
-Double ran = Math.random();
+Initialize temperature of plate. The top row is hot.%0A    temperature = new double%5Bshape.get(0)%5D%5Bshape.get(1)%5D;%0A    for (int i = 0; i %3C shape.get(1); i++) %7B%0A      temperature%5B0%5D%5Bi%5D = 20.0;%0A    %7D
 %0A  %7D
@@ -2618,36 +2618,34 @@
 %7D%0A%0A  public 
-List%3CD
+d
 ouble
-%3E
+%5B%5D%5B%5D
  getTemperat
@@ -2710,28 +2710,26 @@
 erature(
-List%3CD
+d
 ouble
-%3E
+%5B%5D%5B%5D
  tempera

Convert temperature property to a 2D array