Skip to content

Conversation

@efaulhaber
Copy link
Member

@efaulhaber efaulhaber commented Oct 15, 2025

This PR adds a keyword coordinates_eltype to the RectangularTank, RectangularShape and SphereShape, which defaults to Float64.
This will make the coordinates Float64, while everything else is still Float32.
For large numbers of particles, the particle spacing becomes very small relative to the domain size, which create larger errors in the distances between neighboring particles (relative to the particle spacing). With Float32 coordinates, these errors can easily grow to a point where they cause artifacts in the simulation.

This can easily be demonstrated by running the 2D dam break and passing min_coordinates = (1000.0, 1000.0) to the RectangularTank. With Float32, this yields:
grafik
With this PR and Float64 coordinates:
grafik

Here is a benchmark of a full dam break simulation and of just the fluid-fluid interaction kernel with 320k particles on an Nvidia RTX A4500.

Full simulation Time Relative
Float64 213 s 13.6×
Float32 15.7 s
Float32 + Float64 coordinates 21.1 s 1.34×
fluid-fluid interact Time Relative
All Float64 16.823 ms 20×
All Float32 839.356 μs
Float32 + Float64 coordinates 1.278 ms 1.5×

@efaulhaber efaulhaber self-assigned this Oct 15, 2025
@efaulhaber efaulhaber added enhancement New feature or request gpu labels Oct 15, 2025
@svchb
Copy link
Collaborator

svchb commented Nov 17, 2025

/run-gpu-tests

@svchb
Copy link
Collaborator

svchb commented Nov 17, 2025

/run-gpu-tests

@svchb
Copy link
Collaborator

svchb commented Nov 17, 2025

/run-gpu-tests

svchb added a commit to trixi-framework/PointNeighbors.jl that referenced this pull request Nov 17, 2025
@svchb svchb closed this Nov 18, 2025
@svchb svchb reopened this Nov 18, 2025
@svchb svchb closed this Nov 18, 2025
@svchb svchb reopened this Nov 18, 2025
@svchb svchb closed this Nov 18, 2025
@svchb svchb reopened this Nov 18, 2025
@efaulhaber
Copy link
Member Author

/run-gpu-tests

@svchb
Copy link
Collaborator

svchb commented Nov 27, 2025

/run-gpu-tests

svchb
svchb previously approved these changes Nov 27, 2025
@efaulhaber efaulhaber requested a review from svchb November 27, 2025 16:11
svchb
svchb previously approved these changes Nov 27, 2025
@efaulhaber
Copy link
Member Author

/run-gpu-tests

@svchb
Copy link
Collaborator

svchb commented Dec 2, 2025

/run-gpu-tests

Copy link
Collaborator

@LasNikas LasNikas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm, wondering if we want the ELTYPE and coordinates eltype info in the show box for Semidiscretization, too?

Co-authored-by: Niklas Neher <73897120+LasNikas@users.noreply.github.com>
@efaulhaber efaulhaber requested a review from LasNikas December 2, 2025 12:47
@svchb
Copy link
Collaborator

svchb commented Dec 3, 2025

/run-gpu-tests

@svchb svchb enabled auto-merge (squash) December 3, 2025 14:25
@svchb svchb merged commit f8adb77 into trixi-framework:main Dec 3, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request gpu

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants