Skip to content

Adding NgonFace like types for volumetric elements (e.g. polyhedra) #217

@Kevin-Mattheus-Moerman

Description

@Kevin-Mattheus-Moerman

This is a feature request. I am interested in using GeometryBasics in combination with volumetric meshing for finite element analysis, which features tetra-, hexa-, pentahedral elements for instance (both linear and higher order variants). I know there is some volumetric element stuff there in GeometryBasics, however unless I am mistaken they all "come with the points" e.g. P here:

const TetrahedronP{T,P<:AbstractPoint{3,T}} = Simplex{3,T,4,P}

In addition, I think it would be useful to have a polyhedron description where the points and point indices are separate. It would be great to have something equivalent to NgonFace but for polyhedra. Therefore I propose NhedraElement * and perhaps it can be achieved by adding something like this (which I believe is fully in line with how NgonFace is defined:

abstract type AbstractElement{N,T} <: StaticVector{N,T} end
abstract type AbstractNhedraElement{N,T} <: AbstractElement{N,T} end

@fixed_vector Nhedra = AbstractNhedraElement

Next we can define useful aliases, e.g. similar to TriangleFace or QuadFace. In the same vein one could propose TetrahedronElement and HexahedronElement. However I am proposing the shorter tet4 and hex8 (although I could also just implement them as aliases):

const tet4{T} = Nhedra{4,T} # A 4-noded tetrahedron
const hex8{T} = Nhedra{8,T} # An 8-noded hexahedron
const penta6{T} = Nhedra{6,T} # A 6 noded pentahedron (aka wedge element)

I am partial to, but not hung up on, these names. However I choose them in anticipation of support for higher-order finite elements (which may also feature mid-edge and mid-face points) e.g. something like:

const tet10{T} = Nhedra{10,T} # A 10-noded quadratic tetrahedron
const hex20{T} = Nhedra{20,T} # An 20-noded quadratic hexahedron

Let me know if this is of interest, I'm relatively new to Julia but I'd be happy to try add it and submit a PR.

*In an NgonFace the N should formally stand for the number of edges but it happens to be equal also to the number of points, certainly, functionally the code treats it as the latter. For the NhedraElement I propose it would be for the number of points (as the number of faces can be and often is different). The mathematical purist may feel upset though that N does not stand for the number of faces, however functionally, like with NgonFace the N really relates to the number of points we have to account for, so I'd be happy with this naming convention.

I'd also be interested to see what @fverdugo @santiagobadia @termi-official @fredrikekre @KristofferC feel about the above. They may have "baked their own cookies" over at their respective finite element related packages, but may still be able to offer insight in what they would ideally like to see on this in GeometryBasics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions