Hi,
Just complemented another point. You might also need to Gather and Scatter the acceleration and Lagrange multipliers if you want to recover the system state exactly as the snapshot investigated.
Something like:
auto state_der2 = chrono_types::make_shared<ChStateDelta>(system.GetNumCoordsVelLevel(), &system);
system.StateGatherAcceleration(*state_der2);
auto state_L = chrono_types::make_shared<ChVectorDynamic<>>(system.GetNumConstraints());
system.StateGatherReactions(*state_L);
and similarly for the Scattering (i.e. loading back into ChSystem).
The complete state of a system includes: X (position and orientation), V (velocity), A (acceleration), T (time), L(
Lagrange multipliers).
Good luck.
Chao PENG.