-
Notifications
You must be signed in to change notification settings - Fork 53
Add a tutorial about vtu mesh input in our documentation #1512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a comprehensive tutorial demonstrating how to use VTU (VTK Unstructured Grid) file format for mesh input in 4C, using a solid mechanics example featuring a living soft tissue with collagen fibers.
Key Changes:
- Enhanced plotting functionality with a new
PlotBuilderclass that enables flexible, chainable plot construction for documentation - Added VTU mesh input tutorial with detailed explanations of block definitions, boundary conditions via point-sets, and field definitions
- Extended testing framework to support dependency checks (e.g., VTK requirement) for tutorial tests
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| utilities/four_c_python/src/four_c_documentation/render.py | Adds PlotBuilder class for flexible plot construction, refactors plotting functions, and adds read_mesh helper for loading VTU files in templates |
| tests/tutorials/solid/tutorial_solid_vtu.4C.yaml | New tutorial input file demonstrating VTU mesh usage with complex material models and boundary conditions |
| tests/list_of_tests.cmake | Registers the VTU tutorial test with VTK dependency requirement |
| doc/documentation/src/tutorial_templates/tutorials.rst | Updates tutorial listing to include the new VTU tutorial |
| doc/documentation/src/tutorial_templates/tutorial_vtu.md.j2 | Tutorial content explaining VTU file format usage, including blocks, point-sets, and field definitions |
| cmake/functions/four_c_testing_functions.cmake | Extends four_c_test_tutorial function to support REQUIRED_DEPENDENCIES parameter |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b3748f2 to
c782320
Compare
c-p-schmidt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for providing this tutorial!
This PR adds a tutorial on VTU mesh input in our documentation. I hope I explain everything that is relevant.
Next week in the community meeting, I will present the tutorial in a short TGM (and a related python project) and answer questions.
I also extended a bit the plotting functionality in our documentation. We can also do now more complex plots (see the new tutorial). In this case, I'm plotting two meshes (the mesh itself with glyphs indicating the fiber direction). We are now able to plot anything that the plotter in pyvista can plot. We just forward all calls to pyvista and return a reference to the plotter-class: