Skip to content

Commit

Permalink
#1886 added fix within processed variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Scottmar93 committed Jan 10, 2022
1 parent c8a01ba commit bc383c0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pybamm/solvers/processed_variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,12 @@ def initialise_sensitivity_explicit_forward(self):

# Add the individual sensitivity
start = 0
for name, inp in self.all_inputs[0].items():
# Sort the list of input names so that it aligns
# with the sorting applied during solver setup
sorted_input_names = self.all_inputs[0].keys()
sorted_input_names.sort()
for name in sorted_input_names:
inp = self.all_inputs[0][name]
end = start + inp.shape[0]
sensitivities[name] = S_var[:, start:end]
start = end
Expand Down

0 comments on commit bc383c0

Please sign in to comment.