Skip to content

Commit

Permalink
Some corrections related to bubbles
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalinen committed Jan 25, 2025
1 parent 8cb7258 commit 1903674
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 15 deletions.
30 changes: 19 additions & 11 deletions fem/src/DefUtils.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down
10 changes: 6 additions & 4 deletions fem/src/ElementUtils.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1903674

Please sign in to comment.