Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
493 commits
Select commit Hold shift + click to select a range
c668692
Merge branch 'main' into Redesign_mesh_hierarchy
Ruochun Dec 18, 2025
209184e
Initial plan
Copilot Dec 18, 2025
568afa2
Add SAT-based tri-tri contact filtering for patch-based force correct…
Copilot Dec 18, 2025
66d803b
Fix atomic operation for uint8_t compatibility
Copilot Dec 18, 2025
db477ab
Fix missing parameter and simplify atomic operation
Copilot Dec 18, 2025
c582b74
Address code review comments - improve code clarity
Copilot Dec 18, 2025
ec47f8f
Add dedicated SAT check function for triangle-triangle physical conta…
Copilot Dec 18, 2025
a3d6040
Format files and remove some archived code
Ruochun Dec 18, 2025
6612b82
Apply important logic changes
Ruochun Dec 18, 2025
9d549cd
Add max-negative reduce operation for finding largest negative penetr…
Copilot Dec 18, 2025
eb733c7
Finish the no-SAT check attempt
Ruochun Dec 18, 2025
eeed660
Fix a bug that causes inf penetrations in zero-area contacts
Ruochun Dec 19, 2025
f7c2bd2
Merge pull request #37 from projectchrono/copilot/add-triangle-triang…
Ruochun Dec 19, 2025
7922fec
Remove some unused variables
Ruochun Dec 19, 2025
41298d7
Fix bugs in force collect
Ruochun Dec 19, 2025
20cebaf
Initial plan
Copilot Dec 19, 2025
9748357
Add angular velocity transfer infrastructure between kT and dT
Copilot Dec 19, 2025
238fb21
Change angular velocity transfer to use magnitude instead of components
Copilot Dec 19, 2025
90740a8
Format some files
Ruochun Dec 20, 2025
75258f9
Convert DEMMiscKernels from JIT to static compilation
Copilot Dec 20, 2025
a3afa92
Correct inclusion and remove unneeded files
Ruochun Dec 20, 2025
9c40173
Minor changes to pCycle inspectors
Ruochun Dec 20, 2025
1a406ba
Refactor DEMInspector to own result storage arrays
Copilot Dec 20, 2025
ae25daf
Update GetValue/GetValues to use inspector's own arrays
Copilot Dec 21, 2025
adc4dca
Refactor inspector methods to accept array parameters and add device …
Copilot Dec 21, 2025
20b37cb
Add DEMSolver methods for device pointer inspection and update GetDev…
Copilot Dec 21, 2025
3facfa4
Correctly use DualArray in inspectors
Ruochun Dec 21, 2025
92c3094
Merge pull request #38 from projectchrono/copilot/add-angular-velocit…
Ruochun Dec 21, 2025
64ceddb
Fix a crucial misuse of contact type
Ruochun Dec 21, 2025
24f1e5f
Margin size is now primitive-based
Ruochun Dec 22, 2025
5eb8704
Fix a logic error in resizing
Ruochun Dec 22, 2025
c719d86
Fix some typos in comments
Ruochun Dec 23, 2025
8b92e44
Format the files
Ruochun Dec 23, 2025
3610fcb
Fix a crucial mistake in geomToPatchMap generation
Ruochun Dec 24, 2025
b1bf90f
Fix a bug in deciding contact normal
Ruochun Dec 28, 2025
9893fb7
Add some more security checks
Ruochun Dec 28, 2025
c9b8681
Initial plan
Copilot Dec 28, 2025
81645ec
Implement contact point derivation with zero-area patch logic
Copilot Dec 28, 2025
2e7718c
Format everything
Ruochun Dec 28, 2025
7bb89d1
Modernize RotatingDrum demo
Ruochun Dec 28, 2025
56d42e5
Merge branch 'Mesh_Particles' into copilot/update-contact-point-deriv…
Ruochun Dec 28, 2025
b9a51cb
Merge pull request #40 from projectchrono/copilot/update-contact-poin…
Ruochun Dec 28, 2025
9b52eb6
Initial plan
Copilot Dec 28, 2025
4b4fd40
Implement patch-based force correction changes for projected areas an…
Copilot Dec 28, 2025
40c284a
Better organize the voting workflow
Ruochun Dec 29, 2025
0bdf81b
Redesign projection-based contact rule
Ruochun Dec 29, 2025
9751ba8
Merge pull request #41 from projectchrono/copilot/update-patch-based-…
Ruochun Dec 29, 2025
f498ceb
Initial plan
Copilot Dec 29, 2025
f23c65d
Add particle diversity and increase count in BoxesFalling demo
Copilot Dec 29, 2025
4fbf114
Address code review feedback: use math_PI constant and named constant…
Copilot Dec 29, 2025
dc5b4af
Fix a shared_ptr error
Ruochun Dec 29, 2025
44e6d17
Merge pull request #42 from projectchrono/copilot/update-boxes-fallin…
Ruochun Dec 29, 2025
88bc736
Merge branch 'main' into Mesh_Particles
Ruochun Dec 30, 2025
030d0a7
Find the cause of random missed contact migration
Ruochun Dec 30, 2025
e49cd97
Initial plan
Copilot Dec 30, 2025
c9a2527
Add max tri-tri penetration transfer from dT to kT
Copilot Dec 30, 2025
ec8da9d
Reset maxTriTriPenetration at start of each calculateForces call
Copilot Dec 30, 2025
acb8db3
Optimize maxTriTriPenetration to stay on device
Copilot Dec 30, 2025
7c20214
Correct misuse of variables in the prev commit
Ruochun Dec 31, 2025
f378610
Add API methods for tri-tri penetration control and clamping
Copilot Dec 31, 2025
f1eb35a
Add validation to SetMaxTriTriPenetrationMargin for negative values
Copilot Dec 31, 2025
6afde3c
Add user controls for mesh--mesh margins
Ruochun Dec 31, 2025
0f646aa
Merge pull request #43 from projectchrono/copilot/update-final-penetr…
Ruochun Dec 31, 2025
2b6c469
Update some demos to reflex the new version
Ruochun Jan 2, 2026
251bf43
Initial plan
Copilot Jan 5, 2026
3eaab37
Add Python package build infrastructure
Copilot Jan 5, 2026
d16db4b
Fix float4 type caster size check bug
Copilot Jan 5, 2026
36944f0
Clean up bindings: remove duplicate include and fix typo
Copilot Jan 5, 2026
d557b2e
Improve robustness and reduce code duplication
Copilot Jan 5, 2026
cca3939
Address code review feedback: improve messages and documentation
Copilot Jan 5, 2026
b34ad2b
Add implementation notes and complete Python package support
Copilot Jan 5, 2026
64aef4c
Add missing DEMSolver methods to Python bindings and conda recipe
Copilot Jan 5, 2026
d35b19b
Update documentation with new methods and conda installation
Copilot Jan 5, 2026
7c8ff07
Fix typo: thinckness -> thickness
Copilot Jan 5, 2026
340108f
Slightly modify a demo
Ruochun Jan 6, 2026
fa7eb4c
Merge branch 'Mesh_Particles' into copilot/modify-cmake-for-python-pa…
Ruochun Jan 6, 2026
aa6079f
Merge branch 'copilot/modify-cmake-for-python-package' of https://git…
Ruochun Jan 6, 2026
b6eba7e
Fix some inclusion errors
Ruochun Jan 9, 2026
99f00dd
Add a missing inclusion
Ruochun Jan 9, 2026
c38ed5c
Merge branch 'Mesh_Particles' into copilot/modify-cmake-for-python-pa…
Ruochun Jan 9, 2026
f6bf5bc
Organize DEME paths
Ruochun Jan 9, 2026
1963016
Fix static_cast return types for DEMBoxGridSampler and DEMBoxHCPSampler
Copilot Jan 9, 2026
cc8ea20
Correct a comment
Ruochun Jan 12, 2026
5cc4da9
Merge branch 'Mesh_Particles' into copilot/modify-cmake-for-python-pa…
Ruochun Jan 15, 2026
50faedd
Merge branch 'copilot/modify-cmake-for-python-package' of https://git…
Ruochun Jan 15, 2026
968fab3
Update version and fix some binding issues
Ruochun Jan 15, 2026
4ed9940
Fix contact force method signatures and add GetMass/GetMOI methods
Copilot Jan 15, 2026
36b8dcb
Fix libstdc++ dependency issue for conda package
Copilot Jan 15, 2026
f4c3dca
Make pip whl work correctly
Ruochun Jan 15, 2026
faadcdf
Document compiler setup and fix conda-build channel requirements
Copilot Jan 15, 2026
9f6b044
yaml changes to 3.0.0
Ruochun Jan 15, 2026
6ef9f59
Change version to hardcoded 3.0.0 in conda recipe
Copilot Jan 15, 2026
6aa2250
Merge branch 'CUDA13' into Mesh_Particles
Ruochun Jan 16, 2026
958bfa9
Add a demo and slightly improve CD
Ruochun Jan 16, 2026
881278a
(Supposedly) fix fake-remote-contact-induced big penetration problems
Ruochun Jan 26, 2026
6745df9
Clarify that the patch loc metric works for MM contact only
Ruochun Jan 27, 2026
f50eb0c
Modify conda-build installation guide
Ruochun Feb 4, 2026
52ba768
Fix Python pathing
Ruochun Feb 4, 2026
257431f
Merge branch 'Mesh_Particles_Py' into Mesh_Particles
Ruochun Feb 4, 2026
8c0d6bb
Add a test
Ruochun Feb 22, 2026
a2fab72
Add another mesh modular test
Ruochun Feb 23, 2026
0e6105b
Initial plan
Copilot Feb 23, 2026
05c3b17
Add interval-averaged force readings and new ConeGrazingSphere test
Copilot Feb 23, 2026
6c31e65
Tweak the two new demos
Ruochun Feb 23, 2026
2ecb5ef
Merge pull request #54 from projectchrono/copilot/update-demtest-forc…
Ruochun Feb 23, 2026
e129904
Initial plan
Copilot Feb 25, 2026
ee2d71c
Add DEMTest_CylinderCrossRotation to ModularTests
Copilot Feb 25, 2026
44102d8
Add correct contact normal output
Ruochun Mar 1, 2026
e229219
Improve same DEMTest
Ruochun Mar 1, 2026
5397aab
Merge pull request #57 from projectchrono/copilot/add-demtest-cylinde…
Ruochun Mar 1, 2026
b15210f
Slightly modify a demo
Ruochun Mar 1, 2026
704075c
Add two tests
Ruochun Mar 16, 2026
01a633b
Slightly modify a test
Ruochun Mar 17, 2026
f508963
Finalize cyl test
Ruochun Mar 18, 2026
3dfa3eb
Add cached JIT and debug-sync infrastructure
Ruochun Jun 23, 2026
95eae9d
Fix Jitify problem caused by last commit
Ruochun Jun 24, 2026
f094f86
Mesh util update milestone
Ruochun Jun 24, 2026
977de41
Track per-triangle mesh penetration margins
Ruochun Jun 24, 2026
3588c04
Expose mesh-particle setup API knobs
Ruochun Jun 24, 2026
9f52598
Start Mesh-Particle Contact Model Parity
Ruochun Jun 24, 2026
1e0f1d4
Add shell-aware mesh contact metadata
Ruochun Jun 25, 2026
eafc17c
Revamp patch-based contact derivation
Ruochun Jun 25, 2026
b439a53
Add mesh contact island metadata plumbing
Ruochun Jun 25, 2026
224d022
Optimize primitive contact dedup sorting
Ruochun Jun 25, 2026
1f7d3e1
Add patch island transfer plumbing
Ruochun Jun 25, 2026
dc9139d
Stabilize mesh patch contact grouping
Ruochun Jun 27, 2026
1db4303
Optimize sphere-side kT contact detection
Ruochun Jun 28, 2026
2f20a94
Optimize triangle-side kT contact detection
Ruochun Jun 28, 2026
662628d
Prewarm JIT kernels and gate utility syncs
Ruochun Jun 28, 2026
2d89f26
Gate worker stream barriers behind debug sync
Ruochun Jun 28, 2026
705bdf6
Update mesh primitive force semantics
Ruochun Jun 28, 2026
0c7824d
Harden mesh force reduction helpers
Ruochun Jun 29, 2026
e88016e
Add dT step completion barrier
Ruochun Jun 29, 2026
b244fe9
Add combined-owner runtime support
Ruochun Jun 30, 2026
6b91f07
Restore Mesh_Particles demo parity assets
Ruochun Jun 30, 2026
a603960
Add optional GPU event timing
Ruochun Jul 1, 2026
b05556b
Scope public API CUDA device access
Ruochun Jul 1, 2026
a1561ba
Scope private API CUDA device access
Ruochun Jul 1, 2026
834c6e2
Expose mesh template helpers in Python
Ruochun Jul 1, 2026
a28a6f0
Move demo force models to owner wildcards
Ruochun Jul 1, 2026
0e88b39
Finally fix type-0 contact problem typically present with 2 GPUs
Ruochun Jul 7, 2026
2ddbd07
Remove public geometry wildcard force-model APIs
Ruochun Jul 7, 2026
43dde9d
Refine combined owner API parity
Ruochun Jul 8, 2026
4220fb4
Harden CUDA handoff synchronization
Ruochun Jul 8, 2026
a104d74
Compact mesh mass properties for jitification
Ruochun Jul 8, 2026
7424e3a
Stabilize simple patch contact identities
Ruochun Jul 8, 2026
81587c3
Canonicalize mesh contact history keys
Ruochun Jul 9, 2026
5b050e1
Add debug lost-contact diagnostics
Ruochun Jul 15, 2026
4333af4
Finish contact detection parity
Ruochun Jul 16, 2026
eb7c050
Port async kT-dT scheduling
Ruochun Jul 16, 2026
fe2959f
Add triangle PV tracking and mesh wear API
Ruochun Jul 16, 2026
bbe3d10
Expose shell mesh loading APIs
Ruochun Jul 16, 2026
80577e3
Port async output and timer controls
Ruochun Jul 16, 2026
fdaf89c
Remove legacy clump resizing
Ruochun Jul 16, 2026
d78e5a9
Document GPU transfer handoff safety
Ruochun Jul 16, 2026
80892be
Revert async kT-dT scheduling
Ruochun Jul 16, 2026
ef97dc7
Port mesh cylinder boundary handling
Ruochun Jul 17, 2026
1f04710
Add agent guide and clean ignores
Ruochun Jul 17, 2026
9ccce81
Port WCR collision kernel parity
Ruochun Jul 17, 2026
a4213c5
Port WCR mesh patch utility parity
Ruochun Jul 17, 2026
6b837ba
Port WCR public API cleanup
Ruochun Jul 18, 2026
cc741b4
Clean up demo and test parity output
Ruochun Jul 18, 2026
944c98d
Rename hopper sphere-cylinder demo
Ruochun Jul 19, 2026
f53f74b
Correct a typo
Ruochun Jul 20, 2026
7687b4b
No longer crash due to large ang vel
Ruochun Jul 20, 2026
b0ccd1f
Handle null contact mapping on kT
Ruochun Jul 20, 2026
33890b9
Handle fragmented primitive contact type runs
Ruochun Jul 20, 2026
15df282
Redesign future drift regulation safely
Ruochun Jul 21, 2026
fb4b600
Initialize GPU timers during solver setup
Ruochun Jul 21, 2026
8f203a4
Align selected runtime defaults with WCR
Ruochun Jul 21, 2026
6f06eb1
Clean up dT inspector and integration time paths
Ruochun Jul 22, 2026
0efb5ef
Derive contact normal storage from output flags
Ruochun Jul 22, 2026
0d68ebc
Clean up demos and force accumulation guards
Ruochun Jul 22, 2026
9cba7c6
Audit collision helper kernel parity
Ruochun Jul 22, 2026
9c88615
Fix a bug in in-place reduction
Ruochun Jul 22, 2026
9c8cba0
Compact null primitive contacts before patch mapping
Ruochun Jul 23, 2026
69574ad
Restore sphere query quaternion aliases
Ruochun Jul 24, 2026
5863337
Tweak some demos
Ruochun Jul 25, 2026
515abb1
Split the WheelDP wheel
Ruochun Jul 25, 2026
800341e
Correct patch material logic
Ruochun Jul 25, 2026
e4a3155
Further correct patch mat logic
Ruochun Jul 25, 2026
4479c03
Elevate some SM and MM contact precision
Ruochun Jul 26, 2026
5a98b12
Fix a _f residual typo
Ruochun Jul 26, 2026
77e0bfe
Normalize Python package naming and version
Ruochun Jul 28, 2026
8de6406
Add buildable Doxygen and Sphinx documentation
Ruochun Jul 29, 2026
fac3dcd
Add explicit DEMSolver GPU selection
Ruochun Jul 29, 2026
a864c9a
Add tracker device data retrieval
Ruochun Jul 29, 2026
bc761cb
Merge branch 'Mesh_Particles' into Mesh_Particles_Py
Ruochun Jul 30, 2026
438b226
Add task-oriented Python documentation
Ruochun Jul 30, 2026
3020bb1
Generate comprehensive Python API documentation
Ruochun Jul 30, 2026
c51dca3
Update docs
Ruochun Jul 31, 2026
0b3bc6c
Prepare multi-version Python wheel builds
Ruochun Jul 31, 2026
f530c5c
Automate portable Python wheel releases
Ruochun Aug 1, 2026
a88eca1
Merge remote-tracking branch 'origin/main' into Mesh_Particles_Py
Ruochun Aug 2, 2026
2ef8e45
Fix Python discovery for manylinux wheels
Ruochun Aug 2, 2026
629efeb
Recover NVRTC target in CUDA wheel images
Ruochun Aug 2, 2026
0838bf7
Install NVRTC in CUDA wheel builds
Ruochun Aug 2, 2026
287a003
Merge branch 'main' into Mesh_Particles_Py
Ruochun Aug 2, 2026
1d2b6e6
Match JIT CUDA headers to loaded NVRTC
Ruochun Aug 2, 2026
435bec1
Bump DEM-Engine version to 3.0.1
Ruochun Aug 2, 2026
cc8adbc
Use a single authoritative project version
Ruochun Aug 2, 2026
40ddda7
Add step-wise DEM visualizer
Ruochun Aug 5, 2026
b5216ce
Bump DEM-Engine version to 3.0.2
Ruochun Aug 5, 2026
c0fcf3a
Keep native visualizer library out of wheels
Ruochun Aug 6, 2026
514d3ed
Add cohesion to default Hertzian models
Ruochun Aug 11, 2026
c7a76e3
Use overlap geometry in user force models
Ruochun Aug 12, 2026
96cfe64
Add one-particle mesh box regression test
Ruochun Aug 15, 2026
4e2d3a9
Merge branch 'Mesh_Particles' into Mesh_Particles_Py
Ruochun Aug 15, 2026
157a2c4
Bump DEM-Engine version to 3.0.6
Ruochun Aug 15, 2026
0ef2549
Port main fixes and analytical cone support
Ruochun Aug 17, 2026
8a9b5de
Normalize fracture demo name
Ruochun Aug 18, 2026
cd41695
Merge pull request #19 from projectchrono/main
Ruochun Aug 21, 2026
f8b7b37
Merge branch 'main' into integrate-main-into-mesh-particles
Ruochun Aug 21, 2026
e5ec7ed
Harden zero-force contact accumulation
Ruochun Aug 21, 2026
64cbe99
Add opt-in persistent Jitify header cache
Ruochun Aug 21, 2026
5a1f609
Document Python Jitify cache usage
Ruochun Aug 21, 2026
f4581a5
Separate official deme publishing
Ruochun Aug 21, 2026
784ee66
Support live simulation parameter updates
Ruochun Aug 25, 2026
2668bc1
Add VTK output for spheres and analytical boundaries
Ruochun Aug 28, 2026
4079630
Add configurable mesh VTK metadata output
Ruochun Aug 29, 2026
cc7cf35
Add GPU-native owner state exchange
Ruochun Aug 31, 2026
4b343f1
Align GPU owner data exchange semantics
Ruochun Sep 4, 2026
0174507
Add device next-step acceleration inputs
Ruochun Sep 4, 2026
c3e0028
Merge branch 'projectchrono:main' into main
Ruochun Sep 4, 2026
0193d99
Support cross-device owner data exchange
Ruochun Sep 4, 2026
e493df0
Restore standard CUDA error handling
Ruochun Sep 4, 2026
b7b0d0b
Merge branch 'projectchrono:main' into main
Ruochun Sep 6, 2026
c2602a1
Adapt main state checks and plate-sinkage demo
Ruochun Sep 6, 2026
1c2c15b
Record main through b7b0d0b while preserving Mesh_Particles
Ruochun Sep 6, 2026
6373651
Distribute electrostatic rod charge across combined mesh sections
Ruochun Sep 7, 2026
30f94b8
Add hopper demo with meshed cylinders and analytical spheres
Ruochun Sep 8, 2026
373e677
Document session review and commit approval rules
Ruochun Sep 8, 2026
44149f0
Consolidate documentation and refresh README navigation
Ruochun Sep 9, 2026
6d0f689
Restore README demo animations and link design paper
Ruochun Sep 9, 2026
c56ec12
Automate documentation publishing with configurable Pages branch
Ruochun Sep 9, 2026
d677234
Document internal contact, geometry, and owner type codes
Ruochun Sep 11, 2026
00cbbd6
Add native OpenGL visualizer with cached geometry and interactive ins…
Ruochun Sep 11, 2026
dcbe935
Document responsive visualization loops and performance tradeoffs
Ruochun Sep 12, 2026
b042c6b
Modify a suspicious C++ std choice
Ruochun Sep 13, 2026
1cafc85
Merge branch 'DEME3_docs' into Mesh_Particles
Ruochun Sep 13, 2026
f5991b9
Modify a suspicious C++ std choice again
Ruochun Sep 13, 2026
7eb4829
Prepare 3.0.12 with Python CUDA dependencies and demos
Ruochun Sep 15, 2026
65021e0
Merge branch 'projectchrono:main' into main
Ruochun Sep 15, 2026
3080538
Merge main into Mesh_Particles
Ruochun Sep 15, 2026
677f74c
Update cover images and related hopper demo
Ruochun Sep 16, 2026
0946573
Remove preview package references from release documentation
Ruochun Sep 16, 2026
a150b6b
Document DEME 3 features and DEME 2 migration choices
Ruochun Sep 16, 2026
37535ae
Expand demo documentation and clarify DEME 3 migration
Ruochun Sep 16, 2026
e808fa4
Make documentation links work on GitHub and the Sphinx site
Ruochun Sep 16, 2026
80d8eec
Prepare 3.0.13 with portable PyPI README links
Ruochun Sep 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .format_all
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

# Directories to exclude (relative to repo root)
EXCLUDE_EXTERNAL="./thirdparty"
EXCLUDE_BUILD="./build"

# Recursively find source files and apply clang-format with -i -style=file
find . \( \
-path "$EXCLUDE_EXTERNAL" -prune \
-o -path "${EXCLUDE_BUILD}*" -prune \
\) -o \( \
-name "*.cpp" -o \
-name "*.c" -o \
-name "*.h" -o \
-name "*.hpp" -o \
-name "*.cu" -o \
-name "*.cuh" -o \
-name "*.cc" \
\) -exec clang-format -i -style=file {} +

echo "✔ All matching source files formatted (excluding external and build* folders) with clang-format -style=file"
83 changes: 83 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Build and publish documentation

on:
# Branch filters cannot use repository variables. Filter at the job level so
# switching DOCS_PUBLISH_BRANCH does not require editing this workflow.
push:
branches: ["**"]
pull_request:
paths:
- ".github/workflows/docs.yml"
- "docs/**"
- "src/DEM/**"
- "VERSION"
- "LICENSE.md"
workflow_dispatch:

permissions:
contents: read

jobs:
build:
# Set this repository variable to DEME3_docs initially, then main when ready.
# An unset variable disables publication; PRs still validate the site.
if: >-
github.event_name == 'pull_request' ||
(github.ref_type == 'branch' && github.ref_name == vars.DOCS_PUBLISH_BRANCH)
runs-on: ubuntu-24.04
timeout-minutes: 20

