Skip to content

Commit

Permalink
#4776 processed computed var shape
Browse files Browse the repository at this point in the history
  • Loading branch information
rtimms committed Feb 4, 2025
1 parent d8a5275 commit 2b18b4f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/pybamm/solvers/processed_variable_computed.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,12 @@ def unroll_3D(
n_dim2 = self.unroll_params["n_dim2"]
n_dim3 = self.unroll_params["n_dim3"]
axis_swaps = self.unroll_params["axis_swaps"]
entries = np.concatenate(self._unroll_nnz(realdata), axis=0).reshape(
(len(self.t_pts), n_dim1, n_dim2, n_dim3)
entries = (
np.concatenate(self._unroll_nnz(realdata), axis=0)
.transpose()
.reshape(
(len(self.t_pts), n_dim1, n_dim2, n_dim3),
)
)
for a, b in axis_swaps:
entries = np.moveaxis(entries, a, b)
Expand Down Expand Up @@ -483,6 +487,7 @@ def initialise_3D(self):
n_dim1=third_dim_size,
n_dim2=second_dim_size,
n_dim3=first_dim_size,
axis_swaps=[(0, 3), (0, 2), (0, 1)],
)

# add points outside first dimension domain for extrapolation to
Expand Down

0 comments on commit 2b18b4f

Please sign in to comment.