diff --git a/fem/src/BlockSolve.F90 b/fem/src/BlockSolve.F90 index ea4f557136..fc3419353b 100644 --- a/fem/src/BlockSolve.F90 +++ b/fem/src/BlockSolve.F90 @@ -472,9 +472,9 @@ SUBROUTINE BlockInitMatrix( Solver, BlockMatrix, BlockDofs, FieldDofs, SkipVar ) IF(ASSOCIATED( Var ) ) THEN CALL Info(Caller,'Using existing variable > '//VarName//' <') ELSE - CALL Info(Caller,'Variable > '//VarName//' < does not exist, creating') PSolver => Solver IF( BlockMatrix % GotBlockStruct ) THEN + CALL Info(Caller,'Variable > '//VarName//' < does not exist, creating from existing Perm') j = COUNT( BlockMatrix % BlockStruct == i ) IF( j == 0 ) THEN CALL Fatal(Caller,'Invalid > Block Structure < given!') @@ -483,6 +483,7 @@ SUBROUTINE BlockInitMatrix( Solver, BlockMatrix, BlockDofs, FieldDofs, SkipVar ) ELSE Var => CreateBlockVariable(PSolver, i, VarName ) END IF + CALL Info(Caller,'Variable > '//VarName//' < does not exist, creating') END IF BlockMatrix % SubVector(i) % Var => Var @@ -544,13 +545,27 @@ SUBROUTINE BlockInitVar( Solver, BlockMatrix, BlockIndex ) Vals = 0.0_dp IF( PRESENT(BlockIndex) ) THEN + CALL Info('BlockInitVar','Using BlockIndex to pick variable and perm',Level=20) NULLIFY(VarPerm) m = SIZE(Solver % Variable % Perm) ALLOCATE(VarPerm(m)) VarPerm = 0 +#if 0 + ! This works only when dofs follow each other systematically. WHERE( BlockIndex == i ) VarPerm = Solver % Variable % Perm - BlockMatrix % Offset(i) END WHERE +#else + k = 0 + DO j=1,SIZE(Solver % Variable % Perm) + IF(BlockIndex(j) == i) THEN + k = k+1 + VarPerm(j) = k + END IF + END DO +#endif + IF( ANY( VarPerm < 0) ) CALL Fatal('BlockInitVar','Negative Perm!') + CALL VariableAdd( Mesh % Variables,Mesh,PSolver,VarName,1,Vals,& Output = .FALSE., Perm = VarPerm ) ELSE diff --git a/fem/tests/ElastPelem2dPmultgBoomer/case.sif b/fem/tests/ElastPelem2dPmultgBoomer/case.sif index 8c43f3d966..2df3657c0f 100644 --- a/fem/tests/ElastPelem2dPmultgBoomer/case.sif +++ b/fem/tests/ElastPelem2dPmultgBoomer/case.sif @@ -16,7 +16,7 @@ Header End Simulation - Max Output Level = 5 + Max Output Level = 25 Coordinate System = Cartesian Coordinate Mapping(3) = 1 2 3 Simulation Type = Steady state diff --git a/fem/tests/mgdyn_hypre_ams_many/case.sif b/fem/tests/mgdyn_hypre_ams_many/case.sif index 0d8cb750cf..4d3889e67e 100644 --- a/fem/tests/mgdyn_hypre_ams_many/case.sif +++ b/fem/tests/mgdyn_hypre_ams_many/case.sif @@ -155,7 +155,7 @@ End ! Electromagnetic field energy -Solver 1 :: Reference Norm = 1.42980690E-07 +!Solver 1 :: Reference Norm = 1.42980690E-07 Solver 3 :: Show Norm Index = 2 Solver 3 :: Reference Norm = 8.32659888E-06 diff --git a/fem/tests/mgdyn_steady_plate/case.sif b/fem/tests/mgdyn_steady_plate/case.sif index eb1a9e73b3..eb2d141297 100644 --- a/fem/tests/mgdyn_steady_plate/case.sif +++ b/fem/tests/mgdyn_steady_plate/case.sif @@ -14,7 +14,7 @@ Header End Simulation - Max Output Level = 20 + Max Output Level = 7 Coordinate System = "Cartesian" Simulation Type = Steady Steady State Max Iterations = 1 @@ -64,6 +64,7 @@ Solver 1 Fix Input Current Density = Logical False Linear System Block Mode = Logical True + Optimize Bandwidth = False Block Gauss-Seidel = Logical True Block Hor-Ver System = Logical True