Ferrite-FEM / Ferrite-FEM/Ferrite.jl
Introduce a convenience method to determine the dimensionality of a CellValues object
- Dominant language
- Julia
- Stars
- 453
- Forks
- 115
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 11
Description
I think it would be good to have convenient acces to the dimensionality of a CellValues object. Especially when someone chooses to use a Scalar CellValues object instead of a Vector CellValues object for the element assembly.
In v0.3.14 I could do something like that:
```julia
function assemble_element!(cv::CellScalarValues{dim}, ...) where dim
```
Which although not documented was quite convenient. However due to the canges made to CellValues this is no longer possible. Now I have to do this:
```julia
function assemble_element!(cv::CellValues, ...)
dim = cv |> Ferrite.function_interpolation |> Ferrite.getrefdim
```
Maybe it's possible to overload `getrefdim()` to work for CellValues as well?
Furthermore, the pretty-printing of the CellValues Object already displays this information
```julia
julia> cellValues = CellValues(
QuadratureRule{RefHexahedron}(:legendre, 2),
Lagrange{RefHexahedron, 1}()^3
)
CellValues(vdim=3, rdim=3, and sdim=3): 8 quadrature points
Function interpolation: Lagrange{RefHexahedron, 1}()^3
Geometric interpolation: Lagrange{RefHexahedron, 1}()^3
julia> cellValues = CellValues(
QuadratureRule{RefHexahedron}(:legendre, 2),
Lagrange{RefHexahedron, 1}()
)
CellValues(scalar, rdim=3, and sdim=3): 8 quadrature points
Function interpolation: Lagrange{RefHexahedron, 1}()
Geometric interpolation: Lagrange{RefHexahedron, 1}()^3
```
So it's a bit confusing why you can't easily acces this through the API.
I can create a pull request for this, if you think that this is a good inclusion.
Contributor guide
Assessment
This issue has not been assessed yet.