From 1903674684db750b524543d2721d33f67e9baeac Mon Sep 17 00:00:00 2001 From: Mika Malinen Date: Sat, 25 Jan 2025 17:05:36 +0200 Subject: [PATCH] Some corrections related to bubbles --- fem/src/DefUtils.F90 | 30 +++++++++++++++++++----------- fem/src/ElementUtils.F90 | 10 ++++++---- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/fem/src/DefUtils.F90 b/fem/src/DefUtils.F90 index f4a3521b86..1a1fa0d7b8 100644 --- a/fem/src/DefUtils.F90 +++ b/fem/src/DefUtils.F90 @@ -2171,10 +2171,12 @@ FUNCTION GetElementNOFDOFs( UElement,USolver ) RESULT(n) IF (p > 1) BDOFs = GetBubbleDOFs(Element, p) BDOFs = MAX(nb, BDOFs) ELSE - Bubbles = ListGetLogical(Solver % Values, 'Bubbles', Found ) - ! The following is not a right way to obtain the bubble count - ! in order to support solverwise definitions - IF (Bubbles) BDOFs = SIZE(Element % BubbleIndexes) + IF (ASSOCIATED(Solver % Values)) THEN + Bubbles = ListGetLogical(Solver % Values, 'Bubbles', Found ) + ! The following is not a right way to obtain the bubble count + ! in order to support solverwise definitions + IF (Bubbles) BDOFs = SIZE(Element % BubbleIndexes) + END IF END IF n = n + BDOFs END IF @@ -2247,10 +2249,12 @@ FUNCTION GetElementNOFBDOFs( Element, USolver, Update ) RESULT(n) ELSE ! The element command hasn't been given, so the only way to activate the bubbles ! should be the "Bubbles" command. The following is not a reliable way to obtain - ! the bubble count when solverwise definitions are used. - Bubbles = ListGetLogical(Solver % Values, 'Bubbles', Found) - IF (Bubbles .AND. ASSOCIATED(Element % BubbleIndexes)) THEN - n = SIZE(Element % BubbleIndexes) + ! the bubble count when solverwise definitions are used. + IF (ASSOCIATED(Solver % Values)) THEN + Bubbles = ListGetLogical(Solver % Values, 'Bubbles', Found) + IF (Bubbles .AND. ASSOCIATED(CurrElement % BubbleIndexes)) THEN + n = SIZE(CurrElement % BubbleIndexes) + END IF END IF END IF @@ -2272,9 +2276,13 @@ FUNCTION GetElementNOFBDOFs( Element, USolver, Update ) RESULT(n) n = MAX(k,n) CurrElement % BDOFs = n ELSE - Bubbles = ListGetLogical(Solver % Values, 'Bubbles', Found) - IF (Bubbles .AND. ASSOCIATED(Element % BubbleIndexes)) THEN - CurrElement % BDOFs = SIZE(Element % BubbleIndexes) + IF (ASSOCIATED(Solver % Values)) THEN + Bubbles = ListGetLogical(Solver % Values, 'Bubbles', Found) + IF (Bubbles .AND. ASSOCIATED(CurrElement % BubbleIndexes)) THEN + CurrElement % BDOFs = SIZE(CurrElement % BubbleIndexes) + ELSE + CurrElement % BDOFs = 0 + END IF ELSE CurrElement % BDOFs = 0 END IF diff --git a/fem/src/ElementUtils.F90 b/fem/src/ElementUtils.F90 index ef74e252c6..6d5e5ea594 100644 --- a/fem/src/ElementUtils.F90 +++ b/fem/src/ElementUtils.F90 @@ -4300,10 +4300,12 @@ FUNCTION mGetElementDOFs( Indexes, UElement, USolver, NotDG, UMesh ) RESULT(nd) IF (p > 1) BDOFs = GetBubbleDOFs(Element, p) BDOFs = MAX(nb, BDOFs) ELSE - Bubbles = ListGetLogical(Solver % Values, 'Bubbles', Found ) - ! The following is not a right way to obtain the bubble count - ! in order to support solverwise definitions - IF (Bubbles) BDOFs = SIZE(Element % BubbleIndexes) + IF (ASSOCIATED(Solver % Values)) THEN + Bubbles = ListGetLogical(Solver % Values, 'Bubbles', Found ) + ! The following is not a right way to obtain the bubble count + ! in order to support solverwise definitions + IF (Bubbles) BDOFs = SIZE(Element % BubbleIndexes) + END IF END IF DO i=1,BDOFs nd = nd + 1