Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updep #8

Merged
merged 4 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6'
- 'nightly'
- '1'
os:
- ubuntu-latest
arch:
Expand Down
12 changes: 6 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "FourierGPE"
uuid = "f013a474-557c-11e9-3596-438edcad9d97"
authors = ["Ashton Bradley <ashton.bradley@gmail.com>"]
version = "0.1.0"
version = "0.1.1"

[deps]
DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def"
Expand All @@ -18,16 +18,16 @@ RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"

[compat]
DiffEqCallbacks = "2, 2.1"
DiffEqCallbacks = "2,3"
FFTW = "1, 1.4"
FileIO = "1, 1.8, 1.9"
FillArrays = "0.12"
FillArrays = "~1"
JLD2 = "0.4"
LazyArrays = "0.22"
LazyArrays = "~1"
OrdinaryDiffEq = "5, 5.6, 6"
PaddedViews = "0.5.1"
Parameters = "0.12"
ProgressMeter = "1, 1.5, 1.6, 1.7"
RecursiveArrayTools = "2, 2.2"
RecursiveArrayTools = "~3"
Reexport = "1, 1.2"
julia = "1.7, 1.8"
julia = "1.9,1.10"
10 changes: 5 additions & 5 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ struct KField{D} <: Field
end

@with_kw mutable struct Transforms{D,N} <: TransformLibrary
Txk::AbstractFFTs.ScaledPlan{Complex{Float64},FFTW.cFFTWPlan{Complex{Float64},-1,false,D,UnitRange{Int64}},Float64} = 0.1*plan_fft(crandn_array(D))
Txk!::AbstractFFTs.ScaledPlan{Complex{Float64},FFTW.cFFTWPlan{Complex{Float64},-1,true,D,UnitRange{Int64}},Float64} = 0.1*plan_fft!(crandn_array(D))
Tkx::AbstractFFTs.ScaledPlan{Complex{Float64},FFTW.cFFTWPlan{Complex{Float64},1,false,D,UnitRange{Int64}},Float64} = 0.1*plan_ifft(crandn_array(D))
Tkx!::AbstractFFTs.ScaledPlan{Complex{Float64},FFTW.cFFTWPlan{Complex{Float64},1,true,D,UnitRange{Int64}},Float64} = 0.1*plan_ifft!(crandn_array(D))
Txk = 0.1*plan_fft(crandn_array(D))
Txk! = 0.1*plan_fft!(crandn_array(D))
Tkx = 0.1*plan_ifft(crandn_array(D))
Tkx! = 0.1*plan_ifft!(crandn_array(D))
psi::ArrayPartition = crandnpartition(D,N)
end

Expand All @@ -46,7 +46,7 @@ end
V0::Array{Float64,D} = zeros(N)
t::LinRange{Float64} = LinRange(ti,tf,Nt) # time of saves
ϕi::Array{Complex{Float64},D} = zeros(N) |> complex # initial condition
alg::OrdinaryDiffEq.OrdinaryDiffEqAdaptiveAlgorithm = Tsit5() # default solver
alg::OrdinaryDiffEq.OrdinaryDiffEqAdaptiveAlgorithm = Vern6() # default solver
reltol::Float64 = 1e-6 # default tolerance; may need to use 1e-7 for corner cases
flags::UInt32 = FFTW.MEASURE # choose a plan. PATIENT, NO_TIMELIMIT, EXHAUSTIVE
# === saving
Expand Down
4 changes: 2 additions & 2 deletions test/test_dynamics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ t = LinRange(0.,tf,Nt)
sim2 = Sim(sim;γ = 0.0,tf=tf,t=t)

#make initial state
ϕi = sol[end]
ϕi = sol.u[end]
@pack! sim2 = ϕi

sol2,err = testsim(sim2)
@test err == false

psitest = xspace(sol2[end],sim2)
psitest = xspace(sol2.u[end],sim2)
npeak = abs2.(psitest[256])
@test isapprox(g*npeak,μ,rtol=1e-2)
2 changes: 1 addition & 1 deletion test/test_groundstate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ runsim(sim;info=false)
sol,err = testsim(sim)
@test err == false

psitest = xspace(sol[end],sim)
psitest = xspace(sol.u[end],sim)
npeak = abs2.(psitest[256])
@test isapprox(g*npeak,μ,rtol=1e-2)
Loading