Skip to content

Commit 2450dd7

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 9b9f1b9 commit 2450dd7

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

content/week10/rust_example/rust.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Intro to Rust
22

33
This is an introduction to some of the unique design of Rust. This is not
4-
comprehensive - the fantastic [Rust Book][] is much better if you want to fully learn
5-
Rust. Instead, we'll look at how it's different from what we've seen so far in Python,
6-
and discuss some of the aspects that make special, like how it is memory safe without
7-
resorting to a garbage collector, the trait system, and syntactic macros.
4+
comprehensive - the fantastic [Rust Book][] is much better if you want to fully
5+
learn Rust. Instead, we'll look at how it's different from what we've seen so
6+
far in Python, and discuss some of the aspects that make special, like how it is
7+
memory safe without resorting to a garbage collector, the trait system, and
8+
syntactic macros.
89

910
## Basic syntax
1011

content/week11/poisson_jacobi.f90

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ program poisson
5555
end do
5656
end do
5757
ftot = 0. !ftot/dble(n*n)
58-
58+
5959
! Main loop
6060
ffac = h**2.
6161
err = huge(err)
@@ -68,11 +68,11 @@ program poisson
6868

6969
do j = 1,n
7070
do i = 1,n
71-
71+
7272
lap = uold(i-1,j)+uold(i+1,j)+uold(i,j-1)+uold(i,j+1)-4.0*uold(i,j)
7373
res = lap - ffac * (f(i,j) - ftot)
7474
unew(i,j) = uold(i,j) + omega*0.25*res
75-
75+
7676
err = MAX(err,abs(unew(i,j) - uold(i,j)))
7777
end do
7878
end do
@@ -84,13 +84,13 @@ program poisson
8484
unew(0,i) = 0. !unew(n,i)
8585
unew(n+1,i) = 0. !unew(1,i)
8686
end do
87-
87+
8888
do j = 1,n
8989
do i = 1,n
9090
uold(i,j) = unew(i,j)
9191
end do
9292
end do
93-
93+
9494
iter = iter + 1
9595
if ((mod(iter,OUTFREQ) .eq. 0) .or. (err .lt. eps)) then
9696
write(*, '(A, I8, A, ES13.6)') 'Iter. ', iter, ', err = ', err
@@ -103,7 +103,7 @@ program poisson
103103

104104
write(*,'(A, ES13.6, A)') 'Finished in ', stop-strt, ' s'
105105

106-
106+
107107
! Final time step output
108108
if (FOUT) then
109109
open(7, file = 'final_phi.dat')
@@ -113,9 +113,9 @@ program poisson
113113
end do
114114
close(7)
115115
end if
116-
116+
117117
deallocate(uold)
118118
deallocate(unew)
119119
deallocate(f)
120-
120+
121121
end program poisson

0 commit comments

Comments
 (0)