Ferrite-FEM / Ferrite-FEM/Ferrite.jl

Introduce a convenience method to determine the dimensionality of a CellValues object

Aperta
#972 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
Julia
Stelle
453
Fork
115
Merge medio
1g 17h
PR unite (30g)
11

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.