Repository navigation
Restore contact history on restart: fix island label for loaded contacts, add SA/SM existing contacts - #89
Conversation
…ts, add SA/SM existing contacts - populateEntityArrays: label loaded contacts with island 0, as kT's simple patch route does, so their history is matched on the first contact detection instead of being silently zeroed. Loading contacts with the flooded-island patch route now errors out instead of silently losing history. - DEMClumpBatch::SetExistingContactTypes (C++ and Python): per-pair SS/SA/SM types, so sphere-analytical and sphere-mesh histories can be restored. Loaded contacts are sorted by (type, A, B), duplicates and out-of-range geometry IDs are rejected. - New modular test DEMTest_RestartContactHistory.
|
Thanks. We will merge your pull request. Restarting with history has not been working very well, missing various support and as you noted, especially with MM and MA flavors. So we thank you for the effort in improving that, and we may further modernize this utility later. A few side notes that may be useful for you: 1. We've been putting the history-aware restarting utility at low priority because it seems to us that in typical frictional contact usages, the history at restart plays a minor role, as it will be re-established anyway in a few steps. But this might not be true for you given your use cases. 2. You said you need restarting because of long simulations. But if it is also related to rare, unexpected stalling, the newest version (3.1.0+) should have this problem resolved. Feel free to try. 3. In the upcoming versions (3.2.0+), we plan to improve the rolling resistance and spinning friction implementation, which should slightly change the physics and the format of the detailed contact info class and its output files (forces now differentiate between object A and B, but in typical usages they are the same). It's just a heads-up, since you seem to be using detailed contact info. If you do not use those force model components, then it should be safe to ignore. Thank you! |
Fixes #88.
What
DEMDynamicThread::populateEntityArrays: setcontactPatchIsland = 0for loaded contacts (the label the simple patch-combination route gives every contact). Before this, loaded contacts kept the defaultNULL_BODYIDisland, so kT never matched their history on (A, B, island) and every loaded contact wildcard was silently zeroed. Loading contacts with the non-simple patch-combination route now raises aDEME_ERRORinstead of silently losing history.DEMClumpBatch::SetExistingContactTypes(types)(C++ and Python):"SS","SA"or"SM"per existing pair, validated withDEME_ERROR.SetExistingContactsclears it, so existing callers keep the all-SS behaviour.GetContactDetailedInfo), range-checked against the number of analytical components / mesh patches.SetExistingContactTypes.Tests
DEMTest_RestartContactHistory: settles a small bed on an analytical floor and a mesh plate, saves contacts, builds a new solver, reloads them (typed and untyped) and checks thatdelta_timekeeps growing for SS/SA/SM pairs that stay in contact; it also checks that invalid input (wrong type count, unsupported type) raises errors. It uses the new API, so it does not compile on main; the SS part of the bug (0 % of loaded SS history continued) was measured on 3.0.19, whose load path is the same as main's.main(7b051a7);DEMTest_RestartContactHistorybuilds (CUDA 12.8, sm_89),git clang-formatclean.Compatibility
No behaviour change unless
SetExistingContactTypesis called, apart from the island fix (which makes existing SS restarts keep their history as documented) and the new error for loading contacts with non-simple patch combination.Not covered
Mesh–mesh and mesh–analytical contacts; loading typed contacts into a solver that already has clumps.