Skip to content

Commit

Permalink
pass boundary_conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaLampert committed Dec 11, 2024
1 parent 320d883 commit a2d8497
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/equations/serre_green_naghdi_1d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -314,19 +314,20 @@ end
function rhs!(dq, q, t, mesh,
equations::SerreGreenNaghdiEquations1D,
initial_condition,
::BoundaryConditionPeriodic,
boundary_conditions::BoundaryConditionPeriodic,
source_terms::Nothing,
solver, cache)
if cache.D1 isa PeriodicUpwindOperators
rhs_sgn_upwind!(dq, q, equations, source_terms, cache, equations.bathymetry_type)
rhs_sgn_upwind!(dq, q, equations, source_terms, cache, equations.bathymetry_type, boundary_conditions)
else
rhs_sgn_central!(dq, q, equations, source_terms, cache, equations.bathymetry_type)
rhs_sgn_central!(dq, q, equations, source_terms, cache, equations.bathymetry_type, boundary_conditions)
end

return nothing
end

function rhs_sgn_central!(dq, q, equations, source_terms, cache, ::BathymetryFlat)
function rhs_sgn_central!(dq, q, equations, source_terms, cache, ::BathymetryFlat,
boundary_conditions::BoundaryConditionPeriodic)
# Unpack physical parameters and SBP operator `D1` as well as the
# SBP operator in sparse matrix form `D1mat`
g = gravity_constant(equations)
Expand Down Expand Up @@ -406,7 +407,8 @@ function rhs_sgn_central!(dq, q, equations, source_terms, cache, ::BathymetryFla
return nothing
end

function rhs_sgn_upwind!(dq, q, equations, source_terms, cache, ::BathymetryFlat)
function rhs_sgn_upwind!(dq, q, equations, source_terms, cache, ::BathymetryFlat,
boundary_conditions::BoundaryConditionPeriodic)
# Unpack physical parameters and SBP operator `D1` as well as the
# SBP upwind operator in sparse matrix form `D1mat_minus`
g = gravity_constant(equations)
Expand Down Expand Up @@ -492,7 +494,8 @@ function rhs_sgn_upwind!(dq, q, equations, source_terms, cache, ::BathymetryFlat
end

function rhs_sgn_central!(dq, q, equations, source_terms, cache,
::Union{BathymetryMildSlope, BathymetryVariable})
::Union{BathymetryMildSlope, BathymetryVariable},
boundary_conditions::BoundaryConditionPeriodic)
# Unpack physical parameters and SBP operator `D1` as well as the
# SBP operator in sparse matrix form `D1mat`
g = gravity_constant(equations)
Expand Down Expand Up @@ -597,7 +600,8 @@ function rhs_sgn_central!(dq, q, equations, source_terms, cache,
end

function rhs_sgn_upwind!(dq, q, equations, source_terms, cache,
::Union{BathymetryMildSlope, BathymetryVariable})
::Union{BathymetryMildSlope, BathymetryVariable},
boundary_conditions::BoundaryConditionPeriodic)
# Unpack physical parameters and SBP operator `D1` as well as the
# SBP operator in sparse matrix form `D1mat`
g = gravity_constant(equations)
Expand Down

0 comments on commit a2d8497

Please sign in to comment.