Skip to content

Commit

Permalink
Add option to set MLMG's no. of final smooth (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiqunZhang authored Jun 19, 2024
1 parent ea29209 commit 17569e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Projections/hydro_MacProjector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ MacProjector::setOptions ()

int num_pre_smooth(2);
int num_post_smooth(2);
int num_final_smooth(8);

// Read from input file
ParmParse pp("mac_proj");
Expand All @@ -389,6 +390,7 @@ MacProjector::setOptions ()

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

// Set default/input values
m_linop->setMaxOrder(maxorder);
Expand All @@ -401,6 +403,7 @@ MacProjector::setOptions ()

m_mlmg->setPreSmooth(num_pre_smooth);
m_mlmg->setPostSmooth(num_post_smooth);
m_mlmg->setFinalSmooth(num_final_smooth);

if (bottom_solver == "smoother")
{
Expand Down
3 changes: 3 additions & 0 deletions Projections/hydro_NodalProjector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ NodalProjector::setOptions ()

int num_pre_smooth (2);
int num_post_smooth(2);
int num_final_smooth(8);

Real normalization_threshold(-1.);

Expand All @@ -184,6 +185,7 @@ NodalProjector::setOptions ()

pp.query( "num_pre_smooth" , num_pre_smooth );
pp.query( "num_post_smooth" , num_post_smooth );
pp.query( "num_final_smooth" , num_final_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
Expand All @@ -200,6 +202,7 @@ NodalProjector::setOptions ()

m_mlmg->setPreSmooth(num_pre_smooth);
m_mlmg->setPostSmooth(num_post_smooth);
m_mlmg->setFinalSmooth(num_final_smooth);

if (bottom_solver == "smoother")
{
Expand Down

0 comments on commit 17569e1

Please sign in to comment.