@@ -230,41 +230,41 @@ function create_bcs(dof::DofManager, ::Type{H1Field})
230230end
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
0 commit comments