Skip to content

Commit

Permalink
activated arbitrary order RTk element from ExtendableFEMBase package,…
Browse files Browse the repository at this point in the history
… used in Example202 now
  • Loading branch information
chmerdon committed Jan 24, 2024
1 parent 1e5290e commit d76b3e3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ExtendableFEM"
uuid = "a722555e-65e0-4074-a036-ca7ce79a4aed"
authors = ["Christian Merdon <[email protected]>"]
version = "0.1.0"
version = "0.2.0"

[deps]
CommonSolve = "38540f10-b2f7-11e9-35d8-d573e4eb0ff2"
Expand Down Expand Up @@ -30,7 +30,7 @@ ExtendableFEMDiffEQExt = "DifferentialEquations"
CommonSolve = "0.2"
DiffResults = "1"
DocStringExtensions = "0.8,0.9"
ExtendableFEMBase = "^0.1.0"
ExtendableFEMBase = "^0.2, 0.3"
ExtendableGrids = "1.0"
ExtendableSparse = "1.2"
ForwardDiff = "^0.10.35"
Expand Down
15 changes: 4 additions & 11 deletions examples/Example202_MixedPoissonProblem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ using Test #hide
## define unknowns
σ = Unknown("σ"; name = "pseudostress")
u = Unknown("u"; name = "potential")
p = Unknown("p"; name = "LM hdiv continuity") # only_used if hdivdg == true

## bilinearform kernel for mixed Poisson problem
function blf!(result, u_ops, qpinfo)
Expand All @@ -51,27 +50,21 @@ function boundarydata!(result, qpinfo)
return nothing
end

function main(; nrefs = 5, μ = 0.25, hdivdg = false, Plotter = nothing, kwargs...)
function main(; nrefs = 5, μ = 0.25, order = 0, Plotter = nothing, kwargs...)

## problem description
PD = ProblemDescription()
assign_unknown!(PD, u)
assign_unknown!(PD, σ)
if hdivdg
assign_unknown!(PD, p)
assign_operator!(PD, BilinearOperator([jump(normalflux(σ))], [id(p)]; transposed_copy = 1, entities = ON_IFACES, kwargs...))
assign_operator!(PD, HomogeneousData(p; regions = 1:4))
end
assign_operator!(PD, BilinearOperator(blf!, [id(σ), div(σ), id(u)]; params = [μ], kwargs...))
assign_operator!(PD, LinearOperator(boundarydata!, [normalflux(σ)]; entities = ON_BFACES, regions = 1:4, kwargs...))
assign_operator!(PD, LinearOperator(f!, [id(u)]; kwargs...))
assign_operator!(PD, FixDofs(u; dofs = [1], vals = [0]))

## discretize
xgrid = uniform_refine(grid_unitsquare(Triangle2D), nrefs)
FES = Dict(u => FESpace{L2P0{1}}(xgrid),
σ => FESpace{HDIVRT0{2}}(xgrid; broken = hdivdg),
p => hdivdg ? FESpace{L2P0{1}, ON_FACES}(xgrid) : nothing)
FES = Dict(u => FESpace{order == 0 ? L2P0{1} : H1Pk{1,2,order}}(xgrid; broken = true),
σ => FESpace{HDIVRTk{2, order}}(xgrid))

## solve
sol = ExtendableFEM.solve(PD, FES; kwargs...)
Expand All @@ -84,7 +77,7 @@ end

generateplots = default_generateplots(Example202_MixedPoissonProblem, "example202.svg") #hide
function runtests() #hide
sol, plt = main(; μ = 0.25, nrefs = 2) #hide
sol, plt = main(; μ = 0.25, order = 0, nrefs = 2) #hide
@test maximum(view(sol[1])) 0.08463539106946043 #hide
end #hide
end # module
2 changes: 1 addition & 1 deletion src/ExtendableFEM.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export FESpace, FEMatrix, FEVector
export H1P1, H1P2, H1P3, H1Pk
export H1Q1, H1Q2
export H1CR, H1BR, H1P2B, H1MINI,H1P1TEB, H1BUBBLE
export HDIVRT0, HDIVRT1
export HDIVRT0, HDIVRT1, HDIVRTk
export HDIVBDM1, HDIVBDM2
export HCURLN0, HCURLN1
export HDIVRTkENRICH
Expand Down

0 comments on commit d76b3e3

Please sign in to comment.