steps:
- name: Check out documentation source
uses: actions/checkout@v6
with:
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: pip
cache-dependency-path: docs/requirements.txt

- name: Install documentation tools
run: |
sudo apt-get update
sudo apt-get install --yes doxygen
python -m pip install -r docs/requirements.txt

# The committed Python reference avoids importing the CUDA extension on
# hosted runners. Doxygen parses public headers without compiling DEME.
- name: Build C++ and Python documentation
run: make -C docs html

- name: Upload documentation site
uses: actions/upload-pages-artifact@v4
with:
path: docs/_build/html

deploy:
needs: build
if: >-
github.event_name != 'pull_request' &&
github.ref_type == 'branch' && github.ref_name == vars.DOCS_PUBLISH_BRANCH
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Serialize publication to this repository's single Pages site. Let an
# active deployment finish rather than cancelling it midway through upload.
concurrency:
group: github-pages
cancel-in-progress: false
steps:
- name: Configure GitHub Pages
uses: actions/configure-pages@v5

- name: Deploy documentation
id: deployment
uses: actions/deploy-pages@v4
91 changes: 80 additions & 11 deletions .github/workflows/python-wheels.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Build Python wheels
name: Build DEME Python wheels

on:
workflow_dispatch:
inputs:
publish_to_pypi:
description: Publish the six validated wheels to the deme project on PyPI
description: Publish validated wheels (deme on release branches, deme3 on Mesh_Particles_Py)
required: true
type: boolean
default: false
Expand All @@ -14,6 +14,9 @@ on:
- "CMakeLists.txt"
- "cmake/**"
- "pyproject.toml"
- "README.md"
- "docs/prepare_pypi_readme.py"
- "python/tests/**"
- "VERSION"
- "src/**"
- "thirdparty/**"
Expand Down Expand Up @@ -41,6 +44,33 @@ jobs:
persist-credentials: false
submodules: recursive

