From ced23723c77d87a9bd4a8a777729aaf2ae50c922 Mon Sep 17 00:00:00 2001 From: Mika Malinen Date: Tue, 5 Nov 2024 15:30:06 +0200 Subject: [PATCH] Switch to a nested iteration + correct some typos --- fem/src/CRSMatrix.F90 | 2 +- fem/src/VankaCreate.F90 | 8 ++-- fem/src/modules/VectorHelmholtz.F90 | 2 +- .../port_eigenanalysis_3D.sif | 44 ++++++++++++++----- 4 files changed, 39 insertions(+), 17 deletions(-) diff --git a/fem/src/CRSMatrix.F90 b/fem/src/CRSMatrix.F90 index 2ae7b5bab6..c0334d5348 100644 --- a/fem/src/CRSMatrix.F90 +++ b/fem/src/CRSMatrix.F90 @@ -399,7 +399,7 @@ END SUBROUTINE CRS_AddToMatrixElement !------------------------------------------------------------------------------ -!> Check existance of a matrix element. +!> Check existence of a matrix element. !------------------------------------------------------------------------------ FUNCTION CRS_CheckMatrixElement( A,i,j ) RESULT ( Found ) !------------------------------------------------------------------------------ diff --git a/fem/src/VankaCreate.F90 b/fem/src/VankaCreate.F90 index 7f5216ac63..48fc095826 100644 --- a/fem/src/VankaCreate.F90 +++ b/fem/src/VankaCreate.F90 @@ -284,7 +284,7 @@ SUBROUTINE VankaCreate(A,Solver) CASE(0) - ! Pick entries related to ene single element and inverse the matrix. + ! Pick entries related to a single element and inverse the matrix. ! Add the inverse to the preconditioning matrix. !------------------------------------------------------------------- Active = GetNOFActive(Solver) @@ -444,13 +444,13 @@ SUBROUTINE VankaCreate(A,Solver) Mesh => Solver % Mesh IF( Mesh % MeshDim == 3 ) THEN IF(.NOT. ASSOCIATED(Mesh % Faces)) THEN - CALL Warn('VankaCreate','This mode requires existance of Faces in 3D!') + CALL Warn('VankaCreate','This mode requires existence of Faces in 3D!') CALL FindMeshFaces3D(Mesh) END IF NoElems = Mesh % NumberOfFaces ELSE IF(.NOT. ASSOCIATED(Mesh % Edges)) THEN - CALL Warn('VankaCreate','This mode requires existance of Edges in 2D!') + CALL Warn('VankaCreate','This mode requires existence of Edges in 2D!') CALL FindMeshEdges2D(Mesh) END IF @@ -604,7 +604,7 @@ SUBROUTINE VankaCreate(A,Solver) A % ILUCols => B % Cols A % ILURows => B % Rows - ! Nullify these so that they wont be destroyed + ! Nullify these so that they won't be destroyed NULLIFY( B % Values, B % Cols, B % Rows) CALL FreeMatrix( B ) END IF diff --git a/fem/src/modules/VectorHelmholtz.F90 b/fem/src/modules/VectorHelmholtz.F90 index a8be1c0270..b09e0fe607 100644 --- a/fem/src/modules/VectorHelmholtz.F90 +++ b/fem/src/modules/VectorHelmholtz.F90 @@ -1008,7 +1008,7 @@ SUBROUTINE LocalMatrixBC( BC, Element, n, nd, InitHandles ) DO p=1,nd L(:) = L(:) + CMPLX(Re_Eigenf(n+p) * WBasis(p,:), Im_Eigenf(n+p) * WBasis(p,:), kind=dp) END DO - L = 2 * B * L + L = 2.0_dp * B * L END IF ELSE MagLoad = ListGetElementComplex3D( MagLoad_h, Basis, Element, Found, GaussPoint = t ) diff --git a/fem/tests/EM_port_eigen_3D/port_eigenanalysis_3D.sif b/fem/tests/EM_port_eigen_3D/port_eigenanalysis_3D.sif index 1911ad6572..ed543ad6cb 100755 --- a/fem/tests/EM_port_eigen_3D/port_eigenanalysis_3D.sif +++ b/fem/tests/EM_port_eigen_3D/port_eigenanalysis_3D.sif @@ -140,20 +140,42 @@ Solver 3 Eigenfunction Source = Logical True Variable = EF[EF re:1 EF im:1] - Linear System Symmetric = False - Linear System Scaling = True - Linear System Solver = String "Iterative" - !Linear System Solver = String "Direct" - Linear System Iterative Method = String "bicgstabl" - BiCGstabl polynomial degree = Integer 4 - + Linear System Block Mode = True + Block Nested System = True + Block Preconditioner = True + Block Scaling = True + Linear System Preconditioning Damp Coefficient = Real 0.0 Linear System Preconditioning Damp Coefficient Im = Real -1.0 Mass-proportional Damping = True - Linear System Preconditioning = String ILU0 -! Linear System ILUT Tolerance = Real 3e-3 - Linear System Max Iterations = Integer 4000 - Linear System Convergence Tolerance = 1.0e-7 + +! Linear system solver for the outer loop: +!----------------------------------------- + Outer: Linear System Solver = "Iterative" + Outer: Linear System Convergence Tolerance = 1e-7 +! Outer: Linear System Normwise Backward Error = True + Outer: Linear System Iterative Method = gcr + Outer: Linear System GCR Restart = 100 + Outer: Linear System Residual Output = 1 + Outer: Linear System Max Iterations = 100 + Outer: Linear System Pseudo Complex = True + +! Linear system solver for the inner solution: +!--------------------------------------------- + $blocktol = 5.0e-2 + + block 11: Linear System Solver = "Iterative" + block 11: Linear System Complex = True + block 11: Linear System Row Equilibration = False + block 11: Linear System Preconditioning = ILUT + block 11: Linear System ILUT Tolerance = 3.0e-1 + block 11: Linear System Residual Output = 5 + block 11: Linear System Max Iterations = 200 + block 11: Linear System Iterative Method = GCR + block 11: Linear System GCR Restart = 50 +! block 11: BiCGstabl polynomial degree = 4 + block 11: Linear System Normwise Backward Error = False + block 11: Linear System Convergence Tolerance = $blocktol Linear System Abort not Converged = False