Skip to content

Commit

Permalink
Allow nodes to be as close as one dt to each other
Browse files Browse the repository at this point in the history
  • Loading branch information
brenhinkeller committed Apr 19, 2024
1 parent 9affef8 commit 01e31d0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/helium.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function anneal!(ρᵣ::AbstractMatrix{T}, Teq::DenseVector{T}, dt::Number, tste
@turbo @. ρᵣ[i,1:i] = 1 / ((dm.C0 + dm.C1 * (log(dt + Teqᵢ) - dm.C2) / lᵢ)^(1/dm.beta) + 1)
end

# Guenthner et al conversion volume-length conversion
# Guenthner et al volume-length conversion
rmr0 = dm.rmr0
scale = 1/(1-rmr0)
@fastmath @inbounds for j 1:ntsteps
Expand Down
18 changes: 9 additions & 9 deletions src/inversion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
linterp1s!(Tstepsₚ, knot_index, ages, temperatures, agesteps)

# Retry unless we have satisfied the maximum reheating rate
if isdistinct(agepointsₚ, npointsₚ, k, 2dt) && maxdiff(Tstepsₚ) < dTmax
if isdistinct(agepointsₚ, npointsₚ, k, dt) && maxdiff(Tstepsₚ) < dTmax
break
end
if attempt == nattempts
Expand Down Expand Up @@ -245,7 +245,7 @@
linterp1s!(Tstepsₚ, knot_index, ages, temperatures, agesteps)

# Retry unless we have satisfied the maximum reheating rate
if isdistinct(agepointsₚ, npointsₚ, npointsₚ, 2dt) && maxdiff(Tstepsₚ) < dTmax
if isdistinct(agepointsₚ, npointsₚ, npointsₚ, dt) && maxdiff(Tstepsₚ) < dTmax
break
end
if attempt == nattempts
Expand Down Expand Up @@ -578,7 +578,7 @@
linterp1s!(Tstepsₚ, knot_index, ages, temperatures, agesteps)

# Retry unless we have satisfied the maximum reheating rate
if isdistinct(agepointsₚ, npointsₚ, k, 2dt) && maxdiff(Tstepsₚ) < dTmax
if isdistinct(agepointsₚ, npointsₚ, k, dt) && maxdiff(Tstepsₚ) < dTmax
if pointsininterval(agepointsₚ, npointsₚ, detail.agemin, detail.agemax) >= enoughpoints
break
end
Expand Down Expand Up @@ -608,7 +608,7 @@
linterp1s!(Tstepsₚ, knot_index, ages, temperatures, agesteps)

# Retry unless we have satisfied the maximum reheating rate
if isdistinct(agepointsₚ, npointsₚ, npointsₚ, 2dt) && maxdiff(Tstepsₚ) < dTmax
if isdistinct(agepointsₚ, npointsₚ, npointsₚ, dt) && maxdiff(Tstepsₚ) < dTmax
break
end
if attempt == nattempts
Expand Down Expand Up @@ -955,7 +955,7 @@
linterp1s!(Tstepsₚ, knot_index, ages, temperatures, agesteps)

# Retry unless we have satisfied the maximum reheating rate
if isdistinct(agepointsₚ, npointsₚ, k, 2dt) && maxdiff(Tstepsₚ) < dTmax
if isdistinct(agepointsₚ, npointsₚ, k, dt) && maxdiff(Tstepsₚ) < dTmax
if pointsininterval(agepointsₚ, npointsₚ, detail.agemin, detail.agemax) >= enoughpoints
break
end
Expand Down Expand Up @@ -985,7 +985,7 @@
linterp1s!(Tstepsₚ, knot_index, ages, temperatures, agesteps)

# Retry unless we have satisfied the maximum reheating rate
if isdistinct(agepointsₚ, npointsₚ, npointsₚ, 2dt) && maxdiff(Tstepsₚ) < dTmax
if isdistinct(agepointsₚ, npointsₚ, npointsₚ, dt) && maxdiff(Tstepsₚ) < dTmax
break
end
if attempt == nattempts
Expand Down Expand Up @@ -1351,7 +1351,7 @@
linterp1s!(Tstepsₚ, knot_index, ages, temperatures, agesteps)

# Retry unless we have satisfied the maximum reheating rate
if isdistinct(agepointsₚ, npointsₚ, k, 2dt) && maxdiff(Tstepsₚ) < dTmax
if isdistinct(agepointsₚ, npointsₚ, k, dt) && maxdiff(Tstepsₚ) < dTmax
break
end
if attempt == nattempts
Expand Down Expand Up @@ -1379,7 +1379,7 @@
linterp1s!(Tstepsₚ, knot_index, ages, temperatures, agesteps)

# Retry unless we have satisfied the maximum reheating rate
if isdistinct(agepointsₚ, npointsₚ, k, 2dt) && maxdiff(Tstepsₚ) < dTmax
if isdistinct(agepointsₚ, npointsₚ, k, dt) && maxdiff(Tstepsₚ) < dTmax
break
end
if attempt == nattempts
Expand All @@ -1405,7 +1405,7 @@
linterp1s!(Tstepsₚ, knot_index, ages, temperatures, agesteps)

# Retry unless we have satisfied the maximum reheating rate
if isdistinct(agepointsₚ, npointsₚ, k, 2dt) && maxdiff(Tstepsₚ) < dTmax
if isdistinct(agepointsₚ, npointsₚ, k, dt) && maxdiff(Tstepsₚ) < dTmax
break
end
if attempt == nattempts
Expand Down
2 changes: 1 addition & 1 deletion src/utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
# Check if point k is distinct from other points in list within ± δ
function isdistinct(points::DenseArray, npoints::Int, k::Int, δ::Number)
@inbounds for i = 1:npoints
if i!=k && abs(points[i] - points[k]) < δ
if i!=k && abs(points[i] - points[k]) <= δ
return false
end
end
Expand Down

0 comments on commit 01e31d0

Please sign in to comment.