Skip to content

Commit

Permalink
Allow us to set the "normalization threshold" variable at run-time (#…
Browse files Browse the repository at this point in the history
…1917)

through the NodalProjector class
  • Loading branch information
asalmgren authored Mar 31, 2021
1 parent b8559fe commit ecf7e98
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Src/LinearSolvers/Projections/AMReX_NodalProjector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ void NodalProjector::define (LPInfo const& a_lpinfo)
void
NodalProjector::setOptions ()
{

// Default values
int bottom_verbose(0);
int maxiter(100);
Expand All @@ -150,6 +149,8 @@ NodalProjector::setOptions ()
int num_pre_smooth (2);
int num_post_smooth(2);

Real normalization_threshold(-1.);

// Read from input file
ParmParse pp("nodal_proj");
pp.query( "verbose" , m_verbose );
Expand All @@ -160,9 +161,16 @@ NodalProjector::setOptions ()
pp.query( "bottom_atol" , bottom_atol );
pp.query( "bottom_solver" , bottom_solver );

pp.query( "normalization_threshold" , normalization_threshold);

pp.query( "num_pre_smooth" , num_pre_smooth );
pp.query( "num_post_smooth" , num_post_smooth );

// This is only used by the Krylov solvers but we pass it through the nodal operator
// if it is set here. Otherwise we use the default set in AMReX_NodeLaplacian.H
if (normalization_threshold > 0.)
m_linop->setNormalizationThreshold(normalization_threshold);

// Set default/input values
m_mlmg->setVerbose(m_verbose);
m_mlmg->setBottomVerbose(bottom_verbose);
Expand Down

0 comments on commit ecf7e98

Please sign in to comment.