From 8118a5511da23cda8df41afa9e3ee985e2b23ba4 Mon Sep 17 00:00:00 2001 From: JordiManyer Date: Wed, 11 Dec 2024 16:50:57 +1100 Subject: [PATCH] Save progress --- src/ReferenceFEs/Pullbacks.jl | 66 +++++++++++++++++------------------ 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/ReferenceFEs/Pullbacks.jl b/src/ReferenceFEs/Pullbacks.jl index 36e2d7a03..de49f3a21 100644 --- a/src/ReferenceFEs/Pullbacks.jl +++ b/src/ReferenceFEs/Pullbacks.jl @@ -1,63 +1,63 @@ """ - abstract type Pullback <: Map end + abstract type Pushforward <: Map end -Represents a pullback map F*, defined as +Represents a pushforward map F*, defined as F* : V̂ -> V where - V̂ is a function space on the reference cell K̂ and - V is a function space on the physical cell K. """ -abstract type Pullback <: Map end +abstract type Pushforward <: Map end function lazy_map( - ::Broadcasting{typeof(gradient)}, a::LazyArray{<:Fill{Broadcasting{Operation{<:Pullback}}}} + ::Broadcasting{typeof(gradient)}, a::LazyArray{<:Fill{Broadcasting{Operation{<:Pushforward}}}} ) cell_ref_basis, args = a.args cell_ref_gradient = lazy_map(Broadcasting(∇),cell_ref_basis) return lazy_map(a.maps.value,cell_ref_gradient,args...) end -# InversePullback +# InversePushforward """ - struct InversePullback{PB <: Pullback} <: Map end + struct InversePushforward{PF <: Pushforward} <: Map end -Represents the inverse of a pullback map F*, defined as +Represents the inverse of a pushforward map F*, defined as (F*)^-1 : V -> V̂ where - V̂ is a function space on the reference cell K̂ and - V is a function space on the physical cell K. """ -struct InversePullback{PB} <: Map - pullback::PB - function InversePullback(pullback::Pullback) - PB = typeof(pullback) - new{PB}(pullback) +struct InversePushforward{PF} <: Map + pushforward::PF + function InversePushforward(pushforward::Pushforward) + PF = typeof(pushforward) + new{PF}(pushforward) end end -Arrays.inverse_map(pb::Pullback) = InversePullback(pb) -Arrays.inverse_map(ipb::InversePullback) = ipb.pullback +Arrays.inverse_map(pb::Pushforward) = InversePushforward(pb) +Arrays.inverse_map(ipb::InversePushforward) = ipb.pushforward # Pushforward """ - struct Pushforward{PB <: Pullback} <: Map end + struct Pullback{PF <: Pushforward} <: Map end Represents a pushforward map F**, defined as F** : V* -> V̂* where - V̂* is a dof space on the reference cell K̂ and - V* is a dof space on the physical cell K. -Its action on physical dofs σ : V -> R is defined in terms of the pullback map F* as +Its action on physical dofs σ : V -> R is defined in terms of the pushforward map F* as F**(σ) := σ∘F* : V̂ -> R """ -struct Pushforward{PB} <: Map - pullback::PB - function Pushforward(pullback::Pullback) - PB = typeof(pullback) - new{PB}(pullback) +struct Pullback{PF} <: Map + pushforward::PF + function Pullback(pushforward::Pushforward) + PF = typeof(pushforward) + new{PF}(pushforward) end end @@ -66,46 +66,46 @@ function Arrays.lazy_map( ) pf = k.maps.value phys_cell_dofs, cell_map, pb_args = k.args - phys_cell_basis = lazy_map(pf.pullback,ref_cell_basis,cell_map,pb_args...) + phys_cell_basis = lazy_map(pf.pushforward,ref_cell_basis,cell_map,pb_args...) return lazy_map(evaluate,phys_cell_dofs,phys_cell_basis) end # InversePushforward """ - struct InversePushforward{PB <: Pullback} <: Map end + struct InversePushforward{PF <: Pushforward} <: Map end Represents the inverse of the pushforward map F**, defined as (F**)^-1 : V̂* -> V* where - V̂* is a dof space on the reference cell K̂ and - V* is a dof space on the physical cell K. -Its action on reference dofs ̂σ : V -> R is defined in terms of the pullback map F* as +Its action on reference dofs ̂σ : V -> R is defined in terms of the pushforward map F* as F**(̂σ) := ̂σ∘(F*)^-1 : V -> R """ -struct InversePushforward{PB} <: Map - pullback::PB - function InversePushforward(pullback::Pullback) - PB = typeof(pullback) - new{PB}(pullback) +struct InversePushforward{PF} <: Map + pushforward::PF + function InversePushforward(pushforward::Pushforward) + PF = typeof(pushforward) + new{PF}(pushforward) end end -Arrays.inverse_map(pf::Pushforward) = InversePushforward(pf.pullback) -Arrays.inverse_map(ipf::InversePushforward) = Pushforward(ipf.pullback) +Arrays.inverse_map(pf::Pushforward) = InversePushforward(pf.pushforward) +Arrays.inverse_map(ipf::InversePushforward) = Pushforward(ipf.pushforward) function Arrays.lazy_map( ::typeof{evaluate},k::LazyArray{<:Fill{<:InversePushforward}},phys_cell_basis ) pf = inverse_map(k.maps.value) ref_cell_dofs, cell_map, pb_args = k.args - ref_cell_basis = lazy_map(inverse_map(pf.pullback),phys_cell_basis,cell_map,pb_args...) + ref_cell_basis = lazy_map(inverse_map(pf.pushforward),phys_cell_basis,cell_map,pb_args...) return lazy_map(evaluate,ref_cell_dofs,ref_cell_basis) end # ContraVariantPiolaMap -struct ContraVariantPiolaMap <: Pullback end +struct ContraVariantPiolaMap <: Pushforward end function lazy_map( k::ContraVariantPiolaMap,