From 6fdb2fac29a652fc0a2a6a186cb0ec3f58dbcbf4 Mon Sep 17 00:00:00 2001 From: Jukka Aho Date: Sat, 9 May 2026 16:30:37 +0300 Subject: [PATCH] refactor(src): remove scatter_blocks_to_force.jl src/assemblers/scatter_blocks_to_force.jl | 54 ------------------------------- 1 file changed, 54 deletions(-) --- src/assemblers/scatter_blocks_to_force.jl | 54 ----------------------- 1 file changed, 54 deletions(-) delete mode 100644 src/assemblers/scatter_blocks_to_force.jl diff --git a/src/assemblers/scatter_blocks_to_force.jl b/src/assemblers/scatter_blocks_to_force.jl deleted file mode 100644 index ea00ce5..0000000 --- a/src/assemblers/scatter_blocks_to_force.jl +++ /dev/null @@ -1,54 +0,0 @@ -# This file is a part of JuliaFEM. -# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md - -""" - scatter_blocks_to_force!( - f::Vector{Float64}, - f_blocks::AbstractVector{Vec{3,Float64}}, - dofs::AbstractVector{Int}, - N::Int - ) - -Scatter blocked force vector to global force vector **in-place**. - -Accumulates element contributions from blocked structure. - -# Arguments -- `f`: Global force vector (modified in-place) -- `f_blocks`: Element force as [N] vector of Vec{3} blocks -- `dofs`: Global DOF indices [3*N] -- `N`: Number of nodes in element - -# Zero-Allocation Guarantee - -No allocations - modifies `f` in-place. - -# Algorithm - -```julia -for k in 1:N - block = f_blocks[k] - k_offset = 3(k - 1) - for α in 1:3 - i_global = dofs[k_offset + α] - f[i_global] += block[α] - end -end -``` -""" -@inline function scatter_blocks_to_force!( - f::Vector{Float64}, - f_blocks::Vector{Vec{3,Float64}}, - dofs::Vector{Int}, - N::Int -) - @inbounds for k in 1:N - block = f_blocks[k] - k_offset = 3(k - 1) - for α in 1:3 - i_global = dofs[k_offset+α] - f[i_global] += block[α] - end - end - return nothing -end