Skip to content

Commit d156a85

Browse files
committed
puts back TwoGrid() in the default kwargs and correct grid variable name in Problem()
1 parent 9643dc0 commit d156a85

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

src/physics/traceradvdiff.jl

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,19 @@ function ConstDiffProblem(;
4444
steadyflow = false
4545
else
4646
steadyflow = true
47+
println("I'm here")
4748
end
4849
end
4950

50-
if grid == nothing; g = TwoDGrid(nx, Lx, ny, Ly)
51-
else; g = grid
52-
end
53-
54-
if steadyflow; pr = TracerAdvDiff.ConstDiffSteadyFlowParams(eta, kap, u, v, g)
51+
if steadyflow; pr = TracerAdvDiff.ConstDiffSteadyFlowParams(eta, kap, u, v, grid)
5552
else; pr = TracerAdvDiff.ConstDiffParams(eta, kap, u, v)
5653
end
5754

58-
vs = TracerAdvDiff.Vars(g)
59-
eq = TracerAdvDiff.Equation(pr, g)
60-
ts = FourierFlows.autoconstructtimestepper(stepper, dt, eq.LC, g)
55+
vs = TracerAdvDiff.Vars(grid)
56+
eq = TracerAdvDiff.Equation(pr, grid)
57+
ts = FourierFlows.autoconstructtimestepper(stepper, dt, eq.LC, grid)
6158

62-
FourierFlows.Problem(g, vs, pr, eq, ts)
59+
FourierFlows.Problem(grid, vs, pr, eq, ts)
6360
end
6461

6562

test/test_traceradvdiff.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function test_constvel(stepper, dt, nsteps)
1616
u(x, y) = uvel
1717
v(x, y) = vvel
1818

19-
prob = TracerAdvDiff.Problem(; steadyflow=true, nx=nx, Lx=Lx, kap=0.0, u=u, v=v, dt=dt, stepper=stepper)
19+
prob = TracerAdvDiff.Problem(; nx=nx, Lx=Lx, kap=0.0, u=u, v=v, dt=dt, stepper=stepper)
2020
s, v, p, g = prob.state, prob.vars, prob.params, prob.grid
2121

2222
σ = 0.1
@@ -135,7 +135,6 @@ function test_hyperdiffusion(stepper, dt, tfinal; steadyflow = true)
135135
error("tfinal is not multiple of dt")
136136
end
137137

138-
139138
g = TwoDGrid(nx, Lx)
140139

141140
u, v = 0*g.X, 0*g.X
@@ -182,4 +181,4 @@ dt, tfinal = 0.005, 0.1
182181
@test test_diffusion(stepper, dt, tfinal; steadyflow=false)
183182

184183
dt, tfinal = 0.005, 0.1
185-
@test test_hyperdiffusion(stepper, dt, tfinal; steadyflow=true)
184+
@test test_hyperdiffusion(stepper, dt, tfinal)

0 commit comments

Comments
 (0)