volumential.box_operators#

Box-local (box-specific) maps, reductions and modal filters.

A box-specific operator acts on the quadrature nodes of one leaf box at a time, independently of every other box. This module owns those operators and the filter vectors they take; all of its public names are re-exported by volumential.tools for backwards compatibility.

class volumential.box_operators.BoxSpecificMap[source]#

Bases: KernelCacheWrapper

Box-specific transform that maps between datum defined on quadrature nodes. Being box-specific means that the transform for each box is independent from the rest of the boxes.

class volumential.box_operators.DiscreteLegendreTransform(dim, degree)[source]#

Bases: BoxSpecificMap

Transform from nodal values to Legendre polynomial coefficients for all cells (leaf boxes of a boxtree Tree object). It is assumed that the traversal is built over a tree where the sources and targets coincide.

get_cache_key() → tuple[Any, ...][source]#

Return a hashable key identifying the generated kernel.

get_kernel(**kwargs)[source]#

Return the nodal-to-modal transform kernel.

get_optimized_kernel(ncpus=None, **kwargs)[source]#

Return the transform kernel parallelized over boxes.

class volumential.box_operators.InverseDiscreteLegendreTransform[source]#

Bases: BoxSpecificMap

Box-specific transform that maps box-local modal coefficients to nodal values. Inverse of DiscreteLegendreTransform.

class volumential.box_operators.BoxSpecificReduction[source]#

Bases: KernelCacheWrapper

Box-specific reduction that maps for each box a data vector defined on the quadrature nodes to a scalar. Being box-specific means that the reductions for each box is independent from the rest of the boxes.

class volumential.box_operators.BoxSum(dim, degree)[source]#

Bases: BoxSpecificReduction

Adds up nodal values within each box.

get_cache_key() → tuple[Any, ...][source]#

Return a hashable key identifying the generated kernel.

get_kernel(**kwargs)[source]#

Return the box-wise filtered sum kernel.

get_optimized_kernel(ncpus=None, **kwargs)[source]#

Return the sum kernel parallelized over boxes.

volumential.box_operators.generate_leading_order_filtering(dim, n_dofs) → ndarray[source]#

Returns a filtering vector that is an indicator function of the node that corresponds to the leading order modal values in the Fourier space.