{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "***Info:*** OPAL compiled with `-DDBG_SCALARFIELD=ON` writes the charge density, electrostatic potential and electric field to files." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from opal import load_dataset, filetype\n", "from opal.visualization.styles import load_style\n", "\n", "load_style('jupyter')\n", "\n", "ds = load_dataset('FieldDataset', fname='test-phi_scalar-000000.dat')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "print (ds)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt = ds.plot_projection(field='phi', normal='z', method='max')\n", "plt.tight_layout()\n", "plt.show()\n", "plt.close()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt = ds.plot_slice(field='phi', normal='z')\n", "plt.tight_layout()\n", "plt.show()\n", "plt.close()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt = ds.plot_line(field='phi', normal='z')\n", "plt.tight_layout()\n", "plt.show()\n", "plt.close()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt = ds.plot_line(field='phi', normal='y')\n", "plt.tight_layout()\n", "plt.show()\n", "plt.close()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.5.2" } }, "nbformat": 4, "nbformat_minor": 2 }