kaipartmann / Peridynamics.jl

A Julia package for parallel peridynamics simulations
https://kaipartmann.github.io/Peridynamics.jl/
MIT License
32 stars 7 forks source link

Use PointNeighbors.jl #103

Closed kaipartmann closed 3 weeks ago

kaipartmann commented 3 weeks ago

Using the new package PointNeighbors.jl addresses #29 and leads to a large performance increase.

Example: Find bonds in a cube

using Peridynamics, BenchmarkTools
lxyz = 1.0
N = 100
ΔX = lxyz / N
pos, vol = uniform_box(lxyz, lxyz, lxyz, ΔX)
body = Body(BBMaterial(), pos, vol)
material!(body, horizon=3.01ΔX, rho=1, E=1, Gc=1)
loc_points = 1:length(vol)
@btime Peridynamics.find_bonds($body, $loc_points);

# NearestNeighbors:  6.869 s (6999489 allocations: 9.62 GiB)
# PointNeighbors:    1.780 s (117943 allocations: 6.87 GiB)

The function foreach_neighbor is currently part of v0.2.3-dev of PointNeighbors.jl so this will crash on CI until https://github.com/trixi-framework/PointNeighbors.jl/pull/24 is merged.

codecov[bot] commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 88.30%. Comparing base (83ac5c1) to head (4794291).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #103 +/- ## ========================================== + Coverage 88.24% 88.30% +0.06% ========================================== Files 41 41 Lines 2399 2412 +13 ========================================== + Hits 2117 2130 +13 Misses 282 282 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.