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

Use same MLMG parameters in MS solver as in ES solver #5517

Merged
Show file tree
Hide file tree
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
16 changes: 8 additions & 8 deletions Source/FieldSolver/MagnetostaticSolver/MagnetostaticSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,22 +128,22 @@ WarpX::AddMagnetostaticFieldLabFrame()

// const amrex::Real magnetostatic_absolute_tolerance = self_fields_absolute_tolerance*PhysConst::c;
// temporary fix!!!
const amrex::Real magnetostatic_absolute_tolerance = 0.0;
amrex::Real self_fields_required_precision;
const amrex::Real absolute_tolerance = 0.0;
amrex::Real required_precision;
if constexpr (std::is_same<Real, float>::value) {
self_fields_required_precision = 1e-5;
required_precision = 1e-5;
}
else {
self_fields_required_precision = 1e-11;
required_precision = 1e-11;
}
const int self_fields_max_iters = 200;
const int self_fields_verbosity = 2;
const int verbosity = 2;

computeVectorPotential(
m_fields.get_mr_levels_alldirs(FieldType::current_fp, finest_level),
m_fields.get_mr_levels_alldirs(FieldType::vector_potential_fp_nodal, finest_level),
self_fields_required_precision, magnetostatic_absolute_tolerance, self_fields_max_iters,
self_fields_verbosity);
required_precision, absolute_tolerance, magnetostatic_solver_max_iters,
verbosity
);
}

/* Compute the vector potential `A` by solving the Poisson equation with `J` as
Expand Down
1 change: 1 addition & 0 deletions Source/WarpX.H
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,7 @@ public:

// Magnetostatic Solver Interface
MagnetostaticSolver::VectorPoissonBoundaryHandler m_vector_poisson_boundary_handler;
int magnetostatic_solver_max_iters = 200;
void ComputeMagnetostaticField ();
void AddMagnetostaticFieldLabFrame ();
void computeVectorPotential (ablastr::fields::MultiLevelVectorField const& curr,
Expand Down
1 change: 1 addition & 0 deletions Source/WarpX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,7 @@ WarpX::ReadParameters ()
poisson_solver_id!=PoissonSolverAlgo::IntegratedGreenFunction,
"To use the FFT Poisson solver, compile with WARPX_USE_FFT=ON.");
#endif
utils::parser::queryWithParser(pp_warpx, "self_fields_max_iters", magnetostatic_solver_max_iters);

WARPX_ALWAYS_ASSERT_WITH_MESSAGE(
(
Expand Down
Loading