Skip to content

Commit

Permalink
Use user-defined precision in magnetoelectrostatic solver
Browse files Browse the repository at this point in the history
  • Loading branch information
RemiLehe committed Nov 12, 2024
1 parent 1b27071 commit 69d1f50
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Source/FieldSolver/MagnetostaticSolver/MagnetostaticSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ WarpX::AddMagnetostaticFieldLabFrame()
WARPX_ALWAYS_ASSERT_WITH_MESSAGE( !IsPythonCallbackInstalled("poissonsolver"),
"Python Level Poisson Solve not supported for Magnetostatic implementation.");

// const amrex::Real magnetostatic_absolute_tolerance = self_fields_absolute_tolerance*PhysConst::c;
// temporary fix!!!
// Determine precision required for convergence
const amrex::Real magnetostatic_absolute_tolerance = 0.0;
amrex::Real self_fields_required_precision;
if constexpr (std::is_same<Real, float>::value) {
Expand All @@ -144,6 +143,13 @@ WarpX::AddMagnetostaticFieldLabFrame()
else {
self_fields_required_precision = 1e-11;
}
ParmParse const pp_warpx("warpx");
utils::parser::queryWithParser(
pp_warpx, "self_fields_required_precision", self_fields_required_precision);
utils::parser::queryWithParser(
pp_warpx, "self_fields_absolute_tolerance", self_fields_absolute_tolerance);
const amrex::Real magnetostatic_absolute_tolerance = self_fields_absolute_tolerance*PhysConst::c;

const int self_fields_max_iters = 200;
const int self_fields_verbosity = 2;

Expand Down

0 comments on commit 69d1f50

Please sign in to comment.