Skip to content

Commit 7b8a7d3

Browse files
committed
Update comments
1 parent 0d9b23b commit 7b8a7d3

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/schemes/structure/total_lagrangian_sph/rhs.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ end
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

src/schemes/structure/total_lagrangian_sph/system.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,8 @@ end
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
@@ -543,6 +544,7 @@ end
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

0 commit comments

Comments
 (0)