Ferrite-FEM / Ferrite-FEM/Ferrite.jl

weighted_normal docstring

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

Descrizione

When developing the code for teaching FEM Basics, I realized that

https://github.com/Ferrite-FEM/Ferrite.jl/blob/b099103eb40047015f10657b95845fc25fd2823a/src/FEValues/facet_integrals.jl#L21-L23

is not fully correct - if we consider a triangle cell with the geometry from the reference cell, we have
```julia
julia> norm(Ferrite.weighted_normal(one(Tensor{2,2}), RefTriangle, 1))
1.4142135623730951
```
because this is the length of the reference shape. However, when creating the `FacetQuadratureRule`, we scale the weights such that (for Triangles) we change from the [-1, 1] to the [0, 1] interval by scaling with 1/2.

IMO, the docstring should say,
```
Compute the vector normal to the facet weighted by the area ratio between the facet and the
quadrature rule reference entity corresponding to the facet. E.g. if the quadrature rule is defined for a line [-1, 1], and the facet length is 3.0, return 3.0 / 2.
```
However, since we move part of this scaling computation to the creation, we essentially change the "quadrature reference entity corresponding to the facet".

Not sure if it is worth changing the implementation (since this would actually move a computation to the `reinit!` call, so perhaps sufficient to clarify, but before doing that, happy to get some suggestions on some clearer wording!

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.