The elementseq module.

class nutils.elementseq.References(ndims)

Bases: nutils.types.Singleton

Abstract base class for a sequence of Reference objects.

Parameters:ndims (int) – The number of dimensions of the references in this sequence.


Subclasses must implement __len__() and __getitem__().


Return len(self).

__getitem__(self, index)

Return self[index].


Implement iter(self).


Return the sequence of child references.

Returns:The sequence of child references:
(cref for ref in self for cref in ref.child_refs)
Return type:References
getpoints(self, ischeme, degree)

Return a sequence of Points.

__add__(self, other)

Return self+other.

__mul__(self, other)

Return self*other.


Iterator of unchained References items.

Yields:References – Unchained items.

True if all reference in this sequence are equal.

class nutils.elementseq.PlainReferences(references, ndims)

Bases: nutils.elementseq.References

A general purpose implementation of References.

Use this class only if there exists no specific implementation of References for the references at hand.

  • references (tuple of Reference objects) – The sequence of references.
  • ndims (int) – The number of dimensions of the references.
class nutils.elementseq.UniformReferences(reference, length)

Bases: nutils.elementseq.References

A uniform sequence.

  • reference (Reference) – The reference.
  • length (int) – The length of the sequence.
class nutils.elementseq.SelectedReferences(parent, indices)

Bases: nutils.elementseq.References

A selection of references. Duplication and reordering is allowed.

  • parent (References) – The transforms to subset.
  • indices (one-dimensional array of ints) – Indices of parent that form this selection.
class nutils.elementseq.ChainedReferences(items)

Bases: nutils.elementseq.References

A sequence of chained References objects.

Parameters:items (tuple of References objects) – The References objects to chain.
class nutils.elementseq.RepeatedReferences(parent, count)

Bases: nutils.elementseq.References

An n-times repeated sequence of references.

  • parent (References) – The references to repeat.
  • count (int) – The number of repetitions.
class nutils.elementseq.ProductReferences(left, right)

Bases: nutils.elementseq.References

A sequence of products of two other sequences.

class nutils.elementseq.ChildReferences(parent)

Bases: nutils.elementseq.References

A sequence of child references.

The child references are ordered first by parent references, then by child references, as returned by the reference:

(cref for ref in parent for cref in ref.child_refs)
Parameters:parent (References) – The references to produce the children of.
nutils.elementseq.asreferences(value, ndims)

Convert value to a References object.

nutils.elementseq.chain(items, ndims)

Return the chained references sequence of items.

  • items (iterable of References objects) – The References objects to chain.
  • ndims (int) – the number of dimensions all references.

The chained references.

Return type: