Skip to content

Do not fail for empty reductions #266

Description

@inducer

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions