From 17569e19c79a89b4017fc96e555b895236ab189a Mon Sep 17 00:00:00 2001 From: Weiqun Zhang Date: Tue, 18 Jun 2024 18:52:52 -0700 Subject: [PATCH] Add option to set MLMG's no. of final smooth (#130) --- Projections/hydro_MacProjector.cpp | 3 +++ Projections/hydro_NodalProjector.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Projections/hydro_MacProjector.cpp b/Projections/hydro_MacProjector.cpp index 299779f89..8dd8fafc3 100644 --- a/Projections/hydro_MacProjector.cpp +++ b/Projections/hydro_MacProjector.cpp @@ -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"); @@ -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); @@ -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") { diff --git a/Projections/hydro_NodalProjector.cpp b/Projections/hydro_NodalProjector.cpp index 577a446bf..99deec88f 100644 --- a/Projections/hydro_NodalProjector.cpp +++ b/Projections/hydro_NodalProjector.cpp @@ -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.); @@ -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 @@ -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") {