Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 7 additions & 2 deletions docs/src/devdocs/interpolations.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ order. The [how-to at bottom of this page](@ref devdocs-howto_new-interpolation)
Ferrite.reference_shape_value(::Interpolation, ::Vec, ::Int)
Ferrite.reference_coordinates(::Interpolation)
Ferrite.vertexdof_indices(::Interpolation)
Ferrite.facedof_indices(::Interpolation)
Ferrite.facedof_interior_indices(::Interpolation)
Ferrite.edgedof_indices(::Interpolation)
Ferrite.edgedof_interior_indices(::Interpolation)
Ferrite.volumedof_interior_indices(::Interpolation)
Ferrite.adjust_dofs_during_distribution(::Interpolation)
Expand Down Expand Up @@ -41,6 +39,13 @@ Ferrite.mapping_type
Ferrite.get_direction
```

#### Interpolations that cannot be constructed from their type
For interpolations, `ip`, for which `ip == typeof(ip)()` is false (or doesn't work), the following must be implemented manually
```@docs
Ferrite.edgedof_indices(::Interpolation)
Ferrite.facedof_indices(::Interpolation)
```

### The defaults should always work
The following functions are defined such that they should work for
any interpolations that defines the required functions specified above.
Expand Down
16 changes: 16 additions & 0 deletions src/Grid/grid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,22 @@ function reference_faces(::Type{RefPyramid})
)
end

@generated function reference_face_edgenrs(::Type{RefShape}) where {RefShape <: AbstractRefShape}
Comment thread
termi-official marked this conversation as resolved.
expr = Expr(:tuple)
refedges = reference_edges(RefShape)
for face in reference_faces(RefShape)
expr_i = Expr(:tuple)
for j in 1:length(face)
v1 = face[j]
v2 = face[mod1(j + 1, length(face))]
edgenr = findfirst(refedge -> (refedge === (v1, v2) || refedge === (v2, v1)), refedges)
push!(expr_i.args, edgenr)
end
push!(expr.args, expr_i)
end
return :(return $expr)
end

######################################################
# Concrete implementations of AbstractCell interface #
######################################################
Expand Down
Loading
Loading