Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Specify precision in electromagnetostatic solver #5454

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions Source/FieldSolver/MagnetostaticSolver/MagnetostaticSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "Particles/MultiParticleContainer.H"
#include "Particles/WarpXParticleContainer.H"
#include "Python/callbacks.H"
#include "Utils/Parser/ParserUtils.H"
#include "Utils/WarpXAlgorithmSelection.H"
#include "Utils/WarpXConst.H"
#include "Utils/TextMsg.H"
Expand Down Expand Up @@ -134,16 +135,22 @@ 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!!!
const amrex::Real magnetostatic_absolute_tolerance = 0.0;
// Determine precision required for convergence
amrex::Real self_fields_absolute_tolerance = 0.0;
amrex::Real self_fields_required_precision;
if constexpr (std::is_same<Real, float>::value) {
self_fields_required_precision = 1e-5;
}
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
Loading