warp.fem.periodic_prolongation#
- warp.fem.periodic_prolongation(basis, translations, tolerance=None)[source]#
Return a prolongation that ties the nodes of
basisto their periodic copies.For each translation
T, every nodexthat has a partner node atx - Ttakes the value of that partner. When the domain is a periodic cell that tiles space with the given translations, these are exactly the nodes on the faces that the translations map onto, whether or not the translations are perpendicular to the faces (for instance, the two edge vectors of a parallelogram). Nodes tied by several translations, such as edges and corners, resolve to a single copy. Nodes are matched by position, so any basis that providesBasisSpace.node_positions()works, including a constrained basis returned bymake_conforming_basis_space(), whose nodes are its independent nodes. On geometries with several environments, nodes only match nodes of the same environment.Only nodes with a partner are tied: this function does not check that paired faces carry matching nodes, and nodes without a partner, for instance on a face refined more than its partner, stay independent.
Pass the result to
make_constrained_basis_space()with the samebasisto build the periodic space. The geometry itself is unchanged: paired faces remain boundary sides, so jumps across the seam are not available and positions are not wrapped.Matching runs with a
warp.HashGridon the device holding the geometry’s arrays (or those of a constrainedbasis), and on the current device forGrid2DandGrid3D; only the node bounding box and error status are read back.- Parameters:
basis (BasisSpace) – Basis whose nodes are made periodic.
translations (Sequence[Any]) – One to three translation vectors with the dimension of the geometry, such as
warp.vec2(1.0, 0.0). Each one maps the low face of the periodic domain to its high face.tolerance (float | None) – Distance under which two nodes match.
Noneuses1e-6times the diagonal of the node bounding box.
- Returns:
A compact BSR matrix with scalar blocks of the geometry scalar type, one row per node of
basisand one column per independent node. Independent nodes are numbered in increasing node order, and each has a unit row.- Raises:
ValueError – If a translation is zero or has the wrong dimension, if
toleranceis not positive or not smaller than half of every translation length, or if the translations lead to cyclic or inconsistent constraints, for instance when bothTand-Tare given.- Return type: