spectral_galerkin_heat.core.vector
Immutable 3-component value type for coordinate triples.
Vec3 groups the (x, y, z) scalar triples used throughout the
geometry and state-construction code (domain size, mesh counts, grid spacing).
Classes
An immutable |
Module Contents
- class spectral_galerkin_heat.core.vector.Vec3
An immutable
(x, y, z)triple of scalars.Iterable (so
a, b, c = vandzip(v, w)work) and supports element-wise division for the commonsize / n -> spacingidiom.- Variables:
z (x, y,) – The three components, in natural (x, y, z) order.
Examples
>>> size = Vec3(4.0, 2.0, 1.0) >>> n = Vec3(8, 4, 2) >>> tuple(size / n) (0.5, 0.5, 0.5) >>> tuple(n.zyx()) (2, 4, 8)
- zyx()
Return the triple reversed to
(z, y, x), the array-index order.Arrays in the solver are indexed
[z, y, x].- Return type: