Skip to content

Commit

Permalink
#664 fix casadi solver
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis CI committed Oct 26, 2019
1 parent 15e6b73 commit 372fa0c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
4 changes: 1 addition & 3 deletions examples/scripts/compare-dae-solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@

# set mesh
var = pybamm.standard_spatial_vars

var_pts = {var.x_n: 50, var.x_s: 10, var.x_p: 50, var.r_n: 20, var.r_p: 20}
# var_pts = model.default_var_pts
var_pts = {var.x_n: 50, var.x_s: 50, var.x_p: 50, var.r_n: 20, var.r_p: 20}
mesh = pybamm.Mesh(geometry, model.default_submesh_types, var_pts)

# discretise model
Expand Down
2 changes: 1 addition & 1 deletion examples/scripts/compare_lithium_ion.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
t_eval = np.linspace(0, 0.17, 100)
for i, model in enumerate(models):
model.convert_to_format = "casadi"
solutions[i] = model.default_solver.solve(model, t_eval)
solutions[i] = pybamm.CasadiSolver().solve(model, t_eval)

# plot
plot = pybamm.QuickPlot(models, mesh, solutions)
Expand Down
5 changes: 0 additions & 5 deletions pybamm/solvers/casadi_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,3 @@ def integrate_casadi(self, problem, y0, t_eval, mass_matrix=None):
# If it doesn't work raise error
raise pybamm.SolverError(e.args[0])

def calculate_consistent_initial_conditions(
self, rhs, algebraic, y0_guess, jac=None
):
"No need to calculate initial conditions separately with this solver"
return y0_guess

0 comments on commit 372fa0c

Please sign in to comment.