29 const auto& ldom = this->layout_mp->getLocalNDIndex();
30 const int nghost = this->A_n.getNghost();
31 const auto aview = this->A_n.getView();
32 const auto anp1view = this->A_np1.getView();
33 const auto anm1view = this->A_nm1.getView();
40 / (
static_cast<scalar
>(Kokkos::pow(this->hr_m[2] / this->hr_m[0], 2))
41 +
static_cast<scalar
>(Kokkos::pow(this->hr_m[2] / this->hr_m[1], 2))));
46 - (1 - 2 * calA) *
static_cast<scalar
>(Kokkos::pow(this->dt / this->hr_m[0], 2))
47 - (1 - 2 * calA) *
static_cast<scalar
>(Kokkos::pow(this->dt / this->hr_m[1], 2))
48 -
static_cast<scalar
>(Kokkos::pow(this->dt / this->hr_m[2], 2))),
49 .a2 =
static_cast<scalar
>(Kokkos::pow(this->dt / this->hr_m[0], 2)),
50 .a4 =
static_cast<scalar
>(Kokkos::pow(this->dt / this->hr_m[1], 2)),
51 .a6 =
static_cast<scalar
>(Kokkos::pow(this->dt / this->hr_m[2], 2))
52 - 2 * calA *
static_cast<scalar
>(Kokkos::pow(this->dt / this->hr_m[0], 2))
53 - 2 * calA *
static_cast<scalar
>(Kokkos::pow(this->dt / this->hr_m[1], 2)),
54 .a8 =
static_cast<scalar
>(Kokkos::pow(this->dt, 2))};
56 true_nr += (nghost * 2);
57 constexpr uint32_t one_if_absorbing_otherwise_0 =
58 boundary_conditions == absorbing
64 uint32_t ig = i + ldom.first()[0];
65 uint32_t jg = j + ldom.first()[1];
66 uint32_t kg = k + ldom.first()[2];
69 uint32_t(ig == one_if_absorbing_otherwise_0)
70 + (uint32_t(jg == one_if_absorbing_otherwise_0) << 1)
71 + (uint32_t(kg == one_if_absorbing_otherwise_0) << 2)
72 + (uint32_t(ig == true_nr[0] - one_if_absorbing_otherwise_0 - 1) << 3)
73 + (uint32_t(jg == true_nr[1] - one_if_absorbing_otherwise_0 - 1) << 4)
74 + (uint32_t(kg == true_nr[2] - one_if_absorbing_otherwise_0 - 1) << 5);
78 -anm1view(i, j, k) + ndisp.a1 * aview(i, j, k)
80 * (calA * aview(i + 1, j, k - 1) + (1 - 2 * calA) * aview(i + 1, j, k)
81 + calA * aview(i + 1, j, k + 1))
83 * (calA * aview(i - 1, j, k - 1) + (1 - 2 * calA) * aview(i - 1, j, k)
84 + calA * aview(i - 1, j, k + 1))
86 * (calA * aview(i, j + 1, k - 1) + (1 - 2 * calA) * aview(i, j + 1, k)
87 + calA * aview(i, j + 1, k + 1))
89 * (calA * aview(i, j - 1, k - 1) + (1 - 2 * calA) * aview(i, j - 1, k)
90 + calA * aview(i, j - 1, k + 1))
91 + ndisp.a6 * aview(i, j, k + 1) + ndisp.a6 * aview(i, j, k - 1)
92 + ndisp.a8 * source_view(i, j, k);
96 this->A_np1.fillHalo();
109 this->layout_mp = &(this->JN_mp->getLayout());
110 this->mesh_mp = &(this->JN_mp->get_mesh());
113 this->hr_m = this->mesh_mp->getMeshSpacing();
114 this->dt = this->hr_m[2];
115 this->domain_m = this->layout_mp->getDomain();
116 for (
unsigned int i = 0; i < Dim; ++i)
117 this->nr_m[i] = this->domain_m[i].length();
120 this->A_nm1.initialize(*this->mesh_mp, *this->layout_mp);
121 this->A_n.initialize(*this->mesh_mp, *this->layout_mp);
122 this->A_np1.initialize(*this->mesh_mp, *this->layout_mp);
129 if constexpr (boundary_conditions == periodic) {
130 this->setPeriodicBoundaryConditions();