Skip to content
This repository was archived by the owner on Oct 22, 2025. It is now read-only.

Commit a0090dd

Browse files
committed
contour of potential
1 parent a6b0ff9 commit a0090dd

File tree

2 files changed

+41
-219034
lines changed

2 files changed

+41
-219034
lines changed

python/new-formulation-high-order.ipynb

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
"from plotly.subplots import make_subplots\n",
1313
"import meshio, numpy, copy\n",
1414
"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",
1818
"\n",
1919
"from ipctk import *"
2020
]
@@ -25,8 +25,9 @@
2525
"metadata": {},
2626
"outputs": [],
2727
"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",
3031
"F = np.array([])\n",
3132
"\n",
3233
"dhat=0.11\n",
@@ -1985,6 +1986,34 @@
19851986
"fig.show()"
19861987
]
19871988
},
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+
},
19882017
{
19892018
"cell_type": "code",
19902019
"execution_count": null,

0 commit comments

Comments
 (0)