lbmpy.lattice.Advance

Contents

lbmpy.lattice.Advance#

class Advance(lattice)#

Execute the streaming step on a given lattice via Esoteric Twist timestep advancement.

The Advance operation switches a lattice from a post-collision state (which must previously have been established by a collision operator by writing to f.post) to the next time-step’s pre-collision state, effectively evaluating the streaming operation of the LBM:

\[f_i (\boldsymbol{x} + \boldsymbol{c_i}) = f^{\ast}_i (\boldsymbol{x})\]

Usage: Advance should be executed immediately after a collision operator on the given lattice \(\boldsymbol{f}\). Invoke this operation on the patch that holds the data of \(\boldsymbol{f}\):

f = Lattice(Ω)
advance = Advance(f)

Ω_data = PatchData(Ω, ..., fields=[f])

#   Perform advancement
advance(Ω_data)

Esoteric Twist: Since Lattice internally uses the Esoteric Twist streaming pattern [GS17], Advance only switches an internal timestep counter between even and odd, and is therefore a nearly zero-cost operation.

Parameters:

lattice (Lattice) – The lattice on which streaming will be performed