-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e78db9
commit bb7e252
Showing
4 changed files
with
110 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
struct CR <: ReferenceFEName end | ||
const cr = CR() | ||
|
||
""" | ||
CRRefFE(::Type{et},p::Polytope,order::Integer) where et | ||
The `order` argument has the following meaning: the divergence of the functions in this basis | ||
is in the P space of degree `order-1`. | ||
""" | ||
function CRRefFE(::Type{T},p::Polytope,order::Integer) where T | ||
D = num_dims(p) | ||
|
||
if is_simplex(p) && order == 1 | ||
prebasis = MonomialBasis{D}(T,order,Polynomials._p_filter) | ||
fb = MonomialBasis{D-1}(T,0,Polynomials._p_filter) | ||
else | ||
@notimplemented "CR Reference FE only available for simplices and lowest order" | ||
end | ||
|
||
function fmom(φ,μ,ds) # Face moment function : σ_F(φ,μ) = 1/|F| ( ∫((φ)*μ)dF ) | ||
D = num_dims(ds.cpoly) | ||
facet_measure = get_facet_measure(ds.cpoly, D-1) | ||
facet_measure_1 = Gridap.Fields.ConstantField(1 / facet_measure[ds.face]) | ||
φμ = Broadcasting(Operation(⋅))(φ,μ) | ||
Broadcasting(Operation(*))(φμ,facet_measure_1) | ||
end | ||
|
||
moments = Tuple[ | ||
(get_dimrange(p,D-1),fmom,fb), # Face moments | ||
] | ||
|
||
return Gridap.ReferenceFEs.MomentBasedReferenceFE(CR(),p,prebasis,moments,L2Conformity()) | ||
end | ||
|
||
|
||
function ReferenceFE(p::Polytope,::CR, order) | ||
CRRefFE(Float64,p,order) | ||
end | ||
|
||
function ReferenceFE(p::Polytope,::CR,::Type{T}, order) where T | ||
CRRefFE(T,p,order) | ||
end | ||
|
||
function Conformity(reffe::GenericRefFE{CR},sym::Symbol) | ||
if sym == :L2 | ||
L2Conformity() | ||
else | ||
@unreachable """\n | ||
It is not possible to use conformity = $sym on a CR reference FE. | ||
Possible values of conformity for this reference fe are $((:L2, hdiv...)). | ||
""" | ||
end | ||
end | ||
|
||
function get_face_own_dofs(reffe::GenericRefFE{CR}, conf::L2Conformity) | ||
get_face_dofs(reffe) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters