nifty8.operators.distributors module#

class DOFDistributor(dofdex, target=None, space=None)[source]#

Bases: LinearOperator

Operator which distributes actual degrees of freedom (dof) according to some distribution scheme into a higher dimensional space. This distribution scheme is defined by the dofdex, a degree of freedom index, which associates the entries within the operator’s domain to locations in its target. This operator’s domain is a DOFSpace, which is defined according to the distribution scheme.

Parameters:
  • dofdex (nifty8.field.Field of integers) – An integer Field on exactly one Space establishing the association between the locations in the operator’s target and the underlying degrees of freedom in its domain. It has to start at 0 and it increases monotonically, no empty bins are allowed.

  • target (Domain, tuple of Domain, or DomainTuple, optional) – The target of the operator. If not specified, the domain of the dofdex is used.

  • space (int, optional:) – The index of the sub-domain on which the operator acts. Can be omitted if target only has one sub-domain.

__init__(dofdex, target=None, space=None)[source]#
apply(x, mode)[source]#

Applies the Operator to a given x, in a specified mode.

Parameters:
  • x (nifty8.field.Field) – The input Field, defined on the Operator’s domain or target, depending on mode.

  • mode (int) –

    • TIMES: normal application

    • ADJOINT_TIMES: adjoint application

    • INVERSE_TIMES: inverse application

    • ADJOINT_INVERSE_TIMES or INVERSE_ADJOINT_TIMES: adjoint inverse application

Returns:

The processed Field defined on the Operator’s target or domain, depending on mode.

Return type:

nifty8.field.Field

class PowerDistributor(target, power_space=None, space=None)[source]#

Bases: DOFDistributor

Operator which transforms between a PowerSpace and a harmonic domain.

Parameters:
  • target (Domain, tuple of Domain, or DomainTuple) – the total target domain of the operator.

  • power_space (PowerSpace, optional) – the input sub-domain on which the operator acts. If not supplied, a matching PowerSpace with natural binbounds will be used.

  • space (int, optional:) – The index of the sub-domain on which the operator acts. Can be omitted if target only has one sub-domain.

__init__(target, power_space=None, space=None)[source]#