tDOF
This method returns total degrees of freedom.
This operator returns the total number of degrees of freedom in a physical variable.
Calling example:
Getting total degrees of freedom in DOF_
ans= .tdof. obj
Getting total degrees of freedom of a physical name
ans= obj .tdof. "U"
Getting the total number of degrees of freedom of a physical variable by number.
ans= obj .tdof. 1
Interface 1
INTERFACE
MODULE PURE FUNCTION tdof(obj) RESULT(ans)
CLASS(DOF_), INTENT(IN) :: obj
INTEGER(I4B) :: ans
END FUNCTION tdof
END INTERFACE
This method returns the total number of degrees of freedom.
Interface 2
INTERFACE
MODULE PURE FUNCTION tdof(obj, Name) RESULT(ans)
CLASS(DOF_), INTENT(IN) :: obj
CHARACTER(1), INTENT(IN) :: Name
INTEGER(I4B) :: ans
END FUNCTION tdof
END INTERFACE
This function returns the total number of degrees of freedom in a physical variable. The physical variable is specified by using its name.
Interface 3
INTERFACE
MODULE PURE FUNCTION tdof(obj, ivar) RESULT(ans)
CLASS(DOF_), INTENT(IN) :: obj
INTEGER(I4B), INTENT(IN) :: ivar
INTEGER(I4B) :: ans
END FUNCTION tdof
END INTERFACE
This function returns the total number of degrees of freedom in a physical variable. The physical variable is specified by using its number.
Examples
PROGRAM main
USE GlobalData
USE DOF_Method
USE Test_Method
USE BaseType, ONLY: DOF_
IMPLICIT NONE
TYPE(DOF_) :: obj
INTEGER(I4B) :: found, want
CHARACTER(:), ALLOCATABLE :: msg
CALL Initiate(obj, tNodes=[10], names=["U"], spaceCompo=[3], &
timeCompo=[1], storageFMT=FMT_DOF)
found = .tDOF.obj
want = 3
msg = ".tDOF. obj"
CALL OK(found .EQ. want, msg)
found = obj.tDOF.1
want = 3
msg = "obj .tDOF. 1"
CALL OK(found .EQ. want, msg)
found = obj.tDOF."U"
want = 3
msg = "obj .tDOF. U"
CALL OK(found .EQ. want, msg)
CALL DEALLOCATE (obj)
END PROGRAM main