diff --git a/analysis/python/astar/data/read.py b/analysis/python/astar/data/read.py index 17a7d05..79b4e52 100644 --- a/analysis/python/astar/data/read.py +++ b/analysis/python/astar/data/read.py @@ -96,9 +96,9 @@ class Mesh: aay = [] aaz = [] - self.xx = self.minfo.contents['AC_inv_dsx']*np.arange(self.minfo.contents['AC_mx']) - self.yy = self.minfo.contents['AC_inv_dsy']*np.arange(self.minfo.contents['AC_my']) - self.zz = self.minfo.contents['AC_inv_dsz']*np.arange(self.minfo.contents['AC_mz']) + self.xx = np.arange(self.minfo.contents['AC_mx']) * self.minfo.contents['AC_dsx'] + self.yy = np.arange(self.minfo.contents['AC_my']) * self.minfo.contents['AC_dsy'] + self.zz = np.arange(self.minfo.contents['AC_mz']) * self.minfo.contents['AC_dsz'] self.xmid = int(self.minfo.contents['AC_mx']/2) self.ymid = int(self.minfo.contents['AC_my']/2) diff --git a/analysis/python/jupyter/README.md b/analysis/python/jupyter/README.md new file mode 100644 index 0000000..e7e546c --- /dev/null +++ b/analysis/python/jupyter/README.md @@ -0,0 +1,11 @@ +# Setting up a remote jupyter session + +1. In remote machine write: `jupyter notebook --no-browser --port=8889` + +2. In the local machine write: `ssh -N -L localhost:8888:localhost:8889 username@remote.machine` + +3. Access jupyter seession with a browser: `http://localhost:8888` + +Now it should work. + +*PLEASE NOTE: Never commit `.ipyb` files without clearing them to the github repo.* diff --git a/analysis/python/jupyter/notebook_example.ipynb b/analysis/python/jupyter/notebook_example.ipynb new file mode 100644 index 0000000..d1ed7e9 --- /dev/null +++ b/analysis/python/jupyter/notebook_example.ipynb @@ -0,0 +1,78 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import astar.data as ad\n", + "import astar.visual as vis" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Here we read data from the run directory" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "imesh = 0\n", + "meshdir = \"/scratch/data/mvaisala/iotest/\"\n", + "mesh = ad.read.Mesh(imesh, fdir=meshdir)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Example visualization funtion call. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "scrolled": true + }, + "outputs": [], + "source": [ + "vis.slices.plot_3(mesh, mesh.uu[0], title = r'$u_x$', bitmap = False, fname = 'uux')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "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.7.2" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/src/standalone/simulation.cc b/src/standalone/simulation.cc index ce35e31..efa198a 100644 --- a/src/standalone/simulation.cc +++ b/src/standalone/simulation.cc @@ -90,6 +90,9 @@ void write_mesh_info(const AcMeshInfo* config) fprintf(infotxt, "int AC_nz_max %i \n", config->int_params[AC_nz_max]); // Spacing + fprintf(infotxt, "real AC_dsx %e \n", (double)config->real_params[AC_dsx]); + fprintf(infotxt, "real AC_dsy %e \n", (double)config->real_params[AC_dsy]); + fprintf(infotxt, "real AC_dsz %e \n", (double)config->real_params[AC_dsz]); fprintf(infotxt, "real AC_inv_dsx %e \n", (double)config->real_params[AC_inv_dsx]); fprintf(infotxt, "real AC_inv_dsy %e \n", (double)config->real_params[AC_inv_dsy]); fprintf(infotxt, "real AC_inv_dsz %e \n", (double)config->real_params[AC_inv_dsz]);