Closed stingjp closed 4 months ago
@nickbianco Thanks for the comments, totally makes sense. I should now have all the changes that you mentioned committed, including adding a short entry to the CHANGELOG_MOCO.md
. Let me know if anything else is out of place!
Fixed!
Good catch, done!
Thanks @stingjp!
Previously, when adding a muscle to a
Bhargava2004SmoothMuscleMetabolics
component, the muscle mass is calculated based on either the provided muscle mass or specific tension and stored in a member variable viaBhargava2004SmoothedMuscleMetabolics_MuscleParameters::setMuscleMass()
. Example here.However, during deserialization, setMuscleMass() is never called for all connected muscles leaving the muscle masses set to zero, which obviously produces incorrect metabolic cost values.
Fixes issue #3783
Brief summary of changes
Included the
extendConnectToModel
method in the header file forBhargava2004SmoothMuscleMetabolics
, so that it could be called in the .cpp file. In the method, looped through the muscles that are stored in the list property for the metabolics object, and calledsetMuscleMass
.Testing I've completed
Tested the changes locally using the edited sandboxSandbox.cpp file. The file now works as a simple test by creating a model, adding the metabolic component, and printing the model. It then loads in the model file, and verifies that the returned muscle mass matches what was originally set.
Looking for feedback on...
First pull request - any feedback welcome.
CHANGELOG.md (choose one)
This change is