Skip to content

Refactor volume calculation#487

Open
brbass wants to merge 3 commits intollnl:developfrom
brbass:brody/volume-refactor
Open

Refactor volume calculation#487
brbass wants to merge 3 commits intollnl:developfrom
brbass:brody/volume-refactor

Conversation

@brbass
Copy link
Copy Markdown
Contributor

@brbass brbass commented Mar 25, 2026

Summary

  • Volume upgrade
    • Separates the volume calculation from RKCorrections and adds controls for when the volume is updated. Previously, the Voronoi was being calculated way too often in VoronoiCells and getting overwritten by the volumes from RKCorrections.
    • Makes VoronoiCells inherit from VolumeUpdate. It optionally overwrites its own volume calculation with the user's choice of volume.
    • Lets the user choose the volume for all packages, not just RKCorrections.
    • Stores both 3D (annulus or spherical shell) volume and patch volume, which are the same in Cartesian coordinates.
  • Physics package requirements upgrade
    • requireConnectivity, requireGhostConnectivity, requireOverlapConnectivity, requireIntersectionConnectivity have been replaced by requireConnectivity
      • Returns {conn, ghost, overlap, intersection}
    • requireVoronoiCells has been replaced by requireVolumes
      • Returns {explicit, implicit, voronoi}
    • requireReproducingKernels, requireReproducingKernelInFinalize, requireReproducingKernelHessian have been replaced by requireReproducingKernels
      • Returns tuple {explicit, implicit, hessian}
  • Boundary fixes
    • Boundaries were not being ordered consistently.
    • Adds a priority to Boundary to codify this.
  • Bugfix
    • GenerateRatioSphere accessing the wrong element when SPH = True

Timing

Most of the code in this MR is focused on upgrading the volume calculation, but the reason behind it was to fix the inefficiency of ASPH (the True version, not the "classic" version). Here is an example of the timing for a 3D ASPH problem run on 100 procs for 200 cycles before and after these changes. The basic result: ASPH is improved from being prohibitively expensive before to being a reasonable option now.

Function Before this MR After this MR Explanation
Voronoi volume 416.7 (13.5x derivs) 98.6 (3.3x derivs) Only in finalize, not duplicated in RK
Explicit total 379.3 172.9 No more Voronoi in derivatives for ASPH
Explicit derivs 30.8 30.0 Derivative evaluation stays the same

ToDo :

  • Annotate RELEASE_NOTES.md with notable changes.
  • Create LLNLSpheral PR pointing at this branch. (PR#)
  • LLNLSpheral PR has passed all tests.

brbass added 3 commits March 25, 2026 16:42
# Conflicts:
#	src/PYB11/ArtificialViscosity/ArtificialViscosity.py
#	src/PYB11/ArtificialViscosity/ArtificialViscosityHandle.py
#	src/PYB11/ArtificialViscosity/FiniteVolumeViscosity.py
#	src/PYB11/ArtificialViscosity/LimitedMonaghanGingoldViscosity.py
#	src/PYB11/ArtificialViscosity/MonaghanGingoldViscosity.py
#	src/PYB11/ArtificialViscosity/TensorCRKSPHViscosity.py
#	src/PYB11/ArtificialViscosity/TensorMonaghanGingoldViscosity.py
#	src/PYB11/ArtificialViscosity/TensorSVPHViscosity.py
@brbass
Copy link
Copy Markdown
Contributor Author

brbass commented Mar 26, 2026

Just a note that this MR depends on #475

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant