Skip to content

Commit def2a70

Browse files
authored
Merge pull request #120 from Cthonios/deps/remove-accelerated-kernels
remove accelerated kernels as dependency.
2 parents 3f8cac5 + f7b590a commit def2a70

File tree

3 files changed

+39
-38
lines changed

3 files changed

+39
-38
lines changed

Project.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ authors = ["Craig M. Hamel <[email protected]> and contributors"]
44
version = "0.6.0"
55

66
[deps]
7-
AcceleratedKernels = "6a4ca0a5-0e36-4168-a932-d9be78d558f1"
87
Atomix = "a9b6321e-bd34-4604-b9c9-b65b8de01458"
98
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
109
KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
@@ -30,7 +29,6 @@ FiniteElementContainersExodusExt = "Exodus"
3029

3130
[compat]
3231
AMDGPU = "1"
33-
AcceleratedKernels = "0.3"
3432
Adapt = "3, 4"
3533
Aqua = "0.8"
3634
Atomix = "1"

src/DofManagers.jl

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -230,41 +230,41 @@ function create_bcs(dof::DofManager, ::Type{H1Field})
230230
end
231231

232232
# this one needs some TLC
233-
function create_bcs(dof::DofManager, ::Type{H1Field}, dirichlet_bcs, time)
234-
backend = KA.get_backend(dof.H1_bc_dofs)
235-
236-
X = dof.H1_vars[1].fspace.coords
237-
# ND = num_dimensions(dof.H1_vars[1].fspace)
238-
ND = size(X, 1) # TODO do this in a type stable way
239-
# ND = num_fields(X)
240-
# gather all dirichlet dofs
241-
dirichlet_dofs = vcat(map(x -> x.bookkeeping.dofs, dirichlet_bcs)...)
242-
dirichlet_vals = KA.zeros(backend, Float64, 0)
243-
244-
dirichlet_perm = sortperm(dirichlet_dofs)
245-
dirichlet_dofs = dirichlet_dofs[dirichlet_perm]
246-
dof_unique = unique(i -> dirichlet_dofs[i], eachindex(dirichlet_dofs))
247-
dirichlet_dofs = dirichlet_dofs[dof_unique]
248-
249-
# dirichlet_vals = vcat(map(x -> x.func.(X[:, x.bookkeeping.nodes], (time,)), dirichlet_bcs)...)
250-
251-
for bc in dirichlet_bcs
252-
# for node in bc.bookkeeping.nodes
253-
AK.foreachindex(bc.bookkeeping.nodes) do n
254-
node = bc.bookkeeping.nodes[n]
255-
X_temp = SVector{ND, Float64}(@views X[:, node])
256-
# @show bc.func(X_temp, time)
257-
push!(dirichlet_vals, bc.func(X_temp, time))
258-
end
259-
end
260-
# @show dirichlet_vals
261-
# dirichlet_dofs
262-
# need to get the coordinates and time
263-
# for bc in dirichlet_bcs
233+
# function create_bcs(dof::DofManager, ::Type{H1Field}, dirichlet_bcs, time)
234+
# backend = KA.get_backend(dof.H1_bc_dofs)
235+
236+
# X = dof.H1_vars[1].fspace.coords
237+
# # ND = num_dimensions(dof.H1_vars[1].fspace)
238+
# ND = size(X, 1) # TODO do this in a type stable way
239+
# # ND = num_fields(X)
240+
# # gather all dirichlet dofs
241+
# dirichlet_dofs = vcat(map(x -> x.bookkeeping.dofs, dirichlet_bcs)...)
242+
# dirichlet_vals = KA.zeros(backend, Float64, 0)
243+
244+
# dirichlet_perm = sortperm(dirichlet_dofs)
245+
# dirichlet_dofs = dirichlet_dofs[dirichlet_perm]
246+
# dof_unique = unique(i -> dirichlet_dofs[i], eachindex(dirichlet_dofs))
247+
# dirichlet_dofs = dirichlet_dofs[dof_unique]
248+
249+
# # dirichlet_vals = vcat(map(x -> x.func.(X[:, x.bookkeeping.nodes], (time,)), dirichlet_bcs)...)
250+
251+
# for bc in dirichlet_bcs
252+
# # for node in bc.bookkeeping.nodes
253+
# AK.foreachindex(bc.bookkeeping.nodes) do n
254+
# node = bc.bookkeeping.nodes[n]
255+
# X_temp = SVector{ND, Float64}(@views X[:, node])
256+
# # @show bc.func(X_temp, time)
257+
# push!(dirichlet_vals, bc.func(X_temp, time))
258+
# end
259+
# end
260+
# # @show dirichlet_vals
261+
# # dirichlet_dofs
262+
# # need to get the coordinates and time
263+
# # for bc in dirichlet_bcs
264264

265-
# end
266-
dirichlet_vals[dirichlet_perm][dof_unique]
267-
end
265+
# # end
266+
# dirichlet_vals[dirichlet_perm][dof_unique]
267+
# end
268268

269269

270270
"""
@@ -452,7 +452,11 @@ function update_dofs!(dof::DofManager, dirichlet_dofs::T) where T <: AbstractArr
452452
# for d in dirichlet_dofs
453453
# @assert d >= 1 && d <= ND * NN
454454
# end
455-
AK.foreachindex(dirichlet_dofs) do i
455+
# AK.foreachindex(dirichlet_dofs) do i
456+
# d = dirichlet_dofs[i]
457+
# @assert d >= 1 && d <= ND * NN
458+
# end
459+
for i in axes(dirichlet_dofs, 1)
456460
d = dirichlet_dofs[i]
457461
@assert d >= 1 && d <= ND * NN
458462
end

src/FiniteElementContainers.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ export MappedInterpolants
120120
export MappedSurfaceInterpolants
121121

122122
# dependencies
123-
import AcceleratedKernels as AK
124123
import KernelAbstractions as KA
125124
using Atomix
126125
using DocStringExtensions

0 commit comments

Comments
 (0)