U = {
let U1 = [];
for (let i = 0; i <= N; i++) {
let y = i / N;
U1.push(
d3.range(N + 1).map(function (j) {
let x = j / N;
if (i == 0 || i == N || j == 0 || j == N) {
return uBoundary(x, y);
} else {
return u0(x, y);
}
})
);
}
let U = [U1];
for (let k = 1; k < T + 1; k++) {
let UU = [];
for (let i = 0; i <= N; i++) {
let y = i / N;
UU.push(
d3.range(0, N + 1).map(function (j) {
if (i == 0 || i == N || j == 0 || j == N) {
let x = j / N;
return uBoundary(x, y);
} else {
return (
(U[k - 1][i - 1][j] +
U[k - 1][i + 1][j] +
U[k - 1][i][j - 1] +
U[k - 1][i][j + 1]) /
4
);
}
})
);
}
U.push(UU);
}
let UThin = [U1];
for (let i = 50; i < U.length; i = i + 50) {
UThin.push(U[i]);
}
return UThin;
}