Skip to content

Commit

Permalink
hot fix for sign issues in TMatrix terms
Browse files Browse the repository at this point in the history
  • Loading branch information
cneverett committed Jan 31, 2025
1 parent ecbb9ce commit 224ec7a
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "BoltzmannCollisionIntegral"
uuid = "20179301-8dfd-43f5-a10b-08fddd2c788a"
authors = ["Christopher Everett and contributors"]
version = "2.2.2"
version = "2.2.3"

[deps]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Expand Down
12 changes: 6 additions & 6 deletions src/Common/DataReading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Loads all the data stored in `fileName` stored at `fileLocation`.
# Example
```julia-repl
(Parameters,SAtot3,SAtot4,TAtot,SAtal3,SAtal4,TAtal,SMatrix3,SMatrix4,TMatrix1,TMatrix2,p3Max,p4Max,t3MinMax,t4MinMax,SConv3,SConv4,TConv) = fload_All(fileLocation,fileName);
(Parameters,SAtot3,SAtot4,TAtot,SAtal3,SAtal4,TAtal,SMatrix3,SMatrix4,TMatrix1,TMatrix2,p3Max,p4Max,u3MinMax,u4MinMax,SConv3,SConv4,TConv) = fload_All(fileLocation,fileName);
```
Returns a tuple of the data stored in the file. The fields are as follows:
- `Parameters` : A tuple of the parameters used in the evaluation.
Expand All @@ -20,9 +20,9 @@ Returns a tuple of the data stored in the file. The fields are as follows:
- `TMatrix1` : A 4D matrix of the absorption spectrum for 12->34 interaction.
- `TMatrix2` : A 4D matrix of the absorption spectrum for 21->34 interaction i.e. by permutation of TMatrix1 and correct application of phase space factors if species 1 != species 2.
- `p3Max` : The maximum value of the momentum space variable p3 sampled for each bin. (Useful for correcting numerical diffusion)
- `t3MinMax` : The minimum and maximum values of the momentum space variable t3 sampled for each bin. (Useful for correcting numerical diffusion)
- `u3MinMax` : The minimum and maximum values of the momentum space variable t3 sampled for each bin. (Useful for correcting numerical diffusion)
- `p4Max` : The maximum value of the momentum space variable p4 sampled for each bin. (Useful for correcting numerical diffusion)
- `t4MinMax` : The minimum and maximum values of the momentum space variable t4 sampled for each bin. (Useful for correcting numerical diffusion)
- `u4MinMax` : The minimum and maximum values of the momentum space variable t4 sampled for each bin. (Useful for correcting numerical diffusion)
- `SConv3` : A 6D matrix of the convergence of the emission spectrum compared to the previous run with given `Parameters` for 12->34 interaction.
- `SConv4` : A 6D matrix of the convergence of the emission spectrum compared to the previous run with given `Parameters` for 12->43 interaction.
- `TConv` : A 4D matrix of the convergence of the absorption spectrum compared to the previous run with given `Parameters`.
Expand All @@ -42,14 +42,14 @@ function fload_All(fileLocation::String,fileName::String)
SMatrix3 = f["SMatrix3"];
SConv3 = f["SConverge3"];
p3Max = f["p3Max"];
t3MinMax = f["t3MinMax"];
u3MinMax = f["u3MinMax"];

SAtot4 = f["STotal4"];
SAtal4 = f["STally4"];
SMatrix4 = f["SMatrix4"];
SConv4 = f["SConverge4"];
p4Max = f["p4Max"];
t4MinMax = f["t4MinMax"];
u4MinMax = f["u4MinMax"];

TAtot = f["TTotal"];
TAtal = f["TTally"];
Expand All @@ -62,7 +62,7 @@ function fload_All(fileLocation::String,fileName::String)
error("no file with name $fileName found at location $fileLocation")
end

return (Parameters,SAtot3,SAtot4,TAtot,SAtal3,SAtal4,TAtal,SMatrix3,SMatrix4,TMatrix1,TMatrix2,p3Max,p4Max,t3MinMax,t4MinMax,SConv3,SConv4,TConv);
return (Parameters,SAtot3,SAtot4,TAtot,SAtal3,SAtal4,TAtal,SMatrix3,SMatrix4,TMatrix1,TMatrix2,p3Max,p4Max,u3MinMax,u4MinMax,SConv3,SConv4,TConv);

end

