Skip to content

Add visual example for Poisson bracket #38

@anjor

Description

@anjor

Background

The Poisson bracket tests verify correctness numerically, but visual examples help understand:

  • Physical interpretation of {f,g} as advection operator
  • Effect of dealiasing on high-k modes
  • Differences between analytical and random fields

Tasks

  • Create examples/poisson_bracket_demo.py script
  • Visualize 2D example: f=sin(x), g=cos(y), {f,g}=-cos(x)sin(y)
    • Plot f, g, and {f,g} as 2D heatmaps
    • Show quiver plot of ∇f and ∇g
    • Annotate with cross product interpretation
  • Show effect of dealiasing:
    • Compute bracket with and without dealiasing
    • Plot difference and high-k mode content
  • Compare smooth vs random fields:
    • Show why random fields have larger numerical errors
    • Visualize spectral content (1D energy spectra)
  • Add to documentation as tutorial

Visual Output

examples/
├── poisson_bracket_demo.py
└── figures/
    ├── analytical_bracket.png       # sin/cos example
    ├── dealiasing_effect.png        # with/without comparison
    └── random_field_spectra.png     # spectral content

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions