Skip to content

Commit

Permalink
Don't mix PrecValues updates with mass lumping procedure
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalinen committed Nov 14, 2024
1 parent 4202809 commit 9ef9aee
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions fem/src/DefUtils.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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 )

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 )

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9ef9aee

Please sign in to comment.