Skip to content

Commit

Permalink
basis - traverse dimensions in opposite order
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylt committed Jul 7, 2023
1 parent 10544cc commit d63baca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions interface/ceed-basis.c
Original file line number Diff line number Diff line change
Expand Up @@ -1548,7 +1548,7 @@ int CeedBasisApplyAtPoints(CeedBasis basis, CeedInt num_points, CeedTransposeMod
for (CeedInt p = 0; p < num_points; p++) {
CeedInt pre = num_comp * CeedIntPow(Q_1d, dim - 1), post = 1;

for (CeedInt d = 0; d < dim; d++) {
for (CeedInt d = dim - 1; d >= 0; d--) {
// ------ Compute Chebyshev polynomial values
{
const CeedScalar x = x_array_read[p * dim + d];
Expand All @@ -1558,8 +1558,8 @@ int CeedBasisApplyAtPoints(CeedBasis basis, CeedInt num_points, CeedTransposeMod
for (CeedInt j = 2; j < Q_1d; j++) chebyshev_x[j] = 2 * x * chebyshev_x[j - 1] - chebyshev_x[j - 2];
}
// ------ Tensor contract
CeedCall(CeedTensorContractApply(basis->contract, pre, Q_1d, post, 1, chebyshev_x, t_mode, false, d == 0 ? chebyshev_coeffs : tmp[d % 2],
d == dim - 1 ? &v_array[p * num_comp] : tmp[(d + 1) % 2]));
CeedCall(CeedTensorContractApply(basis->contract, pre, Q_1d, post, 1, chebyshev_x, t_mode, false,
d == (dim - 1) ? chebyshev_coeffs : tmp[d % 2], d == 0 ? &v_array[p * num_comp] : tmp[(d + 1) % 2]));
pre /= Q_1d;
post *= 1;
}
Expand Down

0 comments on commit d63baca

Please sign in to comment.