spectral_galerkin_heat.core.vector ================================== .. py:module:: spectral_galerkin_heat.core.vector .. autoapi-nested-parse:: 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 ------- .. autoapisummary:: spectral_galerkin_heat.core.vector.Vec3 Module Contents --------------- .. py:class:: Vec3 An immutable ``(x, y, z)`` triple of scalars. Iterable (so ``a, b, c = v`` and ``zip(v, w)`` work) and supports element-wise division for the common ``size / n -> spacing`` idiom. :ivar x, y, z: The three components, in natural (x, y, z) order. :vartype x, y, z: int or float .. rubric:: 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) .. py:method:: zyx() Return the triple reversed to ``(z, y, x)``, the array-index order. Arrays in the solver are indexed ``[z, y, x]``. .. py:method:: map(f) Return a new ``Vec3`` with *f* applied to each component.