Skip to content

Commit

Permalink
Major NRPy+ update: Make in_progress-GiRaFFE_NRPy/Tutorial-Start_to_F…
Browse files Browse the repository at this point in the history
…inish_UnitTest-GiRaFFEfood_NRPy-Curved_Spacetime_Tests.ipynb run again.
  • Loading branch information
zachetienne committed Dec 29, 2022
1 parent 519accb commit 4314d35
Showing 1 changed file with 58 additions and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@
"execution_count": 1,
"metadata": {
"execution": {
"iopub.execute_input": "2022-11-24T14:14:50.873748Z",
"iopub.status.busy": "2022-11-24T14:14:50.873595Z",
"iopub.status.idle": "2022-11-24T14:14:50.879196Z",
"shell.execute_reply": "2022-11-24T14:14:50.878869Z"
"iopub.execute_input": "2022-12-29T09:31:22.014101Z",
"iopub.status.busy": "2022-12-29T09:31:22.013489Z",
"iopub.status.idle": "2022-12-29T09:31:22.024283Z",
"shell.execute_reply": "2022-12-29T09:31:22.023355Z"
}
},
"outputs": [],
Expand All @@ -96,10 +96,10 @@
"execution_count": 2,
"metadata": {
"execution": {
"iopub.execute_input": "2022-11-24T14:14:50.881946Z",
"iopub.status.busy": "2022-11-24T14:14:50.881570Z",
"iopub.status.idle": "2022-11-24T14:14:51.313521Z",
"shell.execute_reply": "2022-11-24T14:14:51.313015Z"
"iopub.execute_input": "2022-12-29T09:31:22.027466Z",
"iopub.status.busy": "2022-12-29T09:31:22.027151Z",
"iopub.status.idle": "2022-12-29T09:31:22.542305Z",
"shell.execute_reply": "2022-12-29T09:31:22.541624Z"
}
},
"outputs": [],
Expand All @@ -109,9 +109,12 @@
"nrpy_dir_path = os.path.join(\"..\")\n",
"if nrpy_dir_path not in sys.path:\n",
" sys.path.append(nrpy_dir_path)\n",
"nrpy_dir_path = os.path.join(\"..\",\"..\")\n",
"nrpy_dir_path = os.path.join(\"..\", \"Deprecated\")\n",
"if nrpy_dir_path not in sys.path:\n",
" sys.path.append(nrpy_dir_path)\n",
"# nrpy_dir_path = os.path.join(\"..\",\"..\")\n",
"# if nrpy_dir_path not in sys.path:\n",
"# sys.path.append(nrpy_dir_path)\n",
"\n",
"from outputC import outCfunction, lhrh # NRPy+: Core C code output module\n",
"import sympy as sp # SymPy: The Python computer algebra package upon which NRPy+ depends\n",
Expand Down Expand Up @@ -159,10 +162,10 @@
"execution_count": 3,
"metadata": {
"execution": {
"iopub.execute_input": "2022-11-24T14:14:51.316059Z",
"iopub.status.busy": "2022-11-24T14:14:51.315951Z",
"iopub.status.idle": "2022-11-24T14:14:51.556518Z",
"shell.execute_reply": "2022-11-24T14:14:51.556031Z"
"iopub.execute_input": "2022-12-29T09:31:22.544826Z",
"iopub.status.busy": "2022-12-29T09:31:22.544650Z",
"iopub.status.idle": "2022-12-29T09:31:22.812770Z",
"shell.execute_reply": "2022-12-29T09:31:22.812198Z"
}
},
"outputs": [
Expand All @@ -178,23 +181,23 @@
"source": [
"# Exact Wald is more complicated. We'll need the Shifted Kerr Schild metric in Cartesian coordinates.\n",
"import BSSN.ShiftedKerrSchild as sks\n",
"sks.ShiftedKerrSchild(True)\n",
"sks.ShiftedKerrSchild()\n",
"import reference_metric as rfm\n",
"par.set_parval_from_str(\"reference_metric::CoordSystem\",\"Cartesian\")\n",
"rfm.reference_metric()\n",
"# Use the Jacobian matrix to transform the vectors to Cartesian coordinates.\n",
"gammaSphDD = ixp.zerorank2()\n",
"for i in range(3):\n",
" for j in range(3):\n",
" gammaSphDD[i][j] += sks.gammaSphDD[i][j].subs(sks.r,rfm.xxSph[0]).subs(sks.th,rfm.xxSph[1])\n",
" gammaSphDD[i][j] += sks.gammaDD[i][j].subs(sks.r,rfm.xxSph[0]).subs(sks.th,rfm.xxSph[1])\n",
"\n",
"unused_gammaUU,gammaSphDET = ixp.symm_matrix_inverter3x3(gammaSphDD)\n",
"sqrtgammaSphDET = sp.sqrt(gammaSphDET)\n",
"\n",
"betaSphU = ixp.zerorank1()\n",
"for i in range(3):\n",
" betaSphU[i] += sks.betaSphU[i].subs(sks.r,rfm.xxSph[0]).subs(sks.th,rfm.xxSph[1])\n",
"alpha = sks.alphaSph.subs(sks.r,rfm.xxSph[0]).subs(sks.th,rfm.xxSph[1])\n",
" betaSphU[i] += sks.betaU[i].subs(sks.r,rfm.xxSph[0]).subs(sks.th,rfm.xxSph[1])\n",
"alpha = sks.alpha.subs(sks.r,rfm.xxSph[0]).subs(sks.th,rfm.xxSph[1])\n",
"\n",
"# We only need to set alpha and betaU in C for the original Exact Wald\n",
"name = \"Shifted_Kerr_Schild_initial_metric_spherical\"\n",
Expand Down Expand Up @@ -237,7 +240,7 @@
" lhrh(lhs=gri.gfaccess(\"auxevol_gfs\",\"betaU0\"),rhs=betaU[0]),\n",
" lhrh(lhs=gri.gfaccess(\"auxevol_gfs\",\"betaU1\"),rhs=betaU[1]),\n",
" lhrh(lhs=gri.gfaccess(\"auxevol_gfs\",\"betaU2\"),rhs=betaU[2]),\n",
" lhrh(lhs=gri.gfaccess(\"auxevol_gfs\",\"alpha\"),rhs=sks.alphaSph.subs(sks.r,rfm.xxSph[0]).subs(sks.th,rfm.xxSph[1]))\n",
" lhrh(lhs=gri.gfaccess(\"auxevol_gfs\",\"alpha\"),rhs=sks.alpha.subs(sks.r,rfm.xxSph[0]).subs(sks.th,rfm.xxSph[1]))\n",
" ]\n",
"\n",
"outCfunction(\n",
Expand All @@ -264,10 +267,10 @@
"execution_count": 4,
"metadata": {
"execution": {
"iopub.execute_input": "2022-11-24T14:14:51.586226Z",
"iopub.status.busy": "2022-11-24T14:14:51.586105Z",
"iopub.status.idle": "2022-11-24T14:14:51.871655Z",
"shell.execute_reply": "2022-11-24T14:14:51.871224Z"
"iopub.execute_input": "2022-12-29T09:31:22.840337Z",
"iopub.status.busy": "2022-12-29T09:31:22.840183Z",
"iopub.status.idle": "2022-12-29T09:31:23.162669Z",
"shell.execute_reply": "2022-12-29T09:31:23.162118Z"
},
"scrolled": false
},
Expand All @@ -287,7 +290,7 @@
" desc = \"Generate exact Wald initial test data for GiRaFFEfood_NRPy.\"\n",
"elif initial_data==\"MagnetosphericWald\":\n",
" import BSSN.ADMBSSN_tofrom_4metric as AB4m\n",
" AB4m.g4DD_ito_BSSN_or_ADM(\"ADM\",sks.gammaSphDD,sks.betaSphU,sks.alphaSph)\n",
" AB4m.g4DD_ito_BSSN_or_ADM(\"ADM\",sks.gammaDD,sks.betaU,sks.alpha)\n",
" g4DD = AB4m.g4DD\n",
"\n",
" for mu in range(4):\n",
Expand Down Expand Up @@ -338,10 +341,10 @@
"execution_count": 5,
"metadata": {
"execution": {
"iopub.execute_input": "2022-11-24T14:14:51.873995Z",
"iopub.status.busy": "2022-11-24T14:14:51.873887Z",
"iopub.status.idle": "2022-11-24T14:14:53.314571Z",
"shell.execute_reply": "2022-11-24T14:14:53.314030Z"
"iopub.execute_input": "2022-12-29T09:31:23.164435Z",
"iopub.status.busy": "2022-12-29T09:31:23.164299Z",
"iopub.status.idle": "2022-12-29T09:31:24.252515Z",
"shell.execute_reply": "2022-12-29T09:31:24.251542Z"
}
},
"outputs": [],
Expand Down Expand Up @@ -396,10 +399,10 @@
"execution_count": 6,
"metadata": {
"execution": {
"iopub.execute_input": "2022-11-24T14:14:53.317317Z",
"iopub.status.busy": "2022-11-24T14:14:53.317194Z",
"iopub.status.idle": "2022-11-24T14:14:53.323532Z",
"shell.execute_reply": "2022-11-24T14:14:53.323119Z"
"iopub.execute_input": "2022-12-29T09:31:24.255481Z",
"iopub.status.busy": "2022-12-29T09:31:24.255135Z",
"iopub.status.idle": "2022-12-29T09:31:24.263467Z",
"shell.execute_reply": "2022-12-29T09:31:24.263008Z"
}
},
"outputs": [],
Expand Down Expand Up @@ -474,10 +477,10 @@
"execution_count": 7,
"metadata": {
"execution": {
"iopub.execute_input": "2022-11-24T14:14:53.325564Z",
"iopub.status.busy": "2022-11-24T14:14:53.325449Z",
"iopub.status.idle": "2022-11-24T14:14:53.329323Z",
"shell.execute_reply": "2022-11-24T14:14:53.328938Z"
"iopub.execute_input": "2022-12-29T09:31:24.265862Z",
"iopub.status.busy": "2022-12-29T09:31:24.265643Z",
"iopub.status.idle": "2022-12-29T09:31:24.271935Z",
"shell.execute_reply": "2022-12-29T09:31:24.271483Z"
}
},
"outputs": [],
Expand Down Expand Up @@ -520,10 +523,10 @@
"execution_count": 8,
"metadata": {
"execution": {
"iopub.execute_input": "2022-11-24T14:14:53.331730Z",
"iopub.status.busy": "2022-11-24T14:14:53.331489Z",
"iopub.status.idle": "2022-11-24T14:14:53.340516Z",
"shell.execute_reply": "2022-11-24T14:14:53.340105Z"
"iopub.execute_input": "2022-12-29T09:31:24.275063Z",
"iopub.status.busy": "2022-12-29T09:31:24.274741Z",
"iopub.status.idle": "2022-12-29T09:31:24.289320Z",
"shell.execute_reply": "2022-12-29T09:31:24.288702Z"
}
},
"outputs": [
Expand Down Expand Up @@ -897,10 +900,10 @@
"execution_count": 9,
"metadata": {
"execution": {
"iopub.execute_input": "2022-11-24T14:14:53.342723Z",
"iopub.status.busy": "2022-11-24T14:14:53.342406Z",
"iopub.status.idle": "2022-11-24T14:14:54.437549Z",
"shell.execute_reply": "2022-11-24T14:14:54.437124Z"
"iopub.execute_input": "2022-12-29T09:31:24.291319Z",
"iopub.status.busy": "2022-12-29T09:31:24.291078Z",
"iopub.status.idle": "2022-12-29T09:31:25.589494Z",
"shell.execute_reply": "2022-12-29T09:31:25.588830Z"
},
"scrolled": false
},
Expand All @@ -911,11 +914,11 @@
"text": [
"Now compiling, should take ~2 seconds...\n",
"\n",
"Finished in 0.8674116134643555 seconds.\n",
"Finished in 1.061720848083496 seconds.\n",
"\n",
"\n",
"(EXEC): Executing `taskset -c 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 ./GiRaFFEfood_NRPy_unit_test 2`...\n",
"(BENCH): Finished executing in 0.2 seconds.\n"
"(EXEC): Executing `taskset -c 1,3,5,7,9,11,13,15 ./GiRaFFEfood_NRPy_unit_test 2`...\n",
"(BENCH): Finished executing in 0.20 seconds.\n"
]
}
],
Expand Down Expand Up @@ -955,10 +958,10 @@
"execution_count": 10,
"metadata": {
"execution": {
"iopub.execute_input": "2022-11-24T14:14:54.439721Z",
"iopub.status.busy": "2022-11-24T14:14:54.439591Z",
"iopub.status.idle": "2022-11-24T14:14:54.443021Z",
"shell.execute_reply": "2022-11-24T14:14:54.442628Z"
"iopub.execute_input": "2022-12-29T09:31:25.591892Z",
"iopub.status.busy": "2022-12-29T09:31:25.591638Z",
"iopub.status.idle": "2022-12-29T09:31:25.597026Z",
"shell.execute_reply": "2022-12-29T09:31:25.596469Z"
}
},
"outputs": [
Expand Down Expand Up @@ -997,60 +1000,17 @@
"execution_count": 11,
"metadata": {
"execution": {
"iopub.execute_input": "2022-11-24T14:14:54.444922Z",
"iopub.status.busy": "2022-11-24T14:14:54.444800Z",
"iopub.status.idle": "2022-11-24T14:14:55.666191Z",
"shell.execute_reply": "2022-11-24T14:14:55.665856Z"
"iopub.execute_input": "2022-12-29T09:31:25.600013Z",
"iopub.status.busy": "2022-12-29T09:31:25.599598Z",
"iopub.status.idle": "2022-12-29T09:31:29.823362Z",
"shell.execute_reply": "2022-12-29T09:31:29.822789Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Traceback (most recent call last):\n",
" File \"/home/zetienne/jup310/lib/python3.10/site-packages/traitlets/traitlets.py\", line 537, in get\n",
" value = obj._trait_values[self.name]\n",
"KeyError: 'template_paths'\n",
"\n",
"During handling of the above exception, another exception occurred:\n",
"\n",
"Traceback (most recent call last):\n",
" File \"/home/zetienne/jup310/bin/jupyter-nbconvert\", line 8, in <module>\n",
" sys.exit(main())\n",
" File \"/home/zetienne/jup310/lib/python3.10/site-packages/jupyter_core/application.py\", line 269, in launch_instance\n",
" return super().launch_instance(argv=argv, **kwargs)\n",
" File \"/home/zetienne/jup310/lib/python3.10/site-packages/traitlets/config/application.py\", line 846, in launch_instance\n",
" app.start()\n",
" File \"/home/zetienne/jup310/lib/python3.10/site-packages/nbconvert/nbconvertapp.py\", line 426, in start\n",
" self.convert_notebooks()\n",
" File \"/home/zetienne/jup310/lib/python3.10/site-packages/nbconvert/nbconvertapp.py\", line 595, in convert_notebooks\n",
" self.exporter = cls(config=self.config)\n",
" File \"/home/zetienne/jup310/lib/python3.10/site-packages/nbconvert/exporters/templateexporter.py\", line 342, in __init__\n",
" super().__init__(config=config, **kw)\n",
" File \"/home/zetienne/jup310/lib/python3.10/site-packages/nbconvert/exporters/exporter.py\", line 118, in __init__\n",
" self._init_preprocessors()\n",
" File \"/home/zetienne/jup310/lib/python3.10/site-packages/nbconvert/exporters/templateexporter.py\", line 508, in _init_preprocessors\n",
" conf = self._get_conf()\n",
" File \"/home/zetienne/jup310/lib/python3.10/site-packages/nbconvert/exporters/templateexporter.py\", line 526, in _get_conf\n",
" for path in map(Path, self.template_paths):\n",
" File \"/home/zetienne/jup310/lib/python3.10/site-packages/traitlets/traitlets.py\", line 577, in __get__\n",
" return self.get(obj, cls)\n",
" File \"/home/zetienne/jup310/lib/python3.10/site-packages/traitlets/traitlets.py\", line 540, in get\n",
" default = obj.trait_defaults(self.name)\n",
" File \"/home/zetienne/jup310/lib/python3.10/site-packages/traitlets/traitlets.py\", line 1580, in trait_defaults\n",
" return self._get_trait_default_generator(names[0])(self)\n",
" File \"/home/zetienne/jup310/lib/python3.10/site-packages/traitlets/traitlets.py\", line 977, in __call__\n",
" return self.func(*args, **kwargs)\n",
" File \"/home/zetienne/jup310/lib/python3.10/site-packages/nbconvert/exporters/templateexporter.py\", line 537, in _template_paths\n",
" template_names = self.get_template_names()\n",
" File \"/home/zetienne/jup310/lib/python3.10/site-packages/nbconvert/exporters/templateexporter.py\", line 621, in get_template_names\n",
" raise ValueError(\n",
"ValueError: No template sub-directory with name './nbconvert_latex_settings' found in the following paths:\n",
"\t/home/zetienne/.local/share/jupyter\n",
"\t/home/zetienne/jup310/share/jupyter\n",
"\t/usr/local/share/jupyter\n",
"\t/usr/share/jupyter\n",
"Created Tutorial-Start_to_Finish_UnitTest-GiRaFFEfood_NRPy-\n",
" Curved_Spacetime_Tests.tex, and compiled LaTeX file to PDF file\n",
" Tutorial-Start_to_Finish_UnitTest-GiRaFFEfood_NRPy-\n",
Expand Down Expand Up @@ -1080,7 +1040,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.4"
"version": "3.11.1"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 4314d35

Please sign in to comment.