Skip to content

Commit 600f4c5

Browse files
efaulhaberLasNikassvchb
authored
Update program flow diagram (and use Mermaid.js to make it easy to modify) (#917)
* Update program flow diagram (and use Mermaid.js to make it easy to modify) * Improve diagram * Make subgraph titles bold --------- Co-authored-by: Niklas Neher <[email protected]> Co-authored-by: Sven Berger <[email protected]>
1 parent 9d306e2 commit 600f4c5

File tree

3 files changed

+60
-2
lines changed

3 files changed

+60
-2
lines changed

docs/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Asciicast = "2600d445-abca-43b9-92aa-ce144ac0b05b"
33
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
44
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
5+
DocumenterMermaid = "a078cd44-4d9c-4618-b545-3ab9d77f9177"
56
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
67
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
78
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"

docs/make.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Documenter, DocumenterCitations
1+
using Documenter, DocumenterCitations, DocumenterMermaid
22
using TrixiParticles
33
using TrixiParticles.TrixiBase
44
using TrixiParticles.PointNeighbors

docs/src/overview.md

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,65 @@ During a single time step or an intermediate step of the time integration scheme
1717
`drift!` and `kick!` are invoked, followed by the functions depicted in this diagram
1818
(with key parts highlighted in orange/yellow).
1919

20-
![Main Program Flow](https://github.com/trixi-framework/TrixiParticles.jl/assets/10238714/d7c6eedd-7173-4879-b62e-3e6d4bc5091f)
20+
```mermaid
21+
%% Make arrows bend at right angles
22+
%%{ init : { "flowchart" : { "curve" : "stepAfter" }}}%%
2123
24+
%% TD means vertical layout
25+
flowchart TD
26+
%% --- Define color palette and styles ---
27+
classDef start_node fill:#d9ead3,stroke:#333,color:#333
28+
classDef time_integration fill:#d9d2e9,stroke:#333,color:#333
29+
classDef primary_stage fill:#cfe2f3,stroke:#333,color:#333
30+
classDef update fill:#eeeeee,stroke:#333,color:#333
31+
classDef updates fill:#fff2cc,stroke:#333,color:#333
32+
classDef physics fill:#fce5cd,stroke:#333,color:#333
33+
34+
A(simulation) --> B[time integration];
35+
36+
%% Add hidden dummy node to branch the arrow nicely
37+
B --- dummy[ ];
38+
style dummy width:0;
39+
dummy --> C["drift!<br/>(update du/dt)"];
40+
41+
subgraph kick["<div style='padding: 10px; font-weight: bold;'>kick! (update dv/dt)</div>"]
42+
%% Horizontal layout within this subgraph
43+
direction LR;
44+
45+
subgraph updates["<div style='padding: 10px; font-weight: bold;'>update_systems_and_nhs</div>"]
46+
%% Vertical layout within this subgraph
47+
direction TB;
48+
49+
H["update_positions!<br/>(moving boundaries and structures)"];
50+
I["update_nhs!<br/>(update neighborhood search)"];
51+
J["update_quantities!<br/>(recalculate density etc.)"];
52+
K["update_pressure!<br/>(recalculate pressure etc.)"];
53+
L["update_boundary_interpolation!<br/>(interpolate boundary pressure)"];
54+
M["update_final!<br/>(update shifting)"];
55+
56+
H --> I --> J --> K --> L --> M;
57+
end
58+
59+
F["system_interaction!<br/>(e.g. momentum/continuity equation)"];
60+
G["add_source_terms!<br/>(gravity and source terms)"];
61+
62+
updates --> F --> G;
63+
end
64+
65+
dummy --> kick;
66+
67+
%% Color the sub-tasks by their function
68+
class A start_node;
69+
class B time_integration;
70+
class C primary_stage;
71+
class kick primary_stage;
72+
class updates update;
73+
class H,I,J,K,L,M updates;
74+
class F,G physics;
75+
76+
%% Style the arrows
77+
linkStyle default stroke-width:2px,stroke:#555
78+
```
2279

2380
## Structure
2481
What we refer to as schemes are various models such as Weakly Compressible Smoothed Particle Hydrodynamics (WCSPH)

0 commit comments

Comments
 (0)