Skip to content

Commit 078fa15

Browse files
committed
change of how comment was written, resolves issue of library Printf and Plots from being read
1 parent d4985cf commit 078fa15

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

julia/MOLE.jl/examples/hyperbolic1D.jl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
"""
1+
#=
22
Julia implementation of the 1D Advection equation with periodic boundary conditions
33
from MATLAB MOLE example
4-
"""
4+
=#
5+
56
using Printf
67
using Plots
78
import MOLE: Operators, BCs
@@ -24,10 +25,12 @@ D = Operators.div(k,m,dx); #1D Mimetic divergence operator
2425
I = Operators.interpol(m, 0.5); #1D 2nd order interpolator
2526

2627
# 1D Staggered grid
27-
grid = [west west+dx/2: dx : east-dx/2 east];
28+
grid = [west, west+dx/2:dx:east-dx/2, east];
2829

2930
# Initial Condition
30-
U = sin(2*π*grid)';
31+
q = 2 * π .* grid
32+
println(typeof(q))
33+
U = sin.(q)';
3134

3235
#Periodic Boundary Condition imposed on the divergence operator
3336
D[1, 2] = 1/(2*dx);
@@ -53,7 +56,7 @@ for i in 1: t/dt
5356
#Plot approximation
5457
plot(grid, U2, label="Approximated")
5558
#Plot exact solution
56-
plot!(grid, sin.(2*π*(grid - a*i*dt)), label="exact")
59+
plot!(grid, sin.(2*π .*(grid - a*i*dt)), label="exact")
5760
#Plot attributes
5861
title!("1D Advection Equation with Periodic BC");
5962
xlabel!("x");

0 commit comments

Comments
 (0)