Ferrite-FEM / Ferrite-FEM/FerriteInterfaceElements.jl

facedof_indices and edgedof_indices wrong fallback?

Open
#32 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
10
Forks
3
Avg merge
3d 11h
Merged PRs (30d)
2

Description

In https://github.com/Ferrite-FEM/Ferrite.jl/pull/1293 I got a failure because `typeof(ip::InterfaceCellInterpolation)()` doesn't work (which is ok of course), but it also seems like the current default fallback is wrong since the wrong number is used.

Since `facedof_indices` and `edgedof_indices` are only used AFAIU for applying `Dirichlet` boundary conditions (via `dirichlet_facedof_indices` and `dirichlet_edgedof_indices`), this is not used in the interface elements? Of course, for interpolations inside an interface cell, one would have dofs on the external boundary of the interface element, but currently it seems like the implementation assumes that even though `ipi = InterfaceCellInterpolation(Lagrange{RefLine,1}())::Interpolation{RefQuadrilateral}`, there are only 2 edges... And these dofs would be on the 2 (zero-length) edges that are currently missing (but that would belong to something like an `InternalInterfaceCellInterpolation` I guess...).

To support https://github.com/Ferrite-FEM/Ferrite.jl/pull/1293, would it be ok to add the default implementations here instead for `InterfaceCellInterpolation`, given the current behavior? (At least as a temporary solution until the above can be worked out) CC: @DRollin / @kimauth
```julia
Ferrite.edgedof_indices(ip::InterfaceCellInterpolation) = ntuple(i -> (), Ferrite.nedges(ip))
Ferrite.faceedof_indices(ip::InterfaceCellInterpolation) = ntuple(i -> (), Ferrite.nfaces(ip))
```

Output showing the inconsistencies wrt. number of edges/faces between interior and non-interior:
```julia
julia> ipi = InterfaceCellInterpolation(Lagrange{RefLine,1}())
InterfaceCellInterpolation{RefQuadrilateral, 1, Lagrange{RefLine, 1}}(Lagrange{RefLine, 1}())

julia> Ferrite.edgedof_interior_indices(ipi)
((), ())

julia> Ferrite.edgedof_indices(ipi)
((), (), (), ())

julia> ipi2 = InterfaceCellInterpolation(Lagrange{RefLine,2}())
InterfaceCellInterpolation{RefQuadrilateral, 2, Lagrange{RefLine, 2}}(Lagrange{RefLine, 2}())

julia> Ferrite.edgedof_interior_indices(ipi2)
((5,), (6,))

julia> Ferrite.edgedof_indices(ipi2)
((), (), (), ())

julia> ipi_3d = InterfaceCellInterpolation(Lagrange{RefQuadrilateral,1}())
InterfaceCellInterpolation{RefHexahedron, 1, Lagrange{RefQuadrilateral, 1}}(Lagrange{RefQuadrilateral, 1}())

julia> Ferrite.edgedof_interior_indices(ipi_3d)
((), (), (), (), (), (), (), ())

julia> Ferrite.edgedof_indices(ipi_3d)
((), (), (), (), (), (), (), (), (), (), (), ())

julia> Ferrite.facedof_indices(ipi_3d)
((), (), (), (), (), ())

julia> Ferrite.facedof_interior_indices(ipi_3d)
((), ())
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.