Expand Down
8 changes: 4 additions & 4 deletions src/MultiThread/STIntegration_MultiThread.jl
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ function SpectraEvaluateMultiThread(userInputMultiThread::Tuple{Tuple{String,Str
replace!(TMatrix1,NaN=>0e0);

# Angle / Momentum Ranges
u3val = bounds(u_up,u_low,u3_num,u3_grid)
u4val = bounds(u_up,u_low,u4_num,u4_grid)
u1val = bounds(u_up,u_low,u1_num,u1_grid)
u2val = bounds(u_up,u_low,u2_num,u2_grid)
u3val = bounds(u_low,u_up,u3_num,u3_grid)
u4val = bounds(u_low,u_up,u4_num,u4_grid)
u1val = bounds(u_low,u_up,u1_num,u1_grid)
u2val = bounds(u_low,u_up,u2_num,u2_grid)
p3val = bounds(p3_low,p3_up,p3_num,p3_grid)
p4val = bounds(p4_low,p4_up,p4_num,p4_grid)
p1val = bounds(p1_low,p1_up,p1_num,p1_grid)
Expand Down
10 changes: 5 additions & 5 deletions src/Serial/STIntegration_Serial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ function SpectraEvaluateSerial(userInputSerial::Tuple{Tuple{String,String,String
replace!(TMatrix1,NaN=>0e0);

# Angle / Momentum Ranges
u3val = bounds(u_up,u_low,u3_num,u3_grid)
u4val = bounds(u_up,u_low,u4_num,u4_grid)
u1val = bounds(u_up,u_low,u1_num,u1_grid)
u2val = bounds(u_up,u_low,u2_num,u2_grid)
u3val = bounds(u_low,u_up,u3_num,u3_grid)
u4val = bounds(u_low,u_up,u4_num,u4_grid)
u1val = bounds(u_low,u_up,u1_num,u1_grid)
u2val = bounds(u_low,u_up,u2_num,u2_grid)
p3val = bounds(p3_low,p3_up,p3_num,p3_grid)
p4val = bounds(p4_low,p4_up,p4_num,p4_grid)
p1val = bounds(p1_low,p1_up,p1_num,p1_grid)
Expand Down Expand Up @@ -197,7 +197,7 @@ function SpectraEvaluateSerial(userInputSerial::Tuple{Tuple{String,String,String
# ========== Save Arrays ============== #

#OutputParameters = Parameters

f = jldopen(filePath,"w") # creates file and overwrites previous file if one existed
write(f,"STotal3",SAtotal3)
write(f,"STally3",SAtally3)
Expand Down
2 changes: 1 addition & 1 deletion src/Serial/STMonteCarlo_Serial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ function STMonteCarloAxi_Serial!(SAtotal3::Array{Float64,6},SAtotal4::Array{Floa
SAtallyView4 .+= UInt32(1)
end

# asign to T arrays
# assign to T arrays
TAtotal[loc12] += Tval # ST[3] doesn't change with S loop
TAtally[loc12] += UInt32(1)

Expand Down
4 changes: 2 additions & 2 deletions src/Synchrotron/MultiThread/SyncIntegration_MultiThread.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ function SyncEvaluateMultiThread(userInputSyncMultiThread::Tuple{Tuple{String,St
replace!(SMatrix,NaN=>0e0); # remove NaN caused by /0e0

# Angle / Momentum Ranges
u1val = bounds(u_up,u_low,u1_num,u1_grid)
u2val = bounds(u_up,u_low,u2_num,u2_grid)
u1val = bounds(u_low,u_up,u1_num,u1_grid)
u2val = bounds(u_low,u_up,u2_num,u2_grid)
p1val = bounds(p1_low,p1_up,p1_num,p1_grid)
p2val = bounds(p2_low,p2_up,p2_num,p2_grid)

Expand Down
4 changes: 2 additions & 2 deletions src/Synchrotron/Serial/SyncIntegration_Serial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ function SyncEvaluateSerial(userSyncInputSerial::Tuple{Tuple{String,String,Float
replace!(SMatrix,NaN=>0e0); # remove NaN caused by /0e0

# Angle / Momentum Ranges
u1val = bounds(u_up,u_low,u1_num,u1_grid)
u2val = bounds(u_up,u_low,u2_num,u2_grid)
u1val = bounds(u_low,u_up,u1_num,u1_grid)
u2val = bounds(u_low,u_up,u2_num,u2_grid)
p1val = bounds(p1_low,p1_up,p1_num,p1_grid)
p2val = bounds(p2_low,p2_up,p2_num,p2_grid)

Expand Down

2 comments on commit 224ec7a

@cneverett
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release Notes:

  • Hot fix for sign issues in TMatrix outputs

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/124117

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v2.2.3 -m "<description of version>" 224ec7ac89a380ab8e11cf344e7015e790e4d687
git push origin v2.2.3

Please sign in to comment.