Skip to content
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

Feature puma patches [7/x] Batch processing of element ref_coords #661

Merged
merged 10 commits into from
Sep 11, 2023
21 changes: 14 additions & 7 deletions src/t8_schemes/t8_default/t8_default_pyramid/t8_dpyramid_bits.c
Original file line number Diff line number Diff line change
Expand Up @@ -1561,25 +1561,32 @@ t8_dpyramid_compute_reference_coords (const t8_dpyramid_t *elem, const double *r
T8_ASSERT (t8_dpyramid_is_valid (elem));
if (t8_dpyramid_shape (elem) == T8_ECLASS_PYRAMID) {
const t8_dpyramid_coord_t length = T8_DPYRAMID_LEN (elem->pyramid.level);

for (size_t coord = 0; coord < num_coords; ++coord) {
size_t coord;
for (coord = 0; coord < num_coords; ++coord) {
const size_t offset = coord * 3;
out_coords[offset + 0] = elem->pyramid.x;
out_coords[offset + 1] = elem->pyramid.y;
out_coords[offset + 2] = elem->pyramid.z;

if (elem->pyramid.type == T8_DPYRAMID_FIRST_TYPE) {
}
if (elem->pyramid.type == T8_DPYRAMID_FIRST_TYPE) {
for (coord = 0; coord < num_coords; ++coord) {
const size_t offset = coord * 3;
out_coords[offset + 0] += ref_coords[offset + 0] * length;
out_coords[offset + 1] += ref_coords[offset + 1] * length;
out_coords[offset + 2] += ref_coords[offset + 2] * length;
}
else {
}
else {
for (coord = 0; coord < num_coords; ++coord) {
const size_t offset = coord * 3;
out_coords[offset + 0] += (ref_coords[offset + 0] - ref_coords[offset + 2]) * length;
out_coords[offset + 1] += (ref_coords[offset + 1] - ref_coords[offset + 2]) * length;
out_coords[offset + 2] += (1 - ref_coords[offset + 2]) * length;
}

/*scale the coordinates onto the reference cube */
}
for (coord = 0; coord < num_coords; ++coord) {
const size_t offset = coord * 3;
/* Scale the coordinates onto the reference cube */
out_coords[offset + 0] /= (double) T8_DPYRAMID_ROOT_LEN;
out_coords[offset + 1] /= (double) T8_DPYRAMID_ROOT_LEN;
out_coords[offset + 2] /= (double) T8_DPYRAMID_ROOT_LEN;
Expand Down