|
12 | 12 | "from plotly.subplots import make_subplots\n", |
13 | 13 | "import meshio, numpy, copy\n", |
14 | 14 | "import meshplot as mp\n", |
15 | | - "import sys\n", |
16 | | - "import pathlib\n", |
17 | | - "sys.path.append(str(pathlib.Path(\"/home/zizhou/smooth-ipc/build\") / \"debug\" / \"python\")) # noqa\n", |
| 15 | + "# import sys\n", |
| 16 | + "# import pathlib\n", |
| 17 | + "# sys.path.append(str(pathlib.Path(\"/home/zizhou/smooth-ipc/build\") / \"debug\" / \"python\")) # noqa\n", |
18 | 18 | "\n", |
19 | 19 | "from ipctk import *" |
20 | 20 | ] |
|
25 | 25 | "metadata": {}, |
26 | 26 | "outputs": [], |
27 | 27 | "source": [ |
28 | | - "V = np.array([[0.5,0],[1.0,0],[1.5,0],[0.9,0.3],[1.01,0.1],[1.1,0.3],[1,-0.5]])\n", |
29 | | - "E = np.array([[1,0],[2,1],[3,4],[4,5],[5,3],[0,6],[6,2]], dtype=int)\n", |
| 28 | + "V = np.array([[0.5,0],[1.0,0],[1.4,0],[0.5,1],[1.01,0.1],[1.5,1],[1,-0.5]])\n", |
| 29 | + "# E = np.array([[1,0],[2,1],[3,4],[4,5],[5,3],[0,6],[6,2]], dtype=int)\n", |
| 30 | + "E = np.array([[1,0],[2,1],[0,6],[6,2]], dtype=int)\n", |
30 | 31 | "F = np.array([])\n", |
31 | 32 | "\n", |
32 | 33 | "dhat=0.11\n", |
|
1985 | 1986 | "fig.show()" |
1986 | 1987 | ] |
1987 | 1988 | }, |
| 1989 | + { |
| 1990 | + "cell_type": "code", |
| 1991 | + "execution_count": null, |
| 1992 | + "metadata": {}, |
| 1993 | + "outputs": [], |
| 1994 | + "source": [ |
| 1995 | + "xs = numpy.linspace(0.3, 1.5, 100)\n", |
| 1996 | + "ys = numpy.linspace(1e-2, 4e-2, 40)\n", |
| 1997 | + "dtypes = numpy.empty((ys.size, xs.size), dtype=float)\n", |
| 1998 | + "for i, x in enumerate(xs):\n", |
| 1999 | + " for j, y in enumerate(ys):\n", |
| 2000 | + " V_disp = copy.deepcopy(V)\n", |
| 2001 | + " V_disp[4, :] = [x, y]\n", |
| 2002 | + " dtypes[j, i] = potential_single_point(V_disp)" |
| 2003 | + ] |
| 2004 | + }, |
| 2005 | + { |
| 2006 | + "cell_type": "code", |
| 2007 | + "execution_count": null, |
| 2008 | + "metadata": {}, |
| 2009 | + "outputs": [], |
| 2010 | + "source": [ |
| 2011 | + "fig = go.Figure(data=[\n", |
| 2012 | + " go.Contour(z=dtypes, x=xs, y=ys)\n", |
| 2013 | + "], layout=go.Layout(width=1000, height=500))\n", |
| 2014 | + "fig.show()" |
| 2015 | + ] |
| 2016 | + }, |
1988 | 2017 | { |
1989 | 2018 | "cell_type": "code", |
1990 | 2019 | "execution_count": null, |
|
0 commit comments