aboutsummaryrefslogtreecommitdiff
path: root/notebook
diff options
context:
space:
mode:
Diffstat (limited to 'notebook')
-rw-r--r--notebook/inspect_opencl_layout.ipynb612
-rw-r--r--notebook/lbm_codegen.ipynb828
-rw-r--r--notebook/lbm_codegen_d3q19.ipynb1160
3 files changed, 2600 insertions, 0 deletions
diff --git a/notebook/inspect_opencl_layout.ipynb b/notebook/inspect_opencl_layout.ipynb
new file mode 100644
index 0000000..521f93a
--- /dev/null
+++ b/notebook/inspect_opencl_layout.ipynb
@@ -0,0 +1,612 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Thread layouting in OpenCL\n",
+ "## Setup PyOpenCL"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import pyopencl as cl\n",
+ "import numpy"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "platform = cl.get_platforms()[0]\n",
+ "context = cl.Context(properties=[(cl.context_properties.PLATFORM, platform)])\n",
+ "queue = cl.CommandQueue(context)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "<pyopencl.Platform 'NVIDIA CUDA' at 0x28ef860>"
+ ]
+ },
+ "execution_count": 3,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "platform"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Initialize array for storing group and local IDs"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "nX = 16\n",
+ "nY = 16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "np_data = numpy.ndarray(shape=(nX*nY, 4), dtype=numpy.int32)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "np_data[:,:] = 0"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "array([[0, 0, 0, 0],\n",
+ " [0, 0, 0, 0],\n",
+ " [0, 0, 0, 0],\n",
+ " ...,\n",
+ " [0, 0, 0, 0],\n",
+ " [0, 0, 0, 0],\n",
+ " [0, 0, 0, 0]], dtype=int32)"
+ ]
+ },
+ "execution_count": 7,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "np_data"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "cl_data = cl.Buffer(context, cl.mem_flags.READ_WRITE | cl.mem_flags.USE_HOST_PTR, hostbuf=np_data)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "<pyopencl._cl.Buffer at 0x7efd2d9f2888>"
+ ]
+ },
+ "execution_count": 9,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "cl_data"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Define OpenCL kernel\n",
+ "\n",
+ "Simply writes out group and local indices to the given data array."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "program = cl.Program(context, \"\"\"\n",
+ "__kernel void test(__global int* data)\n",
+ "{\n",
+ " const unsigned int gid = 4*(get_global_id(1)*get_global_size(1) + get_global_id(0));\n",
+ " data[gid + 0] = get_group_id(0);\n",
+ " data[gid + 1] = get_group_id(1);\n",
+ " data[gid + 2] = get_local_id(0);\n",
+ " data[gid + 3] = get_local_id(1);\n",
+ "}\"\"\").build()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Test output for a 1x1 work group size:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "array([[ 0, 0, 0, 0],\n",
+ " [ 1, 0, 0, 0],\n",
+ " [ 2, 0, 0, 0],\n",
+ " ...,\n",
+ " [13, 15, 0, 0],\n",
+ " [14, 15, 0, 0],\n",
+ " [15, 15, 0, 0]], dtype=int32)"
+ ]
+ },
+ "execution_count": 11,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "program.test(queue, (nX,nY), (1,1), cl_data)\n",
+ "queue.finish()\n",
+ "cl.enqueue_copy(queue, np_data, cl_data).wait();\n",
+ "np_data"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Test various work group sizes"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "def computeWorkgroup(i, j):\n",
+ " program.test(queue, (nX,nY), (i,j), cl_data)\n",
+ " queue.finish()\n",
+ " cl.enqueue_copy(queue, np_data, cl_data).wait();"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "array([[0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n",
+ " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n",
+ " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n",
+ " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n",
+ " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n",
+ " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n",
+ " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n",
+ " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n",
+ " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n",
+ " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n",
+ " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n",
+ " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n",
+ " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n",
+ " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n",
+ " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3],\n",
+ " [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3]], dtype=int32)"
+ ]
+ },
+ "execution_count": 13,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "computeWorkgroup(4,4)\n",
+ "np_data.reshape((nX, nY, 4))[:,:,0] # x-index of work group"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
+ " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n",
+ " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n",
+ " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n",
+ " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n",
+ " [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],\n",
+ " [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],\n",
+ " [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],\n",
+ " [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],\n",
+ " [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3],\n",
+ " [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3],\n",
+ " [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3],\n",
+ " [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]], dtype=int32)"
+ ]
+ },
+ "execution_count": 14,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "np_data.reshape((nX, nY, 4))[:,:,1] # y-index of work group"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "computeWorkgroup(8,2)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "array([[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1]], dtype=int32)"
+ ]
+ },
+ "execution_count": 16,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "np_data.reshape((nX, nY, 4))[:,:,0]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
+ " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n",
+ " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n",
+ " [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],\n",
+ " [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],\n",
+ " [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3],\n",
+ " [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3],\n",
+ " [4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4],\n",
+ " [4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4],\n",
+ " [5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5],\n",
+ " [5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5],\n",
+ " [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6],\n",
+ " [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6],\n",
+ " [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7],\n",
+ " [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7]], dtype=int32)"
+ ]
+ },
+ "execution_count": 17,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "np_data.reshape((nX, nY, 4))[:,:,1]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "array([[0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n",
+ " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n",
+ " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n",
+ " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n",
+ " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n",
+ " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n",
+ " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n",
+ " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n",
+ " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n",
+ " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n",
+ " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n",
+ " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n",
+ " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n",
+ " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n",
+ " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7],\n",
+ " [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7]], dtype=int32)"
+ ]
+ },
+ "execution_count": 18,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "np_data.reshape((nX, nY, 4))[:,:,2]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
+ " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
+ " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
+ " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
+ " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
+ " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
+ " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
+ " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n",
+ " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
+ " [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]], dtype=int32)"
+ ]
+ },
+ "execution_count": 19,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "np_data.reshape((nX, nY, 4))[:,:,3]"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Generate some visuals"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import matplotlib.pyplot as plt"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "def plotWorkgroupConfig(i,j):\n",
+ " computeWorkgroup(i,j)\n",
+ " data = np_data.reshape((nX, nY, 4))\n",
+ " for k in range(0,4):\n",
+ " plt.subplot(1,4,k+1)\n",
+ " plt.imshow(np_data.reshape((nX, nY, 4))[:,:,k])"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAABrCAYAAABnlHmpAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAACAxJREFUeJzt3U1oXNcZxvHn1YwlTZPKkj+jJnGahbNI7EKKiAktbSAtuN04m5Y4Gy0MLoFsuigVdBG6ateF0tYLY0NJQmkLcamhTQRNCi3GLoU2KSRWHCdWrVpRrUBiog9bbxeaiPlSR5q59545Z/4/CHfOyVHum0fXrw73zljm7gIAxG8gdAEAgGzQ0AEgETR0AEgEDR0AEkFDB4BE0NABIBE0dABIBA0dABLRVUM3s6Nm9paZzZjZVFZFYR355ods80O24VinnxQ1s5KktyV9XdKspIuSjrv7vzb7mkEb8mHdVf/f2VGuX1RuGEtaK9f/3PGyNa8pqWFN8/m9cU2pxf97i7lyea1uPDhwu2nNcKl+rjKw0rSmYqsN4+afp3/7x/KCu+/dbr6tskW9j7TYUbYS+bazpFta8WUj23x8eu22W9ei7W3ZY5Jm3P2KJJnZS5KOSdr0Gzesu3TEnqwvYM/+uvHavrGmr1vZU//NXtrdXPbSWH1zXB5rbvoro/XNenX0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ASAQNHQASQUMHgETQ0AEgETR0AEgEDR0AEkFDB4BE0NABIBH/A/6TJLQTZrhjAAAAAElFTkSuQmCC\n",
+ "text/plain": [
+ "<Figure size 432x288 with 4 Axes>"
+ ]
+ },
+ "metadata": {
+ "needs_background": "light"
+ },
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "plotWorkgroupConfig(1,1)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAABrCAYAAABnlHmpAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAB6NJREFUeJzt3U+IXeUZx/Hf00mMSWhL4vhn6p9WJIKiRcqQ4kYEkcRuRiiVRApZBETBTVcOdOHGRVYuBBFDCclGpbhJoAGxgdZFKWRKS0gLJqOJmakxcUz8A5V0Rh4Xcw03Jzfek3POe859n/v9QLj3nNx5z8NvXh4O58y5r7m7AAD5+0HXBQAAmkFDB4AgaOgAEAQNHQCCoKEDQBA0dAAIgoYOAEHQ0AEgiFoN3cy2m9n7ZjZvZrNNFYVV5JsO2aZDtt2xqk+KmtmEpBOSHpe0KOmopJ3u/p9r/cwNts5v1MZKx+u3Mll/DEmyTSuNjCNJ962/2Mg4/zh2acndb77efJvKNrKvdLFSttLgfIvzcNB8Ks6LE8c2XPWZVOMMGmvQPC2OVWWc0wvLWrrwjXXZFyL7bu4O+9yaGsfYKmne3T+UJDN7S9KMpGv+4m7URv3SHqtxyFVLv3649hiStPbJTxsZR5L+/tDbjYwzMTX/Ue/tdeXbVLaR/dnfrpStNDjf4jwcNJ+K82LbTx666jOpxhk01qB5Whyryjhbty1cfquO+kJkfXP3e9W55HK7pIW+7cXeviuY2TNmNmdmc8u6VONw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sZS2+8dtsV2xNT80vu/pnIt7Z7Zmeu2D76xB6ybUhx3m7dtqDTC8tk2zGeFAWAIGjoABAE37YYBDeWhit7YwntYgm6MliCDgDGCg0dAIKgoQNAEFxDB9ApViwqgRWLAGC80NABIAgaOgAEQUMHgCC4KQqgU6xYVELiFYsAACOGhg4AQdDQASAIrqED6BRfLDdc2S+W4wwdAIKgoQNAEDR0AAiChg4AQZi7t3cws08lfaTV1deXWjtwc9qo+6fufvP1/hDZllIpWyn7fMk2rZHJt9WGfvmgZnPuPt36gWvKoe4cahwkl7pzqbNfLjXnUmfRKNXNJRcACIKGDgBBdNXQ93Z03LpyqDuHGgfJpe5c6uyXS8251Fk0MnV3cg0dANA8LrkAQBCtN3Qz225m75vZvJnNtn38Msxsn5mdN7Pjffs2m9m7Znay97qpyxoHySFbKc98yTatHPLNIdtWG7qZTUh6VdITku6XtNPM7m+zhpL2S9pe2Dcr6Yi7b5F0pLc9MjLKVsosX7JNK6N892vEs237DH2rpHl3/9Dd/y/pLUkzLdcwlLu/J+lCYfeMpAO99wckPdlqUcNlka2UZb5km1YW+eaQbdsN/XZJC33bi719ObjV3c9KUu/1lo7rKco5W2m08yXbtHLOd6Sybbuh24B9/JlNM8g2HbJNi3wb0nZDX5R0Z9/2HZI+brmGqs6Z2ZQk9V7Pd1xPUc7ZSqOdL9mmlXO+I5Vt2w39qKQtZna3md0gaYekQy3XUNUhSbt673dJOthhLYPknK002vmSbVo55zta2bp7q/8k/UrSCUkfSPp928cvWeObks5KWtbq2cNuSTdp9S72yd7r5q7rzDHbXPMlW/LNIVueFAWAIHhSFACCoKEDQBA0dAAIgoYOAEHQ0AEgCBo6AARBQweAIGjoABDEt1uHTloE0FJaAAAAAElFTkSuQmCC\n",
+ "text/plain": [
+ "<Figure size 432x288 with 4 Axes>"
+ ]
+ },
+ "metadata": {
+ "needs_background": "light"
+ },
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "plotWorkgroupConfig(4,4)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAABrCAYAAABnlHmpAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAB9JJREFUeJzt3c9rHPcdxvHn41WyqxgEkexEyo/WwTgEUUwowqWXEgjFbi/upSbOwSYYAoVeeqqhh177D5SCD8a+JKH0Eh8cRGpoc+hFKgkmLcRWEztS7dpR3ITg1K4kPj1oa3ZnR9Fqdma+8/36/QIzO+OR5uHx+sPszK5k7i4AQPx2hQ4AACgHAx0AEsFAB4BEMNABIBEMdABIBAMdABLBQAeARDDQASARIw10MztiZh+Z2ZKZnS4rFDbRb3Xotjp0G44V/aSombUkXZH0Q0krkhYkHXf3v2/1NY9a2zvaXeh4VXj+4NehIwz46+X7q+6+d6f9Nq3bJvpK/y7UrZTfr413+tbXx1sDX7fR7l/39uD/t057rW99cuzuwD5TrfW+9SuXHxvYJ5snL1M2T16mbJ68TNk815bXtHpnw1KYC030/+fudvuNjXCMQ5KW3P1jSTKztyQdlbTlP1xHu/U9e3mEQ5Zrfv6D0BEGtGaWrncf7qjfpnXbRH/0PxTqVsrvd9cLs33rX8xODHzdl/v7XwTf239/YJ/ZfTf61o9NLwzsc2JitW/98FMvDuyTzZOXKZsnL1M2T16mbJ5Dh5cfPFTkc6GJep6732iUSy5PS1ruWV/pbutjZq+b2aKZLa5p8MmMLW3bL90WxnO3OnQb0CgD3XK2DbyedPcz7j7n7nOPKOf1Hraybb90WxjP3erQbUCjDPQVSc/2rD8jafC1Goqi3+rQbXXoNqBRrqEvSDpgZs9J+qekVyS9WkoqSPRbJbqtzo67tfFO7vV/9Hh/uN0KD3R3Xzezn0ual9SSdNbd/1b0+6Ef/VaHb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CgA0AiGOgAkAiuoQMIaqq1rhMTq6FjNNprQ+7HGToAJIKBDgCJYKADQCIY6ACQCHP3+g5m9pk2f3DYHkkx3gWpI/e33X3vTr+IbodSqFsp+n7ptlqN6bfWgf7goGaL7j5X+4FHFEPuGDLmiSV3LDl7xZI5lpxZTcrNJRcASAQDHQASEWqgnwl03FHFkDuGjHliyR1Lzl6xZI4lZ1Zjcge5hg4AKB+XXAAgEbUPdDM7YmYfmdmSmZ2u+/jDMLOzZnbbzD7s2TZpZu+a2dXu8vGQGfPE0K0UZ790W60Y+o2h21oHupm1JP1W0o8kzUo6bmazdWYY0jlJRzLbTku65O4HJF3qrjdGRN1KkfVLt9WKqN9zani3dZ+hH5K05O4fu/t/Jb0l6WjNGbbl7u9JupPZfFTS+e7j85J+Umuo7UXRrRRlv3RbrSj6jaHbugf605KWe9ZXutti8KS735Sk7vKJwHmyYu5Wana/dFutmPttVLd1D3TL2cbbbMpBt9Wh22rRb0nqHugrkp7tWX9G0o2aMxR1y8xmJKm7vB04T1bM3UrN7pduqxVzv43qtu6BviDpgJk9Z2aPSnpF0oWaMxR1QdLJ7uOTkt4OmCVPzN1Kze6XbqsVc7/N6tbda/0j6ceSrkj6h6Rf1X38ITO+KemmpDVtnj2ckjSlzbvYV7vLydA5Y+w21n7pln5j6JZPigJAIvikKAAkgoEOAIlgoANAIhjoAJAIBjoAJIKBDgCJYKADQCIY6ACQiP8BpLw4oSzcg78AAAAASUVORK5CYII=\n",
+ "text/plain": [
+ "<Figure size 432x288 with 4 Axes>"
+ ]
+ },
+ "metadata": {
+ "needs_background": "light"
+ },
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "plotWorkgroupConfig(8,8)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAABrCAYAAABnlHmpAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgA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AEgEjR0AIiEuXtxBzN7X9IFLf709RBXwRRR9z3uvnGlH0S2PUmVrRR8vmSbr8rkW2hDXzqo2Wl3nyj8wH0Koe4QauwklLpDqbNZKDWHUmerKtXNLRcAiAQNHQAiUVZDP1jScfsVQt0h1NhJKHWHUmezUGoOpc5Wlam7lHvoAIDsccsFACJReEM3s11m9qaZTZrZgaKP3wszO2Rms2b2etPcOjN72czONbZjZdbYSQjZSmHmS7b5CiHfELIttKGbWU3STyR9WdK4pD1mNl5kDT06LGlXy9wBSSfdfbukk41xZQSUrRRYvmSbr4DyPayKZ1v0FfoOSZPu/pa7z0t6QdLugmvoyt1fk3S5ZXq3pCON10ckfbXQoroLIlspyHzJNl9B5BtCtkU39DskTTWNpxtzIdjs7hclqbHdVHI9rULOVqp2vmSbr5DzrVS2RTd06zDH22yyQbb5Idt8kW9Gim7o05LuahrfKWmm4BrSumRmWyWpsZ0tuZ5WIWcrVTtfss1XyPlWKtuiG/opSdvN7F4zG5L0pKRjBdeQ1jFJexuv90p6scRaOgk5W6na+ZJtvkLOt1rZunuhvyR9RdJZSX+X9L2ij99jjc9LuihpQYtXD/skrdfiU+xzje26susMMdtQ8yVb8g0hW1aKAkAkWCkKAJGgoQNAJGjoABAJGjoARIKGDgCRoKEDQCRo6AAQCRo6AETiv+qQRIYl3vsZAAAAAElFTkSuQmCC\n",
+ "text/plain": [
+ "<Figure size 432x288 with 4 Axes>"
+ ]
+ },
+ "metadata": {
+ "needs_background": "light"
+ },
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "plotWorkgroupConfig(16,2)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAABrCAYAAABnlHmpAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuM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3kzO1L38fMws2NmdsXM3ukY22Jmr5vZ+fZ2KmSNvcSQrRRnvmRbrRjyjSHbWhu6mTUk/UrS9yTNSDpgZjN11pDTcUn7usaOSDrj7rslnWnvD4yIspUiy5dsqxVRvsc14NnWvULfI2ne3S+4+7KkVyTtr7mGTO7+lqSrXcP7JZ1oPz4h6Qe1FpUtimylKPMl22pFkW8M2dbd0B+QtNCxv9gei8FOd78kSe3tjsD1dIs5W2mw8yXbasWc70BlW3dDtx5jvM2mHGRbHbKtFvmWpO6GvijpoY79ByXF8tthL5vZtCS1t1cC19Mt5mylwc6XbKsVc74DlW3dDX1O0m4ze8zMRiW9IOlkzTUUdVLSwfbjg5JeC1hLLzFnKw12vmRbrZjzHaxs3b3WP5K+L+mcpH9K+nndx89Z48uSLklqaXX1cEjSVq3exT7f3m4JXWeM2caaL9mSbwzZ8klRAEgEnxQFgETQ0AEgETR0AEgEDR0AEkFDB4BE0NABIBE0dABIBA0dABLxf0GZN9fdsbfGAAAAAElFTkSuQmCC\n",
+ "text/plain": [
+ "<Figure size 432x288 with 4 Axes>"
+ ]
+ },
+ "metadata": {
+ "needs_background": "light"
+ },
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "plotWorkgroupConfig(2,16)"
+ ]
+ },
+ {
+ "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.3"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/notebook/lbm_codegen.ipynb b/notebook/lbm_codegen.ipynb
new file mode 100644
index 0000000..e1593c0
--- /dev/null
+++ b/notebook/lbm_codegen.ipynb
@@ -0,0 +1,828 @@
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "from sympy import *\n",
+ "init_printing()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Characteristic constants"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "q = 9\n",
+ "d = 2"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "c = [Matrix(x) for x in [(-1, 1), ( 0, 1), ( 1, 1), (-1, 0), ( 0, 0), ( 1, 0), (-1,-1), ( 0, -1), ( 1, -1)]]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/latex": [
+ "$$\\left [ \\left[\\begin{matrix}-1\\\\1\\end{matrix}\\right], \\quad \\left[\\begin{matrix}0\\\\1\\end{matrix}\\right], \\quad \\left[\\begin{matrix}1\\\\1\\end{matrix}\\right], \\quad \\left[\\begin{matrix}-1\\\\0\\end{matrix}\\right], \\quad \\left[\\begin{matrix}0\\\\0\\end{matrix}\\right], \\quad \\left[\\begin{matrix}1\\\\0\\end{matrix}\\right], \\quad \\left[\\begin{matrix}-1\\\\-1\\end{matrix}\\right], \\quad \\left[\\begin{matrix}0\\\\-1\\end{matrix}\\right], \\quad \\left[\\begin{matrix}1\\\\-1\\end{matrix}\\right]\\right ]$$"
+ ],
+ "text/plain": [
+ "⎡⎡-1⎤ ⎡0⎤ ⎡1⎤ ⎡-1⎤ ⎡0⎤ ⎡1⎤ ⎡-1⎤ ⎡0 ⎤ ⎡1 ⎤⎤\n",
+ "⎢⎢ ⎥, ⎢ ⎥, ⎢ ⎥, ⎢ ⎥, ⎢ ⎥, ⎢ ⎥, ⎢ ⎥, ⎢ ⎥, ⎢ ⎥⎥\n",
+ "⎣⎣1 ⎦ ⎣1⎦ ⎣1⎦ ⎣0 ⎦ ⎣0⎦ ⎣0⎦ ⎣-1⎦ ⎣-1⎦ ⎣-1⎦⎦"
+ ]
+ },
+ "execution_count": 4,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "c"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "w = [Rational(*x) for x in [(1,36), (1,9), (1,36), (1,9), (4,9), (1,9), (1,36), (1,9), (1,36)]]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlMAAAAVCAYAAABi32uwAAAABHNCSVQICAgIfAhkiAAABzlJREFUeJztnWuoFVUUx3++wqKHWZEEkhZC4Y1I0jJMt0VShqFSXwIhpPoSFIhF9KBjlFlRaFpEVJr5IeghfQgrE063J0pZUWkvtRdpXtOyNM1HH9Ye7pxhzjkzc/acM/vM+sFh7t2zZ85ea/9n1r77dUFRFEVRFEVxggGOhj6bO1oaRVEURVGU4nAqte2ko8GJgTGZ3wUWAMsi6dcCS4H3gL/sTVYlLMDpwGHgiVDaw8A64GdgP/AHsBG4Dzilwb0uBV4FfgMO2OPbwPSEZWkHLn01AJgLfAzsBfYhfroVGOSuyE5waXdWfUDxNeL6WfJJI2Hm0P9CurFJXp/tLmt9a8xIjsaMdHa71Ack18g+pH20APix3s2MNaRS5/xn9vxeYBPpKvtmm39qKO0gUtnPA4sQh26w+X4FRsbc5x57fiewHFgIPGOveyRhWdqBS1+ttL/vAJ4FlgBf2bRXkAenKLi0O4s+wA+NuH6WfNJIwEhgD+KDJI0pn+0ua31rzEiOxox0drvSB2TXSJVQz1QYQ+PG1FRgDFIRQd6klb0G6KO2VTy0Tt4H7b2fiqRfZ9PXAifEXDckYVnagStfzbTXbkG6FwOGAKvtu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vEfjOTvscdtGb6rCGTx1Rxk/PgF4L88CtUGsmokqg/obo1k9VNRNHIAeK7OuXHABcD7wDfUDgH6bndW1O70aMxojuqjTTHD4LZnailS8LiJX+fQv4QzzED6N9j6IHJulU1/IJJ+BdK1uQf5CzjMCjq/SZmhNV+dGJM2Htkqfy+1KzQCVuC33Vn0AX5qxNCaPsBfjUDjCejdaLeh/fW9gs7XtUFjRlIMGjPicK0PyKaRgCoZe6Zm2g/0F3oiUgkg3W/zI/k/RMYto1yJdKH1Irsg70IcNAWp6O3ATZFr5gEXAXcjLdT1wJnIGOphmz+6b0YwJ+xQc/Oc4tJXa5Gu2S+RB2EsMpHwANJNGbefiO92Z9EH+KMRl/oAvzSShm6xu9P17fv7ADRmaMxwrw/IppGmGBr3TFVoPNdhWyjveJs2r869eoAnkRUGfUgF/omMXVaoXdIZZjjwOLAV6ZLbBbwOXFwn/0bknyeeXOd8XlRw56vbkR1r9yAPw1bgaWBUg+/33e6s+gA/NFLBnT7AL41EqRDfM9VNdlfobH37/j4AjRnbQnnLGDPy0gek10hAlVDPVBhD8mG+Ziy094rbOKxdDENalkX6Z5ZxuPZVWe3Ogg++ysNPandx0fdB5yirr3ywuwj6iFKlSWMq+Gxu4Us2IS3ETjID2RY+bhy1SLj2VVntzoIPvsrDT2p3cdH3Qecoq698sLsI+gBZDRjtPQNks6qAUdROPusDluVfNkVRFEVRlMJzHHBHJK3SgXIoiqIoiqIoiqIoiqIoiuV/+NxET1RKZ7IAAAAASUVORK5CYII=\n",
+ "text/latex": [
+ "$$\\left [ \\frac{1}{36}, \\quad \\frac{1}{9}, \\quad \\frac{1}{36}, \\quad \\frac{1}{9}, \\quad \\frac{4}{9}, \\quad \\frac{1}{9}, \\quad \\frac{1}{36}, \\quad \\frac{1}{9}, \\quad \\frac{1}{36}\\right ]$$"
+ ],
+ "text/plain": [
+ "[1/36, 1/9, 1/36, 1/9, 4/9, 1/9, 1/36, 1/9, 1/36]"
+ ]
+ },
+ "execution_count": 6,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "w"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAA0AAAASCAYAAACAa1QyAAAABHNCSVQICAgIfAhkiAAAAHZJREFUKJFjYKACCGFgYJjMwMBwmIGB4RMDA8N/BgaGJYQ0XYAq/MzAwHCdWE2ODAwMqgwMDIwMDAwOuDSxoPH3EzKVgYGBgYkYRaOaBlwTeuQGQDEDAwODBJS2ZGBgWABlv2FgYChBN6SBAZJ0cOEH5LiMzgAA6XoX52TB9a4AAAAASUVORK5CYII=\n",
+ "text/latex": [
+ "$$1$$"
+ ],
+ "text/plain": [
+ "1"
+ ]
+ },
+ "execution_count": 7,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "sum(w)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAADEAAAAdCAYAAAAD8oRRAAAABHNCSVQICAgIfAhkiAAAAi9JREFUWIXt1t2LTVEYx/GPGTTFNJkhk5SoKeRCopAkaoSkhD/BtXArLrwkF8pbjQvuKcqUuZIkbpTxFlFKTSF5yUthzMTF2jNzzmnvffY5Z585Ls63dmu113p+63n2evazFk3+D6ZUOL8d3xq4fi7swuZGLJwn5zC90U6U0lLB3NboGa6TL1VTSRBrcb9ejkwWJ9DVaCfiqGQnuvCpXo7UQtYgevAyYewkbmEIP/EZgzgs+87NxSjOVKObtU4fQD9exYwN4yGe4wNmYDVW4m3UHyqjvxd92IjbOeoW0Zcy1pbw/hj+4kIG/QF8FKpfxbqF6dSCo9hSYtQp/V/4lfD+StT2pNhCh7AD/UJKVaxbGEQv1mB3idFW3CzjSBzbo/ZJmXnbhAP0Wl66y4X8KwzuvGwF4CCO4DTuClv+GHPK2F3FD8npU5XuG6yL+tMUV4w03kcLjD0DQtVJow3fhUCq1o37wjewI+pvwJ0yjozRLVS7buzEIqEkrkix6cVMXM9Z1yYTpfRUtEg1LMBvPEuZczma05Gzrqn4giWylcc0BoUUmB0z1iqU1YFadePSaUSoRofwtIoFCpkXtaMxY+uFkzctlarRHWePEOn8MmKLhVwtpcXEoXQvwfZs5ETcz1+L7jjtsl279+GPcMe5KNx0L+F1tNA7LE2wHRJKZt66RczKMGeZcI48EvJ7BF/xQKjtnQl2qyJn9uesO6kcF4JY2GhHauGF8JWbNGlSB/4BwBaSc+fGZlwAAAAASUVORK5CYII=\n",
+ "text/latex": [
+ "$$\\frac{\\sqrt{3}}{3}$$"
+ ],
+ "text/plain": [
+ "√3\n",
+ "──\n",
+ "3 "
+ ]
+ },
+ "execution_count": 8,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "c_s = sqrt(Rational(1,3))\n",
+ "c_s"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Moments"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "rho, tau = symbols('rho tau')"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "array([f_next_0, f_next_1, f_next_2, f_next_3, f_next_4, f_next_5,\n",
+ " f_next_6, f_next_7, f_next_8], dtype=object)"
+ ]
+ },
+ "execution_count": 10,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "f_next = symarray('f_next', q)\n",
+ "f_next"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "array([f_curr_0, f_curr_1, f_curr_2, f_curr_3, f_curr_4, f_curr_5,\n",
+ " f_curr_6, f_curr_7, f_curr_8], dtype=object)"
+ ]
+ },
+ "execution_count": 11,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "f_curr = symarray('f_curr', q)\n",
+ "f_curr"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/latex": [
+ "$$\\left[\\begin{matrix}u_{0}\\\\u_{1}\\end{matrix}\\right]$$"
+ ],
+ "text/plain": [
+ "⎡u₀⎤\n",
+ "⎢ ⎥\n",
+ "⎣u₁⎦"
+ ]
+ },
+ "execution_count": 12,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+