-
Notifications
You must be signed in to change notification settings - Fork 127
More flexibility & consistency (across dimensions) to compute_coefficients!
for discontinuous ICs
#2433
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
base: main
Are you sure you want to change the base?
Conversation
Review checklistThis checklist is meant to assist creators of PRs (to let them know what reviewers will typically look for) and reviewers (to guide them in a structured review process). Items do not need to be checked explicitly for a PR to be eligible for merging. Purpose and scope
Code quality
Documentation
Testing
Performance
Verification
Created with ❤️ by the Trixi.jl community. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2433 +/- ##
==========================================
- Coverage 96.77% 96.56% -0.20%
==========================================
Files 495 497 +2
Lines 41055 41214 +159
==========================================
+ Hits 39727 39798 +71
- Misses 1328 1416 +88
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Interesting proposal. I am looking forward to the discussion in our next meeting.
|
||
initial_condition = initial_condition_composite | ||
# Note calling the constructor of the struct: `InitialConditionComposite()` instead of `initial_condition_composite` ! | ||
const initial_condition = InitialConditionComposite() |
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.
Does setting this to const
conflict with including different elixirs in a single REPL session?
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.
Yes, that will cause errors. I took inspiration from
Trixi.jl/src/equations/numerical_fluxes.jl
Line 244 in f35d749
const flux_lax_friedrichs = FluxLaxFriedrichs() |
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.
It is required there in our code but not here since we just pass the IC to the semidiscretization. So it should be fine without const
here
if i == 1 | ||
x_node = SVector(nextfloat(x_node[1]), x_node[2]) | ||
elseif i == nnodes(dg) | ||
x_node = SVector(prevfloat(x_node[1]), x_node[2]) | ||
end | ||
if j == 1 | ||
x_node = SVector(x_node[1], nextfloat(x_node[2])) | ||
elseif j == nnodes(dg) | ||
x_node = SVector(x_node[1], prevfloat(x_node[2])) | ||
end |
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.
This assumes that the element lies in the coordinate direction, which may not be the case for unstructured and curved meshes in general, is it?
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.
True, we would need to check the direction of the face.
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.
As discussed in the meeting, it would also be fine to implement this only for the TreeMesh
when a hard error is thrown for the other mesh types in 2D and 3D.
if i == 1 | ||
x_node = SVector(nextfloat(x_node[1]), x_node[2], x_node[3]) | ||
elseif i == nnodes(dg) | ||
x_node = SVector(prevfloat(x_node[1]), x_node[2], x_node[3]) | ||
end |
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.
Same here?
# NOTE: This still assumes that the first node index somewhat resembles the first coordinate direction! | ||
if x_node[1] < x_node_n[1] | ||
x_node = SVector(nextfloat(x_node[1]), x_node[2]) | ||
else | ||
x1_min_at_node1 = false | ||
x_node = SVector(prevfloat(x_node[1]), x_node[2]) | ||
end |
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.
This is probably the most convenient way of dragging the nodes inwards. As mentioned in the comment, this is probably not really fail-safe if a mesh is supplied/constructed where the i
index does not really expand the element in 1
direction but 2
direction. I would assume that this is possible depending on the exact order of node numbering in a supplied mesh file. @andrewwinters5000 is that right?
@@ -437,7 +437,7 @@ end | |||
left_direction = right_direction - 1 | |||
|
|||
for i in eachnode(dg) | |||
if orientation == 1 | |||
if orientation == 1 # (x-direction) |
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.
See
Trixi.jl/src/solvers/dgsem_structured/dg_2d.jl
Lines 404 to 411 in da9e72e
# Interfaces in x-direction (`orientation` = 1) | |
calc_interface_flux!(elements.surface_flux_values, | |
elements.left_neighbors[1, element], | |
element, 1, u, mesh, | |
nonconservative_terms, equations, | |
surface_integral, dg, cache) | |
# Interfaces in y-direction (`orientation` = 2) |
@@ -552,7 +552,7 @@ end | |||
left_direction = right_direction - 1 | |||
|
|||
for j in eachnode(dg), i in eachnode(dg) | |||
if orientation == 1 | |||
if orientation == 1 # (x-direction) |
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.
see
Trixi.jl/src/solvers/dgsem_structured/dg_3d.jl
Lines 513 to 527 in da9e72e
# Interfaces in x-direction (`orientation` = 1) | |
calc_interface_flux!(elements.surface_flux_values, | |
elements.left_neighbors[1, element], | |
element, 1, u, mesh, | |
nonconservative_terms, equations, | |
surface_integral, dg, cache) | |
# Interfaces in y-direction (`orientation` = 2) | |
calc_interface_flux!(elements.surface_flux_values, | |
elements.left_neighbors[2, element], | |
element, 2, u, mesh, | |
nonconservative_terms, equations, | |
surface_integral, dg, cache) | |
# Interfaces in z-direction (`orientation` = 3) |
See the item in the Trixi Meeting
xref: #1511
Major issue: The extensively used
initial_condition_weak_blast_wave
- if this is changed, we have lots of CI values to update.