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__()
andget()
.- static from_iter(value, ndims)¶
Create a
References
sequence from an iterator.- Parameters
- Returns
sequence
- Return type
- static uniform(value, length)¶
Create a uniform
References
.- Parameters
- Returns
sequence
- Return type
- static empty(ndims)¶
Create an empty
References
sequence.- Parameters
ndims (
int
) –- Returns
sequence
- Return type
- __bool__(self)¶
Return
bool(self)
.
- abstract __len__(self)¶
Return
len(self)
.
- __iter__(self)¶
Implement
iter(self)
.
- __getitem__(index: int) nutils.element.Reference ¶
- __getitem__(index: Union[slice, numpy.ndarray]) References
Return
self[index]
.
- __add__(self, other)¶
Return
self+other
.
- __mul__(other: int) nutils.element.Reference ¶
- __mul__(other: References) References
Return
self*other
.
- abstract get(self, index)¶
Return the reference at
index
.
- take(self, indices)¶
Return a selection of this sequence.
- Parameters
indices (
numpy.ndarray
, ndim: 1, dtype: int) – The indices of references of this sequence to select.- Returns
references – The sequence of selected references.
- Return type
- compress(self, mask)¶
Return a selection of this sequence.
- Parameters
mask (
numpy.ndarray
, ndim: 1, dtype: bool) – A boolean mask of references of this sequence to select.- Returns
sequence – The sequence of selected references.
- Return type
- repeat(self, count)¶
Return this sequence repeated
count
times.- Parameters
count (
int
) –- Returns
sequence – This sequence repeated
count
times.- Return type
- product(self, other)¶
Return the product of this sequence with another sequence.
- Parameters
other (
References
) –- Returns
sequence – The product sequence.
- Return type
- chain(self, other)¶
Return the chained sequence of this sequence with
other
.- Parameters
other (
References
) –- Returns
sequence – The chained sequence.
- Return type
- property children: nutils.elementseq.References¶
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
- property edges: nutils.elementseq.References¶
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