From e9980164d624637d3addca063c2e089176a6274a Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Sat, 23 Nov 2024 16:51:23 -0600 Subject: [PATCH 1/4] MGR tests --- .../linearAlgebra/interfaces/hypre/HypreMGR.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/coreComponents/linearAlgebra/interfaces/hypre/HypreMGR.hpp b/src/coreComponents/linearAlgebra/interfaces/hypre/HypreMGR.hpp index feca89dd6d0..fd090d79bbc 100644 --- a/src/coreComponents/linearAlgebra/interfaces/hypre/HypreMGR.hpp +++ b/src/coreComponents/linearAlgebra/interfaces/hypre/HypreMGR.hpp @@ -178,9 +178,9 @@ class MGRStrategyBase GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetTol( solver.ptr, 0.0 ) ); GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetMaxIter( solver.ptr, 1 ) ); GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetMaxRowSum( solver.ptr, 1.0 ) ); - GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetStrongThreshold( solver.ptr, 0.6 ) ); + GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetStrongThreshold( solver.ptr, 0.8 ) ); GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetPrintLevel( solver.ptr, 0 ) ); - GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetInterpType( solver.ptr, hypre::getAMGInterpolationType( LinearSolverParameters::AMG::InterpType::modifiedExtendedE )) ); + GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetInterpType( solver.ptr, hypre::getAMGInterpolationType( LinearSolverParameters::AMG::InterpType::ExtendedI )) ); #if GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_CUDA || GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_HIP GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetCoarsenType( solver.ptr, hypre::getAMGCoarseningType( LinearSolverParameters::AMG::CoarseningType::PMIS ) ) ); GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetRelaxType( solver.ptr, hypre::getAMGRelaxationType( LinearSolverParameters::AMG::SmootherType::chebyshev ) ) ); @@ -192,6 +192,9 @@ class MGRStrategyBase GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetNumFunctions( solver.ptr, 3 ) ); GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetFilterFunctions( solver.ptr, separateComponents ) ); + GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetAggNumLevels( solver.ptr, 1 ) ); + GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetAggInterpType( solver.ptr, hypre::getAMGAggressiveInterpolationType( LinearSolverParameters::AMG::AggInterpType::multipass ) ) ); + solver.setup = HYPRE_BoomerAMGSetup; solver.solve = HYPRE_BoomerAMGSolve; solver.destroy = HYPRE_BoomerAMGDestroy; From 747062e6cf7ad24d46ffa1e26904cc94da06a80c Mon Sep 17 00:00:00 2001 From: Pavel Tomin Date: Mon, 25 Nov 2024 12:27:54 -0600 Subject: [PATCH 2/4] Update HypreMGR.hpp --- src/coreComponents/linearAlgebra/interfaces/hypre/HypreMGR.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreComponents/linearAlgebra/interfaces/hypre/HypreMGR.hpp b/src/coreComponents/linearAlgebra/interfaces/hypre/HypreMGR.hpp index fd090d79bbc..bae8c2d38d9 100644 --- a/src/coreComponents/linearAlgebra/interfaces/hypre/HypreMGR.hpp +++ b/src/coreComponents/linearAlgebra/interfaces/hypre/HypreMGR.hpp @@ -180,7 +180,7 @@ class MGRStrategyBase GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetMaxRowSum( solver.ptr, 1.0 ) ); GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetStrongThreshold( solver.ptr, 0.8 ) ); GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetPrintLevel( solver.ptr, 0 ) ); - GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetInterpType( solver.ptr, hypre::getAMGInterpolationType( LinearSolverParameters::AMG::InterpType::ExtendedI )) ); + GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetInterpType( solver.ptr, hypre::getAMGInterpolationType( LinearSolverParameters::AMG::InterpType::extendedI )) ); #if GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_CUDA || GEOS_USE_HYPRE_DEVICE == GEOS_USE_HYPRE_HIP GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetCoarsenType( solver.ptr, hypre::getAMGCoarseningType( LinearSolverParameters::AMG::CoarseningType::PMIS ) ) ); GEOS_LAI_CHECK_ERROR( HYPRE_BoomerAMGSetRelaxType( solver.ptr, hypre::getAMGRelaxationType( LinearSolverParameters::AMG::SmootherType::chebyshev ) ) ); From 60d1630365eec6e03698a6912b4113903e1d5ef4 Mon Sep 17 00:00:00 2001 From: "Victor A. P. Magri" Date: Mon, 25 Nov 2024 18:09:15 -0500 Subject: [PATCH 3/4] Use injection as restriction in first level --- .../mgrStrategies/MultiphasePoromechanicsReservoirFVM.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/MultiphasePoromechanicsReservoirFVM.hpp b/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/MultiphasePoromechanicsReservoirFVM.hpp index 18293db1f12..483b8a05684 100644 --- a/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/MultiphasePoromechanicsReservoirFVM.hpp +++ b/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/MultiphasePoromechanicsReservoirFVM.hpp @@ -87,8 +87,8 @@ class MultiphasePoromechanicsReservoirFVM : public MGRStrategyBase< 4 > m_levelFRelaxType[0] = MGRFRelaxationType::amgVCycle; m_levelFRelaxIters[0] = 1; m_levelInterpType[0] = MGRInterpolationType::jacobi; - m_levelRestrictType[0] = MGRRestrictionType::injection; - m_levelCoarseGridMethod[0] = MGRCoarseGridMethod::nonGalerkin; + m_levelRestrictType[0] = MGRRestrictionType::jacobi; //MGRRestrictionType::injection; + m_levelCoarseGridMethod[0] = (MGRCoarseGridMethod) 5; //MGRCoarseGridMethod::nonGalerkin; m_levelGlobalSmootherType[0] = MGRGlobalSmootherType::none; // Level 1 From 8fbb5d52c449110b2277ba2ca217f174e1399a3c Mon Sep 17 00:00:00 2001 From: "Victor A. P. Magri" Date: Mon, 25 Nov 2024 18:11:30 -0500 Subject: [PATCH 4/4] Use injection as restriction and prolongation in first level --- .../mgrStrategies/MultiphasePoromechanicsReservoirFVM.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/MultiphasePoromechanicsReservoirFVM.hpp b/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/MultiphasePoromechanicsReservoirFVM.hpp index 483b8a05684..0f3e2612e15 100644 --- a/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/MultiphasePoromechanicsReservoirFVM.hpp +++ b/src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/MultiphasePoromechanicsReservoirFVM.hpp @@ -86,8 +86,8 @@ class MultiphasePoromechanicsReservoirFVM : public MGRStrategyBase< 4 > // Level 0 m_levelFRelaxType[0] = MGRFRelaxationType::amgVCycle; m_levelFRelaxIters[0] = 1; - m_levelInterpType[0] = MGRInterpolationType::jacobi; - m_levelRestrictType[0] = MGRRestrictionType::jacobi; //MGRRestrictionType::injection; + m_levelInterpType[0] = MGRInterpolationType::injection; + m_levelRestrictType[0] = MGRRestrictionType::injection; //MGRRestrictionType::jacobi; m_levelCoarseGridMethod[0] = (MGRCoarseGridMethod) 5; //MGRCoarseGridMethod::nonGalerkin; m_levelGlobalSmootherType[0] = MGRGlobalSmootherType::none;