-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add padding option to element reference coords #1221
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a thorough review but skimmed over it. Looks great on the first glance.
Changed the comment describing padding thoughout, since "amount of padding" could be understood as "number of bytes" instead we mean "number of entries" (i.e. doubles).
src/t8_schemes/t8_default/t8_default_vertex/t8_default_vertex.hxx
Outdated
Show resolved
Hide resolved
Co-authored-by: Johannes Holke <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good in general, just found an argument that should be const and some iterator-variables with meaningless names.
t8_forest_element_coordinate (t8_forest_t forest, t8_locidx_t ltree_id, const t8_element_t *element, int corner_number, | ||
double *coordinates); | ||
t8_forest_element_coordinate_from_corner_number (t8_forest_t forest, t8_locidx_t ltree_id, const t8_element_t *element, | ||
int corner_number, double *coordinates); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int corner_number, double *coordinates); | |
const int corner_number, double * const coordinates); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change the documentation of *coordinates to "\param [in, out]" to make clear that no memory is allocated?
@@ -52,8 +52,8 @@ t8_forest_get_dimension (const t8_forest_t forest); | |||
* the x, y and z coordinates of the vertex. | |||
*/ | |||
void | |||
t8_forest_element_coordinate (t8_forest_t forest, t8_locidx_t ltree_id, const t8_element_t *element, int corner_number, | |||
double *coordinates); | |||
t8_forest_element_coordinate_from_corner_number (t8_forest_t forest, t8_locidx_t ltree_id, const t8_element_t *element, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t8_forest_element_coordinate_from_corner_number (t8_forest_t forest, t8_locidx_t ltree_id, const t8_element_t *element, | |
t8_forest_element_coordinate_from_corner_number (const t8_forest_t forest, const t8_locidx_t ltree_id, const t8_element_t *element, |
void | ||
t8_forest_element_from_ref_coords (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, | ||
const double *ref_coords, const size_t num_coords, double *coords_out); | ||
t8_forest_element_coordinate_from_ref_coords (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t8_forest_element_coordinate_from_ref_coords (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, | |
t8_forest_element_coordinate_from_ref_coords (const t8_forest_t forest, const t8_locidx_t ltreeid, const t8_element_t *element, |
const double *ref_coords, const size_t num_coords, double *coords_out); | ||
t8_forest_element_coordinate_from_ref_coords (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, | ||
const double *ref_coords, const size_t num_coords, const size_t padding, | ||
double *coords_out); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double *coords_out); | |
double * const coords_out); |
t8_forest_element_from_ref_coords_ext (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, | ||
const double *ref_coords, const size_t num_coords, double *coords_out, | ||
const double *stretch_factors); | ||
t8_forest_element_coordinate_from_ref_coords_ext (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t8_forest_element_coordinate_from_ref_coords_ext (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, | |
t8_forest_element_coordinate_from_ref_coords_ext (const t8_forest_t forest, const t8_locidx_t ltreeid, const t8_element_t *element, |
* \param [out] out_coords The coordinates of the points in the | ||
* reference space of the tree. | ||
*/ | ||
virtual void | ||
t8_element_reference_coords (const t8_element_t *elem, const double *ref_coords, const size_t num_coords, | ||
double *out_coords) const; | ||
const size_t padding, double *out_coords) const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const size_t padding, double *out_coords) const; | |
const size_t padding, double * const out_coords) const; |
@@ -176,12 +176,13 @@ t8_dvertex_vertex_ref_coords (const t8_dvertex_t *elem, const int vertex, double | |||
|
|||
void | |||
t8_dvertex_compute_reference_coords (const t8_dvertex_t *elem, const double *ref_coords, const size_t num_coords, | |||
double *out_coords) | |||
const size_t padding, double *out_coords) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const size_t padding, double *out_coords) | |
const size_t padding, double * const out_coords) |
* \param [out] out_coords An array of \a num_coords x 1 x double that | ||
* will be filled with the reference coordinates | ||
* of the points on the vertex (will be set to 0). | ||
*/ | ||
void | ||
t8_dvertex_compute_reference_coords (const t8_dvertex_t *elem, const double *ref_coords, const size_t num_coords, | ||
double *out_coords); | ||
const size_t padding, double *out_coords); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const size_t padding, double *out_coords); | |
const size_t padding, double * const out_coords); |
@@ -94,7 +94,7 @@ t8_midpoint (t8_forest_t forest, t8_locidx_t which_tree, t8_eclass_scheme_c *ts, | |||
for (i = 0; i < 3; i++) { | |||
corner[i] = T8_ALLOC (double, 3); | |||
/* Get the coordinates of the elements i-th vertex */ | |||
t8_forest_element_coordinate (forest, which_tree, element, i, corner[i]); | |||
t8_forest_element_coordinate_from_corner_number (forest, which_tree, element, i, corner[i]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t8_forest_element_coordinate_from_corner_number (forest, which_tree, element, i, corner[i]); | |
t8_forest_element_coordinate_from_corner_number (forest, which_tree, element, icorner, corner[icorner]); |
* \param [out] out_coords The coordinates of the points in the | ||
* reference space of the tree. | ||
*/ | ||
virtual void | ||
t8_element_reference_coords (const t8_element_t *elem, const double *ref_coords, const size_t num_coords, | ||
double *out_coords) const | ||
const size_t padding, double *out_coords) const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const size_t padding, double *out_coords) const | |
const size_t padding, double * const out_coords) const |
Describe your changes here:
This PR introduces a padding to the reference coords. This way the element ref coords becomes consistend with the geometries and the element_from_ref_coord_function.
This is the result of the element ref coord discussion.
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 Makefiles
The code is well documented
All function declarations, structs/classes and their members have a proper doxygen documentation
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
Github action
The code compiles without warning in debugging and release mode, with and without MPI (this should be executed automatically in a github action)
All tests pass (in various configurations, this should be executed automatically in a github action)
If the Pull request introduces code that is not covered by the github action (for example coupling with a new library):
Scripts and Wiki
script/find_all_source_files.scp
to check the indentation of these files.Licence
doc/
(or already has one)