Skip to content

Improvement: Mesh handle tutorials#2348

Open
Vyp3er wants to merge 11 commits into
DLR-AMR:mainfrom
Vyp3er:mesh_handle_tutorials
Open

Improvement: Mesh handle tutorials#2348
Vyp3er wants to merge 11 commits into
DLR-AMR:mainfrom
Vyp3er:mesh_handle_tutorials

Conversation

@Vyp3er

@Vyp3er Vyp3er commented Jun 22, 2026

Copy link
Copy Markdown

Describe your changes here:

All these boxes must be checked by the AUTHOR before requesting review:

  • The PR is small enough to be reviewed easily. If not, consider splitting up the changes in multiple PRs.
  • The title starts with one of the following prefixes: Documentation:, Bugfix:, Feature:, Improvement: or Other:.
  • If the PR is related to an issue, make sure to link it.
  • The author made sure that, as a reviewer, he/she would check all boxes below.

All these boxes must be checked by the REVIEWERS before merging the pull request:

As a reviewer please read through all the code lines and make sure that the code is fully understood, bug free, well-documented and well-structured.

General

  • The reviewer executed the new code features at least once and checked the results manually.
  • The code follows the t8code coding guidelines.
  • New source/header files are properly added to the CMake files.
  • The code is well documented. In particular, all function declarations, structs/classes and their members have a proper doxygen documentation. Make sure to add a file documentation for each file!
  • README.md files are updated if necessary.
  • All new algorithms and data structures are sufficiently optimal in terms of memory and runtime (If this should be merged, but there is still potential for optimization, create a new issue).

Tests

  • The code is covered in an existing or new test case using Google Test.
  • The code coverage of the project (reported in the CI) should not decrease. If coverage is decreased, make sure that this is reasonable and acceptable.
  • Valgrind doesn't find any bugs in the new code. This script can be used to check for errors; see also this wiki article.

If the Pull request introduces code that is not covered by the github action (for example coupling with a new library):

  • Should this use case be added to the github action?
  • If not, does the specific use case compile and all tests pass (check manually).

Scripts and Wiki

  • If a new directory with source files is added, it must be covered by the scripts/internal/find_all_source_files.sh to check the indentation of these files.
  • If this PR introduces a new feature, it must be covered in an example or tutorial and a Wiki article.

License

  • The author added a BSD statement to doc/ (or already has one).

@Vyp3er Vyp3er changed the title Mesh handle tutorials Improvement: Mesh handle tutorials Jul 1, 2026
@Vyp3er
Vyp3er marked this pull request as ready for review July 1, 2026 08:46
@lenaploetzke
lenaploetzke self-requested a review July 1, 2026 08:52
@lenaploetzke lenaploetzke self-assigned this Jul 1, 2026
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.28%. Comparing base (66cd94f) to head (ca472bd).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2348   +/-   ##
=======================================
  Coverage   82.28%   82.28%           
=======================================
  Files         125      125           
  Lines       20701    20701           
=======================================
  Hits        17033    17033           
  Misses       3668     3668           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lenaploetzke lenaploetzke left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial review. Thank you for your work, this is really nice and my comments are mainly documentation! :)

@@ -0,0 +1,138 @@
/*

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should rename this as we try to hide the "forest". Do you have an idea? Also maybe we should write a Readme such that it is clear why this is "step3" although we have no step 1 and 2 in this folder. I removed the "step5" for the other mesh handle tutorial but maybe its good to keep the name but state it clearly in the readme (and link to steps 0-2 there as they are necessary to understand also for the mesh handle)

Comment thread tutorials/mesh_handle/t8_mesh_step3_adapt_forest.cxx Outdated
* In this example we want to adapt in a spherical shape around a given point. */
struct adapt_data
{
std::array<double, 3> midpoint; /**< midpoint of our sphere. */

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer t8_3D_vec here (which is essentially the same but clearer)

Comment thread tutorials/mesh_handle/t8_mesh_step3_adapt_forest.cxx
Comment thread tutorials/mesh_handle/t8_mesh_step3_adapt_forest.cxx
sc_MPI_Comm comm = sc_MPI_COMM_WORLD;

/* Print a starting message. */
t8_global_productionf (" [tutorial] \n");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also think of something different than "tutorial" here. Any ideas?

Comment thread tutorials/mesh_handle/t8_mesh_step3_adapt_forest.cxx
t8_global_productionf (" [tutorial] \n");
t8_global_productionf (" [tutorial] Writing adapted mesh to vtu file: adapted_mesh.vtu\n");
t8_global_productionf (" [tutorial] \n");
t8_mesh_handle::write_mesh_to_vtk (*mesh, "adapted_mesh.vtu");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also add a step here such that the files are not overridden by the next step. Maybe we can do step_mh3 or smth like this? (for mesh handle). Maybe you have a better idea, i am not fully convinced of my idea.

Vyp3er and others added 3 commits July 17, 2026 09:45
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