| # 2D Poisson Equation Dataset | |
| Numerical solutions to the 2D Poisson equation with mixed boundary conditions using Dedalus spectral methods. | |
|  | |
| ## Equation | |
| The 2D Poisson equation boundary value problem: | |
| **PDE**: ∇²u = f(x,y) in Ω = [0, Lx] × [0, Ly] | |
| **Boundary Conditions**: | |
| - u(x,0) = g(x) (Dirichlet on bottom) | |
| - ∂u/∂y(x,Ly) = h(x) (Neumann on top) | |
| ## Variables | |
| The dataset returns a dictionary with the following fields: | |
| ### Coordinates | |
| - `spatial_coordinates`: (2, Nx, Ny) - Combined X,Y coordinate meshgrids | |
| ### Solution Fields | |
| - `solution_field`: (Nx, Ny) - Solution u(x,y) | |
| - `forcing_function`: (Nx, Ny) - Random forcing function f(x,y) | |
| ### Boundary Conditions | |
| - `boundary_condition_bottom`: (Nx,) - Bottom Dirichlet BC g(x) | |
| - `boundary_condition_top_gradient`: (Nx,) - Top Neumann BC h(x) | |
| ## Dataset Parameters | |
| - **Domain**: [0, 2π] × [0, π] (2D rectangular domain) | |
| - **Grid points**: 256 × 128 (Nx × Ny) | |
| - **Discretization**: Fourier(x) × Chebyshev(y) spectral methods | |
| - **Solver**: Dedalus LBVP (Linear Boundary Value Problem) | |
| ### Randomization | |
| - **Forcing function**: Generated using Gaussian processes with random length scales | |
| - **Boundary conditions**: Fixed sinusoidal bottom BC, zero top gradient BC | |
| - **Amplitude**: Random amplitude scaling for forcing functions (0.5 to 3.0) | |
| ## Physical Context | |
| This dataset simulates steady-state physical systems governed by the 2D Poisson equation. | |
| The equation models phenomena where the spatial distribution depends on source/sink terms, including: | |
| **Applications**: | |
| - Electrostatic potential in the presence of charge distributions | |
| - Steady-state heat conduction with internal heat sources | |
| - Fluid stream functions for incompressible flow | |
| - Gravitational potential from mass distributions | |
| ## Usage | |
| ```python | |
| from dataset import PoissonDataset | |
| # Create dataset | |
| dataset = PoissonDataset() | |
| # Generate a sample | |
| sample = next(iter(dataset)) | |
| # Access solution data | |
| spatial_coords = sample["spatial_coordinates"] # X, Y meshgrids | |
| solution = sample["solution_field"] # u(x,y) | |
| forcing = sample["forcing_function"] # f(x,y) | |
| ``` | |
| ## Visualization | |
| Run the plotting script to visualize samples: | |
| ```bash | |
| python plot_sample.py # 2D visualization of forcing, solution, and BCs | |
| ``` | |
| ## Data Generation | |
| Generate the full dataset: | |
| ```bash | |
| python generate_data.py | |
| ``` | |
| This creates train/test splits saved as chunked parquet files in the `data/` directory. |