Improvement: Step 2 tutorial and get_num_global_elements to mesh.hxx - #2371
Improvement: Step 2 tutorial and get_num_global_elements to mesh.hxx#2371Vyp3er wants to merge 4 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2371 +/- ##
=======================================
Coverage 82.28% 82.28%
=======================================
Files 125 125
Lines 20701 20703 +2
=======================================
+ Hits 17033 17035 +2
Misses 3668 3668 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
lenaploetzke
left a comment
There was a problem hiding this comment.
Thanks for your nice work :)
lenaploetzke
left a comment
There was a problem hiding this comment.
Thank you, i think we are nearly ready to merge here
| /* Build the uniform mesh, it is automatically partitioned among the processes. */ | ||
| std::unique_ptr<MeshType> mesh = t8_mesh_handle::handle_new_uniform<MeshType> (cmesh, scheme, level, comm); | ||
|
|
||
| t8_global_productionf (" [t8_step2] Constructed uniform mesh with refinement level %d.\n", level); |
There was a problem hiding this comment.
I do like t8_step2 better but maybe mesh_step2 is even better? Then it is clear that we are not in the general folder? Sorry for the inconvenience. And you missed one in l. 61
| #include <t8.h> /** General t8code header, always include this. */ | ||
| #include <mesh_handle/mesh.hxx> /** General Mesh Header, always needed for mesh_handle code. */ | ||
| #include <t8_cmesh/t8_cmesh.h> /** cmesh definition and basic interface. */ | ||
| #include <mesh_handle/constructor_wrappers.hxx> /** Wrapper for basic Cmesh to mesh_handle conversions. */ |
There was a problem hiding this comment.
| #include <mesh_handle/constructor_wrappers.hxx> /** Wrapper for basic Cmesh to mesh_handle conversions. */ | |
| #include <mesh_handle/constructor_wrappers.hxx> /** Wrapper for basic cmesh to mesh_handle conversions. */ |
| #include <t8_cmesh/t8_cmesh.h> /** cmesh definition and basic interface. */ | ||
| #include <mesh_handle/constructor_wrappers.hxx> /** Wrapper for basic Cmesh to mesh_handle conversions. */ | ||
| #include <mesh_handle/mesh_io.hxx> /** Used to export mesh to vtk files. */ | ||
| #include <t8_schemes/t8_default/t8_default.hxx> /** default refinement scheme. */ |
There was a problem hiding this comment.
| #include <t8_schemes/t8_default/t8_default.hxx> /** default refinement scheme. */ | |
| #include <t8_schemes/t8_default/t8_default.hxx> /** Default refinement scheme. */ |
| #include <memory> | ||
|
|
||
| /** Builds cmesh of 2 prisms that build up a unit cube. | ||
| * See step1 for a detailed description. |
There was a problem hiding this comment.
| * See step1 for a detailed description. | |
| * See \ref tutorials/general/t8_step1_coarsemesh.cxx for a detailed description. |
| * \return A uniform mesh with the given refinement level that is | ||
| * partitioned across the processes in \a comm. | ||
| */ | ||
| template <typename MeshType> |
There was a problem hiding this comment.
In general, we start template parameters with T. I used TMeshClass throughout the code.
Please also add a doxygen doc for this. You could also use the concept t8_mesh_handle::T8MeshType here (and include the concepts header.). I think its maybe cool to learn about the concept here. (also add a comment about the concept then.)
|
|
||
| /** Print a message on the root process. */ | ||
| t8_global_productionf (" [t8_step2] \n"); | ||
| t8_global_productionf (" [t8_step2] Hello, this is the step2 example of t8code using the mesh handle.\n"); |
There was a problem hiding this comment.
| t8_global_productionf (" [t8_step2] Hello, this is the step2 example of t8code using the mesh handle.\n"); | |
| t8_global_productionf (" [t8_step2] Hello, this is step 2 of t8code's mesh handle tutorials.\n"); |
| /** Print a message on the root process. */ | ||
| t8_global_productionf (" [t8_step2] \n"); | ||
| t8_global_productionf (" [t8_step2] Hello, this is the step2 example of t8code using the mesh handle.\n"); | ||
| t8_global_productionf (" [t8_step2] In this example we build our first uniform mesh and output it to vtu files.\n"); |
There was a problem hiding this comment.
| t8_global_productionf (" [t8_step2] In this example we build our first uniform mesh and output it to vtu files.\n"); | |
| t8_global_productionf (" [t8_step2] In this tutorial we build our first uniform mesh and output it to vtu files.\n"); |
| /** Create the cmesh. */ | ||
| t8_cmesh_t cmesh = t8_step2_build_prismcube_coarse_mesh (comm); | ||
| /** | ||
| * We will put the Mesh in a separate scope here, |
There was a problem hiding this comment.
| * We will put the Mesh in a separate scope here, | |
| * We will put the mesh in a separate scope here, |
| t8_cmesh_t cmesh = t8_step2_build_prismcube_coarse_mesh (comm); | ||
| /** | ||
| * We will put the Mesh in a separate scope here, | ||
| * because it will destroy itself completely on its own when reaching the end of this scope. |
There was a problem hiding this comment.
| * because it will destroy itself completely on its own when reaching the end of this scope. | |
| * because it will be destroyed automatically at the end of this scope. This is only needed because SC_CHECK_MPI checks for leftover references. Otherwise, it would be destroyed at the end of the main function. |
I think we need a line break here, sorry
| * because it will destroy itself completely on its own when reaching the end of this scope. | ||
| */ | ||
| { | ||
| /** Build the uniform mesh. */ |
There was a problem hiding this comment.
I think it would even be cleaner if we write using mesh_class= .... here and add the explanation:
The mesh class is templated so that further competences/features that are not needed by default can be added to it. This is explained in more detail in the further tutorials. In our case, the default mesh class is sufficient.
…mesh.hxx.
Describe your changes here:
All these boxes must be checked by the AUTHOR before requesting review:
Documentation:,Bugfix:,Feature:,Improvement:orOther:.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
Tests
If the Pull request introduces code that is not covered by the github action (for example coupling with a new library):
Scripts and Wiki
scripts/internal/find_all_source_files.shto check the indentation of these files.License
doc/(or already has one).