-
Notifications
You must be signed in to change notification settings - Fork 93
Closed
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededperformance
Description
The algorithm is embarrassingly parallel, and should be trivial to run in parallel with multiple threads:
Lines 44 to 65 in 4965450
function winding(points, mesh::Mesh) | |
assertion(paramdim(mesh) == 2, "winding number only defined for surface meshes") | |
(eltype(mesh) <: Triangle) || return winding(points, simplexify(mesh)) | |
function w(p) | |
∑ = sum(1:nelements(mesh)) do i | |
v = vertices(mesh[i]) | |
a⃗ = v[1] - p | |
b⃗ = v[2] - p | |
c⃗ = v[3] - p | |
a = norm(a⃗) | |
b = norm(b⃗) | |
c = norm(c⃗) | |
n = det([a⃗ b⃗ c⃗]) | |
d = a * b * c + (a⃗ ⋅ b⃗) * c + (b⃗ ⋅ c⃗) * a + (c⃗ ⋅ a⃗) * b | |
2atan(n, d) | |
end | |
∑ / oftype(∑, 4π) | |
end | |
[w(p) for p in points] | |
end |
I am opening the issue in case someone wants to give it a try.
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededperformance