File tree Expand file tree Collapse file tree
src/schemes/structure/total_lagrangian_sph Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7171 F_b = @inbounds deformation_gradient (system, neighbor)
7272
7373 current_pos_diff_ = current_coords_a - current_coords_b
74- # On GPUs, convert `Float64` to `Float32` after computing the difference
74+ # In mixed-precision simulations, convert from `coordinates_eltype(system)`
75+ # to `eltype(system)` immediately after computing the difference.
7576 current_pos_diff = convert .(eltype (system), current_pos_diff_)
7677 current_distance = norm (current_pos_diff)
7778
Original file line number Diff line number Diff line change 534534 current_coords_b = @inbounds current_coords (system, neighbor)
535535
536536 pos_diff_ = current_coords_a - current_coords_b
537- # On GPUs, convert `Float64` to `Float32` after computing the difference
537+ # In mixed-precision simulations, convert from `coordinates_eltype(system)`
538+ # to `eltype(system)` immediately after computing the difference.
538539 pos_diff = convert .(eltype (system), pos_diff_)
539540
540541 # The tensor product pos_diff ⊗ (L_{0a} * ∇W) is equivalent to multiplication
543544 end
544545
545546 for j in 1 : ndims (system), i in 1 : ndims (system)
547+ # We overwrite every entry of `deformation_grad`, so no `set_zero!` is required.
546548 @inbounds deformation_grad[i, j, particle] = result[][i, j]
547549 end
548550 end
You can’t perform that action at this time.
0 commit comments