{ "cells": [ { "cell_type": "markdown", "id": "title", "metadata": {}, "source": [ "# Helmholtz 3D convergence study\n", "\n", "This notebook runs a compact q-order sweep for the 3D Helmholtz volume potential using a Laplace near-field table plus online Helmholtz-Laplace smooth correction, and reports a manufactured-source PDE residual on an interior calculus patch." ] }, { "cell_type": "code", "execution_count": null, "id": "imports", "metadata": {}, "outputs": [], "source": [ "import pathlib\n", "import sys\n", "\n", "cwd = pathlib.Path.cwd()\n", "if (cwd / \"volumential\").exists():\n", " repo_root = cwd\n", "elif (cwd.parent / \"volumential\").exists():\n", " repo_root = cwd.parent\n", "else:\n", " repo_root = cwd\n", "\n", "sys.path.insert(0, str(repo_root))\n", "sys.path.insert(0, str((repo_root / \"examples\").resolve()))\n", "\n", "from helmholtz3d import run_convergence_study" ] }, { "cell_type": "code", "execution_count": null, "id": "run-study", "metadata": {}, "outputs": [], "source": [ "results = run_convergence_study(smoke_mode=True)\n", "results" ] }, { "cell_type": "code", "execution_count": null, "id": "plot-results", "metadata": {}, "outputs": [], "source": [ "try:\n", " import matplotlib.pyplot as plt\n", "except ImportError:\n", " plt = None\n", "\n", "if plt is not None:\n", " q_orders = [entry[\"q_order\"] for entry in results]\n", " rel_pde_residual = [entry[\"rel_pde_residual\"] for entry in results]\n", "\n", " plt.figure(figsize=(5, 3))\n", " plt.semilogy(q_orders, rel_pde_residual, marker=\"o\")\n", " plt.xlabel(\"Quadrature order\")\n", " plt.ylabel(\"rel PDE residual\")\n", " plt.title(\"Helmholtz3D convergence (smoke)\")\n", " plt.grid(True, which=\"both\", linestyle=\":\")\n", " plt.show()\n", "else:\n", " print(\"matplotlib not available; skipping plot\")" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "name": "python", "version": "3" } }, "nbformat": 4, "nbformat_minor": 5 }