Skip to content

Commit

Permalink
Trying to fix problem with numerical integration
Browse files Browse the repository at this point in the history
There was a problem for computations where the number of
elem dofs was different from the number of integration points
  • Loading branch information
fverdugo committed Jul 9, 2019
1 parent 189ba53 commit 0b3d4bf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Integration/CellIntegration.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module CellIntegration

using Gridap
using Gridap.Kernels: IntegrateKernel

export integrate

Expand All @@ -12,8 +13,12 @@ function integrate(
w = weights(quad)
f = evaluate(cellfun,z)
j = evaluate(gradient(phi),z)
# TODO this can be optimized wiht a Kernel
cellsum( f*(meas(j)*w), dim=N )
k = _prepare_kernel(f)
apply(k,f,meas(j),w)
end

function _prepare_kernel(f::CellArray{T,N}) where {T,N}
IntegrateKernel(Val(N))
end

function integrate(
Expand Down

0 comments on commit 0b3d4bf

Please sign in to comment.