diff --git a/Z4cow/wolfram/Z4cow_set_ADM.hxx b/Z4cow/wolfram/Z4cow_set_ADM.hxx new file mode 100644 index 00000000..b736f557 --- /dev/null +++ b/Z4cow/wolfram/Z4cow_set_ADM.hxx @@ -0,0 +1,126 @@ +/* Z4cow_set_ADM.hxx */ +/* Produced with Mathematica */ + +#ifndef Z4COW_SET_ADM_HXX +#define Z4COW_SET_ADM_HXX + +const GF3D2 &local_ADMgam11 = gf_ADMgam(0,0); +const GF3D2 &local_ADMgam12 = gf_ADMgam(0,1); +const GF3D2 &local_ADMgam13 = gf_ADMgam(0,2); +const GF3D2 &local_ADMgam22 = gf_ADMgam(1,1); +const GF3D2 &local_ADMgam23 = gf_ADMgam(1,2); +const GF3D2 &local_ADMgam33 = gf_ADMgam(2,2); +const GF3D2 &local_ADMK11 = gf_ADMK(0,0); +const GF3D2 &local_ADMK12 = gf_ADMK(0,1); +const GF3D2 &local_ADMK13 = gf_ADMK(0,2); +const GF3D2 &local_ADMK22 = gf_ADMK(1,1); +const GF3D2 &local_ADMK23 = gf_ADMK(1,2); +const GF3D2 &local_ADMK33 = gf_ADMK(2,2); +const GF3D2 &local_ADMalpha = gf_ADMalpha; +const GF3D2 &local_ADMbeta1 = gf_ADMbeta(0); +const GF3D2 &local_ADMbeta2 = gf_ADMbeta(1); +const GF3D2 &local_ADMbeta3 = gf_ADMbeta(2); + +grid.loop_all_device<0, 0, 0, vsize>( + grid.nghostzones, [=] ARITH_DEVICE(const PointDesc &p) ARITH_INLINE { + const vbool mask = mask_for_loop_tail(p.i, p.imax); + const GF3D2index index2(layout2, p.I); + +const auto &tmp_W = gf_W(mask, index2); +const auto &tmp_gamt = gf_gamt(mask, index2); +const auto &tmp_exKh = gf_exKh(mask, index2); +const auto &tmp_exAt = gf_exAt(mask, index2); +const auto &tmp_Theta = gf_Theta(mask, index2); +const auto &tmp_alpha = gf_alpha(mask, index2); +const auto &tmp_beta = gf_beta(mask, index2); + +const vreal W = tmp_W; +const vreal gamt11 = tmp_gamt(0,0); +const vreal gamt12 = tmp_gamt(0,1); +const vreal gamt13 = tmp_gamt(0,2); +const vreal gamt22 = tmp_gamt(1,1); +const vreal gamt23 = tmp_gamt(1,2); +const vreal gamt33 = tmp_gamt(2,2); +const vreal exKh = tmp_exKh; +const vreal exAt11 = tmp_exAt(0,0); +const vreal exAt12 = tmp_exAt(0,1); +const vreal exAt13 = tmp_exAt(0,2); +const vreal exAt22 = tmp_exAt(1,1); +const vreal exAt23 = tmp_exAt(1,2); +const vreal exAt33 = tmp_exAt(2,2); +const vreal Theta = tmp_Theta; +const vreal alpha = tmp_alpha; +const vreal beta1 = tmp_beta(0); +const vreal beta2 = tmp_beta(1); +const vreal beta3 = tmp_beta(2); + +local_ADMgam11.store(mask, index2, +gamt11/Power(W,2) +); + +local_ADMgam12.store(mask, index2, +gamt12/Power(W,2) +); + +local_ADMgam13.store(mask, index2, +gamt13/Power(W,2) +); + +local_ADMgam22.store(mask, index2, +gamt22/Power(W,2) +); + +local_ADMgam23.store(mask, index2, +gamt23/Power(W,2) +); + +local_ADMgam33.store(mask, index2, +gamt33/Power(W,2) +); + +local_ADMK11.store(mask, index2, +(exAt11 + (gamt11*(exKh + 2*Theta))/3.)/Power(W,2) +); + +local_ADMK12.store(mask, index2, +(exAt12 + (gamt12*(exKh + 2*Theta))/3.)/Power(W,2) +); + +local_ADMK13.store(mask, index2, +(exAt13 + (gamt13*(exKh + 2*Theta))/3.)/Power(W,2) +); + +local_ADMK22.store(mask, index2, +(exAt22 + (gamt22*(exKh + 2*Theta))/3.)/Power(W,2) +); + +local_ADMK23.store(mask, index2, +(exAt23 + (gamt23*(exKh + 2*Theta))/3.)/Power(W,2) +); + +local_ADMK33.store(mask, index2, +(exAt33 + (gamt33*(exKh + 2*Theta))/3.)/Power(W,2) +); + +local_ADMalpha.store(mask, index2, +alpha +); + +local_ADMbeta1.store(mask, index2, +beta1 +); + +local_ADMbeta2.store(mask, index2, +beta2 +); + +local_ADMbeta3.store(mask, index2, +beta3 +); + + +}); + +#endif // #ifndef Z4COW_SET_ADM_HXX + +/* Z4cow_set_ADM.hxx */ diff --git a/Z4cow/wolfram/Z4cow_set_ADM.wl b/Z4cow/wolfram/Z4cow_set_ADM.wl new file mode 100644 index 00000000..b1b183a4 --- /dev/null +++ b/Z4cow/wolfram/Z4cow_set_ADM.wl @@ -0,0 +1,53 @@ +(* ::Package:: *) + +(* Z4c_set_rhs.wl *) + +(* (c) Liwei Ji, 07/2024 *) + +Needs["xAct`xCoba`", FileNameJoin[{Environment["GENERATO"], "src/Generato.wl" + }]] + +SetPVerbose[False]; + +SetPrintDate[False]; + +SetGridPointIndex[""]; + +SetTempVariableType["vreal"]; + +DefManifold[M3, 3, IndexRange[a, z]]; + +DefChart[cart, M3, {1, 2, 3}, {X[], Y[], Z[]}, ChartColor -> Blue]; + +(* Define Variables *) + +< "MainOut"}, ADMVarlist]; + pr[]; + + pr["grid.loop_all_device<0, 0, 0, vsize>("]; + pr[" grid.nghostzones, [=] ARITH_DEVICE(const PointDesc &p) ARITH_INLINE {"]; + pr[" const vbool mask = mask_for_loop_tail(p.i, p.imax);"]; + pr[" const GF3D2index index2(layout2, p.I);"]; + pr[]; + + PrintListInitializations[Drop[EvolVarlist, {5}], "gf_", "index2"]; + pr[]; + + PrintInitializations[{Mode -> "MainIn"}, Drop[EvolVarlist, {5}]]; + pr[]; + PrintEquations[{Mode -> "Main"}, ADMVarlist]; + pr[]; + pr["});"]; + ]; + +Import[FileNameJoin[{Environment["GENERATO"], "codes/CarpetX.wl"}]];