Mesh competence tutorial - #2370
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2370 +/- ##
=======================================
Coverage 82.28% 82.28%
=======================================
Files 125 125
Lines 20701 20701
=======================================
Hits 17033 17033
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.
Nice tutorial! Maybe a bit more of explanation would help :)
| * These so called competences are a way to extend the functionality of the mesh handle and its elements. | ||
| * | ||
| * The competences are organized in different types, depending the functionality. | ||
| * Element data competences are used to store data in the mesh elements and work with it in different ways |
There was a problem hiding this comment.
| * Element data competences are used to store data in the mesh elements and work with it in different ways | |
| * Element data competences are used to store data in the mesh elements and work with it in different ways. |
| * | ||
| * The competences are organized in different types, depending the functionality. | ||
| * Element data competences are used to store data in the mesh elements and work with it in different ways | ||
| * Cache competences are used to store data in the mesh elements to work with it more efficiently, e.g. to avoid recomputing the same data multiple times. |
There was a problem hiding this comment.
| * Cache competences are used to store data in the mesh elements to work with it more efficiently, e.g. to avoid recomputing the same data multiple times. | |
| * Cache competences are used to store data in the mesh elements to avoid recomputing the same data multiple times. |
|
|
||
| #include <t8.h> /** General t8code header. Always include this. */ | ||
|
|
||
| #include <mesh_handle/mesh.hxx> /** General Mesh header, always needed for mesh_handle code. */ |
There was a problem hiding this comment.
Please correct capitalization in all the descriptions pls
| * Creating a simple custom competence that computes the squared volume of an element. | ||
| * | ||
| * All custom competences follow the same CRTP inheritance pattern: | ||
| * They are templated on the underlying element type and inherit from |
There was a problem hiding this comment.
| * They are templated on the underlying element type and inherit from | |
| * They are templated on the underlying element type TUnderlying and inherit from |
| * They are templated on the underlying element type and inherit from | ||
| * t8_crtp_operator<TUnderlying, Competence>. This gives the competence access to the functionality | ||
| * of the underlying element with using this->underlying(), allowing it to extend the element with additional methods. | ||
| * The use of t8_crtp_operator also avoids diamond-shaped inheritance when multiple competences are combined into one pack. |
There was a problem hiding this comment.
| * The use of t8_crtp_operator also avoids diamond-shaped inheritance when multiple competences are combined into one pack. |
I think we don't need this for the user. This would need some more explanation, i think we can leave it out
| * We will now create a second mesh with our custom competence pack that includes the volume competence and our custom defined competence 'volume_squared'. | ||
| */ | ||
| /* Defining a competence pack with the volume cache competence and our custom defined competence. */ | ||
| using custom_element_competences = element_competence_pack<cache_volume, volume_squared_custom_competence>; |
There was a problem hiding this comment.
Can you also include the cache competences header?
| using custom_element_competences = element_competence_pack<cache_volume, volume_squared_custom_competence>; | ||
|
|
||
| /* Defining a custom mesh_type with our competence pack. */ | ||
| using custom_mesh = mesh<custom_element_competences>; |
There was a problem hiding this comment.
| using custom_mesh = mesh<custom_element_competences>; | |
| using custom_mesh_class = mesh<custom_element_competences>; |
| level); | ||
| t8_global_productionf (" [t8 Step A Mesh handle] \n"); | ||
|
|
||
| /* Creating a custom mesh with the mesh_type including our custom competence pack and the initial refinement level 2. */ |
There was a problem hiding this comment.
| /* Creating a custom mesh with the mesh_type including our custom competence pack and the initial refinement level 2. */ | |
| /* Creating a mesh with the mesh_type including our custom competence pack. */ |
| t8_global_productionf (" [t8 Step A Mesh handle] \n"); | ||
|
|
||
| /* Creating a custom mesh with the mesh_type including our custom competence pack and the initial refinement level 2. */ | ||
| auto custom = handle_hypercube_hybrid_uniform_default<custom_mesh> (level, comm); |
There was a problem hiding this comment.
| auto custom = handle_hypercube_hybrid_uniform_default<custom_mesh> (level, comm); | |
| auto custom_mesh = handle_hypercube_hybrid_uniform_default<custom_mesh> (level, comm); |
| auto custom = handle_hypercube_hybrid_uniform_default<custom_mesh> (level, comm); | ||
|
|
||
| t8_global_productionf (" [t8 Step A Mesh handle] \n"); | ||
| t8_global_productionf (" [t8 Step A Mesh handle] Demonstrating the custom competence 'Squared Value'.\n"); |
There was a problem hiding this comment.
| t8_global_productionf (" [t8 Step A Mesh handle] Demonstrating the custom competence 'Squared Value'.\n"); | |
| t8_global_productionf (" [t8 Step A Mesh handle] Demonstrating the custom competence 'squared volume'.\n"); |
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).