Skip to content

Commit

Permalink
the external current only needs to be calculated once per field solve…
Browse files Browse the repository at this point in the history
… step
  • Loading branch information
roelof-groenewald committed Dec 1, 2023
1 parent 045e56f commit 3f0fa04
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/FieldSolver/WarpXPushFieldsHybridPIC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ void WarpX::HybridPICEvolveFields ()
// Get requested number of substeps to use
int sub_steps = m_hybrid_pic_model->m_substeps / 2;

// Get the external current
m_hybrid_pic_model->GetCurrentExternal(m_edge_lengths);

// Reference hybrid-PIC multifabs
auto& rho_fp_temp = m_hybrid_pic_model->rho_fp_temp;
auto& current_fp_temp = m_hybrid_pic_model->current_fp_temp;
Expand Down Expand Up @@ -95,7 +98,6 @@ void WarpX::HybridPICEvolveFields ()
// momentum equation
for (int sub_step = 0; sub_step < sub_steps; sub_step++)
{
m_hybrid_pic_model->GetCurrentExternal(m_edge_lengths);
m_hybrid_pic_model->CalculateCurrentAmpere(Bfield_fp, m_edge_lengths);
m_hybrid_pic_model->HybridPICSolveE(
Efield_fp, current_fp_temp, Bfield_fp, rho_fp_temp, m_edge_lengths,
Expand Down Expand Up @@ -124,7 +126,6 @@ void WarpX::HybridPICEvolveFields ()
// Now push the B field from t=n+1/2 to t=n+1 using the n+1/2 quantities
for (int sub_step = 0; sub_step < sub_steps; sub_step++)
{
m_hybrid_pic_model->GetCurrentExternal(m_edge_lengths);
m_hybrid_pic_model->CalculateCurrentAmpere(Bfield_fp, m_edge_lengths);
m_hybrid_pic_model->HybridPICSolveE(
Efield_fp, current_fp, Bfield_fp, rho_fp_temp, m_edge_lengths,
Expand Down Expand Up @@ -157,7 +158,6 @@ void WarpX::HybridPICEvolveFields ()
m_hybrid_pic_model->CalculateElectronPressure(DtType::Full);

// Update the E field to t=n+1 using the extrapolated J_i^n+1 value
m_hybrid_pic_model->GetCurrentExternal(m_edge_lengths);
m_hybrid_pic_model->CalculateCurrentAmpere(Bfield_fp, m_edge_lengths);
m_hybrid_pic_model->HybridPICSolveE(
Efield_fp, current_fp_temp, Bfield_fp, rho_fp, m_edge_lengths,
Expand Down

0 comments on commit 3f0fa04

Please sign in to comment.