Skip to content

Commit

Permalink
fix PrimitiveProps constructor, change my name
Browse files Browse the repository at this point in the history
  • Loading branch information
aj-fleming committed Nov 4, 2024
1 parent e9ee119 commit 2e65fe7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ShockwaveProperties"
uuid = "77d2bf28-a3e9-4b9c-9fcf-b85f74cc8a50"
authors = ["Alex Fleming <alexander.[email protected]> and contributors"]
version = "0.2.5"
authors = ["Sasha Fleming <fleming@stce.rwth-aachen.de>"]
version = "0.2.6"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
2 changes: 1 addition & 1 deletion src/cpg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ end
Construct a PrimitiveProps from a vector and assign default units.
"""
function PrimitiveProps(s::AbstractVector)
N = length(u)
N = length(s)
idcs = SVector{N - 2}(ntuple(i -> i + 1, N - 2))
return PrimitiveProps(Quantity(s[1], _units_ρ), s[idcs], Quantity(s[end], _units_T))
end
Expand Down
8 changes: 8 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ using Test
using Unitful

@testset verbose = true "ShockwaveProperties.jl" begin

@testset "Construct from Containers" begin
s1 = PrimitiveProps(SVector(1.225, 2.0, 0.0, 300.0))
s2 = PrimitiveProps([1.225, 2.0, 0.0, 300.0])
# just use some garbage numbers here
u1 = ConservedProps(SVector(1.225, 1.0, 1.0, 2.0))
u2 = ConservedProps([1.225, 1.0, 1.0, 2.0])
end
@testset "Dimensional Analysis" begin
# giving different units shouldn't mess with the actual results
# these are the same state
Expand Down

0 comments on commit 2e65fe7

Please sign in to comment.