nifty7.multi_domain module#

class MultiDomain(dct, _callingfrommake=False)[source]#

Bases: object

A tuple of domains corresponding to a direct sum.

This class is the domain of the direct sum of fields defined on (possibly different) domains. To make an instance of this class, call MultiDomain.make(inp).


For consistency and to be independent of the order of insertion, the keys within a multi-domain are sorted. Hence, renaming a domain may result in it being placed at a different index within a multi-domain. This is especially important if a sequence of, e.g., random numbers is distributed sequentially over a multi-domain. In this example, ordering keys differently will change the resulting MultiField.

property idx#
static make(inp)[source]#

Creates a MultiDomain object from a dictionary of names and domains


inp (MultiDomain or dict{name: DomainTuple}) – The already built MultiDomain or a dictionary of DomainTuples

Return type:

A MultiDomain with the input Domains as domains

property size#
static union(inp)[source]#