Ferrite-FEM / Ferrite-FEM/Ferrite.jl

weighted_normal docstring

Open
#1,241 0 comments 0 reactions 0 assignees View on GitHub
docs
Dominant language
Julia
Stars
453
Forks
115
Avg merge
1d 17h
Merged PRs (30d)
11

Description

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!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.