Skip to content

Commit

Permalink
drop unused clearing
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylt committed Jul 7, 2023
1 parent 4f78e47 commit c728f78
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 0 additions & 2 deletions interface/ceed-basis.c
Original file line number Diff line number Diff line change
Expand Up @@ -1542,8 +1542,6 @@ int CeedBasisApplyAtPoints(CeedBasis basis, CeedInt num_points, CeedTransposeMod
{
CeedScalar tmp[2][num_comp * CeedIntPow(Q_1d, dim)], chebyshev_x[Q_1d];

// ---- Clear output array
for (CeedInt i = 0; i < num_points * num_comp; i++) v_array[i] = 0.0;
// ---- Values at point
for (CeedInt p = 0; p < num_points; p++) {
CeedInt pre = num_comp * CeedIntPow(Q_1d, dim - 1), post = 1;
Expand Down
18 changes: 9 additions & 9 deletions tests/t352-basis.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ int main(int argc, char **argv) {
CeedScalar coord[dim];

for (CeedInt d = 0; d < dim; d++) coord[d] = x_array[d * p_dim + i];
for (CeedInt c = 0; c < num_comp; c++) u_array[i * num_comp + c] = Eval(dim, c + 1, coord);
for (CeedInt c = 0; c < num_comp; c++) u_array[i + c * p_dim] = Eval(dim, c, coord);
}
CeedVectorRestoreArrayRead(x_nodes, &x_array);
CeedVectorSetArray(u, CEED_MEM_HOST, CEED_COPY_VALUES, (CeedScalar *)&u_array);
Expand All @@ -77,16 +77,16 @@ int main(int argc, char **argv) {

for (CeedInt d = 0; d < dim; d++) coord[d] = x_array[d + i * dim];
for (CeedInt c = 0; c < num_comp; c++) {
CeedScalar fx = Eval(dim, c + 1, coord);
if (fabs(v_array[i * num_comp + c] - fx) > 1E-4) {
// LCOV_EXCL_START
printf("[%" CeedInt_FMT ", %" CeedInt_FMT "] %f != %f = f(%f", dim, c, v_array[i * num_comp + c], fx, coord[0]);
for (CeedInt d = 1; d < dim; d++) printf(", %f", coord[d]);
puts(")");
// LCOV_EXCL_STOP
CeedScalar fx = Eval(dim, c, coord);
if (fabs(v_array[c + i * num_comp] - fx) > 1E-4) {
// LCOV_EXCL_START
printf("[%" CeedInt_FMT ", %" CeedInt_FMT "] %f != %f = f(%f", dim, c, v_array[c + i * num_comp], fx, coord[0]);
for (CeedInt d = 1; d < dim; d++) printf(", %f", coord[d]);
puts(")");
// LCOV_EXCL_STOP
}
}
}
}
CeedVectorRestoreArrayRead(x_points, &x_array);
CeedVectorRestoreArrayRead(v, &v_array);
}
Expand Down

0 comments on commit c728f78

Please sign in to comment.