Skip to content

Conversation

@amgebauer
Copy link
Member

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:

{% set mesh = read_mesh("solid/tutorial_vtu.vtu") %}
{{ plotter(aspect_ratio=2/1)
    .add_mesh(mesh, show_edges=True)
    .add_mesh(mesh.glyph(orient="collagen_fiber", factor=0.5), color="red")
    .make() }}

@amgebauer amgebauer requested a review from Copilot November 19, 2025 13:54
Copilot finished reviewing on behalf of amgebauer November 19, 2025 13:57
Copy link

Copilot AI left a 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 PlotBuilder class 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.

Copy link
Contributor

@c-p-schmidt c-p-schmidt left a 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!

@amgebauer amgebauer merged commit 1006cbc into 4C-multiphysics:main Nov 20, 2025
29 checks passed
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.

3 participants