Computational art and PDE visualization on word-shaped cutout domains with FEniCSx, Gmsh, and PyVista.
Alphaflow builds meshes with letters removed as true interior voids, solves a selected PDE on the resulting domain, and renders the result as a high-resolution image. It is intended for expressive geometry-aware visualization, not as a validated solver package.
Use an existing Python environment that already has a working FEniCSx stack. The active environment should provide:
dolfinxmpi4pypetsc4pygmsh
Install Alphaflow into that environment:
python -m pip install -e .[meshing,dev]If gmsh.py is installed in a non-standard location, set one of:
ALPHAFLOW_GMSH_PY=/path/to/gmsh.pyALPHAFLOW_GMSH_SITEPACKAGES=/path/to/site-packages
Build a mesh:
python scripts/build_word_mesh.py ALPHAFLOW --output-dir outputsRender flow:
python scripts/render_flow_logo.py ALPHAFLOW --output-dir outputsRender elasticity:
python scripts/render_elasticity_logo.py ALPHAFLOW --output-dir outputsRender Helmholtz:
python scripts/render_helmholtz_logo.py ALPHAFLOW --output-dir outputs --obstacle-bc sound-softYou can also use the installed CLI:
alphaflow build-mesh ALPHAFLOW --output-dir outputs
alphaflow flow ALPHAFLOW --output-dir outputs
alphaflow elasticity ALPHAFLOW --output-dir outputs
alphaflow helmholtz ALPHAFLOW --output-dir outputs --obstacle-bc sound-softThese are the exact commands used to generate the versioned gallery images in docs/readme_assets/.
Flow:
python scripts/render_flow_logo.py ALPHAFLOW \
--output-dir outputs/readme_alphaflow_flow \
--width 20.0 \
--height 3.6 \
--mesh-size 0.18 \
--obstacle-mesh-size 0.08 \
--letter-spacing 0.04 \
--nu 0.08 \
--inflow-speed 0.7 \
--background light-blueElasticity:
python scripts/render_elasticity_logo.py ALPHAFLOW \
--output-dir outputs/readme_alphaflow_elasticity \
--width 20.0 \
--height 3.6 \
--mesh-size 0.18 \
--obstacle-mesh-size 0.08 \
--letter-spacing 0.04 \
--young-modulus 150.0 \
--traction-y -0.02 \
--warp-scale 3.2Helmholtz:
python scripts/render_helmholtz_logo.py ALPHAFLOW \
--output-dir outputs/readme_alphaflow_helmholtz \
--width 20.0 \
--height 3.6 \
--letter-spacing 0.04 \
--degree 4 \
--wavenumber 4.8 \
--obstacle-bc sound-soft \
--source-x-fraction 0.14 \
--source-y-fraction 0.68 \
--source-sigma-fraction 0.032scripts/build_word_mesh.py: build and preview a cutout meshscripts/render_flow_logo.py: solve the steady flow example and render streamlinesscripts/render_elasticity_logo.py: solve the linear elasticity example and render bendingscripts/render_helmholtz_logo.py: solve the Helmholtz example and render the acoustic field
The mesh uses these physical groups:
fluid: 2D cells of the domaininlet: left boundaryoutlet: right boundarywalls: top and bottom boundariesobstacle: letter boundaries
Current PDE setups:
- flow: parabolic inflow, no-slip walls and letters, zero-pressure outlet
- elasticity: clamped left edge, traction-loaded right edge
- Helmholtz: absorbing left/right boundaries, sound-hard top/bottom walls, selectable
sound-hard,sound-soft, orimpedanceletter BCs
Shared geometry options:
--width--height--mesh-size--obstacle-mesh-size--x-offset--letter-spacing
Flow:
--nu--inflow-speed--background
Elasticity:
--young-modulus--poisson-ratio--traction-y--warp-scale--show-undeformed
Helmholtz:
--degree--wavenumber--obstacle-bc--impedance--source-amplitude--source-x-fraction--source-y-fraction--source-sigma-fraction
- screenshots default to
3600 x 1440 - planar views are framed so the domain diagonal occupies about
90%of the image diagonal - flow streamlines are seeded directly on the inlet boundary
- flow backgrounds support
soft-gray,mist, andlight-blue
- This repo uses Gmsh-based meshing, not
meshr. - Generated files go to
outputs/by default, andoutputs/is gitignored. - Some XDMF writes may emit HDF5 warnings depending on the local FEniCSx / HDF5 build; current workflows still complete and write usable files.
- The Helmholtz path defaults to polynomial degree
4to reduce low-order pollution effects.


