Skip to content

Commit

Permalink
Check that all E-field values are finite in Ohm solver (ECP-WarpX#5417)
Browse files Browse the repository at this point in the history
This assert is meant to help identify the origin of a common problem in
hybrid-PIC simulations, wherein unresolved Whistler waves cause runaway
E-field values. Currently when this happens, WarpX fails in the current
deposition routine.

---------

Signed-off-by: roelof-groenewald <[email protected]>
  • Loading branch information
roelof-groenewald authored Nov 13, 2024
1 parent 6014f9b commit 09dc620
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Source/FieldSolver/WarpXPushFieldsHybridPIC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,18 @@ void WarpX::HybridPICEvolveFields ()
0, 0, 1, current_fp_temp[lev][idim]->nGrowVect());
}
}

// Check that the E-field does not have nan or inf values, otherwise print a clear message
ablastr::fields::MultiLevelVectorField Efield_fp = m_fields.get_mr_levels_alldirs(FieldType::Efield_fp, finest_level);
for (int lev = 0; lev <= finest_level; ++lev)
{
for (int idim = 0; idim < 3; ++idim) {
WARPX_ALWAYS_ASSERT_WITH_MESSAGE(
Efield_fp[lev][idim]->is_finite(),
"Non-finite value detected in E-field; this indicates more substeps should be used in the field solver."
);
}
}
}

void WarpX::HybridPICDepositInitialRhoAndJ ()
Expand Down

0 comments on commit 09dc620

Please sign in to comment.