aboutsummaryrefslogtreecommitdiff
path: root/Examples/SimpleWaveScript.kranc
blob: 0aeb6ae13f1635c6b292e7c7248208149dc572ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
begin thorn SimpleWaveScript

begin variables
    phi pi
end variables

begin temporaries
    foo bar
end temporaries

begin derivatives
    Du u_i = (u_(i+1) - u_(i-1))/h
    Dv v_i = (v_(i+1,j) - u_(i-1,j))/h
end derivatives

begin calculation initial_sine_calc scheduled at initial
  phi = sin(2*PI*(x-t))
  pi = -2*pi*cos(2*PI*(x-t))
end calculation

begin calculation calc_rhs scheduled at mol_calcrhs
  D_t phi = pi
  D_t pi = Euc^ij*D_ij phi
end calculation

end thorn