JuliaGeometry / JuliaGeometry/GeometryBasics.jl
Adding NgonFace like types for volumetric elements (e.g. polyhedra)
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 215
- Forks
- 64
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 2
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing NgonFace and volumetric element definitions, including TetrahedronP, to compare how points and indices are represented. Then clarify the proposed AbstractElement, AbstractNhedraElement, aliases, and parameter semantics with maintainers; done means the public API and supported element types are agreed and consistently implemented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- backend-api-design, computer-graphics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100