optimad / bitpit

Open source library for scientific HPC
http://optimad.github.io/bitpit/
GNU Lesser General Public License v3.0
116 stars 34 forks source link

patchkernel: fix evaluation of normal for polygonal elements #378

Closed marcocisternino closed 1 year ago

marcocisternino commented 1 year ago

The return vector must be normalized to assure to be a versor.

andrea-iob commented 1 year ago

I've added some comments.

andrea-iob commented 1 year ago

On a second though, the code can be simplified: if the normal is re-normalized, there is no need to divede it by surfaceArea.

andrea-iob commented 1 year ago

The branch "ai.element.eval.normal" contains a simplified version.