Skip to content

Commit

Permalink
Set verbose level of MG solver (#615)
Browse files Browse the repository at this point in the history
* Set verbose level for MG solver

* set MG verbose default to 0
  • Loading branch information
AlexanderSinn authored Nov 3, 2021
1 parent 25ea478 commit b32544b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
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

0 comments on commit b32544b

Please sign in to comment.