inducer / inducer/grudge

Do not fail for empty reductions

Open
#266 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
14
Forks
18
Avg merge
26m
Merged PRs (30d)
1

Description

Originally raised by @MTCam in #264:

A second problem is that this pattern fails to actually execute for `CV` objects since we have:
`CV = [DOFArray, DOFArray, DOFArray, ... , numpy.ndarray = [] ]`, i.e., an empty array for the `species_mass` component for non-mixture CV. Attempting a reduction operation using a single gas CV now produces this error:

```
if not isinstance(vec, DOFArray):
> return max(
nodal_max_loc(dcoll, dd, comp, initial=initial)
for _, comp in serialize_container(vec)
)
E ValueError: max() arg is an empty sequence

../../grudge/grudge/reductions.py:257: ValueError
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.