Ferrite-FEM / Ferrite-FEM/FerriteInterfaceElements.jl

facedof_indices and edgedof_indices wrong fallback?

Aperta
#32 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Julia
Stelle
10
Fork
3
Merge medio
3g 11h
PR unite (30g)
2

Descrizione

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)
((), ())
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.