Skip to content

Commit

Permalink
Fixed style issues in the last commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yannick Kuhn committed Aug 12, 2020
1 parent 86588b0 commit 6b24217
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pybamm/spatial_methods/spectral_volume.py
Original file line number Diff line number Diff line change
@@ -288,7 +288,7 @@ def gradient(self, symbol, discretised_symbol, boundary_conditions):

# Multiply by gradient matrix
out = (gradient_matrix @ reconstructed_symbol
+ penalty_matrix @ discretised_symbol)
+ penalty_matrix @ discretised_symbol)

# Add Neumann boundary conditions, if defined
if symbol.id in boundary_conditions:
@@ -362,7 +362,7 @@ def gradient_matrix(self, domain, auxiliary_domains):
for i in range(1, n - 1):
sub_matrix[i * d, i * (d + 1):(i + 1) * (d + 1)] = (
f * sub_matrix_raw[i * (d + 1),
i * (d + 1):(i + 1) * (d + 1)]
i * (d + 1):(i + 1) * (d + 1)]
)
sub_matrix[i * d + 1:(i + 1) * d,
i * (d + 1):(i + 1) * (d + 1)] = (
@@ -371,7 +371,7 @@ def gradient_matrix(self, domain, auxiliary_domains):
)
sub_matrix[(i + 1) * d, i * (d + 1):(i + 1) * (d + 1)] = (
f * sub_matrix_raw[i * (d + 1) + d,
i * (d + 1):(i + 1) * (d + 1)]
i * (d + 1):(i + 1) * (d + 1)]
)
sub_matrix[-d - 1, -d - 1:] = f * sub_matrix_raw[-d - 1, -d - 1:]
sub_matrix[-d:, -d - 1:] = sub_matrix_raw[-d:, -d - 1:]
@@ -416,7 +416,7 @@ def penalty_matrix(self, domain, auxiliary_domains):
n = submesh.npts
d = self.order
e = np.zeros(n - 1)
e[d-1::d] = 1 / submesh.d_nodes[d-1::d]
e[d - 1::d] = 1 / submesh.d_nodes[d - 1::d]
sub_matrix = vstack([
np.zeros(n),
diags([-e, e], [0, 1], shape=(n - 1, n)),

0 comments on commit 6b24217

Please sign in to comment.