Skip to content

Commit

Permalink
fix issue 130
Browse files Browse the repository at this point in the history
  • Loading branch information
ghislainb committed Aug 28, 2024
1 parent 02d16cb commit 3d1f366
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/LazyOperators/lazy_operator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,10 @@ get_operator(a::NullOperator) = nothing
get_args(a::NullOperator) = (nothing,)
materialize(a::NullOperator, x) = a

Base.length(::NullOperator) = 1
Base.iterate(a::NullOperator) = (a, nothing)
Base.iterate(a::NullOperator, state) = nothing

function show_lazy_operator(op::NullOperator; level = 1, indent = 4, islast = (true,))
level == 1 && println("\n---------------")
print_tree_prefix(level, indent, islast)
Expand Down
11 changes: 7 additions & 4 deletions src/assembler/assembler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,13 @@ function _append_contribution!(X, I, J, U, V, values, elementInfo::CellInfo, dom
idofs = get_dofs(V, icell, nV) # lines correspond to the TestFunction
_idofs, _jdofs = _cartesian_product(idofs, jdofs)
unwrapValues = _unwrap_cell_integrate(V, values)
append!(I, _idofs)
append!(J, _jdofs)
for _v in unwrapValues
append!(X, _v)
val = [reduce((x, y) -> (x..., y...), unwrapValues)...]
for (_i, _j, _v) in zip(_idofs, _jdofs, val)
if !isa(_v, NullOperator)
append!(X, _v)
append!(I, _i)
append!(J, _j)
end
end
return nothing
end
Expand Down
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,8 @@ fname2sum = Dict(r[2] => r[1] for r in eachrow(f))
custom_include("./operator/test_algebra.jl")
custom_include("./dof/test_meshdata.jl")
custom_include("./writers/test_vtk.jl")

@testset "Issues" begin
custom_include("./issues/issue_130.jl")
end
end

0 comments on commit 3d1f366

Please sign in to comment.