Skip to content

Commit 75e0999

Browse files
committed
update readme
1 parent c0ea905 commit 75e0999

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ The package currently provides only two main functions: `WENOScheme()`, that is
1616

1717
## Example
1818

19+
To see more examples, refer to the folder examples or the test folder.
1920
Here is a simple example of using the package to solve the 1D linear advection equation with periodic boundary conditions and classical initial conditions:
2021

2122
```julia
@@ -68,9 +69,11 @@ idx = (x .>= 0.4) .& (x .<= 0.6)
6869
u0_vec[idx] .= (1 / 6) .* (F(x[idx], α, a - δ) .+ 4 .* F(x[idx], α, a) .+ F(x[idx], α, a + δ))
6970

7071
u = copy(u0_vec)
72+
# here we create a WENO scheme for staggered grid, boundary (2,2) means periodic BCs on both sides. 0 means homogeneous Neumann and 1 means homogeneous Dirichlet BCs. stag = true means that the advection velocity is defined on the sides of the cells and should be of size nx+1 compared to the scalar field u.
7173
weno = WENOScheme(u; boundary = (2, 2), stag = true)
7274

73-
# advection velocity
75+
# advection velocity, here we use a constant velocity of 1.0.
76+
# It should be provided as a NamedTuple
7477
a = (; x = ones(nx + 1))
7578

7679
# grid size
@@ -81,7 +84,9 @@ tmax = period * (Lx + Δx) / maximum(abs.(a.x))
8184

8285
t = 0
8386

87+
# timeloop
8488
while t < tmax
89+
# here, u is updated in place and contains the solution at the next time step after the call to WENO_step!
8590
WENO_step!(u, a, weno, Δt, Δx)
8691

8792
t += Δt

0 commit comments

Comments
 (0)