Skip to content

Update the DEME Version 3 - #81

Merged
Ruochun merged 493 commits into
projectchrono:mainfrom
Ruochun:main
Sep 16, 2026
Merged

Ruochun merged 493 commits into
projectchrono:mainfrom
Ruochun:main

Conversation

@Ruochun

@Ruochun Ruochun commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Ruochun and others added 30 commits December 18, 2025 11:25
…ions

Co-authored-by: Ruochun <24469442+Ruochun@users.noreply.github.com>
Co-authored-by: Ruochun <24469442+Ruochun@users.noreply.github.com>
Co-authored-by: Ruochun <24469442+Ruochun@users.noreply.github.com>
Co-authored-by: Ruochun <24469442+Ruochun@users.noreply.github.com>
…ct detection

Co-authored-by: Ruochun <24469442+Ruochun@users.noreply.github.com>
- Always write back force and contact point info, to avoid some mem
  hazards
- Always compute primitive tri-tri penetration even in non-contact
- Patch-based contacts can have NOT_A_CONTACT now
…ation values

Co-authored-by: Ruochun <24469442+Ruochun@users.noreply.github.com>
…iangle-triangle-contact-logic

Add SAT-based filtering for triangle-triangle patch contacts
- Added angular velocity buffer arrays in kT.h (absAngVelX/Y/Z_buffer)
- Added buffer pointers in Defines.h (pKTOwnedBuffer_absAngVelX/Y/Z)
- Updated packTransferPointers in dT.cpp to set buffer pointers
- Added angular velocity inspectors in dT.h (approxAngVelX/Y/ZFunc)
- Added angular velocity inspection code in AuxClasses.cpp (INSP_CODE_ANGVEL_X/Y/Z)
- Updated determineSysVel function to call angular velocity inspectors
- Updated sendToTheirBuffer to transfer angular velocity data
- Initialized angular velocity inspectors in API*.cpp
- Allocated angular velocity buffers in kT.cpp

Co-authored-by: Ruochun <24469442+Ruochun@users.noreply.github.com>
- Changed from 3 inspectors (X, Y, Z) to 1 inspector (magnitude)
- Changed from 3 buffers to 1 buffer (absAngVel_buffer)
- Moved angular velocity inspector creation to DEFAULT strategy in decideCDMarginStrat
- Added "absangvel" case using INSP_CODE_EVERYTHING_ABSANGVEL
- Updated all related data structures and transfer logic

Co-authored-by: Ruochun <24469442+Ruochun@users.noreply.github.com>
- Moved kernels from src/kernel/DEMMiscKernels.cu to src/algorithms/DEMMiscKernels.cu
- Added wrapper functions for: markOwnerToChange, modifyComponents, computeMarginFromAbsv, fillMarginValues
- Made modifyComponents generic with template to work with both DEMDataDT and DEMDataKT
- Added function declarations to DEMStaticDeviceSubroutines.h
- Updated dT.cpp and kT.cpp to call wrapper functions instead of jitified kernels
- Removed misc_kernels jitify initialization and member variables from dT and kT

Co-authored-by: Ruochun <24469442+Ruochun@users.noreply.github.com>
- Moved m_reduceResArr and m_reduceRes from dT to DEMInspector class
- Each inspector now has its own DualArray storage for inspection results
- Added releaseData() method to DEMInspector for manual cleanup
- Updated destructor to properly free data on inspector destruction
- Modified inspectCall() to accept DualArray pointers as required parameters
- Updated all inspector methods to pass their own arrays to inspectCall()
- Used thread_local temporary arrays in legacy API paths (dTInspectReduce/NoReduce)
- Removed m_reduceResArr and m_reduceRes from dT.h

This makes DEMInspector self-contained and thread-safe, allowing multiple inspectors to work together without data conflicts.

Co-authored-by: Ruochun <24469442+Ruochun@users.noreply.github.com>
- Changed GetValue() to directly call inspectCall() with inspector's m_reduceResArr and m_reduceRes
- Changed GetValues() to directly call inspectCall() with inspector's m_reduceResArr and m_reduceRes
- Removed dependency on static thread_local arrays in dTInspectReduce/NoReduce
- All inspector methods now consistently use the inspector's own storage

This ensures all inspector methods (GetValue, GetValues, dT_GetValue, dT_GetDeviceValue) use the same storage pattern, making each inspector fully self-contained.

Co-authored-by: Ruochun <24469442+Ruochun@users.noreply.github.com>
…pointer versions

- Modified dTInspectReduce/NoReduce to accept DualArray pointers as arguments instead of using static thread_local
- Reverted GetValue/GetValues to call through DEMSolver methods (maintaining command chain)
- Added GetDeviceValue() and GetDeviceValues() methods that return device pointers
- GetValue/GetValues now pass inspector's own arrays to dTInspectReduce/NoReduce
- GetDeviceValue/GetDeviceValues bypass command chain and call dT directly for performance

All methods consistently use inspector's own storage arrays while respecting the command chain architecture.

Co-authored-by: Ruochun <24469442+Ruochun@users.noreply.github.com>
…iceValue/GetDeviceValues

- Added dTInspectReduceDevice() and dTInspectNoReduceDevice() methods to DEMSolver
- Updated GetDeviceValue() to call sys->dTInspectReduceDevice() instead of directly calling dT
- Updated GetDeviceValues() to call sys->dTInspectNoReduceDevice() instead of directly calling dT
- All inspector methods now properly respect the command chain through DEMSolver

GetDeviceValue/GetDeviceValues now follow the same pattern as GetValue/GetValues, maintaining the command chain architecture while providing device pointer access.

Co-authored-by: Ruochun <24469442+Ruochun@users.noreply.github.com>
…gular-velocity-transfer

Add angular velocity transfer infrastructure, convert DEMMiscKernels to static compilation, and refactor DEMInspector
Adapt dac9dce by checking each owner's velocity magnitudes inside the
existing internal dT inspection kernels. Cover fixed margins and disabled
angular margins without extra reductions, launches, or host transfers.
Keep public inspectors unchanged.

Fix the fixed-margin wrapper's host dereference of device metadata, exposed
by the healthy fixed-margin regression. Select primitive arrays on device.

Port the two-stage plate-sinkage demo from 0d84721 with this branch's include
and verbosity APIs, output-file validation, and a floor-travel limit.

Validation: both targets built; all 15 fresh-process GPU cases passed
(healthy and linear/angular NaN/Inf across three margin modes). The plate
demo completed JIT initialization and entered bed settling; its full
pressure-sinkage experiment was not completed.
Manually adapted state-finiteness checks and the plate-sinkage demo in c2602a1. Omit AMD/HIP support and its documentation, and retain the 3.0.11 version line. Worker exception handling remains with the separate Mesh_Particles_FixThrow work.
…pection

Preserve C++ and Python viewer APIs, add ImGui controls and depth picking, and refresh demo windows independently of simulation output intervals. Include scene/frame and interactive regression coverage.
Integrate main through 65021e0. Retain version 3.0.12 and the existing force-collection API, incorporate upstream documentation, and enable in-kernel force collection in both PlateSinkage stages.
@Ruochun
Ruochun merged commit 91a717e into projectchrono:main Sep 16, 2026
8 checks passed
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.

2 participants