B:BD[
4.80169] → [
4.80169:80598]
B:BD[
4.80598] → [
6.676:704]
∅:D[
6.704] → [
4.80624:82550]
B:BD[
4.80624] → [
4.80624:82550]
B:BD[
4.82550] → [
3.9498:9596]
∅:D[
3.9596] → [
4.82647:82732]
B:BD[
4.82647] → [
4.82647:82732]
B:BD[
4.82732] → [
3.9597:9643]
∅:D[
3.9643] → [
4.82982:82992]
B:BD[
4.82982] → [
4.82982:82992]
B:BD[
4.82992] → [
3.9644:9739]
∅:D[
3.9739] → [
4.83086:83266]
B:BD[
4.83086] → [
4.83086:83266]
B:BD[
4.83321] → [
4.83321:84061]
"}\\n\"\"\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<a id='t4uu'></a>\n",
"\n",
"## Step 4.f: `driver_BSSN_T4UU()`: Compute $T^{\\mu\\nu}$ from `TmunuBase`'s $T_{\\mu\\nu}$ \\[Back to [top](#toc)\\]\n",
"$$\\label{t4uu}$$\n",
"\n",
"Here we implement $T^{\\mu\\nu} = g^{\\mu \\delta} g^{\\nu \\gamma} T_{\\delta \\gamma}.$"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"if add_stress_energy_source_terms == True:\n",
" # Declare T4DD as a set of gridfunctions. These won't \n",
" # actually appear in interface.ccl, as interface.ccl \n",
" # was set above. Thus before calling the code output\n",
" # by FD_outputC(), we'll have to set pointers\n",
" # to the actual gridfunctions they reference.\n",
" # (In this case the eTab's.)\n",
" T4DD = ixp.register_gridfunctions_for_single_rank2(\"AUXEVOL\",\"T4DD\",\"sym01\",DIM=4)\n",
" import BSSN.ADMBSSN_tofrom_4metric as AB4m\n",
" AB4m.g4UU_ito_BSSN_or_ADM(\"BSSN\")\n",
"\n",
" T4UUraised = ixp.zerorank2(DIM=4)\n",
" for mu in range(4):\n",
" for nu in range(4):\n",
" for delta in range(4):\n",
" for gamma in range(4):\n",
" T4UUraised[mu][nu] += AB4m.g4UU[mu][delta]*AB4m.g4UU[nu][gamma]*T4DD[delta][gamma]\n",
" \n",
" T4UU_expressions = [\n",
" lhrh(lhs=gri.gfaccess(\"in_gfs\",\"T4UU00\"),rhs=T4UUraised[0][0]),\n",
" lhrh(lhs=gri.gfaccess(\"in_gfs\",\"T4UU01\"),rhs=T4UUraised[0][1]),\n",
" lhrh(lhs=gri.gfaccess(\"in_gfs\",\"T4UU02\"),rhs=T4UUraised[0][2]),\n",
" lhrh(lhs=gri.gfaccess(\"in_gfs\",\"T4UU03\"),rhs=T4UUraised[0][3]),\n",
" lhrh(lhs=gri.gfaccess(\"in_gfs\",\"T4UU11\"),rhs=T4UUraised[1][1]),\n",
" lhrh(lhs=gri.gfaccess(\"in_gfs\",\"T4UU12\"),rhs=T4UUraised[1][2]),\n",
" lhrh(lhs=gri.gfaccess(\"in_gfs\",\"T4UU13\"),rhs=T4UUraised[1][3]),\n",
" lhrh(lhs=gri.gfaccess(\"in_gfs\",\"T4UU22\"),rhs=T4UUraised[2][2]),\n",
" lhrh(lhs=gri.gfaccess(\"in_gfs\",\"T4UU23\"),rhs=T4UUraised[2][3]),\n",
" lhrh(lhs=gri.gfaccess(\"in_gfs\",\"T4UU33\"),rhs=T4UUraised[3][3])]\n",
"\n",
" outCparams = \"outCverbose=False,includebraces=False,preindent=2,SIMD_enable=False\"\n",
" T4UUstr = fin.FD_outputC(\"returnstring\",T4UU_expressions, outCparams)\n",
" T4UUstr_loop = loop_all(T4UUstr)\n",
"\n",
" with open(append_to_make_code_defn_list(\"driver_BSSN_T4UU.cc\"), \"w\") as file:\n",
" file.write(\"\"\"\n",
"#include <math.h>\n",
"\n",
"#include \"cctk.h\"\n",
"#include \"cctk_Arguments.h\"\n",
"#include \"cctk_Parameters.h\"\n",
"\n",
"void driver_BSSN_T4UU(CCTK_ARGUMENTS) {\n",
" DECLARE_CCTK_ARGUMENTS;\n",
" DECLARE_CCTK_PARAMETERS;\n",
"\n",
" const CCTK_REAL *restrict T4DD00GF = eTtt;\n",
" const CCTK_REAL *restrict T4DD01GF = eTtx;\n",
" const CCTK_REAL *restrict T4DD02GF = eTty;\n",
" const CCTK_REAL *restrict T4DD03GF = eTtz;\n",
" const CCTK_REAL *restrict T4DD11GF = eTxx;\n",
" const CCTK_REAL *restrict T4DD12GF = eTxy;\n",
" const CCTK_REAL *restrict T4DD13GF = eTxz;\n",
" const CCTK_REAL *restrict T4DD22GF = eTyy;\n",
" const CCTK_REAL *restrict T4DD23GF = eTyz;\n",
" const CCTK_REAL *restrict T4DD33GF = eTzz;\n",
"\"\"\"+T4UUstr_loop+\"\"\"\n",