Added DEPRECATED marking to the old forcing function.

I do not want to remove it yet. Not until something like that exists in the DSL code.
This commit is contained in:
Miikka Vaisala
2019-06-19 13:46:03 +08:00
parent b5753f0bec
commit 40b4a61a4c
3 changed files with 37 additions and 7 deletions

View File

@@ -7,7 +7,8 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"import astar.data as ad\n", "import astar.data as ad\n",
"import astar.visual as vis" "import astar.visual as vis\n",
"import numpy as np"
] ]
}, },
{ {
@@ -23,7 +24,7 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"meshdir = \"/scratch/data/mvaisala/iotest/\"" "meshdir = \"/scratch/data/mvaisala/forcingtest/\""
] ]
}, },
{ {
@@ -32,10 +33,26 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"imesh = 0\n", "imesh = 10000\n",
"mesh = ad.read.Mesh(imesh, fdir=meshdir)" "mesh = ad.read.Mesh(imesh, fdir=meshdir)"
] ]
}, },
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Auxuliary variables"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"uu_tot = np.sqrt(mesh.uu[0]**2.0 + mesh.uu[1]**2.0 + mesh.uu[2]**2.0)"
]
},
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
@@ -51,7 +68,11 @@
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"vis.slices.plot_3(mesh, mesh.uu[0], title = r'$u_x$', bitmap = False, fname = 'uux')" "vis.slices.plot_3(mesh, uu_tot, title = r'$\\|u\\|$')\n",
"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$')"
] ]
}, },
{ {
@@ -86,6 +107,13 @@
"outputs": [], "outputs": [],
"source": [] "source": []
}, },
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,

View File

@@ -45,7 +45,7 @@ print("sys.argv", sys.argv)
#meshdir = "/tiara/home/mvaisala/astaroth-code/astaroth_2.0/build/" #meshdir = "/tiara/home/mvaisala/astaroth-code/astaroth_2.0/build/"
#meshdir = "/tiara/ara/data/mvaisala/tmp/astaroth-code/astaroth_2.0/build/" #meshdir = "/tiara/ara/data/mvaisala/tmp/astaroth-code/astaroth_2.0/build/"
#meshdir = "/tiara/ara/data/mvaisala/asth_testbed_double/" #meshdir = "/tiara/ara/data/mvaisala/asth_testbed_double/"
meshdir = "/scratch/data/mvaisala/iotest/" meshdir = "/scratch/data/mvaisala/forcingtest/"
if "xtopbound" in sys.argv: if "xtopbound" in sys.argv:
for i in range(0, 171): for i in range(0, 171):
@@ -169,7 +169,7 @@ if '1d' in sys.argv:
if 'sl' in sys.argv: if 'sl' in sys.argv:
#maxfiles = 200002 #maxfiles = 200002
#stride = 10000 #stride = 10000
maxfiles = 1001 maxfiles = 5001
stride = 100 stride = 100
for i in range(0, maxfiles, stride): for i in range(0, maxfiles, stride):
mesh = ad.read.Mesh(i, fdir=meshdir) mesh = ad.read.Mesh(i, fdir=meshdir)

View File

@@ -545,10 +545,12 @@ normalized(const AcReal3& vec)
// Sinusoidal forcing // Sinusoidal forcing
// https://arxiv.org/pdf/1704.04676.pdf // https://arxiv.org/pdf/1704.04676.pdf
// NOTE: This method of forcing is depracated. However, it will remain in here
// until a corresponding scheme exists in the new code.
__constant__ AcReal3 forcing_vec; __constant__ AcReal3 forcing_vec;
__constant__ AcReal forcing_phi; __constant__ AcReal forcing_phi;
static __device__ __forceinline__ AcReal3 static __device__ __forceinline__ AcReal3
forcing(const int i, const int j, const int k) DEPRECATED_forcing(const int i, const int j, const int k)
{ {
#define DOMAIN_SIZE_X (DCONST_INT(AC_nx) * DCONST_REAL(AC_dsx)) #define DOMAIN_SIZE_X (DCONST_INT(AC_nx) * DCONST_REAL(AC_dsx))
#define DOMAIN_SIZE_Y (DCONST_INT(AC_ny) * DCONST_REAL(AC_dsy)) #define DOMAIN_SIZE_Y (DCONST_INT(AC_ny) * DCONST_REAL(AC_dsy))