# Resolve the distribution at build time so merges cannot redirect preview publication.
- name: Select branch distribution
env:
DISTRIBUTION: ${{ github.ref_name == 'Mesh_Particles_Py' && 'deme3' || 'deme' }}
run: |
python - <<'PYTHON'
import os
from pathlib import Path
import re

path = Path("pyproject.toml")
source = path.read_text()
source, count = re.subn(r'^name = "deme3?"$', 'name = "' + os.environ["DISTRIBUTION"] + '"', source, flags=re.M)
if count != 1:
raise SystemExit("Expected one DEME distribution name")
path.write_text(source)
PYTHON

# PyPI cannot resolve repository-relative links. Rewrite only this build
# checkout so the wheel description uses the same README with permanent URLs.
- name: Prepare README for PyPI
run: |
python python/tests/test_pypi_readme.py
python docs/prepare_pypi_readme.py README.md \
--repository-url "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \
--revision "$GITHUB_SHA"

- name: Build and repair wheel
uses: pypa/cibuildwheel@v4.1.1
env:
Expand All @@ -55,30 +85,66 @@ jobs:
python -m auditwheel show wheelhouse/*.whl
python - <<'PY'
from pathlib import Path
from zipfile import ZipFile

wheels = list(Path("wheelhouse").glob("*.whl"))
if len(wheels) != 1:
raise SystemExit(f"Expected exactly one wheel, found: {wheels}")

wheel = wheels[0]
name = wheels[0].name
expected_python = "${{ matrix.python }}"
if expected_python not in wheel.name or "manylinux_2_28_x86_64" not in wheel.name:
raise SystemExit(f"Unexpected wheel tags: {wheel.name}")
distribution = "${{ github.ref_name == 'Mesh_Particles_Py' && 'deme3' || 'deme' }}"
if not name.startswith(distribution + "-"):
raise SystemExit(f"Expected a {distribution} distribution wheel, found: {name}")
if expected_python not in name or "manylinux_2_28_x86_64" not in name:
raise SystemExit(f"Unexpected wheel tags: {name}")

# CUDA comes from NVIDIA pip dependencies or a system toolkit. Auditwheel must not copy its build-time driver
# stub or an incomplete NVRTC installation into the repaired artifact.
from zipfile import ZipFile
from email.parser import BytesParser

with ZipFile(wheel) as archive:
with ZipFile(wheels[0]) as archive:
metadata_files = [name for name in archive.namelist() if name.endswith(".dist-info/METADATA")]
if len(metadata_files) != 1:
raise SystemExit("Expected one wheel METADATA file")
metadata = BytesParser().parsebytes(archive.read(metadata_files[0]))
if metadata["Name"] != distribution or "cuda12" not in metadata.get_all("Provides-Extra", []):
raise SystemExit("Unexpected distribution name or missing cuda12 extra")
if metadata["Description-Content-Type"] != "text/markdown":
raise SystemExit("Expected a Markdown PyPI description")
description = metadata.get_payload(decode=True).decode("utf-8").strip()
if description != Path("README.md").read_text(encoding="utf-8").strip():
raise SystemExit("Wheel description does not match the prepared README")
standalone_visualizer = [
member for member in archive.namelist() if member.endswith("/libDEMEVisualizer.so")
]
bundled_cuda = [
member
for member in archive.namelist()
if ".libs/" in member
and any(library in member for library in ("libcuda", "libcudart", "libnvrtc"))
]
if standalone_visualizer:
raise SystemExit(
"Python embeds the visualizer and must not package its native C++ facade: "
f"{standalone_visualizer}"
)
if bundled_cuda:
raise SystemExit(f"CUDA libraries must remain external: {bundled_cuda}")

print(f"Validated {wheel.name} ({wheel.stat().st_size / 1024 / 1024:.1f} MiB)")
print(f"Validated {name} ({wheels[0].stat().st_size / 1024 / 1024:.1f} MiB)")
PY

- name: Test cuda12 extra without a system CUDA toolkit
env:
PYTHON_ABI: ${{ matrix.python }}
DISTRIBUTION: ${{ github.ref_name == 'Mesh_Particles_Py' && 'deme3' || 'deme' }}
run: |
minor="${PYTHON_ABI#cp3}"
docker run --rm -v "$PWD:/work:ro" -e DISTRIBUTION "python:3.${minor}-slim-bookworm" \
sh -ec 'for wheel in /work/wheelhouse/*.whl; do python -m pip install "$wheel[cuda12]"; done; \
python /work/python/tests/cuda12_smoke.py --distribution "$DISTRIBUTION"'

- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
Expand All @@ -88,11 +154,14 @@ jobs:
retention-days: 14

publish-pypi:
name: Publish deme wheels to PyPI
if: github.event_name == 'workflow_dispatch' && inputs.publish_to_pypi
name: Publish branch distribution to PyPI
if: >-
github.event_name == 'workflow_dispatch' &&
inputs.publish_to_pypi &&
(github.ref == 'refs/heads/main' || github.ref == 'refs/heads/Mesh_Particles' || github.ref == 'refs/heads/Mesh_Particles_Py')
needs: build-linux-wheels
runs-on: ubuntu-24.04
environment: pypi
environment: ${{ github.ref_name == 'Mesh_Particles_Py' && 'pypi-deme3' || 'pypi' }}
permissions:
contents: read
id-token: write
Expand Down
65 changes: 59 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,64 @@
build*
.vscode/
*.vtk
*.csv
# Local build trees and CMake/Ninja products
build*/
cmake-build-*/
CMakeFiles/
CMakeCache.txt
cmake_install.cmake
compile_commands.json
Makefile
*.ninja
.ninja_*

# Native/CUDA build artifacts
*.o
*.a
*.so
*.dylib
*.dll
*.exe
*.out
*.ptx
*.cubin
*.fatbin
*.sass

# Python packaging, caches, and local environments
__pycache__/
*.py[cod]
*.egg-info/
.cache/
.pytest_cache/
.mypy_cache/
.ruff_cache/
.venv/
venv/
dist/
output/*
post/*
wheelhouse/
docs/_build/

# Demo/test/generated simulation output
DemoOutput_*/
modular_test_output/
output/
post/
*.vtk
*.vtp
*.vtu
/*.csv
Contact_pairs_*.csv
DEMdemo_output_*.csv
DEMdemo_forces_*.csv

# CodeQL and other scanner scratch files
_codeql*

# Editor, OS, and temporary local files
.vscode/
.idea/
.DS_Store
*~
*.swp
*.swo
*.tmp
*.log
*.diff
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
path = thirdparty/pybind11
url = https://github.com/pybind/pybind11.git
branch = stable
[submodule "thirdparty/raylib"]
path = thirdparty/raylib
url = https://github.com/raysan5/raylib.git
Loading
Loading