Skip to content

tomoleary/alphaflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alphaflow

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.

Gallery

Flow

ALPHAFLOW flow

Elasticity

ALPHAFLOW elasticity

Helmholtz

ALPHAFLOW Helmholtz

Usage

Use an existing Python environment that already has a working FEniCSx stack. The active environment should provide:

  • dolfinx
  • mpi4py
  • petsc4py
  • gmsh

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.py
  • ALPHAFLOW_GMSH_SITEPACKAGES=/path/to/site-packages

Quick Start

Build a mesh:

python scripts/build_word_mesh.py ALPHAFLOW --output-dir outputs

Render flow:

python scripts/render_flow_logo.py ALPHAFLOW --output-dir outputs

Render elasticity:

python scripts/render_elasticity_logo.py ALPHAFLOW --output-dir outputs

Render Helmholtz:

python scripts/render_helmholtz_logo.py ALPHAFLOW --output-dir outputs --obstacle-bc sound-soft

You 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-soft

README Examples

These 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-blue

Elasticity:

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.2

Helmholtz:

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.032

Main Scripts

  • scripts/build_word_mesh.py: build and preview a cutout mesh
  • scripts/render_flow_logo.py: solve the steady flow example and render streamlines
  • scripts/render_elasticity_logo.py: solve the linear elasticity example and render bending
  • scripts/render_helmholtz_logo.py: solve the Helmholtz example and render the acoustic field

Geometry And BCs

The mesh uses these physical groups:

  • fluid: 2D cells of the domain
  • inlet: left boundary
  • outlet: right boundary
  • walls: top and bottom boundaries
  • obstacle: 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, or impedance letter BCs

Most Useful Options

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

Render Defaults

  • 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, and light-blue

Notes

  • This repo uses Gmsh-based meshing, not meshr.
  • Generated files go to outputs/ by default, and outputs/ 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 4 to reduce low-order pollution effects.

About

Repository for rendering flow over letters.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages