Skip to content
This repository was archived by the owner on Jul 19, 2023. It is now read-only.

Commit 274105c

Browse files
author
Akash Garg
committed
Fixing bad merge and updating higher order test
1 parent adcc01a commit 274105c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/MOLFiniteDifference/MOL_discretization.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ function SciMLBase.symbolic_discretize(pdesys::ModelingToolkit.PDESystem,discret
195195
# Use max and min to apply buffers
196196
central_neighbor_idxs(II,j) = stencil(j) .+ max(Imin,min(II,Imax))
197197
central_neighbor_space(II,j) = vec(grid[j][map(i->i[j],central_neighbor_idxs(II,j))])
198-
central_weights(d_order, II,j) = DiffEqOperators.calculate_weights(2, grid[j][II[j]], central_neighbor_space(II,j))
198+
central_weights(d_order, II,j) = DiffEqOperators.calculate_weights(d_order, grid[j][II[j]], central_neighbor_space(II,j))
199199
central_deriv(d_order, II,j,k) = dot(central_weights(d_order, II,j),depvarsdisc[k][central_neighbor_idxs(II,j)])
200200

201201
# get a sorted list derivative order such that highest order is first. This is useful when substituting rules

test/MOL/MOL_1D_HigherOrder.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,14 @@ end
103103
# Discretization
104104
dx = 0.4; dt = 0.2
105105

106-
discretization = MOLFiniteDifference([x=>dx],t;centered_order=4)
106+
discretization = MOLFiniteDifference([x=>dx],t;centered_order=4,grid_align=center_align)
107107
pdesys = PDESystem(eq,bcs,domains,[x,t],[u(x,t)])
108108
prob = discretize(pdesys,discretization)
109109

110110
sol = solve(prob,Tsit5(),saveat=0.1,dt=dt)
111+
112+
@test sol.retcode == :Success
113+
111114
xs = domains[1].domain.lower+dx+dx:dx:domains[1].domain.upper-dx-dx
112115
ts = sol.t
113116

0 commit comments

Comments
 (0)