fixed phiflow diffusion scaling; switched to main branch instead of develop

This commit is contained in:
NT 2021-12-28 15:53:32 +01:00
parent 24130d50be
commit b74ada9eb2
5 changed files with 14 additions and 15 deletions

View File

@ -28,14 +28,14 @@
"metadata": {},
"outputs": [],
"source": [
"#!pip install --upgrade --quiet phiflow\n",
"!pip install --upgrade --quiet git+https://github.com/tum-pbs/PhiFlow@develop \n",
"!pip install --upgrade --quiet phiflow\n",
"#!pip install --upgrade --quiet git+https://github.com/tum-pbs/PhiFlow@develop \n",
"from phi.tf.flow import *\n",
"\n",
"N = 128\n",
"STEPS = 32\n",
"DT = 1./STEPS\n",
"NU = 0.2/np.pi\n",
"NU = 0.01/(N*np.pi)\n",
"\n",
"# allocate velocity grid\n",
"velocity = CenteredGrid(0, extrapolation.PERIODIC, x=N, bounds=Box[-1:1])\n",
@ -402,7 +402,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Naturally, this is a tougher task: the optimization receives direct feedback what the state at $t=0.5$ should look like, but due to the non-linear model equation, we typically have a large number of solutions that exactly or numerically very closely satisfy the constraints. Hence, our minimizer does not necessarily find the exact state we started from. However, it's still quite close in this Burgers scenario.\n",
"Naturally, this is a tougher task: the optimization receives direct feedback what the state at $t=0.5$ should look like, but due to the non-linear model equation, we typically have a large number of solutions that exactly or numerically very closely satisfy the constraints. Hence, our minimizer does not necessarily find the exact state we started from (we can observe some numerical oscillations from the diffusion operator here with the default settings). However, the solution is still quite close in this Burgers scenario.\n",
"\n",
"Before measuring the overall error of the reconstruction, let's visualize the full evolution of our system over time as this also yields the solution in the form of a numpy array that we can compare to the other versions:"
]

View File

@ -78,8 +78,8 @@
"cell_type": "code",
"execution_count": 1,
"source": [
"#!pip install --upgrade --quiet phiflow\n",
"!pip install --upgrade --quiet git+https://github.com/tum-pbs/PhiFlow@develop\n",
"!pip install --upgrade --quiet phiflow\n",
"#!pip install --upgrade --quiet git+https://github.com/tum-pbs/PhiFlow@develop\n",
"\n",
"from phi.torch.flow import * \n",
"import pylab # for visualizations later on\n"
@ -665,4 +665,4 @@
},
"nbformat": 4,
"nbformat_minor": 1
}
}

View File

@ -179,9 +179,8 @@
}
],
"source": [
"#!pip install --upgrade --quiet phiflow\n",
"#!pip uninstall phiflow\n",
"!pip install --upgrade --quiet git+https://github.com/tum-pbs/PhiFlow@develop\n",
"!pip install --upgrade --quiet phiflow\n",
"#!pip install --upgrade --quiet git+https://github.com/tum-pbs/PhiFlow@develop\n",
"\n",
"from phi.tf.flow import *\n",
"import tensorflow as tf\n",

View File

@ -40,8 +40,8 @@
"cell_type": "code",
"execution_count": 1,
"source": [
"#!pip install --upgrade --quiet phiflow\n",
"!pip install --upgrade --quiet git+https://github.com/tum-pbs/PhiFlow@develop\n",
"!pip install --upgrade --quiet phiflow\n",
"#!pip install --upgrade --quiet git+https://github.com/tum-pbs/PhiFlow@develop\n",
"\n",
"from phi.flow import *\n",
"\n",
@ -80,7 +80,7 @@
"N = 128\n",
"STEPS = 32\n",
"DT = 1./STEPS\n",
"NU = 0.01/np.pi\n",
"NU = 0.01/(N*np.pi)\n",
"\n",
"# initialization of velocities\n",
"INITIAL_NUMPY = np.asarray( [-np.sin(np.pi * x) * 1. for x in np.linspace(-1,1,N)] ) # 1D numpy array\n",

View File

@ -37,8 +37,8 @@
"cell_type": "code",
"execution_count": 1,
"source": [
"#!pip install --upgrade --quiet phiflow \n",
"!pip install --upgrade --quiet git+https://github.com/tum-pbs/PhiFlow@develop\n",
"!pip install --upgrade --quiet phiflow \n",
"#!pip install --upgrade --quiet git+https://github.com/tum-pbs/PhiFlow@develop\n",
"\n",
"from phi.flow import * # The Dash GUI is not supported on Google colab, ignore the warning\n",
"import pylab"