diff --git a/src/vfvm_geometryitems.jl b/src/vfvm_geometryitems.jl index 1e5ef21e0..f9b9b547e 100644 --- a/src/vfvm_geometryitems.jl +++ b/src/vfvm_geometryitems.jl @@ -207,7 +207,7 @@ Structure holding local boundary node information. $(TYPEDFIELDS) """ -mutable struct BNode{Td, Tc, Tp, Ti} <: AbstractNode{Tc, Tp, Ti} +mutable struct BNode{Td, Tc, Tp, Ti} <: AbstractNode{Tc, Tp, Ti} """ Index in grid """ @@ -272,7 +272,7 @@ mutable struct BNode{Td, Tc, Tp, Ti} <: AbstractNode{Tc, Tp, Ti} function BNode{Td, Tc, Tp, Ti}( sys::Ts, time, embedparam, params::Vector{Tp} - ) where {Td, Tc, Tp, Ti, Ts<:AbstractSystem} + ) where {Td, Tc, Tp, Ti, Ts <: AbstractSystem} return new( 0, 0, 0, 0, zeros(Ti, 2), num_species(sys), @@ -290,7 +290,7 @@ end # JF: We need to be able to distinguish bwetween dirichlet type and value type. # So far we will use Tp for the dirichlet type instead of the valuetype. # Maybe this even allows derivatives wrt. Dirichlet data. -function BNode(sys::AbstractSystem{Tv, Tc, Ti, Tm}, time, embedparam, params::Vector{Tp}) where {Tv,Tc, Tp, Ti, Tm} +function BNode(sys::AbstractSystem{Tv, Tc, Ti, Tm}, time, embedparam, params::Vector{Tp}) where {Tv, Tc, Tp, Ti, Tm} return BNode{Tp, Tc, Tp, Ti}(sys, time, embedparam, params) end BNode(sys) = BNode(sys, 0, 0, zeros(0)) diff --git a/test/test_geomitems.jl b/test/test_geomitems.jl index e4e6c444a..4b070e685 100644 --- a/test/test_geomitems.jl +++ b/test/test_geomitems.jl @@ -9,72 +9,71 @@ const Dual64 = ForwardDiff.Dual{Float64, Float64, 1} flux(y, u, edge, data) = y[1] = u[1, 1] - u[1, 2] -function main(;n=3) +function main(; n = 3) g = simplexgrid(0:0.1:1) - sys = VoronoiFVM.System(g; flux,species = 1:n) - time=0.0 - λ=0.0 - params=zeros(3) + sys = VoronoiFVM.System(g; flux, species = 1:n) + time = 0.0 + λ = 0.0 + params = zeros(3) - utest=zeros(Dual64,2*n) + utest = zeros(Dual64, 2 * n) node = VoronoiFVM.Node(sys, time, λ, params) - u=unknowns(node,utest) - @test typeof(u[1])==eltype(u) - @test typeof(copy(u)[1])==eltype(u) - @test length(u)==n - @test size(u)==(n,) + u = unknowns(node, utest) + @test typeof(u[1]) == eltype(u) + @test typeof(copy(u)[1]) == eltype(u) + @test length(u) == n + @test size(u) == (n,) bnode = VoronoiFVM.BNode(sys, time, λ, params) - u=unknowns(bnode,utest) - @test typeof(u[1])==eltype(u) - @test typeof(copy(u)[1])==eltype(u) - @test length(u)==n - @test size(u)==(n,) + u = unknowns(bnode, utest) + @test typeof(u[1]) == eltype(u) + @test typeof(copy(u)[1]) == eltype(u) + @test length(u) == n + @test size(u) == (n,) edge = VoronoiFVM.Edge(sys, time, λ, params) - u=unknowns(edge,utest) - @test typeof(u[1])==eltype(u) - @test typeof(copy(u)[1])==eltype(u) - @test length(u)==2*n - @test size(u)==(n,2) + u = unknowns(edge, utest) + @test typeof(u[1]) == eltype(u) + @test typeof(copy(u)[1]) == eltype(u) + @test length(u) == 2 * n + @test size(u) == (n, 2) bedge = VoronoiFVM.BEdge(sys, time, λ, params) - u=unknowns(bedge,utest) - @test typeof(u[1])==eltype(u) - @test typeof(copy(u)[1])==eltype(u) - @test length(u)==2*n - @test size(u)==(n,2) + u = unknowns(bedge, utest) + @test typeof(u[1]) == eltype(u) + @test typeof(copy(u)[1]) == eltype(u) + @test length(u) == 2 * n + @test size(u) == (n, 2) - - ftest=zeros(Dual64,2*n) + ftest = zeros(Dual64, 2 * n) node = VoronoiFVM.Node(sys, time, λ, params) - f=VoronoiFVM.rhs(node,ftest) - @test typeof(f[1])==eltype(f) - @test typeof(copy(f)[1])==eltype(f) - @test length(f)==n - @test size(f)==(n,) + f = VoronoiFVM.rhs(node, ftest) + @test typeof(f[1]) == eltype(f) + @test typeof(copy(f)[1]) == eltype(f) + @test length(f) == n + @test size(f) == (n,) bnode = VoronoiFVM.BNode(sys, time, λ, params) - f=VoronoiFVM.rhs(bnode,ftest) - @test typeof(f[1])==eltype(f) - @test typeof(copy(f)[1])==eltype(f) - @test length(f)==n - @test size(f)==(n,) + f = VoronoiFVM.rhs(bnode, ftest) + @test typeof(f[1]) == eltype(f) + @test typeof(copy(f)[1]) == eltype(f) + @test length(f) == n + @test size(f) == (n,) edge = VoronoiFVM.Edge(sys, time, λ, params) - f=VoronoiFVM.rhs(edge,ftest) - @test typeof(f[1])==eltype(f) - @test typeof(copy(f)[1])==eltype(f) - @test length(f)==n - @test size(f)==(n,) + f = VoronoiFVM.rhs(edge, ftest) + @test typeof(f[1]) == eltype(f) + @test typeof(copy(f)[1]) == eltype(f) + @test length(f) == n + @test size(f) == (n,) bedge = VoronoiFVM.BEdge(sys, time, λ, params) - f=VoronoiFVM.rhs(bedge,ftest) - @test typeof(f[1])==eltype(f) - @test typeof(copy(f)[1])==eltype(f) - @test length(f)==n - @test size(f)==(n,) + f = VoronoiFVM.rhs(bedge, ftest) + @test typeof(f[1]) == eltype(f) + @test typeof(copy(f)[1]) == eltype(f) + @test length(f) == n + return @test size(f) == (n,) end