Skip to content

Commit

Permalink
Merge pull request #1738 from CEED/jeremy/empty-at-points
Browse files Browse the repository at this point in the history
Guard divide by zero
  • Loading branch information
jeremylt authored Feb 3, 2025
2 parents a0c3296 + 19feff8 commit 08bc25a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion interface/ceed-operator.c
Original file line number Diff line number Diff line change
Expand Up @@ -1719,8 +1719,9 @@ int CeedOperatorGetFlopsEstimate(CeedOperator op, CeedSize *flops) {
CeedQFunctionField *qf_input_fields, *qf_output_fields;
CeedOperatorField *op_input_fields, *op_output_fields;

CeedCall(CeedOperatorIsAtPoints(op, &is_at_points));
CeedCall(CeedOperatorGetNumElements(op, &num_elem));
if (num_elem == 0) return CEED_ERROR_SUCCESS;
CeedCall(CeedOperatorIsAtPoints(op, &is_at_points));
if (is_at_points) {
CeedMemType mem_type;
CeedElemRestriction rstr_points = NULL;
Expand Down

0 comments on commit 08bc25a

Please sign in to comment.