Skip to content

Commit

Permalink
Fix threaded winding number calculation (trixi-framework#594)
Browse files Browse the repository at this point in the history
* Fix threaded winding number calculation

* Update version

* Update NEWS.md
  • Loading branch information
efaulhaber authored Aug 7, 2024
1 parent b11cb85 commit de94084
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
12 changes: 3 additions & 9 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@

TrixiParticles.jl follows the interpretation of [semantic versioning (semver)](https://julialang.github.io/Pkg.jl/dev/compatibility/#Version-specifier-format-1)
used in the Julia ecosystem. Notable changes will be documented in this file for human readability.
We aim at 3 to 4 month between major release versions and about 2 weeks between minor versions.

## Version 0.3.x
## Version 0.2.2

### Highlights

### Added

### Removed

### Deprecated
Hotfix for threaded sampling of complex geometries.

## Version 0.2.1

Expand All @@ -22,7 +16,7 @@ Particle sampling of complex geometries from `.stl` and `.asc` files.
## Version 0.2.0

### Removed
- Use of the internal neighborhood search has been removed and replaced with PointNeighbors.jl.
Use of the internal neighborhood search has been removed and replaced with PointNeighbors.jl.

## Development Cycle 0.1

Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "TrixiParticles"
uuid = "66699cd8-9c01-4e9d-a059-b96c86d16b3a"
authors = ["erik.faulhaber <[email protected]>"]
version = "0.2.2-dev"
version = "0.2.2"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down
3 changes: 2 additions & 1 deletion src/preprocessing/point_in_poly/winding_number_horman.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ struct WindingNumberHorman end
function (point_in_poly::WindingNumberHorman)(geometry, points; store_winding_number=false)
(; edge_vertices) = geometry

inpoly = falses(size(points, 2))
# We cannot use a `BitVector` here, as writing to a `BitVector` is not thread-safe
inpoly = fill(false, size(points, 2))

winding_numbers = Float64[]
store_winding_number && (winding_numbers = resize!(winding_numbers, length(inpoly)))
Expand Down
3 changes: 2 additions & 1 deletion src/preprocessing/point_in_poly/winding_number_jacobson.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ function (point_in_poly::WindingNumberJacobson)(geometry, points;
store_winding_number=false)
(; winding_number_factor, winding) = point_in_poly

inpoly = falses(size(points, 2))
# We cannot use a `BitVector` here, as writing to a `BitVector` is not thread-safe
inpoly = fill(false, size(points, 2))

winding_numbers = Float64[]
store_winding_number && (winding_numbers = resize!(winding_numbers, length(inpoly)))
Expand Down

0 comments on commit de94084

Please sign in to comment.