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

Set verbose level of MG solver #615

Merged
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
3 changes: 3 additions & 0 deletions docs/source/run/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ Explicit solver parameters
* ``hipace.MG_tolerance_abs`` (`float`) optional (default `0.`)
Absolute error tolerance of the AMReX multigrid solver.

* ``hipace.MG_verbose`` (`int`) optional (default `0`)
Level of verbosity of the AMReX multigrid solver.

Plasma parameters
-----------------

Expand Down
2 changes: 2 additions & 0 deletions src/Hipace.H
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ public:
static amrex::Real m_MG_tolerance_rel;
/** Absolute tolerance for the multigrid solver, when using the explicit solver */
static amrex::Real m_MG_tolerance_abs;
/** Level of verbosity for the MG solver */
static int m_MG_verbose;
/** Adaptive time step instance */
AdaptiveTimeStep m_adaptive_time_step;
/** GridCurrent instance */
Expand Down
3 changes: 3 additions & 0 deletions src/Hipace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ amrex::Real Hipace::m_external_Ez_slope = 0.;
amrex::Real Hipace::m_external_Ez_uniform = 0.;
amrex::Real Hipace::m_MG_tolerance_rel = 1.e-4;
amrex::Real Hipace::m_MG_tolerance_abs = 0.;
int Hipace::m_MG_verbose = 0;
#ifdef AMREX_USE_GPU
bool Hipace::m_do_tiling = false;
#else
Expand Down Expand Up @@ -130,6 +131,7 @@ Hipace::Hipace () :

queryWithParser(pph, "MG_tolerance_rel", m_MG_tolerance_rel);
queryWithParser(pph, "MG_tolerance_abs", m_MG_tolerance_abs);
queryWithParser(pph, "MG_verbose", m_MG_verbose);
queryWithParser(pph, "do_tiling", m_do_tiling);
#ifdef AMREX_USE_GPU
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(m_do_tiling==0, "Tiling must be turned off to run on GPU.");
Expand Down Expand Up @@ -802,6 +804,7 @@ Hipace::ExplicitSolveBxBy (const int lev)
amrex::LinOpBCType::Dirichlet)});

m_mlmg = std::make_unique<amrex::MLMG>(*m_mlalaplacian);
m_mlmg->setVerbose(m_MG_verbose);
}

// BxBy is assumed to have at least one ghost cell in x and y.
Expand Down