Skip to content

Commit

Permalink
Merge pull request #151 from azuccott/master
Browse files Browse the repository at this point in the history
  • Loading branch information
krcools authored Dec 20, 2024
2 parents 12d987d + 263926d commit e7e801a
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 9 deletions.
26 changes: 17 additions & 9 deletions examples/disabled/tdhh3d_neumann.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ using CompScienceMeshes
using BEAST
using LinearAlgebra

# G = meshsphere(1.0, 0.25)
G = meshsphere(1.0, 0.30)
#G = meshsphere(1.0, 0.30)
G = CompScienceMeshes.meshmobius(h=0.2)

c = 1.0
S = BEAST.HH3DSingleLayerTDBIO(c)
Expand All @@ -20,9 +20,9 @@ h = BEAST.gradient(e)

# X = lagrangecxd0(G)
X = lagrangecxd0(G)
Y = duallagrangec0d1(G)
# Y = lagrangecxd0(G)

#Y = duallagrangec0d1(G)
Y = lagrangecxd0(G)
numfunctions(X)
# X = duallagrangecxd0(G, boundary(G))
# Y = lagrangec0d1(G)

Expand All @@ -31,21 +31,29 @@ Y = duallagrangec0d1(G)
Δt, Nt = 0.16, 300
# T = timebasisc0d1(Δt, Nt)
P = timebasiscxd0(Δt, Nt)
H = timebasisc0d1(Δt, Nt)
#H = timebasisc0d1(Δt, Nt)
δ = timebasisdelta(Δt, Nt)

# assemble the right hand side

bd = assemble(nh, X P)
Z1d = assemble(Id Id, X P, X P, Val{:bandedstorage})
Z0d = assemble(D, X P, X P, Val{:bandedstorage})
Z1d = assemble(Id Id, X P, X P)
Z0d = assemble(D, X P, X P)
Zd = Z0d + (-0.5)*Z1d
u = marchonintime(inv(Zd[:,:,1]), Zd, bd, Nt)

bs = assemble(e, X δ)
Zs = assemble(S, X δ, X P, Val{:bandedstorage})
Zs = assemble(S, X δ, X P)
v = marchonintime(inv(Zs[:,:,1]), Zs, -bs, Nt)


tdacusticsl = @discretise D[j′,j] == 1.0(nh)[j′] j (X P) j′ (X δ)
xacusticsl = solve(tdacusticsl)


import Plots
Plots.plot(xacusticsl[1000,2900:3000])

U, Δω, ω0 = fouriertransform(u, Δt, 0.0, 2)
V, Δω, ω0 = fouriertransform(v, Δt, 0.0, 2)

Expand Down
2 changes: 2 additions & 0 deletions src/bases/local/bdmlocal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ end

divergence(ref::BDMRefSpace, sh, el) = [Shape(sh.cellid, 1, sh.coeff/(2*volume(el)))]

numfunctions(x::BDMRefSpace, dom::CompScienceMeshes.ReferenceSimplex{2}) = 6

const _vert_perms_bdm = [
(1,2,3),
(2,3,1),
Expand Down
2 changes: 2 additions & 0 deletions src/bases/local/ncrossbdmlocal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ function (f::NCrossBDMRefSpace{T})(p) where T
(value= n × (u*tu)/j, curl=d),
(value= n × (v*tv)/j, curl=d),]
end

numfunctions(x::NCrossBDMRefSpace, dom::CompScienceMeshes.ReferenceSimplex{2}) = 6
1 change: 1 addition & 0 deletions src/helmholtz3d/timedomain/tdhh3dexc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ function planewave(direction, speedoflight::Number, signature, amplitude=one(spe
PlaneWaveHH3DTD(direction, speedoflight, signature, amplitude)
end

scalartype(p::PlaneWaveHH3DTD) = scalartype(p.amplitude)

*(a, f::PlaneWaveHH3DTD) = PlaneWaveHH3DTD(f.direction, f.speed_of_light, f.signature, a*f.amplitude)

Expand Down
2 changes: 2 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ include("test_td_tensoroperator.jl")
include("test_variational.jl")

include("test_handlers.jl")
include("test_ncrossbdm.jl")
include("test_curl_lagc0d1_lagc0d2.jl")
include("test_gridfunction.jl")

using TestItemRunner
Expand Down

0 comments on commit e7e801a

Please sign in to comment.