Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 41 additions & 28 deletions src/submodules/STScalarField/src/STScalarField_Class@DBCMethods.F90
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,29 @@

CALL dbc%get(nodalvalue=nodalvalue, nodenum=nodenum, times=times)

IF (SIZE(nodalvalue, 2) .EQ. 1) THEN
DO idof = 1, obj%timecompo
CALL obj%Set(globalNode=nodenum, VALUE=nodalvalue(:, 1), &
& timecompo=idof)
END DO

ELSE
aint = SIZE(nodalvalue, 2)
IF (SIZE(nodalvalue, 2) .NE. obj%timeCompo) THEN
IF (PRESENT(times)) THEN
aint = SIZE(times)
IF (aint .NE. obj%timeCompo) THEN
CALL e%raiseError(modName//'::'//myName//" - "// &
& '[INERNAL ERROR] :: SIZE( nodalvalue, 2 ) is '// &
& '[INERNAL ERROR] :: SIZE( times ) is '// &
& tostring(aint)//' which is not equal to obj%timeCompo '// &
& ' which is '//tostring(obj%timeCompo))
RETURN
END IF
CALL obj%Set(globalNode=nodenum, VALUE=nodalvalue)
DO idof = 1, obj%timecompo
CALL obj%Set(globalNode=nodenum, VALUE=nodalvalue(:, idof), &
& timecompo=idof)
END DO

IF (ALLOCATED(nodalvalue)) DEALLOCATE (nodalvalue)
IF (ALLOCATED(nodenum)) DEALLOCATE (nodenum)
RETURN
END IF

DO idof = 1, obj%timecompo
CALL obj%Set(globalNode=nodenum, VALUE=nodalvalue(:, 1), timecompo=idof)
END DO

IF (ALLOCATED(nodalvalue)) DEALLOCATE (nodalvalue)
IF (ALLOCATED(nodenum)) DEALLOCATE (nodenum)
END PROCEDURE stsField_applyDirichletBC1
Expand All @@ -64,29 +69,37 @@
INTEGER(I4B), ALLOCATABLE :: nodenum(:)
INTEGER(I4B) :: idof, ii, aint

DO ii = 1, SIZE(dbc)
CALL dbc(ii)%ptr%get(nodalvalue=nodalvalue, nodenum=nodenum, &
& times=times)
IF (PRESENT(times)) THEN
aint = SIZE(times)
IF (aint .NE. obj%timeCompo) THEN
CALL e%raiseError(modName//'::'//myName//" - "// &
& '[INERNAL ERROR] :: SIZE( times ) is '// &
& tostring(aint)//' which is not equal to obj%timeCompo '// &
& ' which is '//tostring(obj%timeCompo))
RETURN
END IF

DO ii = 1, SIZE(dbc)
CALL dbc(ii)%ptr%get(nodalvalue=nodalvalue, nodenum=nodenum, &
& times=times)

IF (SIZE(nodalvalue, 2) .EQ. 1) THEN
DO idof = 1, obj%timecompo
CALL obj%Set(globalNode=nodenum, VALUE=nodalvalue(:, 1), &
CALL obj%Set(globalNode=nodenum, VALUE=nodalvalue(:, idof), &
& timecompo=idof)
END DO
END DO

ELSE

aint = SIZE(nodalvalue, 2)

IF (SIZE(nodalvalue, 2) .NE. obj%timeCompo) THEN
CALL e%raiseError(modName//'::'//myName//" - "// &
& '[INERNAL ERROR] :: SIZE( nodalvalue, 2 ) is '// &
& tostring(aint)//' which is not equal to obj%timeCompo '// &
& ' which is '//tostring(obj%timeCompo))
END IF
IF (ALLOCATED(nodalvalue)) DEALLOCATE (nodalvalue)
IF (ALLOCATED(nodenum)) DEALLOCATE (nodenum)
RETURN
END IF

CALL obj%Set(globalNode=nodenum, VALUE=nodalvalue)
END IF
DO ii = 1, SIZE(dbc)
CALL dbc(ii)%ptr%get(nodalvalue=nodalvalue, nodenum=nodenum)
DO idof = 1, obj%timecompo
CALL obj%Set(globalNode=nodenum, VALUE=nodalvalue(:, 1), &
& timecompo=idof)
END DO
END DO

IF (ALLOCATED(nodalvalue)) DEALLOCATE (nodalvalue)
Expand Down