diff --git a/src/MultiField/MultiCellMaps.jl b/src/MultiField/MultiCellMaps.jl index 41db095f3..1797dec47 100644 --- a/src/MultiField/MultiCellMaps.jl +++ b/src/MultiField/MultiCellMaps.jl @@ -42,4 +42,10 @@ function (-)(a::MultiCellMap{N},b::MultiCellMap{N}) where N MultiCellMap(blocks,fieldids) end +function (-)(b::MultiCellMap{N}) where N + blocks = CellMap[] + append!(blocks,[ -k for k in b.blocks]) + MultiCellMap(blocks,b.fieldids) +end + end # module diff --git a/test/MultiFieldTests/MultiFEOperatorsTests.jl b/test/MultiFieldTests/MultiFEOperatorsTests.jl index a0bae3c60..ff5381d76 100644 --- a/test/MultiFieldTests/MultiFEOperatorsTests.jl +++ b/test/MultiFieldTests/MultiFEOperatorsTests.jl @@ -52,7 +52,8 @@ bquad = CellQuadrature(btrian,order=2) # Terms in the volume a(v,u) = inner(∇(v[1]),∇(u[1])) + inner(v[1],u[2]) + inner(∇(v[2]),∇(u[2])) b(v) = inner(v[1],b1fun) + inner(v[2],b2fun) -t_Ω = AffineFETerm(a,b,trian,quad) +t_Ωa = LinearFETerm(a,trian,quad) +t_Ωb = FESource(b,trian,quad) # Terms on Neumann boundary # Note that the Neumann BC only applies on the first field @@ -63,7 +64,7 @@ t_Γ = FESource(g,btrian,bquad) assem = SparseMatrixAssembler(V,U) # Define the FEOperator -op = LinearFEOperator(V,U,assem,t_Ω,t_Γ) +op = LinearFEOperator(V,U,assem,t_Ωa,t_Ωb,t_Γ) # Define the FESolver ls = LUSolver() @@ -99,6 +100,7 @@ e2h1 = sqrt(sum( integrate(h1(e2),trian,quad) )) # Further tests +t_Ω = AffineFETerm(a,b,trian,quad) op = LinearFEOperator(a,b,V,U,assem,trian,quad) op = LinearFEOperator(V,U,t_Ω,t_Γ) op = LinearFEOperator(V,U,t_Ω)