Prefabs#

The SweepGen Prefab library (sweepgen.prefabs) hosts a collection of generators for pre-fabricated sweeps and sweep groups. They encapsulate reusable algorithmic patterns which have been found to often occur across a range of applications and scenarios.

Lattice Boltzmann Prefabs#

class sweepgen.prefabs.lbm_bulk.LbmBulk(sfg, name, lbm_config=None, lbm_optimisation=None, gen_config=None)#

Generate a sweep group for lattice Boltzmann bulk dynamics.

Generate a sweep group for a given lattice Boltzmann method definition, including:

  • A PDF initialization sweep

  • A stream/collide sweep

Example:

lb_config = LBMConfig(
    stencil=Stencil.D3Q19,
    method=Method.CENTRAL_MOMENT,
    relaxation_rate=sp.Symbol("omega")
)
lb_bulk = LbmBulk(sfg, "MyLBM", lb_config)
sfg.generate(lb_bulk)
Parameters:
  • sfg (SfgIComposer | SfgContext) – An SFG composer or context that holds a waLBerla build configuration

  • name (str) – Name of the sweep group

  • lbm_config (LBMConfig | None) – lbmpy method configuration defining the lattice Boltzmann method

  • lbm_optimisation (LBMOptimisation | None) – Optimization settings for lbmpy

  • gen_config (CreateKernelConfig | None) – pystencils code generator configuration

property pdfs: Field#

The symbolic PDF field

property rho: Field#

The symbolic density field

property u: Field#

The symbolic velocity field

property update_rule: LbmCollisionRule#

The symbolic LB update rule

property lb_method: AbstractLbMethod#

The LB method object