diff --git a/fem/src/DefUtils.F90 b/fem/src/DefUtils.F90 index 70f672d2b8..aa3afa9ea0 100644 --- a/fem/src/DefUtils.F90 +++ b/fem/src/DefUtils.F90 @@ -4524,13 +4524,11 @@ SUBROUTINE DefaultUpdatePrecR( M, UElement, USolver ) IF ( PRESENT( USolver ) ) THEN Solver => USolver - A => Solver % Matrix - x => Solver % Variable ELSE Solver => CurrentModel % Solver - A => Solver % Matrix - x => Solver % Variable END IF + A => Solver % Matrix + x => Solver % Variable Element => GetCurrentElement( UElement ) @@ -4569,10 +4567,15 @@ SUBROUTINE DefaultUpdatePrecR( M, UElement, USolver ) IF( Solver % PeriodicFlipActive ) THEN CALL FlipPeriodicLocalMatrix( Solver, n, Indexes, x % dofs, M ) END IF - - CALL UpdateMassMatrix( A, M, n, x % DOFs, x % Perm(Indexes(1:n)), & - A % PrecValues ) + SELECT CASE( A % Format ) + CASE( MATRIX_CRS ) + CALL CRS_GlueLocalMatrix( A, n, x % DOFs, x % Perm(Indexes(1:n)), & + M, A % PrecValues ) + CASE DEFAULT + CALL FATAL( 'DefaultUpdatePrecR', 'Unexpected matrix format') + END SELECT + IF( Solver % PeriodicFlipActive ) THEN CALL FlipPeriodicLocalMatrix( Solver, n, Indexes, x % dofs, M ) END IF @@ -4600,13 +4603,11 @@ SUBROUTINE DefaultUpdatePrecC( MC, UElement, USolver ) IF ( PRESENT( USolver ) ) THEN Solver => USolver - A => Solver % Matrix - x => Solver % Variable ELSE Solver => CurrentModel % Solver - A => Solver % Matrix - x => Solver % Variable END IF + A => Solver % Matrix + x => Solver % Variable Element => GetCurrentElement( UElement ) @@ -4656,9 +4657,15 @@ SUBROUTINE DefaultUpdatePrecC( MC, UElement, USolver ) IF( Solver % PeriodicFlipActive ) THEN CALL FlipPeriodicLocalMatrix( Solver, n, Indexes, x % dofs, M ) END IF - - CALL UpdateMassMatrix( A, M, n, x % DOFs, x % Perm(Indexes(1:n)), & - A % PrecValues ) + + SELECT CASE( A % Format ) + CASE( MATRIX_CRS ) + CALL CRS_GlueLocalMatrix( A, n, x % DOFs, x % Perm(Indexes(1:n)), & + M, A % PrecValues ) + CASE DEFAULT + CALL FATAL( 'DefaultUpdatePrecC', 'Unexpected matrix format') + END SELECT + DEALLOCATE( M ) !------------------------------------------------------------------------------ END SUBROUTINE DefaultUpdatePrecC