Skip to content

Commit

Permalink
started adding extension for interpolating ExtendableFEM vectors into…
Browse files Browse the repository at this point in the history
… edgevelocities
  • Loading branch information
Da-Be-Ru committed Oct 2, 2024
1 parent dae2c6b commit 00495a6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
7 changes: 7 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,19 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"

[weakdeps]
ExtendableFEMBase = "12fb9182-3d4c-4424-8fd1-727a0899810c"

[extensions]
VoronoiFVMExtendableFEMBaseExt = "ExtendableFEMBase"

[compat]
BandedMatrices = "0.17,1"
Colors = "0.12"
CommonSolve = "0.2"
DiffResults = "1"
DocStringExtensions = "0.8,0.9"
ExtendableFEMBase = "0.7.0"
ExtendableGrids = "1.9.2"
ExtendableSparse = "1.5.1"
ForwardDiff = "0.10.35"
Expand Down
11 changes: 11 additions & 0 deletions ext/VoronoiFVMExtendableFEMBaseExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module VoronoiFVMExtendableFEMBaseExt

using VoronoiFVM
using ExtendableFEMBase
using ExtendableGrids

function VoronoiFVM.integrate(coord_system::Union{Cartesian2D,Cylindrical2D},p1,p2,hnormal,fevec::FEVectorBlock; interpolate_eps=1.0e-12, kwargs...)
println("Ja, hallo! Hier sind die kwargs: $(kwargs...)")
end

end
8 changes: 4 additions & 4 deletions src/vfvm_formfactors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ end
#
# TODO: this should be generalized for more quadrules
#
function integrate(::Type{<:Cartesian2D}, coordl, coordr, hnormal, velofunc)
function integrate(::Type{<:Cartesian2D}, coordl, coordr, hnormal, velofunc; kwargs...)
wl = 1.0 / 6.0
wm = 2.0 / 3.0
wr = 1.0 / 6.0
Expand All @@ -337,7 +337,7 @@ function integrate(::Type{<:Cartesian2D}, coordl, coordr, hnormal, velofunc)
return (wl * vxl + wm * vxm + wr * vxr) * hnormal[1] + (wl * vyl + wm * vym + wr * vyr) * hnormal[2]
end

function integrate(::Type{<:Cylindrical2D}, coordl, coordr, hnormal, velofunc)
function integrate(::Type{<:Cylindrical2D}, coordl, coordr, hnormal, velofunc; kwargs...)
wl = 1.0 / 6.0
wm = 2.0 / 3.0
wr = 1.0 / 6.0
Expand Down Expand Up @@ -367,7 +367,7 @@ $(SIGNATURES)
Project velocity onto grid edges,
"""
function edgevelocities(grid, velofunc)
function edgevelocities(grid, velofunc; kwargs...)
@assert dim_space(grid) < 3

cn = grid[CellNodes]
Expand Down Expand Up @@ -404,7 +404,7 @@ function edgevelocities(grid, velofunc)
p2 .= 0.5 * (coord[:, K] + coord[:, L])
end
hnormal = coord[:, K] - coord[:, L]
velovec[iedge] = integrate(coord_system, p1, p2, hnormal, velofunc)
velovec[iedge] = integrate(coord_system, p1, p2, hnormal, velofunc; kwargs...)
end
end
return velovec
Expand Down

0 comments on commit 00495a6

Please sign in to comment.