Skip to content

Commit

Permalink
Fix IntegrationMap on empty subds with physical quads
Browse files Browse the repository at this point in the history
  • Loading branch information
ericneiva committed Jul 8, 2024
1 parent 9079dd1 commit 78a70fc
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Fields/FieldsInterfaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,15 @@ end

struct IntegrationMap <: Map end

function return_value(k::IntegrationMap,ax::AbstractVector,w)
if size(ax,1) == length(w)
evaluate(k,ax,w)
else
T = typeof( testitem(ax)*testitem(w) + testitem(ax)*testitem(w) )
zero(T)

Check warning on line 499 in src/Fields/FieldsInterfaces.jl

View check run for this annotation

Codecov / codecov/patch

src/Fields/FieldsInterfaces.jl#L498-L499

Added lines #L498 - L499 were not covered by tests
end
end

function evaluate!(cache,k::IntegrationMap,ax::AbstractVector,w)
T = typeof( testitem(ax)*testitem(w) + testitem(ax)*testitem(w) )
z = zero(T)
Expand All @@ -513,6 +522,15 @@ function evaluate!(cache,k::IntegrationMap,aq::AbstractVector,w,jq::AbstractVect
z
end

function return_value(k::IntegrationMap,ax::AbstractArray,w)
if size(ax,1) == length(w)
evaluate(k,ax,w)
else
c = return_cache(k,ax,w)
c.array

Check warning on line 530 in src/Fields/FieldsInterfaces.jl

View check run for this annotation

Codecov / codecov/patch

src/Fields/FieldsInterfaces.jl#L529-L530

Added lines #L529 - L530 were not covered by tests
end
end

function return_cache(k::IntegrationMap,ax::AbstractArray,w)
T = typeof( testitem(ax)*testitem(w) + testitem(ax)*testitem(w) )
r = zeros(T,size(ax)[2:end])
Expand Down

0 comments on commit 78a70fc

Please sign in to comment.