Skip to content

Add new two-muscle case with prestretch only#42

Merged
Lukuas31415 merged 17 commits intomainfrom
two_cuboid_prestretch
Jun 26, 2025
Merged

Add new two-muscle case with prestretch only#42
Lukuas31415 merged 17 commits intomainfrom
two_cuboid_prestretch

Conversation

@Lukuas31415
Copy link
Collaborator

@Lukuas31415 Lukuas31415 commented Jun 17, 2025

Main changes of this PR

Issues that are addressed by this PR:

Features that have been added:

Additional information

Author's checklist

  • I updated the documentation.
  • I checked that everything compiles and runs as it should.

@carme-hp
Copy link
Collaborator

mechanics1_00000000.vtu is the same as prestretch1_0000001.vtu -> Hence I delete it (I think this duplicated output also appears in other examples)

@carme-hp
Copy link
Collaborator

I've started adding contraction.

So now in this case you can run

./muscle_contraction_with_prestretch ../settings_contraction_with_prestretch.py incompressible_mooney_rivlin 2

or
./muscle_prestretch ../settings_prestretch.py incompressible_mooney_rivlin 2

For some reason I still don't know, prestretch seems to only be applied to muscle 1.

Minor todos:

  • fix number of output files during contraction (now there are way less fibers files than mechanics files)
  • Change the names of bc in the prestretch only case to the ones I used for contraction (see ../settings_contraction_with_prestretch.py)

@carme-hp
Copy link
Collaborator

image
@Lukuas31415 can you check if the prestretch + contraction looks good now? I've visualized in red the muscle before prestretch and in blue the muscle after prestretch. The first output file from fibers and mechanics for contraction seem to match the geometry after prestretch

@Lukuas31415
Copy link
Collaborator Author

Lukuas31415 commented Jun 18, 2025

The prestretch looks good apart from the fact that there are 2 mechanics and 1 fiber file, but the first contraction fiber file is the prestretched one, so that looks very good. I couldn't find why the contraction mechanics is doing exactly 10 iterations per time step, and the fibers 1, as it should.
For me, both muscles are being prestretched, so that seems to work now as well.

@carme-hp
Copy link
Collaborator

I think that now the output frequency was set to 1, which might not be good if the two solvers use different timestep sizes. Can you compare to what was the output frequency set to in a single muscle case?

@carme-hp carme-hp marked this pull request as ready for review June 18, 2025 12:36
@Lukuas31415
Copy link
Collaborator Author

I have replaced the settings of the contraction part with the equivalent part of the ellipsoid contraction, and now everything works as intended. However, there are a lot of changes in the muscle contraction solver of which I don't know what they do, but it seems to work, so I left it in. Maybe you can check if this is fine this way?

@carme-hp
Copy link
Collaborator

Thank you, I decided to undo your last changes and push again with applying only the relevant changes at the lines. (Your commit included a lot of indentation fixes, which made it hard to find out the differences)

@carme-hp
Copy link
Collaborator

carme-hp commented Jun 20, 2025

TO-DO:

  • Check that it behaves as expected
  • Modify readme to include separated instructions for prestretch only and prestretch + contraction
  • Rename case, and change location if needed
  • Go through issues and PR's and if they are obsolete, link them to this PR.

To do in a different PR (each, in this order)

  • Connect the two muscles
  • Make it possible to choose different forces for each muscle
  • Add optimization file

@carme-hp
Copy link
Collaborator

carme-hp commented Jun 23, 2025

@Lukuas31415 says it doesn't contract. Is this indeed true? Was it contracting with commit 459e5e4?
If yes,

  • find the difference

If not:

  • slot connectors names, do they have to be different in the prestretch than in the contraction
  • prestretch looks first at muscle 2 and then at 1, while contraction does it in the opposite order

This was referenced Jun 24, 2025
@Lukuas31415
Copy link
Collaborator Author

I found the difference. Apart from a lot of indentation differences and differences in the setup of the Dynamic Hyperelasticity Solver, the main differences were the slot names. It works now as intended, and I think this is ready to be merged.

@carme-hp
Copy link
Collaborator

Looks great!

image

Lukuas31415 and others added 2 commits June 26, 2025 11:34
Co-authored-by: carme-hp <71499004+carme-hp@users.noreply.github.com>
Co-authored-by: carme-hp <71499004+carme-hp@users.noreply.github.com>
Lukuas31415 and others added 4 commits June 26, 2025 11:36
Co-authored-by: carme-hp <71499004+carme-hp@users.noreply.github.com>
Co-authored-by: carme-hp <71499004+carme-hp@users.noreply.github.com>
Co-authored-by: carme-hp <71499004+carme-hp@users.noreply.github.com>
Co-authored-by: carme-hp <71499004+carme-hp@users.noreply.github.com>
@Lukuas31415 Lukuas31415 merged commit 086b99d into main Jun 26, 2025
@Lukuas31415 Lukuas31415 deleted the two_cuboid_prestretch branch June 26, 2025 09:39
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