pystella/fourier/derivs.py
def divergence(self, queue, vec, div, allocator=None):
        """
        Computes the divergence of the input ``vec``.
        Provides the same interface as
        :meth:`pystella.FiniteDifferencer.divergence`, while additionally accepting
        the following arguments:

        :arg allocator: A :mod:`pyopencl` allocator used to allocate temporary
            arrays, i.e., most usefully a :class:`pyopencl.tools.MemoryPool`.
        """

        from itertools import product
        slices = list(product(*[range(n) for n in vec.shape[:-4]]))

        for s in slices:
            arguments = {"queue": queue, **self.momenta, "allocator": allocator}

            fk = self.fft.dft(vec[s][0])
            evt, out = self.pdx_knl(fk=fk, **arguments, filter_args=True)
            div_k = out["pdx_k"]
            fk = self.fft.dft(vec[s][1])
            evt, _ = self.pdy_incr_knl(fk=fk, **arguments, div=div_k,
                                       filter_args=True)
            fk = self.fft.dft(vec[s][2])
            evt, _ = self.pdz_incr_knl(fk=fk, **arguments, div=div_k,
                                       filter_args=True)
            self.fft.idft(div_k, div[s])

        return None

        Computes the divergence of the input ``vec``.
        Provides the same interface as
        :meth:`pystella.FiniteDifferencer.divergence`, while additionally accepting
        the following arguments:

        :arg allocator: A :mod:`pyopencl` allocator used to allocate temporary
            arrays, i.e., most usefully a :class:`pyopencl.tools.MemoryPool`.
        
Computes the divergence of the input ``vec``.
Provides the same interface as
Computes the divergence of the input ` ` vec ` ` . Provides the same interface as
def divergence(self, queue, vec, div, allocator=None):
        from itertools import product
        slices = list(product(*[range(n) for n in vec.shape[:-4]]))
        for s in slices:
            arguments = {"queue": queue, **self.momenta, "allocator": allocator}
            fk = self.fft.dft(vec[s][0])
            evt, out = self.pdx_knl(fk=fk, **arguments, filter_args=True)
            div_k = out["pdx_k"]
            fk = self.fft.dft(vec[s][1])
            evt, _ = self.pdy_incr_knl(fk=fk, **arguments, div=div_k,
                                       filter_args=True)
            fk = self.fft.dft(vec[s][2])
            evt, _ = self.pdz_incr_knl(fk=fk, **arguments, div=div_k,
                                       filter_args=True)
            self.fft.idft(div_k, div[s])
        return None
def divergence ( self , queue , vec , div , allocator = None ) : from itertools import product slices = list ( product ( * [ range ( n ) for n in vec . shape [ : - 4 ] ] ) ) for s in slices : arguments = { "queue" : queue , ** self . momenta , "allocator" : allocator } fk = self . fft . dft ( vec [ s ] [ 0 ] ) evt , out = self . pdx_knl ( fk = fk , ** arguments , filter_args = True ) div_k = out [ "pdx_k" ] fk = self . fft . dft ( vec [ s ] [ 1 ] ) evt , _ = self . pdy_incr_knl ( fk = fk , ** arguments , div = div_k , filter_args = True ) fk = self . fft . dft ( vec [ s ] [ 2 ] ) evt , _ = self . pdz_incr_knl ( fk = fk , ** arguments , div = div_k , filter_args = True ) self . fft . idft ( div_k , div [ s ] ) return None
Computes the divergence of the input ``vec``.
Computes the divergence of the input ` ` vec ` ` .
"""
        Computes the divergence of the input ``vec``.
        Provides the same interface as
        :meth:`pystella.FiniteDifferencer.divergence`, while additionally accepting
        the following arguments:

        :arg allocator: A :mod:`pyopencl` allocator used to allocate temporary
            arrays, i.e., most usefully a :class:`pyopencl.tools.MemoryPool`.
        """
self
queue
vec
div
allocator
A :mod:`pyopencl` allocator used to allocate temporary
arrays, i.e., most usefully a :class:`pyopencl.tools.MemoryPool`.
A : mod : ` pyopencl ` allocator used to allocate temporary arrays i . e . most usefully a : class : ` pyopencl . tools . MemoryPool ` .
meth
`pystella.FiniteDifferencer.divergence`, while additionally accepting
the following arguments.
` pystella . FiniteDifferencer . divergence ` while additionally accepting the following arguments .