Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
svchb committed Nov 30, 2023
1 parent 1548433 commit ae78667
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/general/corrections.jl
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,13 @@ function compute_gradient_correction_matrix!(corr_matrix::AbstractArray,

# Loop over all pairs of particles and neighbors within the kernel cutoff.
@trixi_timeit timer() "compute correction matrix" for_particle_neighbor(system, system,
coordinates, coordinates,
neighborhood_search;
particles=eachparticle(system)) do particle, neighbor,
pos_diff, distance
coordinates,
coordinates,
neighborhood_search;
particles=eachparticle(system)) do particle,
neighbor,
pos_diff,
distance
# Only consider particles with a distance > 0.
distance < sqrt(eps()) && return

Expand Down Expand Up @@ -367,7 +370,7 @@ function compute_gradient_correction_matrix!(corr_matrix::AbstractArray,
if cond(L) > 1e10
# if the matrix is really bad condition set the identity matrix instead and
# basically deactivate the gradient correction
for i in 1:ndims(system)
for i in 1:ndims(system)
corr_matrix[i, i, particle] = 1.0
end
return corr_matrix
Expand Down

0 comments on commit ae78667

Please sign in to comment.