@@ -62,12 +62,22 @@ Index filterCreateTransformFromFAB (DstTile& dst1, DstTile& dst2, const amrex::B
62
62
63
63
constexpr int spacedim = AMREX_SPACEDIM;
64
64
65
+ #if defined(WARPX_DIM_1D_Z)
66
+ const Real zlo_global = geom.ProbLo (0 );
67
+ const Real dz = geom.CellSize (0 );
68
+ #elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
65
69
const Real xlo_global = geom.ProbLo (0 );
66
70
const Real dx = geom.CellSize (0 );
67
- const Real ylo_global = (spacedim == 3 ) ? geom.ProbLo (1 ) : amrex::Real (0 .);
68
- const Real dy = (spacedim == 3 ) ? geom.CellSize (1 ) : amrex::Real (0 .);
69
- const Real zlo_global = (spacedim == 3 ) ? geom.ProbLo (2 ) : geom.ProbLo (1 );
70
- const Real dz = (spacedim == 3 ) ? geom.CellSize (2 ) : geom.CellSize (1 );
71
+ const Real zlo_global = geom.ProbLo (1 );
72
+ const Real dz = geom.CellSize (1 );
73
+ #elif defined(WARPX_DIM_3D)
74
+ const Real xlo_global = geom.ProbLo (0 );
75
+ const Real dx = geom.CellSize (0 );
76
+ const Real ylo_global = geom.ProbLo (1 );
77
+ const Real dy = geom.CellSize (1 );
78
+ const Real zlo_global = geom.ProbLo (2 );
79
+ const Real dz = geom.CellSize (2 );
80
+ #endif
71
81
72
82
const auto arrNumPartCreation = src_FAB->array ();
73
83
Gpu::DeviceVector<Index> offsets (ncells);
@@ -91,14 +101,24 @@ Index filterCreateTransformFromFAB (DstTile& dst1, DstTile& dst2, const amrex::B
91
101
{
92
102
const IntVect iv = box.atOffset (i);
93
103
const int j = iv[0 ];
94
- const int k = iv[1 ];
104
+ const int k = (spacedim >= 2 ) ? iv[1 ] : 0 ;
95
105
const int l = (spacedim == 3 ) ? iv[2 ] : 0 ;
96
106
97
107
// Currently all particles are created on nodes. This makes it useless
98
108
// to use N>1 (for now).
99
- const Real x = xlo_global + j*dx;
100
- const Real y = ylo_global + k*dy;
101
- const Real z = (spacedim == 3 ) ? zlo_global + l*dz : zlo_global + k*dz;
109
+ #if defined(WARPX_DIM_1D_Z)
110
+ Real const x = 0.0 ;
111
+ Real const y = 0.0 ;
112
+ Real const z = zlo_global + j*dz;
113
+ #elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
114
+ Real const x = xlo_global + j*dx;
115
+ Real const y = 0.0 ;
116
+ Real const z = zlo_global + k*dz;
117
+ #elif defined(WARPX_DIM_3D)
118
+ Real const x = xlo_global + j*dx;
119
+ Real const y = ylo_global + k*dy;
120
+ Real const z = zlo_global + l*dz;
121
+ #endif
102
122
103
123
for (int n = 0 ; n < N; ++n)
104
124
{
0 commit comments