Skip to content

Commit 8bbf603

Browse files
Merge branch 'main' into ExamplesNewtonKrylov
2 parents 9820f59 + 9b51a54 commit 8bbf603

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+373
-33
lines changed

docs/src/conventions.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,24 @@ set via the keywords
7676
documented with a docstring (but maybe with comments using `#`).
7777

7878

79+
## Structure of the `solver` directory
80+
81+
If some functionality is shared by multiple combinations of meshes/solvers,
82+
it is defined in the directory of the most basic mesh and solver type.
83+
An example for this is the `rhs!` function, which lays out the sequence of functions
84+
that compose the overall right-hand-side function provided to the ODE integrator.
85+
Since this general "recipe" can be unified for different meshes of a certain dimension,
86+
a shared implementation is used to minimize code duplication.
87+
88+
The most basic (in the sense that it is most tested and developed) solver type in Trixi.jl is
89+
[`DGSEM`](@ref) due to historic reasons and background of the main contributors.
90+
We consider the [`TreeMesh`](@ref) to be the most basic mesh type since it is Cartesian
91+
and was the first mesh in Trixi.jl.
92+
Thus, shared implementations for more advanced meshes such as the [`P4estMesh`](@ref) can be found in
93+
the `src/solvers/dgsem_tree/` directory, while only necessary specifics are actually placed in
94+
`src/solvers/dgsem_p4est/`.
95+
96+
7997
## Array types and wrapping
8098

8199
To allow adaptive mesh refinement efficiently when using time integrators from

src/Trixi.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,9 @@ export trixi_include, examples_dir, get_examples, default_example,
309309

310310
export ode_norm, ode_unstable_check
311311

312-
export convergence_test, jacobian_fd, jacobian_ad_forward, linear_structure
312+
export convergence_test,
313+
jacobian_fd, jacobian_ad_forward, jacobian_ad_forward_parabolic,
314+
linear_structure
313315

314316
export DGMulti, DGMultiBasis, estimate_dt, DGMultiMesh, GaussSBP
315317

src/callbacks_stage/entropy_bounded_limiter.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ function (limiter!::EntropyBoundedLimiter)(u_ode, integrator,
5656
limiter_entropy_bounded!(u, u_prev, limiter!.exp_entropy_decrease_max,
5757
mesh_equations_solver_cache(semi)...)
5858
end
59+
60+
return nothing
5961
end
6062

6163
# Exponentiated entropy change for the thermodynamic entropy (see `entropy_thermodynamic`)

src/callbacks_stage/positivity_zhang_shu.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ function (limiter!::PositivityPreservingLimiterZhangShu)(u_ode, integrator,
3636
limiter_zhang_shu!(u, limiter!.thresholds, limiter!.variables,
3737
mesh_equations_solver_cache(semi)...)
3838
end
39+
40+
return nothing
3941
end
4042

4143
# Iterate over tuples in a type-stable way using "lispy tuple programming",

src/callbacks_step/amr_dg.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ function rebalance_solver!(u_ode::AbstractVector,
8989
MPI.Waitall(requests, MPI.Status)
9090
end
9191
end # GC.@preserve old_u_ode
92+
93+
return nothing
9294
end
9395

9496
# Construct cache for ControllerThreeLevel and ControllerThreeLevelCombined.

src/callbacks_step/amr_dg1d.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,5 +282,7 @@ function coarsen_elements!(u::AbstractArray{<:Any, 3}, element_id,
282282
# Update value
283283
set_node_vars!(u, acc, equations, dg, i, element_id)
284284
end
285+
286+
return nothing
285287
end
286288
end # @muladd

src/callbacks_step/amr_dg2d.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ function rebalance_solver!(u_ode::AbstractVector, mesh::TreeMesh{2}, equations,
7474
MPI.Waitall(requests, MPI.Status)
7575
end
7676
end # GC.@preserve old_u_ode
77+
78+
return nothing
7779
end
7880

7981
# Refine elements in the DG solver based on a list of cell_ids that should be refined.

src/callbacks_step/callbacks_step.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# that should be saved
1010
function get_element_variables!(element_variables, u, mesh, equations, solver, cache,
1111
callback; kwargs...)
12-
nothing
12+
return nothing
1313
end
1414

1515
@inline function get_element_variables!(element_variables, u_ode,

src/callbacks_step/save_solution.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ end
276276
element_variables,
277277
solution_callback.node_variables,
278278
system = system)
279+
280+
return nothing
279281
end
280282

281283
@inline function save_solution_file(u_ode, t, dt, iter,
@@ -289,6 +291,8 @@ end
289291
solution_callback,
290292
element_variables,
291293
node_variables; system = system)
294+
295+
return nothing
292296
end
293297

294298
# TODO: Taal refactor, move save_mesh_file?

src/callbacks_step/time_series_dg_tree.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ function record_state_at_points!(point_data, u, solution_variables,
114114
end
115115
end
116116
end
117+
118+
return nothing
117119
end
118120

119121
# Record the solution variables at each given point for the 2D case
@@ -147,6 +149,8 @@ function record_state_at_points!(point_data, u, solution_variables,
147149
end
148150
end
149151
end
152+
153+
return nothing
150154
end
151155

152156
# Record the solution variables at each given point for the 3D case
@@ -181,5 +185,7 @@ function record_state_at_points!(point_data, u, solution_variables,
181185
end
182186
end
183187
end
188+
189+
return nothing
184190
end
185191
end # @muladd

0 commit comments

Comments
 (0)