Skip to content

Commit 2015bd1

Browse files
authored
Merge pull request #691 from gridap/fix_issue_689
Fix issue 689
2 parents 24b4851 + a981329 commit 2015bd1

File tree

5 files changed

+53
-1
lines changed

5 files changed

+53
-1
lines changed

NEWS.md

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
### Fixed
8+
9+
- Laplacian `Δ` operator on unstructured linear grids for quantities defined in the reference space (i.e. shape funcitons in standard FEM). Since PR [#691](https://github.com/gridap/Gridap.jl/pull/691).
10+
- Laplacian `Δ` operator on triangulations using `GridView` (e.g., when interpolating functions in a sub-domain or on the boundary). Since PR [#691](https://github.com/gridap/Gridap.jl/pull/691).
11+
712
## [0.17.0] - 2021-10-22
813

914
### Added

src/Fields/AffineMaps.jl

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ function push_∇∇(∇∇a::Field,ϕ::AffineMap)
5353
end
5454

5555
function push_∇∇(∇∇a::Number,Jt_inv::MultiValue{Tuple{D,D}} where D)
56-
Jt_invJt_inv∇∇a
56+
#Jt_inv⋅Jt_inv⋅∇∇a
57+
Jt_inv∇∇atranspose(Jt_inv)
5758
end
5859

5960
function push_∇∇(∇∇a::Number,Jt_inv::MultiValue{Tuple{D1,D2}} where {D1,D2})

src/Geometry/GridPortions.jl

+4
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,10 @@ function get_cell_type(grid::GridView)
180180
lazy_map(Reindex(get_cell_type(grid.parent)),grid.cell_to_parent_cell)
181181
end
182182

183+
function get_cell_map(grid::GridView)
184+
lazy_map(Reindex(get_cell_map(grid.parent)),grid.cell_to_parent_cell)
185+
end
186+
183187
function get_facet_normal(grid::GridView)
184188
lazy_map(Reindex(get_facet_normal(grid.parent)),grid.cell_to_parent_cell)
185189
end

test/GridapTests/issue_689.jl

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
module Issue689
2+
3+
using Gridap
4+
using Gridap.ReferenceFEs
5+
using Gridap.Geometry
6+
using Gridap.CellData
7+
using Test
8+
9+
function main(transf,T)
10+
11+
𝒯 = CartesianDiscreteModel((0,1,0,1),(10,10)) |> transf
12+
labels = get_face_labeling(𝒯)
13+
add_tag_from_tags!(labels,"surface",6)
14+
Ω = Interior(𝒯)
15+
Γ = Boundary(𝒯,tags="surface")
16+
17+
k = 2
18+
= Measure(Ω,2*k)
19+
= Measure(Γ,2*k)
20+
21+
reffe = ReferenceFE(lagrangian,T,k)
22+
V = FESpace(Ω,reffe)
23+
Q = FESpace(Γ,reffe)
24+
25+
u((x,y)) = x^k + y^k
26+
uh = interpolate(u,V)
27+
qh = interpolate(u,Q)
28+
Δ_Γ(f) = x->∇∇(f)(x)[1,1]
29+
30+
tol = 1.0e-9
31+
@test sqrt(sum( ( abs2( Δ(u) - Δ(uh) ) )dΩ )) < tol
32+
@test sqrt(sum( ( abs2( Δ(u) - Δ(uh) ) )dΓ )) < tol
33+
@test sqrt(sum( ( abs2( Δ_Γ(u) - Δ(qh) ) )dΓ )) < tol
34+
35+
end
36+
37+
main(simplexify,Float64)
38+
main(identity,Float64)
39+
40+
end

test/GridapTests/runtests.jl

+2
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ using Test
3030

3131
@time @testset "Issue614" begin include("issue_614.jl") end
3232

33+
@time @testset "Issue689" begin include("issue_689.jl") end
34+
3335
end # module

0 commit comments

Comments
 (0)