From 2ac2c53941fa90903b7aa7895c2f6b14d436459f Mon Sep 17 00:00:00 2001 From: Gregor Olenik Date: Thu, 11 Jul 2024 10:20:36 +0200 Subject: [PATCH 1/9] wip add multigrid, gko.1.8.0 --- CMakeLists.txt | 4 + DevicePersistent/Base/Base.C | 6 + .../CsrMatrixWrapper/CsrMatrixWrapper.H | 66 ++++-- .../ExecutorHandler/ExecutorHandler.H | 2 +- DevicePersistent/Partition/Partition.H | 6 +- HostMatrix/HostMatrix.C | 7 +- HostMatrix/HostMatrix.H | 43 ++++ Solver/Multigrid/GKOMultigrid.H | 208 +++++++++--------- lduLduBase/lduLduBase.H | 4 +- 9 files changed, 212 insertions(+), 134 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 95d9626fb..87d799b15 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -158,6 +158,8 @@ target_sources( PRIVATE common/common.C ${CMAKE_CURRENT_BINARY_DIR}/version.C lduLduBase/lduLduBase.C + HostMatrix/HostMatrix.C + HostMatrix/HostMatrixFreeFunctions.C StoppingCriterion/StoppingCriterion.C DevicePersistent/Base/Base.C DevicePersistent/Partition/Partition.C @@ -170,6 +172,8 @@ target_sources( BaseWrapper/CoupledLduBase/GKOCoupledLduBase.C Solver/CG/GKOCG.C Solver/BiCGStab/GKOBiCGStab.C + # Solver / IR / GKOIR.C + Solver/Multigrid/GKOMultigrid.C Solver/GMRES/GKOGMRES.C PUBLIC common/common.H StoppingCriterion/StoppingCriterion.H diff --git a/DevicePersistent/Base/Base.C b/DevicePersistent/Base/Base.C index abf416eef..9801a6621 100644 --- a/DevicePersistent/Base/Base.C +++ b/DevicePersistent/Base/Base.C @@ -29,4 +29,10 @@ defineTemplateTypeNameWithName(DevicePersistentBase, typedef gko::experimental::distributed::Matrix GkoMatrix; defineTemplateTypeNameWithName(DevicePersistentBase, "PersistentMatrix"); + +// typedef needed to avoid confusion with the comma separated template +// arguments as macro arguments +typedef gko::experimental::distributed::Partition Partition; +defineTemplateTypeNameWithName(DevicePersistentBase, + "PersistentPartition"); } // namespace Foam diff --git a/DevicePersistent/CsrMatrixWrapper/CsrMatrixWrapper.H b/DevicePersistent/CsrMatrixWrapper/CsrMatrixWrapper.H index 8962e1b39..539a00810 100644 --- a/DevicePersistent/CsrMatrixWrapper/CsrMatrixWrapper.H +++ b/DevicePersistent/CsrMatrixWrapper/CsrMatrixWrapper.H @@ -38,6 +38,8 @@ struct MatrixInitFunctor { const PersistentArray &non_local_coeffs_; + const CommunicationPattern &communication_pattern_; + const word matrix_format_; const bool regenerate_; @@ -54,6 +56,7 @@ struct MatrixInitFunctor { const PersistentArray