@@ -0,0 +1,1755 @@
+package edu.colorado.csdms.heat;%0A%0Aimport java.util.List;%0A%0A/**%0A * A solver for the 2D heat equation on a uniform grid.%0A */%0Apublic class Solve2D %7B%0A%0A  /**%0A   * Solve the 2D heat equation on a uniform grid.%0A   * %0A   * @param temperature a 2D array of temperatures%0A   * @param shape the dimensions of the grid, in (rows, cols)%0A   * @param spacing the distance between rows and columns, respectively%0A   * @param alpha parameter in heat equation%0A   * @param timeStep current time step%0A   * @return the temperatures after timeStep%0A   */%0A  public static double%5B%5D%5B%5D solve(double%5B%5D%5B%5D temperature, List%3CInteger%3E shape,%0A      List%3CDouble%3E spacing, Double alpha, Double timeStep) %7B%0A%0A    Integer topRow = shape.get(0) - 1;%0A    Integer topCol = shape.get(1) - 1;%0A    Double dx2 = Math.pow(spacing.get(1), 2.0);%0A    Double dy2 = Math.pow(spacing.get(0), 2.0);%0A    Double c = alpha * timeStep / (dx2 + dy2);%0A    double%5B%5D%5B%5D newTemperature = new double%5Bshape.get(0)%5D%5Bshape.get(1)%5D;%0A    %0A    for (int i = 1; i %3C topRow; i++) %7B%0A      for (int j = 1; j %3C topCol; j++) %7B%0A        Double rowOp = dx2 * (temperature%5Bi%5D%5Bj - 1%5D + temperature%5Bi%5D%5Bj + 1%5D);%0A        Double colOp = dy2 * (temperature%5Bi - 1%5D%5Bj%5D + temperature%5Bi + 1%5D%5Bj%5D);%0A        newTemperature%5Bi%5D%5Bj%5D =%0A            c * (rowOp + colOp - 2.0 * (dx2 + dy2) * temperature%5Bi%5D%5Bj%5D);%0A      %7D%0A    %7D%0A%0A    for (int i = 0; i %3C shape.get(0); i++) %7B%0A      newTemperature%5Bi%5D%5B0%5D = 0.0;%0A      newTemperature%5Bi%5D%5BtopCol%5D = 0.0;%0A    %7D%0A%0A    for (int j = 0; j %3C shape.get(1); j++) %7B%0A      newTemperature%5B0%5D%5Bj%5D = 0.0;%0A      newTemperature%5BtopRow%5D%5Bj%5D = 0.0;%0A    %7D%0A%0A    for (int i = 1; i %3C topRow; i++) %7B%0A      for (int j = 1; j %3C topCol; j++) %7B%0A        newTemperature%5Bi%5D%5Bj%5D += temperature%5Bi%5D%5Bj%5D;%0A      %7D%0A    %7D%0A    %0A    return newTemperature;%0A  %7D%0A%7D%0A

Add solver class