From 59043e586bec5efce330faee154d484e8e953039 Mon Sep 17 00:00:00 2001 From: Miikka Vaisala Date: Mon, 24 Jun 2019 18:03:24 +0800 Subject: [PATCH] Added a missing switch to stencil_assembly.sas. --- acc/mhd_solver/stencil_assembly.sas | 7 ++++++ acc/mhd_solver/stencil_process.sps | 2 +- .../python/jupyter/notebook_example.ipynb | 24 ++++++------------- analysis/python/samples/readtest.py | 18 +++++++------- 4 files changed, 24 insertions(+), 27 deletions(-) diff --git a/acc/mhd_solver/stencil_assembly.sas b/acc/mhd_solver/stencil_assembly.sas index 380bf93..784692d 100644 --- a/acc/mhd_solver/stencil_assembly.sas +++ b/acc/mhd_solver/stencil_assembly.sas @@ -1,4 +1,7 @@ +#define LUPWD (0) + + Preprocessed Scalar value(in Scalar vertex) { @@ -13,6 +16,8 @@ gradient(in Scalar vertex) derz(vertexIdx, vertex)}; } +#if LUPWD + Preprocessed Scalar der6x_upwd(in Scalar vertex) { @@ -49,6 +54,8 @@ der6z_upwd(in Scalar vertex) + vertex[vertexIdx.x, vertexIdx.y, vertexIdx.z+3] + vertex[vertexIdx.x, vertexIdx.y, vertexIdx.z-3])}; } +#endif + Preprocessed Matrix hessian(in Scalar vertex) { diff --git a/acc/mhd_solver/stencil_process.sps b/acc/mhd_solver/stencil_process.sps index 2f9ef2b..6aa91bd 100644 --- a/acc/mhd_solver/stencil_process.sps +++ b/acc/mhd_solver/stencil_process.sps @@ -3,7 +3,7 @@ #define LTEMPERATURE (0) #define LGRAVITY (0) #define LFORCING (1) -#define LUPWD (1) +#define LUPWD (0) // Declare uniforms (i.e. device constants) diff --git a/analysis/python/jupyter/notebook_example.ipynb b/analysis/python/jupyter/notebook_example.ipynb index feb0a05..3496bbb 100644 --- a/analysis/python/jupyter/notebook_example.ipynb +++ b/analysis/python/jupyter/notebook_example.ipynb @@ -33,7 +33,8 @@ "metadata": {}, "outputs": [], "source": [ - "imesh = 10000\n", + "#imesh = 16000\n", + "imesh = 30000\n", "mesh = ad.read.Mesh(imesh, fdir=meshdir)" ] }, @@ -72,7 +73,10 @@ "vis.slices.plot_3(mesh, mesh.uu[0], title = r'$u_x$')\n", "vis.slices.plot_3(mesh, mesh.uu[1], title = r'$u_y$')\n", "vis.slices.plot_3(mesh, mesh.uu[2], title = r'$u_z$')\n", - "vis.slices.plot_3(mesh, mesh.lnrho, title = r'$\\ln_\\rho$')" + "vis.slices.plot_3(mesh, mesh.lnrho, title = r'$\\ln_\\rho$')\n", + "vis.slices.plot_3(mesh, np.exp(mesh.lnrho), title = r'$\\rho$')\n", + "vis.slices.plot_3(mesh, np.exp(mesh.lnrho), title = r'$N_\\mathrm{col}$', slicetype = 'sum')\n", + "#vis.slices.plot_3(mesh, mesh.entropy, title = r'$s$')\n" ] }, { @@ -97,23 +101,9 @@ "metadata": {}, "outputs": [], "source": [ - "vis.lineplot.plot_ts(ts, lnrho=1, uutot=1, uux=1, ss=1)" + "vis.lineplot.plot_ts(ts, lnrho=1, uutot=1, uux=1, uuy=1, ss=1)" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, { "cell_type": "code", "execution_count": null, diff --git a/analysis/python/samples/readtest.py b/analysis/python/samples/readtest.py index a2263c7..b2e4458 100644 --- a/analysis/python/samples/readtest.py +++ b/analysis/python/samples/readtest.py @@ -169,8 +169,8 @@ if '1d' in sys.argv: if 'sl' in sys.argv: #maxfiles = 200002 #stride = 10000 - maxfiles = 5001 - stride = 100 + maxfiles = 50001 + stride = 500 for i in range(0, maxfiles, stride): mesh = ad.read.Mesh(i, fdir=meshdir) print(" %i / %i" % (i, maxfiles)) @@ -178,13 +178,13 @@ if 'sl' in sys.argv: uu_tot = np.sqrt(mesh.uu[0]**2.0 + mesh.uu[1]**2.0 + mesh.uu[2]**2.0) if 'lim' in sys.argv: - vis.slices.plot_3(mesh, mesh.lnrho, title = r'$\ln \rho$', bitmap = True, fname = 'lnrho', colrange=[-0.02, 0.0]) - vis.slices.plot_3(mesh, np.exp(mesh.lnrho), title = r'$\rho$', bitmap = True, fname = 'rho', colrange=[0.97, 1.0]) - vis.slices.plot_3(mesh, mesh.uu[0], title = r'$u_x$', bitmap = True, fname = 'uux', colrange=[-0.002, 0.002]) - vis.slices.plot_3(mesh, mesh.uu[1], title = r'$u_y$', bitmap = True, fname = 'uuy', colrange=[-1.0e-20, 1.0e-20]) - vis.slices.plot_3(mesh, mesh.uu[2], title = r'$u_z$', bitmap = True, fname = 'uuz', colrange=[-0.002, 0.002]) - vis.slices.plot_3(mesh, np.exp(mesh.lnrho), title = r'$N_\mathrm{col}$', bitmap = True, fname = 'colden', slicetype = 'sum', colrange=[0.0, 100.0]) - vis.slices.plot_3(mesh, uu_tot, title = r'$|u|$', bitmap = True, fname = 'uutot', colrange=[0.00, 0.004]) + vis.slices.plot_3(mesh, mesh.lnrho, title = r'$\ln \rho$', bitmap = True, fname = 'lnrho', colrange=[0.7, 1.15]) + vis.slices.plot_3(mesh, np.exp(mesh.lnrho), title = r'$\rho$', bitmap = True, fname = 'rho', colrange=[2.0, 4.0]) + vis.slices.plot_3(mesh, mesh.uu[0], title = r'$u_x$', bitmap = True, fname = 'uux', colrange=[-1.00, 1.00]) + vis.slices.plot_3(mesh, mesh.uu[1], title = r'$u_y$', bitmap = True, fname = 'uuy', colrange=[-1.00, 1.00]) + vis.slices.plot_3(mesh, mesh.uu[2], title = r'$u_z$', bitmap = True, fname = 'uuz', colrange=[-1.00, 1.00]) + vis.slices.plot_3(mesh, np.exp(mesh.lnrho), title = r'$N_\mathrm{col}$', bitmap = True, fname = 'colden', slicetype = 'sum', colrange=[330.0, 395.0]) + vis.slices.plot_3(mesh, uu_tot, title = r'$|u|$', bitmap = True, fname = 'uutot', colrange=[0.00, 1.2]) else: vis.slices.plot_3(mesh, mesh.lnrho, title = r'$\ln \rho$', bitmap = True, fname = 'lnrho') vis.slices.plot_3(mesh, np.exp(mesh.lnrho), title = r'$\rho$', bitmap = True, fname = 'rho')