Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/engines/grpic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ namespace ntt {
if constexpr (M::Dim == Dim::_2D) {
if (domain.mesh.flds_bc_in({ 0, +1 }) == FldsBC::AXIS) {
range = CreateRangePolicy<Dim::_2D>(
{ domain.mesh.i_min(in::x1) - 1, domain.mesh.i_min(in::x2) },
{ domain.mesh.i_min(in::x1), domain.mesh.i_min(in::x2) },
{ domain.mesh.i_max(in::x1), domain.mesh.i_max(in::x2) + 1 });
}
} else if constexpr (M::Dim == Dim::_3D) {
Expand Down
2 changes: 1 addition & 1 deletion src/kernels/currents_deposit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ namespace kernel {
cur::jx3) += Fx3_1 * (ONE - Wx1_1) * (ONE - Wx2_1);
J_acc(i1_prev(p) + N_GHOSTS + 1,
i2_prev(p) + N_GHOSTS,
cur::jx3) += Fx3_1 * Wx1_2 * (ONE - Wx2_1);
cur::jx3) += Fx3_1 * Wx1_1 * (ONE - Wx2_1);
J_acc(i1_prev(p) + N_GHOSTS,
i2_prev(p) + N_GHOSTS + 1,
cur::jx3) += Fx3_1 * (ONE - Wx1_1) * Wx2_1;
Expand Down
8 changes: 6 additions & 2 deletions src/kernels/fields_bcs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -843,21 +843,25 @@ namespace kernel::bc {
if constexpr (not P) {
if (setE) {
Fld(i1, i_edge - 1, em::ex2) = -Fld(i1, i_edge, em::ex2);
Fld(i1, i_edge, em::ex3) = ZERO;
Fld(i1, i_edge, em::ex3) = ZERO;
Fld(i1, i_edge - 1, em::ex3) = Fld(i1, i_edge + 1, em::ex3);
}
if (setB) {
Fld(i1, i_edge - 1, em::bx1) = Fld(i1, i_edge, em::bx1);
Fld(i1, i_edge, em::bx2) = ZERO;
Fld(i1, i_edge - 1, em::bx2) = - Fld(i1, i_edge + 1, em::bx2);
Fld(i1, i_edge - 1, em::bx3) = Fld(i1, i_edge, em::bx3);
}
} else {
if (setE) {
Fld(i1, i_edge, em::ex2) = -Fld(i1, i_edge - 1, em::ex2);
Fld(i1, i_edge, em::ex3) = ZERO;
Fld(i1, i_edge, em::ex3) = ZERO;
Fld(i1, i_edge + 1, em::ex3) = Fld(i1, i_edge - 1, em::ex3);
}
if (setB) {
Fld(i1, i_edge, em::bx1) = Fld(i1, i_edge - 1, em::bx1);
Fld(i1, i_edge, em::bx2) = ZERO;
Fld(i1, i_edge + 1, em::bx2) = - Fld(i1, i_edge - 1, em::bx2);
Fld(i1, i_edge, em::bx3) = Fld(i1, i_edge - 1, em::bx3);
}
}
Expand Down
29 changes: 22 additions & 7 deletions src/metrics/qkerr_schild.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ namespace metric {
const real_t chi_min, eta_min, phi_min;
const real_t dchi, deta, dphi;
const real_t dchi_inv, deta_inv, dphi_inv;
const bool small_angle;

Inline auto Delta(const real_t& r) const -> real_t {
return SQR(r) - TWO * r + SQR(a);
Expand Down Expand Up @@ -89,7 +90,8 @@ namespace metric {
, dphi { (x3_max - phi_min) / nx3 }
, dchi_inv { ONE / dchi }
, deta_inv { ONE / deta }
, dphi_inv { ONE / dphi } {
, dphi_inv { ONE / dphi }
, small_angle { eta2theta(HALF * deta) < constant::SMALL_ANGLE } {
set_dxMin(find_dxMin());
}

Expand Down Expand Up @@ -484,12 +486,25 @@ namespace metric {
* @param x1 radial coordinate along the axis (code units)
*/
Inline auto polar_area(const real_t& x1) const -> real_t {
return dchi * math::exp(x1 * dchi + chi_min) *
(SQR(r0 + math::exp(x1 * dchi + chi_min)) + SQR(a)) *
math::sqrt(
ONE + TWO * (r0 + math::exp(x1 * dchi + chi_min)) /
(SQR(r0 + math::exp(x1 * dchi + chi_min)) + SQR(a))) *
(ONE - math::cos(eta2theta(HALF * deta)));
if constexpr (D != Dim::_1D) {
if (small_angle) {
const real_t dtheta = eta2theta(HALF * deta);
return dchi * math::exp(x1 * dchi + chi_min) *
(SQR(r0 + math::exp(x1 * dchi + chi_min)) + SQR(a)) *
math::sqrt(
ONE + TWO * (r0 + math::exp(x1 * dchi + chi_min)) /
(SQR(r0 + math::exp(x1 * dchi + chi_min)) + SQR(a))) *
(static_cast<real_t>(48) - SQR(dtheta)) * SQR(dtheta) /
static_cast<real_t>(384);
} else {
return dchi * math::exp(x1 * dchi + chi_min) *
(SQR(r0 + math::exp(x1 * dchi + chi_min)) + SQR(a)) *
math::sqrt(
ONE + TWO * (r0 + math::exp(x1 * dchi + chi_min)) /
(SQR(r0 + math::exp(x1 * dchi + chi_min)) + SQR(a))) *
(ONE - math::cos(eta2theta(HALF * deta)));
}
}
}

/**
Expand Down