-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify LaplaceDiffusion1D
, LaplaceDiffusion2D
, and LaplaceDiffusion3D
BCs
#1421
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sloede What's your take on this? If I remember correctly, we wanted to keep some dimension-agnostic code like this in each dimension-specific source file to make it easier to read, e.g.,
Trixi.jl/src/solvers/dgsem_tree/dg_1d.jl
Lines 479 to 483 in f404661
# TODO: Taal dimension agnostic | |
function calc_boundary_flux!(cache, t, boundary_condition::BoundaryConditionPeriodic, | |
mesh::TreeMesh{1}, equations, surface_integral, dg::DG) | |
@assert isempty(eachboundary(dg, cache)) | |
end |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1421 +/- ##
==========================================
+ Coverage 89.52% 89.55% +0.03%
==========================================
Files 448 448
Lines 35995 35979 -16
==========================================
- Hits 32223 32219 -4
+ Misses 3772 3760 -12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case we also would like to delete the 3D stuff as well (which moved in in the mean time).
Trixi.jl/src/equations/laplace_diffusion_3d.jl
Lines 41 to 72 in f235619
# Dirichlet-type boundary condition for use with a parabolic solver in weak form | |
@inline function (boundary_condition::BoundaryConditionDirichlet)(flux_inner, u_inner, | |
normal::AbstractVector, | |
x, t, | |
operator_type::Gradient, | |
equations_parabolic::LaplaceDiffusion3D) | |
return boundary_condition.boundary_value_function(x, t, equations_parabolic) | |
end | |
@inline function (boundary_condition::BoundaryConditionDirichlet)(flux_inner, u_inner, | |
normal::AbstractVector, | |
x, t, | |
operator_type::Divergence, | |
equations_parabolic::LaplaceDiffusion3D) | |
return flux_inner | |
end | |
@inline function (boundary_condition::BoundaryConditionNeumann)(flux_inner, u_inner, | |
normal::AbstractVector, | |
x, t, | |
operator_type::Divergence, | |
equations_parabolic::LaplaceDiffusion3D) | |
return boundary_condition.boundary_normal_flux_function(x, t, equations_parabolic) | |
end | |
@inline function (boundary_condition::BoundaryConditionNeumann)(flux_inner, u_inner, | |
normal::AbstractVector, | |
x, t, | |
operator_type::Gradient, | |
equations_parabolic::LaplaceDiffusion3D) | |
return flux_inner | |
end |
LaplaceDiffusion1D
and LaplaceDiffusion2D
BCsLaplaceDiffusion1D
, LaplaceDiffusion2D
, and LaplaceDiffusion3D
BCs
I would like to see a review from @sloede before merging this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the remaining issue resolved, this LGTM
Co-authored-by: Michael Schlottke-Lakemper <[email protected]>
Closes #1418