Skip to content

Commit

Permalink
less consolidation
Browse files Browse the repository at this point in the history
  • Loading branch information
benegee committed Jan 23, 2024
1 parent fb5ebf0 commit b068d11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 68 deletions.
36 changes: 2 additions & 34 deletions src/callbacks_step/stepsize_dg2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -144,39 +144,7 @@ function max_dt(u, t,
end

function max_dt(u, t, mesh::ParallelP4estMesh{2},
constant_speed::False, equations, dg::DG, cache)
# call the method accepting a general `mesh::P4estMesh{2}`
# TODO: MPI, we should improve this; maybe we should dispatch on `u`
# and create some MPI array type, overloading broadcasting and mapreduce etc.
# Then, this specific array type should also work well with DiffEq etc.
dt = invoke(max_dt,
Tuple{typeof(u), typeof(t), P4estMesh{2},
typeof(constant_speed), typeof(equations), typeof(dg),
typeof(cache)},
u, t, mesh, constant_speed, equations, dg, cache)
dt = MPI.Allreduce!(Ref(dt), min, mpi_comm())[]

return dt
end

function max_dt(u, t, mesh::ParallelT8codeMesh{2},
constant_speed::False, equations, dg::DG, cache)
# call the method accepting a general `mesh::T8codeMesh{2}`
# TODO: MPI, we should improve this; maybe we should dispatch on `u`
# and create some MPI array type, overloading broadcasting and mapreduce etc.
# Then, this specific array type should also work well with DiffEq etc.
dt = invoke(max_dt,
Tuple{typeof(u), typeof(t), T8codeMesh{2},
typeof(constant_speed), typeof(equations), typeof(dg),
typeof(cache)},
u, t, mesh, constant_speed, equations, dg, cache)
dt = MPI.Allreduce!(Ref(dt), min, mpi_comm())[]

return dt
end

function max_dt(u, t, mesh::ParallelP4estMesh{2},
constant_speed::True, equations, dg::DG, cache)
constant_speed, equations, dg::DG, cache)
# call the method accepting a general `mesh::P4estMesh{2}`
# TODO: MPI, we should improve this; maybe we should dispatch on `u`
# and create some MPI array type, overloading broadcasting and mapreduce etc.
Expand All @@ -192,7 +160,7 @@ function max_dt(u, t, mesh::ParallelP4estMesh{2},
end

function max_dt(u, t, mesh::ParallelT8codeMesh{2},
constant_speed::True, equations, dg::DG, cache)
constant_speed, equations, dg::DG, cache)
# call the method accepting a general `mesh::T8codeMesh{2}`
# TODO: MPI, we should improve this; maybe we should dispatch on `u`
# and create some MPI array type, overloading broadcasting and mapreduce etc.
Expand Down
36 changes: 2 additions & 34 deletions src/callbacks_step/stepsize_dg3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,23 +120,7 @@ function max_dt(u, t, mesh::Union{StructuredMesh{3}, P4estMesh{3}, T8codeMesh{3}
end

function max_dt(u, t, mesh::ParallelP4estMesh{3},
constant_speed::False, equations, dg::DG, cache)
# call the method accepting a general `mesh::P4estMesh{3}`
# TODO: MPI, we should improve this; maybe we should dispatch on `u`
# and create some MPI array type, overloading broadcasting and mapreduce etc.
# Then, this specific array type should also work well with DiffEq etc.
dt = invoke(max_dt,
Tuple{typeof(u), typeof(t), P4estMesh{3},
typeof(constant_speed), typeof(equations), typeof(dg),
typeof(cache)},
u, t, mesh, constant_speed, equations, dg, cache)
dt = MPI.Allreduce!(Ref(dt), min, mpi_comm())[]

return dt
end

function max_dt(u, t, mesh::ParallelP4estMesh{3},
constant_speed::True, equations, dg::DG, cache)
constant_speed, equations, dg::DG, cache)
# call the method accepting a general `mesh::P4estMesh{3}`
# TODO: MPI, we should improve this; maybe we should dispatch on `u`
# and create some MPI array type, overloading broadcasting and mapreduce etc.
Expand All @@ -152,23 +136,7 @@ function max_dt(u, t, mesh::ParallelP4estMesh{3},
end

function max_dt(u, t, mesh::ParallelT8codeMesh{3},
constant_speed::False, equations, dg::DG, cache)
# call the method accepting a general `mesh::T8codeMesh{3}`
# TODO: MPI, we should improve this; maybe we should dispatch on `u`
# and create some MPI array type, overloading broadcasting and mapreduce etc.
# Then, this specific array type should also work well with DiffEq etc.
dt = invoke(max_dt,
Tuple{typeof(u), typeof(t), T8codeMesh{3},
typeof(constant_speed), typeof(equations), typeof(dg),
typeof(cache)},
u, t, mesh, constant_speed, equations, dg, cache)
dt = MPI.Allreduce!(Ref(dt), min, mpi_comm())[]

return dt
end

function max_dt(u, t, mesh::ParallelT8codeMesh{3},
constant_speed::True, equations, dg::DG, cache)
constant_speed, equations, dg::DG, cache)
# call the method accepting a general `mesh::T8codeMesh{3}`
# TODO: MPI, we should improve this; maybe we should dispatch on `u`
# and create some MPI array type, overloading broadcasting and mapreduce etc.
Expand Down

0 comments on commit b068d11

Please sign in to comment.