Skip to content

Commit 3082d8a

Browse files
Mention Solver Source Code Logic in Docs (#2519)
* Mention Solver Source Code Logic in Docs * / * Apply suggestions from code review Co-authored-by: Joshua Lampert <[email protected]> * whitespace --------- Co-authored-by: Joshua Lampert <[email protected]>
1 parent 531ee91 commit 3082d8a

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
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/solvers/dg.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -828,13 +828,14 @@ function compute_coefficients!(backend::Nothing, u, func, t, mesh::AbstractMesh{
828828
end
829829

830830
# Discretizations specific to each mesh type of Trixi.jl
831+
831832
# If some functionality is shared by multiple combinations of meshes/solvers,
832833
# it is defined in the directory of the most basic mesh and solver type.
833834
# The most basic solver type in Trixi.jl is DGSEM (historic reasons and background
834835
# of the main contributors).
835836
# We consider the `TreeMesh` to be the most basic mesh type since it is Cartesian
836-
# and was the first mesh in Trixi.jl. The order of the other mesh types is the same
837-
# as the include order below.
837+
# and was the first mesh in Trixi.jl.
838+
# The order of the other mesh types is the same as the include order below.
838839
include("dgsem_tree/dg.jl")
839840
include("dgsem_structured/dg.jl")
840841
include("dgsem_unstructured/dg.jl")

0 commit comments

Comments
 (0)