Skip to content

Commit

Permalink
#1005 fix integration variable
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinsulzer committed May 20, 2020
1 parent efafa95 commit 05b3f6c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 4 additions & 4 deletions pybamm/expression_tree/unary_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,10 +567,10 @@ def __init__(self, child, integration_variable):
super().__init__(child, integration_variable)
# Overwrite the name
self.name = "{} integrated w.r.t {}".format(
child.name, integration_variable.name
child.name, self.integration_variable[0].name
)
if isinstance(integration_variable, pybamm.SpatialVariable):
self.name += " on {}".format(integration_variable.domain)
self.name += " on {}".format(self.integration_variable[0].domain)


class BackwardIndefiniteIntegral(BaseIndefiniteIntegral):
Expand All @@ -597,10 +597,10 @@ def __init__(self, child, integration_variable):
super().__init__(child, integration_variable)
# Overwrite the name
self.name = "{} integrated backward w.r.t {}".format(
child.name, integration_variable.name
child.name, self.integration_variable[0].name
)
if isinstance(integration_variable, pybamm.SpatialVariable):
self.name += " on {}".format(integration_variable.domain)
self.name += " on {}".format(self.integration_variable[0].domain)


class DefiniteIntegralVector(SpatialOperator):
Expand Down
6 changes: 2 additions & 4 deletions pybamm/spatial_methods/finite_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,7 @@ def indefinite_integral_matrix_edges(self, domain, direction):
Notes
-----
Forward integral
^^^^^^^^^^^^^^^^
**Forward integral**
.. math::
F(x) = \\int_0^x\\!f(u)\\,du
Expand All @@ -367,8 +366,7 @@ def indefinite_integral_matrix_edges(self, domain, direction):
integrand vector `f`, so we add a column of zeros at each end of the
indefinite integral matrix to ignore these.
Backward integral
^^^^^^^^^^^^^^^^^
**Backward integral**
.. math::
F(x) = \\int_x^end\\!f(u)\\,du
Expand Down

0 comments on commit 05b3f6c

Please sign in to comment.