remesh#
- Mesh.remesh(target, strict=True)[source]#
Return per-axis flags indicating which axes require averaging.
An axis needs remeshing when the source is on the half mesh (
1) and the target is on the main mesh (0). By default, requesting a main-to-half transition (upsampling) raises aValueError.- Parameters:
- target
MeshLike|None Desired output stagger; coerced to
Meshvia_coerce_mesh_target()if necessary.Noneis treated asself(no-op: returns allFalse).- strictbool, optional
If
True(default), raiseValueErrorwhen any axis in target is on the half mesh but the corresponding axis inselfis already on the main mesh (main → half is not supported). Set toFalseto silently ignore such axes.
- target
- Returns:
- Raises:
ValueErrorIf strict is
Trueand target requests a half-mesh axis whereselfis already on the main mesh.
Examples
>>> from psi_io.mesh import Mesh >>> src = Mesh.parse(0b111, ndim=3) # all-half >>> src.remesh('main') (True, True, True) >>> src.remesh(None) # no-op: target == self (False, False, False) >>> src.remesh(0b101) # only theta needs averaging (False, True, False)