FAKFUJ4VZQFKOSTNHZGLRIIMZDXFAO6QOPI7UJKMKSKPXWJSZZMQC
GKKJ75HX2ERLVBZVE2CUB6T3J2SUT7R3UKEKTEYNOG43ZKX6X5MQC
4UAVM7QNVW2KOPZCOWOCKMBIPDNDDIUOLNO5EFIWWHKKJ53ALSDAC
5XGIB7XMEZNBLA5ZLQTXRTC3AZ5CTRGMXWBPVMWXG4DPHKWDF4ZAC
4YEITIZWMO2BGSPSNR2XMDAZPPSRHTLHBNZ7KUN7KE37LOSUUW2AC
BEVN3UJ3EJJNK52M2VAT33FV5RWW6IPNGDLPA6TNKLGJ5OCKJ76AC
PG2P3JQPLWZRLCAJ7JY2B7G7AM5DHOE2CJUKIPWREI3NAUKZF3TAC
NGD6QWRDHWBMQXL2YXZVF3BFQALSII3LH6BMIOFL7VFMGPLHCZEQC
JYHNXXG3OJTYBJ2U3WMKUS6N5WHXO773WXVRNSJLBC5FGEYLJP2AC
BPRNUTY7MHK7LK4EY5MY5OFFG3ABOL7LWXD574L35M74YSQPULFAC
NE2O3IMQBR3OAPLJC22SPJ7AX2ABULA7XNSIZYFHCQLWC45T6GJAC
YIQN7NJTGEVKW7JZHL6CTH6EPCIXCNBYNURIGXPYZAOUX3VAJQMAC
SCHEDULE MaxwellToyCarpetX_Initialize AT initial
{
LANG: C
WRITES: potential_phi(interior)
WRITES: potential_ax(interior) potential_ay(interior) potential_az(interior)
WRITES: field_ex(interior) field_ey(interior) field_ez(interior)
WRITES: field_bx(interior) field_by(interior) field_bz(interior)
WRITES: current_rho(interior)
WRITES: current_jx(interior) current_jy(interior) current_jz(interior)
SCHEDULE MaxwellToyCarpetX_Initialize AT initial
{
LANG: C
SYNC: potential_phi
SYNC: potential_ax potential_ay potential_az
SYNC: field_ex field_ey field_ez
SYNC: field_bx field_by field_bz
SYNC: current_rho
SYNC: current_jx current_jy current_jz
} "Set up initial conditions for the Maxwell equations"
} else {
SCHEDULE MaxwellToyCarpetX_Initialize AT initial
{
LANG: C
WRITES: potential_phi(interior)
WRITES: potential_ax(interior) potential_ay(interior) potential_az(interior)
WRITES: field_ex(interior) field_ey(interior) field_ez(interior)
WRITES: current_rho(interior)
WRITES: current_jx(interior) current_jy(interior) current_jz(interior)
SYNC: potential_phi
SYNC: potential_ax potential_ay potential_az
SYNC: field_ex field_ey field_ez
SYNC: current_rho
SYNC: current_jx current_jy current_jz
} "Set up initial conditions for the Maxwell equations"
WRITES: potential_phi(interior)
WRITES: potential_ax(interior) potential_ay(interior) potential_az(interior)
WRITES: current_rho(interior)
WRITES: current_jx(interior) current_jy(interior) current_jz(interior)
SCHEDULE MaxwellToyCarpetX_Dependents1 AT initial AFTER MaxwellToyCarpetX_Initialize
{
LANG: C
SYNC: potential_phi
SYNC: potential_ax potential_ay potential_az
SYNC: current_rho
SYNC: current_jx current_jy current_jz
} "Set up initial conditions for the Maxwell equations"
SYNC: field_bx field_by field_bz
} "Calculate the magnetic field"
READS: potential_phi(everywhere)
READS: potential_ax(everywhere) potential_ay(everywhere) potential_az(everywhere)
READS: current_rho(everywhere)
READS: current_jx(everywhere) current_jy(everywhere) current_jz(everywhere)
WRITES: field_ex(interior) field_ey(interior) field_ez(interior)
WRITES: field_bx(interior) field_by(interior) field_bz(interior)
const Loop::GF3D<CCTK_REAL, 1, 0, 0> ex_(cctkGH, ex);
const Loop::GF3D<CCTK_REAL, 0, 1, 0> ey_(cctkGH, ey);
const Loop::GF3D<CCTK_REAL, 0, 0, 1> ez_(cctkGH, ez);
const Loop::GF3D<CCTK_REAL, 0, 1, 1> bx_(cctkGH, bx);
const Loop::GF3D<CCTK_REAL, 1, 0, 1> by_(cctkGH, by);
const Loop::GF3D<CCTK_REAL, 1, 1, 0> bz_(cctkGH, bz);
Loop::loop_all<1, 0, 0>(cctkGH, [&](const Loop::PointDesc &p) {
ex_(p.i, p.j, p.k) =
-xderiv(linear<CCTK_REAL>, dx)(t + dt / 2, p.x, p.y, p.z).phi -
tderiv(linear<CCTK_REAL>, dt)(t + dt / 2, p.x, p.y, p.z).ax;
});
Loop::loop_all<0, 1, 0>(cctkGH, [&](const Loop::PointDesc &p) {
ey_(p.i, p.j, p.k) =
-yderiv(linear<CCTK_REAL>, dy)(t + dt / 2, p.x, p.y, p.z).phi -
tderiv(linear<CCTK_REAL>, dt)(t + dt / 2, p.x, p.y, p.z).ay;
});
Loop::loop_all<0, 0, 1>(cctkGH, [&](const Loop::PointDesc &p) {
ez_(p.i, p.j, p.k) =
-zderiv(linear<CCTK_REAL>, dz)(t + dt / 2, p.x, p.y, p.z).phi -
tderiv(linear<CCTK_REAL>, dt)(t + dt / 2, p.x, p.y, p.z).az;
});
if (evolve_b) {
Loop::loop_all<0, 1, 1>(cctkGH, [&](const Loop::PointDesc &p) {
bx_(p.i, p.j, p.k) =
yderiv(linear<CCTK_REAL>, dy)(t, p.x, p.y, p.z).az -
zderiv(linear<CCTK_REAL>, dz)(t, p.x, p.y, p.z).ay;
});
Loop::loop_all<1, 0, 1>(cctkGH, [&](const Loop::PointDesc &p) {
by_(p.i, p.j, p.k) =
zderiv(linear<CCTK_REAL>, dz)(t, p.x, p.y, p.z).ax -
xderiv(linear<CCTK_REAL>, dx)(t, p.x, p.y, p.z).az;
});
Loop::loop_all<1, 1, 0>(cctkGH, [&](const Loop::PointDesc &p) {
bz_(p.i, p.j, p.k) =
xderiv(linear<CCTK_REAL>, dx)(t, p.x, p.y, p.z).ay -
yderiv(linear<CCTK_REAL>, dy)(t, p.x, p.y, p.z).ax;
});
}
Loop::loop_all<1, 0, 0>(cctkGH, [&](const Loop::PointDesc &p) {
ex_(p.i, p.j, p.k) =
-xderiv(plane_wave<CCTK_REAL>, dx)(t + dt / 2, p.x, p.y, p.z).phi -
tderiv(plane_wave<CCTK_REAL>, dt)(t + dt / 2, p.x, p.y, p.z).ax;
});
Loop::loop_all<0, 1, 0>(cctkGH, [&](const Loop::PointDesc &p) {
ey_(p.i, p.j, p.k) =
-yderiv(plane_wave<CCTK_REAL>, dy)(t + dt / 2, p.x, p.y, p.z).phi -
tderiv(plane_wave<CCTK_REAL>, dt)(t + dt / 2, p.x, p.y, p.z).ay;
});
Loop::loop_all<0, 0, 1>(cctkGH, [&](const Loop::PointDesc &p) {
ez_(p.i, p.j, p.k) =
-zderiv(plane_wave<CCTK_REAL>, dz)(t + dt / 2, p.x, p.y, p.z).phi -
tderiv(plane_wave<CCTK_REAL>, dt)(t + dt / 2, p.x, p.y, p.z).az;
});
if (evolve_b) {
Loop::loop_all<0, 1, 1>(cctkGH, [&](const Loop::PointDesc &p) {
bx_(p.i, p.j, p.k) =
yderiv(plane_wave<CCTK_REAL>, dy)(t, p.x, p.y, p.z).az -
zderiv(plane_wave<CCTK_REAL>, dz)(t, p.x, p.y, p.z).ay;
});
Loop::loop_all<1, 0, 1>(cctkGH, [&](const Loop::PointDesc &p) {
by_(p.i, p.j, p.k) =
zderiv(plane_wave<CCTK_REAL>, dz)(t, p.x, p.y, p.z).ax -
xderiv(plane_wave<CCTK_REAL>, dx)(t, p.x, p.y, p.z).az;
});
Loop::loop_all<1, 1, 0>(cctkGH, [&](const Loop::PointDesc &p) {
bz_(p.i, p.j, p.k) =
xderiv(plane_wave<CCTK_REAL>, dx)(t, p.x, p.y, p.z).ay -
yderiv(plane_wave<CCTK_REAL>, dy)(t, p.x, p.y, p.z).ax;
});
}
Loop::loop_all<1, 0, 0>(cctkGH, [&](const Loop::PointDesc &p) {
ex_(p.i, p.j, p.k) =
-xderiv(gaussian_wave<CCTK_REAL>, dx)(t + dt / 2, p.x, p.y, p.z).phi -
tderiv(gaussian_wave<CCTK_REAL>, dt)(t + dt / 2, p.x, p.y, p.z).ax;
});
Loop::loop_all<0, 1, 0>(cctkGH, [&](const Loop::PointDesc &p) {
ey_(p.i, p.j, p.k) =
-yderiv(gaussian_wave<CCTK_REAL>, dy)(t + dt / 2, p.x, p.y, p.z).phi -
tderiv(gaussian_wave<CCTK_REAL>, dt)(t + dt / 2, p.x, p.y, p.z).ay;
});
Loop::loop_all<0, 0, 1>(cctkGH, [&](const Loop::PointDesc &p) {
ez_(p.i, p.j, p.k) =
-zderiv(gaussian_wave<CCTK_REAL>, dz)(t + dt / 2, p.x, p.y, p.z).phi -
tderiv(gaussian_wave<CCTK_REAL>, dt)(t + dt / 2, p.x, p.y, p.z).az;
});
if (evolve_b) {
Loop::loop_all<0, 1, 1>(cctkGH, [&](const Loop::PointDesc &p) {
bx_(p.i, p.j, p.k) =
yderiv(gaussian_wave<CCTK_REAL>, dy)(t, p.x, p.y, p.z).az -
zderiv(gaussian_wave<CCTK_REAL>, dz)(t, p.x, p.y, p.z).ay;
});
Loop::loop_all<1, 0, 1>(cctkGH, [&](const Loop::PointDesc &p) {
by_(p.i, p.j, p.k) =
zderiv(gaussian_wave<CCTK_REAL>, dz)(t, p.x, p.y, p.z).ax -
xderiv(gaussian_wave<CCTK_REAL>, dx)(t, p.x, p.y, p.z).az;
});
Loop::loop_all<1, 1, 0>(cctkGH, [&](const Loop::PointDesc &p) {
bz_(p.i, p.j, p.k) =
xderiv(gaussian_wave<CCTK_REAL>, dx)(t, p.x, p.y, p.z).ay -
yderiv(gaussian_wave<CCTK_REAL>, dy)(t, p.x, p.y, p.z).ax;
});
}
Loop::loop_int<1, 0, 0>(cctkGH, [&](const Loop::PointDesc &p) {
ex_(p.i, p.j, p.k) = (phi_(p.i + 1, p.j, p.k) - phi_(p.i, p.j, p.k)) / dx;
});
Loop::loop_int<0, 1, 0>(cctkGH, [&](const Loop::PointDesc &p) {
ey_(p.i, p.j, p.k) = (phi_(p.i, p.j + 1, p.k) - phi_(p.i, p.j, p.k)) / dy;
});
Loop::loop_int<0, 0, 1>(cctkGH, [&](const Loop::PointDesc &p) {
ez_(p.i, p.j, p.k) = (phi_(p.i, p.j, p.k + 1) - phi_(p.i, p.j, p.k)) / dz;
});
}
extern "C" void MaxwellToyCarpetX_Dependents1(CCTK_ARGUMENTS) {
DECLARE_CCTK_ARGUMENTS_MaxwellToyCarpetX_Dependents1;
DECLARE_CCTK_PARAMETERS;
const CCTK_REAL dx = CCTK_DELTA_SPACE(0);
const CCTK_REAL dy = CCTK_DELTA_SPACE(1);
const CCTK_REAL dz = CCTK_DELTA_SPACE(2);
const Loop::GF3D<const CCTK_REAL, 1, 0, 0> ax_(cctkGH, ax);
const Loop::GF3D<const CCTK_REAL, 0, 1, 0> ay_(cctkGH, ay);
const Loop::GF3D<const CCTK_REAL, 0, 0, 1> az_(cctkGH, az);
const Loop::GF3D<CCTK_REAL, 0, 1, 1> bx_(cctkGH, bx);
const Loop::GF3D<CCTK_REAL, 1, 0, 1> by_(cctkGH, by);
const Loop::GF3D<CCTK_REAL, 1, 1, 0> bz_(cctkGH, bz);
Loop::loop_int<0, 1, 1>(cctkGH, [&](const Loop::PointDesc &p) {
bx_(p.i, p.j, p.k) = (az_(p.i, p.j + 1, p.k) - az_(p.i, p.j, p.k)) / dy -
(ay_(p.i, p.j, p.k + 1) - ay_(p.i, p.j, p.k)) / dz;
});
Loop::loop_int<1, 0, 1>(cctkGH, [&](const Loop::PointDesc &p) {
by_(p.i, p.j, p.k) = (ax_(p.i, p.j, p.k + 1) - ax_(p.i, p.j, p.k)) / dz -
(az_(p.i + 1, p.j, p.k) - az_(p.i, p.j, p.k)) / dx;
});
Loop::loop_int<1, 1, 0>(cctkGH, [&](const Loop::PointDesc &p) {
bz_(p.i, p.j, p.k) = (ay_(p.i + 1, p.j, p.k) - ay_(p.i, p.j, p.k)) / dx -
(ax_(p.i, p.j + 1, p.k) - ax_(p.i, p.j, p.k)) / dy;
});