def _call(self, x):
        """Return values at indices, possibly weighted."""
        out = x.asarray().ravel()[self._indices_flat]

        if self.variant == 'point_eval':
            weights = 1.0
        elif self.variant == 'integrate':
            weights = getattr(self.domain, 'cell_volume', 1.0)
        else:
            raise RuntimeError('bad variant {!r}'.format(self.variant))

        if weights != 1.0:
            out *= weights

        return out
def _call ( self , x ) : out = x . asarray ( ) . ravel ( ) [ self . _indices_flat ] if self . variant == 'point_eval' : weights = 1.0 elif self . variant == 'integrate' : weights = getattr ( self . domain , 'cell_volume' , 1.0 ) else : raise RuntimeError ( 'bad variant {!r}' . format ( self . variant ) ) if weights != 1.0 : out *= weights return out
Return values at indices, possibly weighted.