gridap / gridap/GridapP4est.jl
Non conforming meshes and zeromean constraint
- Dominant language
- Julia
- Stars
- 15
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
@amartinhuertas Consider the Poisson problem on [0,1]^2 doubly periodic. This problem has a kernel, which is typically removed using the zeromean constraint in the FE space. i.e. for conforming meshes, consider the folllowing manufactured solution:
```
order = 2
function u_ex(x) ### this exact solution is zero mean + periodic on [0,1]^2
if x[1] < 0.5
return x[1]*(0.5-x[1])
else
return (x[1]-0.5)*(x[1]-1)
end
end
f_ex(x) = -1.0*Δ(u_ex)(x)
model = CartesianDiscreteModel((0,1,0,1),(10,10),isperiodic=(true,true))
Ω = Triangulation(model)
degree = 2*(order+1)
dΩ = Measure(Ω,degree)
sum(∫(u_ex)dΩ ) # check zero mean
sum(∫( laplacian(u_ex))dΩ ) # check compatibility
V = FESpace(model,ReferenceFE(lagrangian,Float64,order);conformity=:H1,constraint=:zeromean)
U = TrialFESpace(V)
biform(u,v) = ∫( ∇(u)⋅∇(v) )dΩ
liform(v) = ∫( v*f_ex )dΩ
op = AffineFEOperator(biform,liform,U,V)
A = get_matrix(op)
b = get_vector(op)
using LinearAlgebra
evals = eigvals(Array(A)) # check no kernel
sum(b)
uh = solve(LUSolver(),op)
l2(v) = sqrt(sum(∫(v⋅v)*dΩ))
eu = u_ex - uh
eu_l2 = l2(eu)
```
When the model is non-conforming, cannot recover the exact solution. Plotting the FE solution shows it is out by a constant factor.
Therefore, the FESpace constructor for OctreeModels might not be properly managing the zeromean constraint when the mesh is non-conforming.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.