Feature: Added Element Methods (get_reference_coordinates, element_is_equal, t8_forest_leaf_face_orientation)#2360
Feature: Added Element Methods (get_reference_coordinates, element_is_equal, t8_forest_leaf_face_orientation)#2360Vyp3er wants to merge 11 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2360 +/- ##
==========================================
- Coverage 82.30% 82.28% -0.02%
==========================================
Files 125 125
Lines 20559 20711 +152
==========================================
+ Hits 16922 17043 +121
- Misses 3637 3668 +31 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-authored-by: lenaploetzke <70579874+lenaploetzke@users.noreply.github.com>
|
Please clean up the PR and remove changes in files that are not relevant here :) |
lenaploetzke
left a comment
There was a problem hiding this comment.
Very cool addition, thank you :)
| @@ -0,0 +1 @@ | |||
| I place my contributions to t8code under the FreeBSD license. Vincent Schmitt (vinz@vincent-schmitt.de) No newline at end of file | |||
There was a problem hiding this comment.
Could you merge main? :)
| return m_is_ghost_element; | ||
| } | ||
|
|
||
| // get_reference_coordinates |
There was a problem hiding this comment.
| // get_reference_coordinates |
We do not have titles in the remaining code, please also adapt for other functions
| } | ||
|
|
||
| // get_reference_coordinates | ||
| /** Function to convert points in reference space of an element to points of the |
There was a problem hiding this comment.
There are several sections in this file, maybe this should be placed at "Functionality of the element."?
There was a problem hiding this comment.
same with the orientation. I think is equal is fine here
| * \param [out] tree_ref_coords Pointer to the reference coordinates of the tree. | ||
| */ | ||
| void | ||
| get_reference_coordinates (const double* ref_coords, std::size_t num_coords, double* tree_ref_coords) const |
There was a problem hiding this comment.
Could you use t8_3D_vec instead of double* here? :) I also find it more intuitive if tree_ref_coords is the return.
| } | ||
|
|
||
| // element_is_equal | ||
| /** Check if two elements are equal. |
There was a problem hiding this comment.
I find it unituitive that two elements are compared inside the element class. I think we either should compare the element to another (so only with one arument which is the element to be compared with) OR should place this function outside of the class definition. I think i prefer the first way
| * \return The orientation of the face with respect to its neighbor. Returns 0 if the face has no neighbor. | ||
| */ | ||
| int | ||
| get_face_orientation (int face) const |
There was a problem hiding this comment.
Very cool function, could you maybe use this one in dg_competences.hxx?
| /** Compute the orientation of a face of an element with respect to its neighbor. | ||
| * \param [in] face The index of the face for which the orientation should be computed. | ||
| * \return The orientation of the face with respect to its neighbor. Returns 0 if the face has no neighbor. | ||
| */ |
There was a problem hiding this comment.
| */ | |
| */ |
Could you please check that the comments have the correct indentation?
| // --- Compare elements. --- | ||
| EXPECT_EQ (mesh_iterator->get_local_tree_id (), itree); | ||
| EXPECT_EQ (mesh_iterator->get_local_element_id (), ielem); | ||
| EXPECT_EQ (mesh_iterator->is_equal (*mesh_iterator, *mesh_iterator), |
There was a problem hiding this comment.
I think for this we can just check EXPECT_TRUE :) This has nothing to do with the forest. And i think it may be cool to also add a test case where this is false.
| // --- Compare elements. --- | ||
| EXPECT_EQ (mesh_iterator->get_local_tree_id (), itree); | ||
| EXPECT_EQ (mesh_iterator->get_local_element_id (), ielem); | ||
| EXPECT_EQ (mesh_iterator->is_equal (*mesh_iterator, *mesh_iterator), |
There was a problem hiding this comment.
We also need this functios to be tested for ghost cells, see t8_gtest_ghost.cxx
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).