@@ -46,9 +46,10 @@ class BaseModel(object):
46
46
variables: dict
47
47
A dictionary that maps strings to expressions that represent
48
48
the useful variables
49
- events: list
50
- A list of events that should cause the solver to terminate (e.g. concentration
51
- goes negative)
49
+ events: list of pybamm.Event
50
+ A list of events. Each event can either cause the solver to terminate
51
+ (e.g. concentration goes negative), or be used to inform the solver of the
52
+ existance of a discontinuity (e.g. discontinuity in the input current)
52
53
concatenated_rhs : :class:`pybamm.Concatenation`
53
54
After discretisation, contains the expressions representing the rhs equations
54
55
concatenated into a single expression
@@ -105,7 +106,7 @@ def __init__(self, name="Unnamed model"):
105
106
self ._initial_conditions = {}
106
107
self ._boundary_conditions = {}
107
108
self ._variables = {}
108
- self ._events = {}
109
+ self ._events = []
109
110
self ._concatenated_rhs = None
110
111
self ._concatenated_algebraic = None
111
112
self ._concatenated_initial_conditions = None
@@ -337,7 +338,7 @@ def update(self, *submodels):
337
338
self ._boundary_conditions , submodel .boundary_conditions
338
339
)
339
340
self .variables .update (submodel .variables ) # keys are strings so no check
340
- self ._events . update ( submodel .events )
341
+ self ._events += submodel .events
341
342
342
343
def check_and_combine_dict (self , dict1 , dict2 ):
343
344
# check that the key ids are distinct
0 commit comments