@@ -28,7 +28,6 @@ using Test #hide
28
28
# # define unknowns
29
29
σ = Unknown (" σ" ; name = " pseudostress" )
30
30
u = Unknown (" u" ; name = " potential" )
31
- p = Unknown (" p" ; name = " LM hdiv continuity" ) # only_used if hdivdg == true
32
31
33
32
# # bilinearform kernel for mixed Poisson problem
34
33
function blf! (result, u_ops, qpinfo)
@@ -51,27 +50,21 @@ function boundarydata!(result, qpinfo)
51
50
return nothing
52
51
end
53
52
54
- function main (; nrefs = 5 , μ = 0.25 , hdivdg = false , Plotter = nothing , kwargs... )
53
+ function main (; nrefs = 5 , μ = 0.25 , order = 0 , Plotter = nothing , kwargs... )
55
54
56
55
# # problem description
57
56
PD = ProblemDescription ()
58
57
assign_unknown! (PD, u)
59
58
assign_unknown! (PD, σ)
60
- if hdivdg
61
- assign_unknown! (PD, p)
62
- assign_operator! (PD, BilinearOperator ([jump (normalflux (σ))], [id (p)]; transposed_copy = 1 , entities = ON_IFACES, kwargs... ))
63
- assign_operator! (PD, HomogeneousData (p; regions = 1 : 4 ))
64
- end
65
59
assign_operator! (PD, BilinearOperator (blf!, [id (σ), div (σ), id (u)]; params = [μ], kwargs... ))
66
60
assign_operator! (PD, LinearOperator (boundarydata!, [normalflux (σ)]; entities = ON_BFACES, regions = 1 : 4 , kwargs... ))
67
61
assign_operator! (PD, LinearOperator (f!, [id (u)]; kwargs... ))
68
62
assign_operator! (PD, FixDofs (u; dofs = [1 ], vals = [0 ]))
69
63
70
64
# # discretize
71
65
xgrid = uniform_refine (grid_unitsquare (Triangle2D), nrefs)
72
- FES = Dict (u => FESpace {L2P0{1}} (xgrid),
73
- σ => FESpace {HDIVRT0{2}} (xgrid; broken = hdivdg),
74
- p => hdivdg ? FESpace {L2P0{1}, ON_FACES} (xgrid) : nothing )
66
+ FES = Dict (u => FESpace {order == 0 ? L2P0{1} : H1Pk{1,2,order}} (xgrid; broken = true ),
67
+ σ => FESpace {HDIVRTk{2, order}} (xgrid))
75
68
76
69
# # solve
77
70
sol = ExtendableFEM. solve (PD, FES; kwargs... )
84
77
85
78
generateplots = default_generateplots (Example202_MixedPoissonProblem, " example202.svg" ) # hide
86
79
function runtests () # hide
87
- sol, plt = main (; μ = 0.25 , nrefs = 2 ) # hide
80
+ sol, plt = main (; μ = 0.25 , order = 0 , nrefs = 2 ) # hide
88
81
@test maximum (view (sol[1 ])) ≈ 0.08463539106946043 # hide
89
82
end # hide
90
83
end # module
0 commit comments