This algorithm is used to compute the normal vectors for all points with level set values <= maxValue (default 0.5). The result is saved in the lsPointData of the lsDomain and can be retrieved with lsDomain.getPointData().getVectorData("Normals").
More...
template<class
T, int D>
class viennals::CalculateNormalVectors< T, D >
This algorithm is used to compute the normal vectors for all points with level set values <= maxValue (default 0.5). The result is saved in the lsPointData of the lsDomain and can be retrieved with lsDomain.getPointData().getVectorData("Normals").
The algorithm uses central differences to compute gradients and normalizes them to unit vectors. Since neighbors in each cartesian direction are necessary for the calculation, the level set width must be >= (maxValue * 4)
- 1. If the level set width is insufficient, it will be automatically expanded.
The calculation is parallelized using OpenMP across level set segments. Normal vectors are computed using finite differences and normalized to unit length. Points with zero gradient magnitude are assigned zero normal vectors.