@@ -167,9 +167,6 @@ struct CopyAndTimestamp {
167
167
int m_delta_index;
168
168
int m_normal_index;
169
169
int m_step;
170
- const amrex::Real m_dt;
171
- amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> m_plo;
172
- amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> m_phi;
173
170
int m_idim;
174
171
int m_iside;
175
172
@@ -189,59 +186,16 @@ struct CopyAndTimestamp {
189
186
for (int j = 0 ; j < src.m_num_runtime_int ; ++j) {
190
187
dst.m_runtime_idata [j][dst_i] = src.m_runtime_idata [j][src_i];
191
188
}
192
-
193
- amrex::ParticleReal const ux = dst.m_rdata [PIdx::ux][dst_i];
194
- amrex::ParticleReal const uy = dst.m_rdata [PIdx::uy][dst_i];
195
- amrex::ParticleReal const uz = dst.m_rdata [PIdx::uz][dst_i];
196
189
197
190
dst.m_runtime_idata [m_step_index][dst_i] = m_step;
198
- amrex::Real delta_t ;
199
- amrex::Real exit_velocity = 0 ;
200
- if (m_idim == 0 ) {
201
- exit_velocity = ux;
202
- } else if (m_idim == 1 ) {
203
- exit_velocity = uy;
204
- } else {
205
- exit_velocity = uz;
206
- }
191
+ dst.m_runtime_rdata [m_delta_index][dst_i] = 0 ._rt ;
207
192
208
- if (m_iside==1 ){ // iside=1, we are in the right side
209
- delta_t = std::abs (dst.m_rdata [PIdx::z][dst_i]-m_phi[m_idim])/exit_velocity;
210
- dst.m_runtime_rdata [m_delta_index][dst_i] = delta_t ;
211
- } else {
212
- delta_t = std::abs (dst.m_rdata [PIdx::z][dst_i]-m_plo[m_idim])/exit_velocity;
213
- dst.m_runtime_rdata [m_delta_index][dst_i] = delta_t ;
214
- }
215
- }
216
193
// calculation of the normal to the boundary
217
194
std::array<double , 3 > n = {0.0 , 0.0 , 0.0 };
218
195
n[m_idim]=1 -2 *m_iside;
219
196
dst.m_runtime_rdata [m_normal_index][dst_i]= n[0 ];
220
197
dst.m_runtime_rdata [m_normal_index+1 ][dst_i]= n[1 ];
221
198
dst.m_runtime_rdata [m_normal_index+2 ][dst_i]= n[2 ];
222
-
223
- #if (defined WARPX_DIM_3D)
224
- [dst_i]-=(m_dt-delta_t )*ux;
225
- dst.m_rdata[PIdx::y][dst_i]-=(m_dt-dedst.m_rdata[PIdx::x]lta_t )*uy;
226
- dst.m_rdata[PIdx::z][dst_i]-=(m_dt-delta_t )*uz;
227
- #elif (defined WARPX_DIM_XZ)
228
- dst.m_rdata[PIdx::x][dst_i]-=(m_dt-delta_t )*ux;
229
- dst.m_rdata[PIdx::z][dst_i]-=(m_dt-delta_t )*uz;
230
- #elif (defined WARPX_DIM_RZ)
231
- amrex::ParticleReal theta_temp=dst.m_rdata[PIdx::theta][dst_i];
232
- amrex::ParticleReal x_temp=dst.m_rdata[PIdx::x][dst_i]*std::cos (theta_temp);
233
- amrex::ParticleReal y_temp=dst.m_rdata[PIdx::y][dst_i]*std::sin (theta);
234
- amrex::ParticleReal z_temp=dst.m_rdata[PIdx::z][dst_i];
235
- x_temp -=(m_dt-delta_t )*ux;
236
- y_temp -=(m_dt-delta_t )*uy;
237
- z_temp -=(m_dt-delta_t )*uz;
238
- theta_temp= std::atan2(y_temp, x_temp);
239
- dst.m_rdata[PIdx::theta][dst_i] = theta_temp;
240
- dst.m_rdata[PIdx::x][dst_i] =x_temp/std::cos(theta_temp);
241
- dst.m_rdata[PIdx::z][dst_i] =z_temp/std::sin(theta_temp);
242
- #else (defined WARPX_DIM_1D_Z)
243
- dst.m_rdata[PIdx::z][dst_i] -=(m_dt-delta_t )*uz;
244
- #endif
245
199
}
246
200
};
247
201
@@ -467,17 +421,15 @@ void ParticleBoundaryBuffer::gatherParticles (MultiParticleContainer& mypc,
467
421
{
468
422
WARPX_PROFILE (" ParticleBoundaryBuffer::gatherParticles::filterAndTransform" );
469
423
auto & warpx = WarpX::GetInstance ();
470
- const auto dt = warpx.getdt (pti.GetLevel ());
471
424
auto string_to_index_intcomp = buffer[i].getParticleRuntimeiComps ();
472
425
const int step_scraped_index = string_to_index_intcomp.at (" stepScraped" );
473
426
auto string_to_index_realcomp = buffer[i].getParticleRuntimeComps ();
474
427
const int delta_index = string_to_index_realcomp.at (" deltaTimeScraped" );
475
428
const int normal_index = string_to_index_realcomp.at (" nx" );
476
429
const int step = warpx_instance.getistep (0 );
477
-
478
430
amrex::filterAndTransformParticles (ptile_buffer, ptile,
479
431
predicate,
480
- CopyAndTimestamp{step_scraped_index, delta_index, normal_index, step, dt, plo, phi, idim, iside},
432
+ CopyAndTimestamp{step_scraped_index, delta_index, normal_index, step, idim, iside},
481
433
0 , dst_index);
482
434
}
483
435
}
@@ -612,4 +564,4 @@ ParticleBoundaryBuffer::getParticleBufferPointer(const std::string species_name,
612
564
auto index = WarpX::GetInstance ().GetPartContainer ().getSpeciesID (species_name);
613
565
614
566
return &buffer[index ];
615
- }
567
+ }
0 commit comments