@@ -250,26 +250,26 @@ void HybridPICModel::GetCurrentExternal ()
250
250
251
251
void HybridPICModel::CalculatePlasmaCurrent (
252
252
ablastr::fields::MultiLevelVectorField const & Bfield,
253
- ablastr::fields::MultiLevelVectorField const & edge_lengths )
253
+ amrex::Vector<std::array< std::unique_ptr<amrex::iMultiFab>, 3 > >& eb_update_E )
254
254
{
255
255
auto & warpx = WarpX::GetInstance ();
256
256
for (int lev = 0 ; lev <= warpx.finestLevel (); ++lev)
257
257
{
258
- CalculatePlasmaCurrent (Bfield[lev], edge_lengths [lev], lev);
258
+ CalculatePlasmaCurrent (Bfield[lev], eb_update_E [lev], lev);
259
259
}
260
260
}
261
261
262
262
void HybridPICModel::CalculatePlasmaCurrent (
263
263
ablastr::fields::VectorField const & Bfield,
264
- ablastr::fields::VectorField const & edge_lengths ,
264
+ std::array< std::unique_ptr<amrex::iMultiFab>, 3 >& eb_update_E ,
265
265
const int lev)
266
266
{
267
267
WARPX_PROFILE (" HybridPICModel::CalculatePlasmaCurrent()" );
268
268
269
269
auto & warpx = WarpX::GetInstance ();
270
270
ablastr::fields::VectorField current_fp_plasma = warpx.m_fields .get_alldirs (FieldType::hybrid_current_fp_plasma, lev);
271
271
warpx.get_pointer_fdtd_solver_fp (lev)->CalculateCurrentAmpere (
272
- current_fp_plasma, Bfield, edge_lengths , lev
272
+ current_fp_plasma, Bfield, eb_update_E , lev
273
273
);
274
274
275
275
// we shouldn't apply the boundary condition to J since J = J_i - J_e but
@@ -293,15 +293,15 @@ void HybridPICModel::HybridPICSolveE (
293
293
ablastr::fields::MultiLevelVectorField const & Jfield,
294
294
ablastr::fields::MultiLevelVectorField const & Bfield,
295
295
ablastr::fields::MultiLevelScalarField const & rhofield,
296
- ablastr::fields::MultiLevelVectorField const & edge_lengths ,
296
+ amrex::Vector<std::array< std::unique_ptr<amrex::iMultiFab>, 3 > >& eb_update_E ,
297
297
const bool solve_for_Faraday) const
298
298
{
299
299
auto & warpx = WarpX::GetInstance ();
300
300
for (int lev = 0 ; lev <= warpx.finestLevel (); ++lev)
301
301
{
302
302
HybridPICSolveE (
303
303
Efield[lev], Jfield[lev], Bfield[lev], *rhofield[lev],
304
- edge_lengths [lev], lev, solve_for_Faraday
304
+ eb_update_E [lev], lev, solve_for_Faraday
305
305
);
306
306
}
307
307
}
@@ -311,13 +311,13 @@ void HybridPICModel::HybridPICSolveE (
311
311
ablastr::fields::VectorField const & Jfield,
312
312
ablastr::fields::VectorField const & Bfield,
313
313
amrex::MultiFab const & rhofield,
314
- ablastr::fields::VectorField const & edge_lengths ,
314
+ std::array< std::unique_ptr<amrex::iMultiFab>, 3 >& eb_update_E ,
315
315
const int lev, const bool solve_for_Faraday) const
316
316
{
317
317
WARPX_PROFILE (" WarpX::HybridPICSolveE()" );
318
318
319
319
HybridPICSolveE (
320
- Efield, Jfield, Bfield, rhofield, edge_lengths , lev,
320
+ Efield, Jfield, Bfield, rhofield, eb_update_E , lev,
321
321
PatchType::fine, solve_for_Faraday
322
322
);
323
323
if (lev > 0 )
@@ -332,7 +332,7 @@ void HybridPICModel::HybridPICSolveE (
332
332
ablastr::fields::VectorField const & Jfield,
333
333
ablastr::fields::VectorField const & Bfield,
334
334
amrex::MultiFab const & rhofield,
335
- ablastr::fields::VectorField const & edge_lengths ,
335
+ std::array< std::unique_ptr<amrex::iMultiFab>, 3 >& eb_update_E ,
336
336
const int lev, PatchType patch_type,
337
337
const bool solve_for_Faraday) const
338
338
{
@@ -344,7 +344,7 @@ void HybridPICModel::HybridPICSolveE (
344
344
// Solve E field in regular cells
345
345
warpx.get_pointer_fdtd_solver_fp (lev)->HybridPICSolveE (
346
346
Efield, current_fp_plasma, Jfield, Bfield, rhofield,
347
- *electron_pressure_fp, edge_lengths , lev, this , solve_for_Faraday
347
+ *electron_pressure_fp, eb_update_E , lev, this , solve_for_Faraday
348
348
);
349
349
amrex::Real const time = warpx.gett_old (0 ) + warpx.getdt (0 );
350
350
warpx.ApplyEfieldBoundary (lev, patch_type, time );
@@ -411,15 +411,15 @@ void HybridPICModel::BfieldEvolveRK (
411
411
ablastr::fields::MultiLevelVectorField const & Efield,
412
412
ablastr::fields::MultiLevelVectorField const & Jfield,
413
413
ablastr::fields::MultiLevelScalarField const & rhofield,
414
- ablastr::fields::MultiLevelVectorField const & edge_lengths ,
414
+ amrex::Vector<std::array< std::unique_ptr<amrex::iMultiFab>, 3 > >& eb_update_E ,
415
415
amrex::Real dt, DtType dt_type,
416
416
IntVect ng, std::optional<bool > nodal_sync )
417
417
{
418
418
auto & warpx = WarpX::GetInstance ();
419
419
for (int lev = 0 ; lev <= warpx.finestLevel (); ++lev)
420
420
{
421
421
BfieldEvolveRK (
422
- Bfield, Efield, Jfield, rhofield, edge_lengths , dt, lev, dt_type,
422
+ Bfield, Efield, Jfield, rhofield, eb_update_E , dt, lev, dt_type,
423
423
ng, nodal_sync
424
424
);
425
425
}
@@ -430,7 +430,7 @@ void HybridPICModel::BfieldEvolveRK (
430
430
ablastr::fields::MultiLevelVectorField const & Efield,
431
431
ablastr::fields::MultiLevelVectorField const & Jfield,
432
432
ablastr::fields::MultiLevelScalarField const & rhofield,
433
- ablastr::fields::MultiLevelVectorField const & edge_lengths ,
433
+ amrex::Vector<std::array< std::unique_ptr<amrex::iMultiFab>, 3 > >& eb_update_E ,
434
434
amrex::Real dt, int lev, DtType dt_type,
435
435
IntVect ng, std::optional<bool > nodal_sync )
436
436
{
@@ -457,7 +457,7 @@ void HybridPICModel::BfieldEvolveRK (
457
457
// The Runge-Kutta scheme begins here.
458
458
// Step 1:
459
459
FieldPush (
460
- Bfield, Efield, Jfield, rhofield, edge_lengths ,
460
+ Bfield, Efield, Jfield, rhofield, eb_update_E ,
461
461
0 .5_rt*dt, dt_type, ng, nodal_sync
462
462
);
463
463
@@ -473,7 +473,7 @@ void HybridPICModel::BfieldEvolveRK (
473
473
474
474
// Step 2:
475
475
FieldPush (
476
- Bfield, Efield, Jfield, rhofield, edge_lengths ,
476
+ Bfield, Efield, Jfield, rhofield, eb_update_E ,
477
477
0 .5_rt*dt, dt_type, ng, nodal_sync
478
478
);
479
479
@@ -493,7 +493,7 @@ void HybridPICModel::BfieldEvolveRK (
493
493
494
494
// Step 3:
495
495
FieldPush (
496
- Bfield, Efield, Jfield, rhofield, edge_lengths ,
496
+ Bfield, Efield, Jfield, rhofield, eb_update_E ,
497
497
dt, dt_type, ng, nodal_sync
498
498
);
499
499
@@ -509,7 +509,7 @@ void HybridPICModel::BfieldEvolveRK (
509
509
510
510
// Step 4:
511
511
FieldPush (
512
- Bfield, Efield, Jfield, rhofield, edge_lengths ,
512
+ Bfield, Efield, Jfield, rhofield, eb_update_E ,
513
513
0 .5_rt*dt, dt_type, ng, nodal_sync
514
514
);
515
515
@@ -543,16 +543,16 @@ void HybridPICModel::FieldPush (
543
543
ablastr::fields::MultiLevelVectorField const & Efield,
544
544
ablastr::fields::MultiLevelVectorField const & Jfield,
545
545
ablastr::fields::MultiLevelScalarField const & rhofield,
546
- ablastr::fields::MultiLevelVectorField const & edge_lengths ,
546
+ amrex::Vector<std::array< std::unique_ptr<amrex::iMultiFab>, 3 > >& eb_update_E ,
547
547
amrex::Real dt, DtType dt_type,
548
548
IntVect ng, std::optional<bool > nodal_sync )
549
549
{
550
550
auto & warpx = WarpX::GetInstance ();
551
551
552
552
// Calculate J = curl x B / mu0 - J_ext
553
- CalculatePlasmaCurrent (Bfield, edge_lengths );
553
+ CalculatePlasmaCurrent (Bfield, eb_update_E );
554
554
// Calculate the E-field from Ohm's law
555
- HybridPICSolveE (Efield, Jfield, Bfield, rhofield, edge_lengths , true );
555
+ HybridPICSolveE (Efield, Jfield, Bfield, rhofield, eb_update_E , true );
556
556
warpx.FillBoundaryE (ng, nodal_sync);
557
557
// Push forward the B-field using Faraday's law
558
558
amrex::Real const t_old = warpx.gett_old (0 );
0 commit comments