elementseq

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.

Notes

Subclasses must implement __len__() and __getitem__().

abstract __len__(self)

Return len(self).

__getitem__(self, index)

Return self[index].

__iter__(self)

Implement iter(self).

property children

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

property edges

Return the sequence of edge references.

Returns

The sequence of edge references:

(eref for ref in self for eref in ref.edge_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.

unchain(self)

Iterator of unchained References items.

Yields

References – Unchained items.

property isuniform

True if all reference in this sequence are equal.

class nutils.elementseq.EmptyReferences(ndims)

Bases: nutils.elementseq.References

An empty sequence of references.

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.

Parameters
  • 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.

Parameters
  • 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.

Parameters
  • 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.

Parameters
  • 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.

Parameters
class nutils.elementseq.DerivedReferences(parent, derived_attribute, ndims)

Bases: nutils.elementseq.References

Abstract base class for references based on parent references.

The derived references are ordered first by parent references, then by derived references:

(dref for ref in parent for dref in getattr(ref, derived_attribute))
Parameters
  • parent (References) – The parent references.

  • derived_attribute (str) – The name of the attribute of a nutils.element.Reference that contains the derived references.

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

nutils.elementseq.asreferences(value, ndims)

Convert value to a References object.

nutils.elementseq.chain(items, ndims)

Return the chained references sequence of items.

Parameters
  • items (iterable of References objects) – The References objects to chain.

  • ndims (int) – the number of dimensions all references.

Returns

The chained references.

Return type

References