Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moment based reffes #1048

Draft
wants to merge 47 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
d93abbe
Optimise sign-flip map
JordiManyer Oct 12, 2024
9bb7093
Massive optimisations to RT
JordiManyer Oct 12, 2024
4ab8e0d
Added ConstantFieldArrays
JordiManyer Oct 12, 2024
e1ce521
Merge branch 'master' of github.com:gridap/Gridap.jl into raviart-thomas
JordiManyer Oct 13, 2024
472b27d
Merge branch 'master' of github.com:gridap/Gridap.jl into raviart-thomas
JordiManyer Oct 13, 2024
c192534
Added gitignore for test folder
JordiManyer Oct 13, 2024
a553631
Minor modification to constantFieldArrays
JordiManyer Oct 14, 2024
13a3861
Minor bugfix
JordiManyer Oct 14, 2024
2dbda6a
Minor
JordiManyer Oct 14, 2024
d22809f
Minor
JordiManyer Oct 14, 2024
ace1df4
Minor
JordiManyer Oct 14, 2024
513e78a
Bugfixes
JordiManyer Oct 14, 2024
37cb076
Expanded Jacobi and added Chebyshev
JordiManyer Oct 21, 2024
6d8e04e
Minor
JordiManyer Oct 21, 2024
4786131
Added new phi kwarg for RT reffe
JordiManyer Oct 22, 2024
99f4919
Minor
JordiManyer Oct 23, 2024
b970d36
Minor
JordiManyer Oct 28, 2024
79edf5b
Minor fix in JacobiPolymials that did now allow interpolation
JordiManyer Oct 30, 2024
57c9897
Started MWE of moment-based reffes
JordiManyer Nov 4, 2024
cee7072
Repreoduced RT and ND reffes in 2D/3D
JordiManyer Nov 4, 2024
62ad259
Minor
JordiManyer Nov 5, 2024
2e551e0
Merge branch 'master' of github.com:gridap/Gridap.jl into raviart-thomas
JordiManyer Nov 6, 2024
7bcf633
Merge branch 'master' of github.com:gridap/Gridap.jl into raviart-thomas
JordiManyer Nov 8, 2024
b9b8fc4
Merge branch 'master' of github.com:gridap/Gridap.jl into raviart-thomas
JordiManyer Nov 8, 2024
107adf1
Added PCurlGradJacobiPolynomialBases
JordiManyer Nov 9, 2024
f2d896d
Minor
JordiManyer Nov 9, 2024
06fe0d4
Replicated Raviart-Thomas refes with new machinery
JordiManyer Nov 9, 2024
e0b4a77
Merge branch 'master' of github.com:gridap/Gridap.jl into moment-base…
JordiManyer Nov 16, 2024
dfdb7e4
Ported Nedelec and BDM
JordiManyer Nov 16, 2024
c967869
Many fixes
JordiManyer Nov 18, 2024
2837bbb
Bugfixes in Nedelec
JordiManyer Nov 23, 2024
9b38ee1
Accounted for detrminant of the face
JordiManyer Nov 23, 2024
2e78db9
Started implementing AW and MTW reffes
JordiManyer Nov 24, 2024
4b3a82d
Started looking at the pullback machinery
JordiManyer Nov 25, 2024
02a1648
Minor
JordiManyer Dec 2, 2024
bb7e252
CR working in 2D
Jai-Tushar Dec 5, 2024
289476a
CRRefFEs working in 2D
Jai-Tushar Dec 9, 2024
df1bca9
Merge pull request #1064 from Jai-Tushar/moment-based-reffes
JordiManyer Dec 9, 2024
6241252
Merge branch 'master' of github.com:gridap/Gridap.jl into moment-base…
JordiManyer Dec 9, 2024
b460249
Minor
JordiManyer Dec 10, 2024
b0329b6
Started reformatting docs
JordiManyer Dec 10, 2024
d3b7159
More docs
JordiManyer Dec 10, 2024
124ae27
Minor
JordiManyer Dec 10, 2024
8118a55
Save progress
JordiManyer Dec 11, 2024
c5be3d4
Fixed Nedelec
JordiManyer Dec 12, 2024
5292024
Removed FineToCoarseReferenceFEs, which have been replaced by macro-e…
JordiManyer Dec 12, 2024
2a4ff4e
Save changes
JordiManyer Dec 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Started looking at the pullback machinery
  • Loading branch information
JordiManyer committed Nov 25, 2024
commit 4b3a82d062fc13642813fd5ff617d7e83521d0f7
128 changes: 128 additions & 0 deletions src/ReferenceFEs/Pullbacks.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@

"""
abstract type Pullback <: Map end

Represents a pullback 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

function lazy_map(
::Broadcasting{typeof(gradient)}, a::LazyArray{<:Fill{Broadcasting{Operation{<:Pullback}}}}
)
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

"""
struct InversePullback{PB <: Pullback} <: Map end

Represents the inverse of a pullback 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)
end
end

Arrays.inverse_map(pb::Pullback) = InversePullback(pb)
Arrays.inverse_map(ipb::InversePullback) = ipb.pullback

# Pushforward

"""
struct Pushforward{PB <: Pullback} <: 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
F**(σ) := σ∘F* : V̂ -> R
"""
struct Pushforward{PB} <: Map
pullback::PB
function Pushforward(pullback::Pullback)
PB = typeof(pullback)
new{PB}(pullback)
end
end

function Arrays.lazy_map(
::typeof{evaluate},k::LazyArray{<:Fill{<:Pushforward}},ref_cell_basis
)
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...)
return lazy_map(evaluate,phys_cell_dofs,phys_cell_basis)
end

# InversePushforward

"""
struct InversePushforward{PB <: Pullback} <: 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
F**(̂σ) := ̂σ∘(F*)^-1 : V -> R
"""
struct InversePushforward{PB} <: Map
pullback::PB
function InversePushforward(pullback::Pullback)
PB = typeof(pullback)
new{PB}(pullback)
end
end

Arrays.inverse_map(pf::Pushforward) = InversePushforward(pf.pullback)
Arrays.inverse_map(ipf::InversePushforward) = Pushforward(ipf.pullback)

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...)
return lazy_map(evaluate,ref_cell_dofs,ref_cell_basis)
end

# ContraVariantPiolaMap

struct ContraVariantPiolaMap <: Pullback end

function lazy_map(
k::ContraVariantPiolaMap,
cell_ref_shapefuns::AbstractArray{<:AbstractArray{<:Field}},
cell_map::AbstractArray{<:Field},
sign_flip::AbstractArray{<:AbstractArray{<:Field}}
)
cell_Jt = lazy_map(∇,cell_map)
lazy_map(Broadcasting(Operation(k)),cell_ref_shapefuns,cell_Jt,sign_flip)
end

function evaluate!(
cache,::ContraVariantPiolaMap,
v::Number,
Jt::Number,
sign_flip::Bool
)
idetJ = 1/meas(Jt)
((-1)^sign_flip*v)⋅(idetJ*Jt)
end