diff --git a/test/field/TestField3.cpp b/test/field/TestField3.cpp index b2ed803477d614e166112e375185eadacdbcedf6..b639a8cc9eb8e8cefcb886220e5f93a2c9aee152 100644 --- a/test/field/TestField3.cpp +++ b/test/field/TestField3.cpp @@ -86,12 +86,12 @@ int main(int argc, char *argv[]) { const int k) { //local to global index conversion - const size_t ig = i + lDom[0].first() + nghost; - const size_t jg = j + lDom[1].first() + nghost; - const size_t kg = k + lDom[2].first() + nghost; - double x = (ig + 0.5) * hx[0]; - double y = (jg + 0.5) * hx[1]; - double z = (kg + 0.5) * hx[2]; + const size_t ig = i + lDom[0].first() - nghost; + const size_t jg = j + lDom[1].first() - nghost; + const size_t kg = k + lDom[2].first() - nghost; + double x = origin[0] + (ig + 0.5) * hx[0]; + double y = origin[1] + (jg + 0.5) * hx[1]; + double z = origin[2] + (kg + 0.5) * hx[2]; //view(i, j, k) = 3.0*pow(x,1) + 4.0*pow(y,1) + 5.0*pow(z,1); //view(i, j, k) = sin(pi * x) * cos(pi * y) * exp(z); diff --git a/test/field/TestFieldBC.cpp b/test/field/TestFieldBC.cpp index 7bdd6d7c3704bfa9f14202763f925ec15d2b9025..02a745d1f70f35f6485b3236aa87ed19ab430085 100644 --- a/test/field/TestFieldBC.cpp +++ b/test/field/TestFieldBC.cpp @@ -71,12 +71,12 @@ int main(int argc, char *argv[]) { const int k) { //local to global index conversion - const size_t ig = i + lDom[0].first() + nghost; - //const size_t jg = j + lDom[1].first() + nghost; - //const size_t kg = k + lDom[2].first() + nghost; - double x = (ig + 0.5) * hx[0]; - //double y = (jg + 0.5) * hx[1]; - //double z = (kg + 0.5) * hx[2]; + const size_t ig = i + lDom[0].first() - nghost; + //const size_t jg = j + lDom[1].first() - nghost; + //const size_t kg = k + lDom[2].first() - nghost; + double x = origin[0] + (ig + 0.5) * hx[0]; + //double y = origin[1] + (jg + 0.5) * hx[1]; + //double z = origin[2] + (kg + 0.5) * hx[2]; //view(i, j, k) = 3.0*pow(x,1) + 4.0*pow(y,1) + 5.0*pow(z,1); //view(i, j, k) = sin(pi * x) * cos(pi * y) * exp(z); diff --git a/test/particle/PIC3d.cpp b/test/particle/PIC3d.cpp index 0b5f7305b0c5d64a6dee74dbeb1acfeaa1d2bf6d..d199f75722a94fdc16b325b9551b85cb26b25c9a 100644 --- a/test/particle/PIC3d.cpp +++ b/test/particle/PIC3d.cpp @@ -206,9 +206,9 @@ public: KOKKOS_LAMBDA(const size_t i, const size_t j, const size_t k){ //local to global index conversion - const size_t ig = i + lDom[0].first() + nghost; - const size_t jg = j + lDom[1].first() + nghost; - const size_t kg = k + lDom[2].first() + nghost; + const size_t ig = i + lDom[0].first() - nghost; + const size_t jg = j + lDom[1].first() - nghost; + const size_t kg = k + lDom[2].first() - nghost; view(i, j, k)[0] = -scale_fact*2.0*pi*phi0 * cos(2.0*pi*(ig+0.5)*hr[0]) * @@ -225,8 +225,8 @@ public: KOKKOS_LAMBDA(const size_t i, const size_t j, const size_t k){ //local to global index conversion - const size_t ig = i + lDom[0].first() + nghost; - const size_t jg = j + lDom[1].first() + nghost; + const size_t ig = i + lDom[0].first() - nghost; + const size_t jg = j + lDom[1].first() - nghost; view(i, j, k)[1] = scale_fact*4.0*pi*phi0 * sin(2.0*pi*(ig+0.5)*hr[0]) * @@ -242,8 +242,8 @@ public: KOKKOS_LAMBDA(const size_t i, const size_t j, const size_t k){ //local to global index conversion - const size_t ig = i + lDom[0].first() + nghost; - const size_t jg = j + lDom[1].first() + nghost; + const size_t ig = i + lDom[0].first() - nghost; + const size_t jg = j + lDom[1].first() - nghost; view(i, j, k)[2] = scale_fact*4.0*pi*phi0 * sin(2.0*pi*(ig+0.5)*hr[0]) *