@@ -98,13 +98,19 @@ def set_parameters(self):
98
98
)
99
99
self ._parameter_values .process_geometry (self ._geometry )
100
100
101
- def build (self ):
101
+ def build (self , check_model = True ):
102
102
"""
103
103
A method to build the model into a system of matrices and vectors suitable for
104
104
performing numerical computations. If the model has already been built or
105
105
solved then this function will have no effect. If you want to rebuild,
106
106
first use "reset()". This method will automatically set the parameters
107
107
if they have not already been set.
108
+
109
+ Parameters
110
+ ----------
111
+ check_model : bool, optional
112
+ If True, model checks are performed after discretisation (see
113
+ :meth:`pybamm.Discretisation.process_model`). Default is True.
108
114
"""
109
115
110
116
if self .built_model :
@@ -113,9 +119,11 @@ def build(self):
113
119
self .set_parameters ()
114
120
self ._mesh = pybamm .Mesh (self ._geometry , self ._submesh_types , self ._var_pts )
115
121
self ._disc = pybamm .Discretisation (self ._mesh , self ._spatial_methods )
116
- self ._built_model = self ._disc .process_model (self ._model , inplace = False )
122
+ self ._built_model = self ._disc .process_model (
123
+ self ._model , inplace = False , check_model = check_model
124
+ )
117
125
118
- def solve (self , t_eval = None , solver = None ):
126
+ def solve (self , t_eval = None , solver = None , check_model = True ):
119
127
"""
120
128
A method to solve the model. This method will automatically build
121
129
and set the model parameters if not already done so.
@@ -129,8 +137,11 @@ def solve(self, t_eval=None, solver=None):
129
137
non-dimensional time of 1.
130
138
solver : :class:`pybamm.BaseSolver`
131
139
The solver to use to solve the model.
140
+ check_model : bool, optional
141
+ If True, model checks are performed after discretisation (see
142
+ :meth:`pybamm.Discretisation.process_model`). Default is True.
132
143
"""
133
- self .build ()
144
+ self .build (check_model = check_model )
134
145
135
146
if t_eval is None :
136
147
try :
0 commit comments