Mercurial > repos > public > sbplib_julia
changeset 1732:c70b54ab8fc8 cleanup
Remove obsolete files
author | Vidar Stiernström <vidar.stiernstrom@gmail.com> |
---|---|
date | Mon, 09 Sep 2024 11:06:41 -0700 |
parents | f215ac2a5c66 |
children | ec5589090faa |
files | TimeStepper.jl plotDerivative.jl plotDerivative2d.jl |
diffstat | 3 files changed, 0 insertions(+), 88 deletions(-) [+] |
line wrap: on
line diff
--- a/TimeStepper.jl Mon Sep 09 08:26:31 2024 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -abstract type TimeStepper end - -# Returns v and t -function getState(ts::TimeStepper) - error("not implemented") -end - - -function step!(ts::TimeStepper) - error("not implemented") -end - -function stepN(ts::TimeStepper,N::Int) - for i ∈ 1:N - ts.step() - end -end - -function stepTo(ts::TimeStepper) - error("Not yet implemented") -end - -function evolve(ts::TimeStepper) - error("Not yet implemented") -end - - -mutable struct Rk4 <: TimeStepper - F::Function - k::Real - v::Vector - t::Real - n::UInt - - function Rk4(F::Function,k::Real,v0::Vector,t0::Real) - # TODO: Check that F has two inputs and one output - v = v0 - t = t0 - n = 0 - return new(F,k,v,t,n) - end -end - -function getState(ts::Rk4) - return ts.t, ts.v -end - -function step!(ts::Rk4) - k1 = ts.F(ts.v,ts.t) - k2 = ts.F(ts.v+0.5*ts.k*k1,ts.t+0.5*ts.k) - k3 = ts.F(ts.v+0.5*ts.k*k2,ts.t+0.5*ts.k) - k4 = ts.F(ts.v+ ts.k*k3,ts.t+ ts.k) - ts.v = ts.v + (1/6)*(k1+2*(k2+k3)+k4)*ts.k - - ts.n = ts.n + 1 - ts.t = ts.t + ts.k - - return nothing -end -
--- a/plotDerivative.jl Mon Sep 09 08:26:31 2024 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -g = sbp.Grid.EquidistantGrid((200,), (0.0,), (2pi,)) -op =sbp.readOperator("d2_4th.txt","h_4th.txt") -Laplace = sbp.Laplace(g,1.0,op) - -init(x) = cos(x) -v = sbp.Grid.evalOn(g,init) -u = zeros(length(v)) - -sbp.apply!(Laplace,u,v) - -@show u -sbp.Grid.plotgridfunction(g,u)
--- a/plotDerivative2d.jl Mon Sep 09 08:26:31 2024 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -include("sbpPlot.jl") - -g = sbp.Grid.EquidistantGrid((100,75), (0.0, 0.0), (2pi, 3/2*pi)) -op = sbp.readOperator("d2_4th.txt","h_4th.txt") -Laplace = sbp.Laplace(g, 1.0, op) - -init(x,y) = sin(x) + cos(y) -v = sbp.Grid.evalOn(g,init) -u = zero(v) - -sbp.apply!(Laplace,u,v) - -#@show u -#@show u'*u - -plotgridfunction(g,u)