@@ -82,7 +82,7 @@ def bcs(self, value):
82
82
# reset discretised_symbols
83
83
self ._discretised_symbols = {}
84
84
85
- def process_model (self , model , inplace = True ):
85
+ def process_model (self , model , inplace = True , check_model = True ):
86
86
"""Discretise a model.
87
87
Currently inplace, could be changed to return a new model.
88
88
@@ -91,9 +91,15 @@ def process_model(self, model, inplace=True):
91
91
model : :class:`pybamm.BaseModel`
92
92
Model to dicretise. Must have attributes rhs, initial_conditions and
93
93
boundary_conditions (all dicts of {variable: equation})
94
- inplace: bool, optional
94
+ inplace : bool, optional
95
95
If True, discretise the model in place. Otherwise, return a new
96
96
discretised model. Default is True.
97
+ check_model : bool, optional
98
+ If True, model checks are performed after discretisation. For large
99
+ systems these checks can be slow, so can be skipped by setting this
100
+ option to False. When developing, testing or debugging it is recommened
101
+ to leave this option as True as it may help to identify any errors.
102
+ Default is True.
97
103
98
104
Returns
99
105
-------
@@ -173,7 +179,9 @@ def process_model(self, model, inplace=True):
173
179
model_disc .mass_matrix = self .create_mass_matrix (model_disc )
174
180
175
181
# Check that resulting model makes sense
176
- self .check_model (model_disc )
182
+ if check_model :
183
+ pybamm .logger .info ("Performing model checks for {}" .format (model .name ))
184
+ self .check_model (model_disc )
177
185
178
186
pybamm .logger .info ("Finish discretising {}" .format (model .name ))
179
187
0 commit comments