Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
j-fu committed Dec 23, 2024
1 parent 7019587 commit ded4956
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 51 deletions.
6 changes: 3 additions & 3 deletions src/vfvm_geometryitems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand Down Expand Up @@ -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),
Expand All @@ -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))
Expand Down
95 changes: 47 additions & 48 deletions test/test_geomitems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

2 comments on commit ded4956

@j-fu
Copy link
Member Author

@j-fu j-fu commented on ded4956 Dec 23, 2024

Choose a reason for hiding this comment

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

@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/121913

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

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.6.3 -m "<description of version>" ded4956feedf6340bcdde1366a2243dbc9ead637
git push origin v2.6.3

Please sign in to comment.