GetNodeLoc
Get the location (index) of node number.
This method returns the location of degree of freedom number idof
at node number nodenum
.
nodenum
should be lesser than the total number of nodes defined for dof number idof
.
idof
s are continuously numbered, so if there are two or more physical variables, then idof of the second or later physical variables does not start from 1.
Calling example:
getNodeLOC(obj, nodenum, idof)
getNodeLOC(obj, nodenum(:), idof)
getNodeLOC(obj, nodenum, idof(:) )
getNodeLOC(obj, idof)
getNodeLOC(obj, nodenum, ivar, idof)
getNodeLOC(obj, nodenum(:), ivar, idof)
getNodeLOC(obj, nodenum, ivar, spacecompo, timecompo)
getNodeLOC(obj, nodenum(:), ivar, spacecompo, timecompo)
getNodeLOC(obj, nodenum, ivar, idof(:) )
getNodeLOC(obj, nodenum, ivar, spacecompo, timecompo(:) )
getNodeLOC(obj, nodenum, ivar, spacecompo(:), timecompo)
getNodeLOC(obj, nodenum(:), ivar, spacecompo, timecompo(:) )
getNodeLOC(obj, nodenum(:), ivar, spacecompo(:), timecompo)
Interface 1
INTERFACE
MODULE PURE FUNCTION GetNodeLoc(obj, nodenum, idof) RESULT(ans)
TYPE(DOF_), INTENT(IN) :: obj
INTEGER(I4B), INTENT(IN) :: nodenum
INTEGER(I4B), INTENT(IN) :: idof
INTEGER(I4B) :: ans
END FUNCTION GetNodeLoc
END INTERFACE
It returns the location of degree of freedom number idof
at node number nodenum
.
nodenum
should be lesser than the total number of nodes defined for dof number idof
.
idofs
are continuously numbered, so if there are two or more physical variables, then idof of the second or later physical variables will not start from 1.
Interface 2
INTERFACE
MODULE PURE FUNCTION GetNodeLoc(obj, nodenum, idof) RESULT(ans)
TYPE(DOF_), INTENT(IN) :: obj
INTEGER(I4B), INTENT(IN) :: nodenum(:)
INTEGER(I4B), INTENT(IN) :: idof
INTEGER(I4B) :: ans(SIZE(nodenum))
END FUNCTION GetNodeLoc
END INTERFACE
It returns the location of degree of freedom number idof
at node number nodenum
.
nodenum
should be lesser than the total number of nodes defined for dof number idof
.
idofs are continuously numbered, so if there are two or more physical variables, then idof of the second or later physical variables will not start from 1.
Interface 3
INTERFACE
MODULE PURE FUNCTION GetNodeLoc(obj, nodenum, idof) RESULT(ans)
TYPE(DOF_), INTENT(IN) :: obj
INTEGER(I4B), INTENT(IN) :: nodenum
INTEGER(I4B), INTENT(IN) :: idof(:)
INTEGER(I4B) :: ans(SIZE(idof))
END FUNCTION GetNodeLoc
END INTERFACE
It returns the location of degree of freedom number idof
at node number nodenum
.
nodenum
should be lesser than the total number of nodes defined for dof number idof
.
idofs are continuously numbered, so if there are two or more physical variables, then idof of the second or later physical variables will not start from 1.
Interface 4
INTERFACE
MODULE PURE FUNCTION GetNodeLoc(obj, idof) RESULT(ans)
TYPE(DOF_), INTENT(IN) :: obj
INTEGER(I4B), INTENT(IN) :: idof
INTEGER(I4B) :: ans(3)
END FUNCTION GetNodeLoc
END INTERFACE
ans(1) : istart
ans(2) : iend
ans(3) : stride
In this way a given degree of freedom idof
will be located in vec(istart:iend:stride)
.
In DOF object, idofs are continuously numbered, so if there are two or more physical variables, then idof of the second or later physical variables will not start from 1.
Interface 5
INTERFACE
MODULE PURE FUNCTION GetNodeLoc(obj, nodenum, ivar, idof) &
& RESULT(ans)
TYPE(DOF_), INTENT(IN) :: obj
INTEGER(I4B), INTENT(IN) :: nodenum
INTEGER(I4B), INTENT(IN) :: ivar
INTEGER(I4B), INTENT(IN) :: idof
INTEGER(I4B) :: ans
END FUNCTION GetNodeLoc
END INTERFACE
Interface 6
INTERFACE
MODULE PURE FUNCTION GetNodeLoc(obj, nodenum, ivar, idof) &
& RESULT(ans)
TYPE(DOF_), INTENT(IN) :: obj
INTEGER(I4B), INTENT(IN) :: nodenum(:)
INTEGER(I4B), INTENT(IN) :: ivar
INTEGER(I4B), INTENT(IN) :: idof
INTEGER(I4B) :: ans(SIZE(nodenum))
END FUNCTION GetNodeLoc
END INTERFACE
Interface 7
INTERFACE
MODULE PURE FUNCTION GetNodeLoc(obj, nodenum, ivar, spacecompo, &
& timecompo) RESULT(ans)
TYPE(DOF_), INTENT(IN) :: obj
INTEGER(I4B), INTENT(IN) :: nodenum
INTEGER(I4B), INTENT(IN) :: ivar
INTEGER(I4B), INTENT(IN) :: spacecompo
INTEGER(I4B), INTENT(IN) :: timecompo
INTEGER(I4B) :: ans
END FUNCTION GetNodeLoc
END INTERFACE
Interface 8
INTERFACE
MODULE PURE FUNCTION GetNodeLoc(obj, nodenum, ivar, spacecompo, &
& timecompo) RESULT(ans)
TYPE(DOF_), INTENT(IN) :: obj
INTEGER(I4B), INTENT(IN) :: nodenum(:)
INTEGER(I4B), INTENT(IN) :: ivar
INTEGER(I4B), INTENT(IN) :: spacecompo
INTEGER(I4B), INTENT(IN) :: timecompo
INTEGER(I4B) :: ans(SIZE(nodenum))
END FUNCTION GetNodeLoc
END INTERFACE
Interface 9
INTERFACE
MODULE PURE FUNCTION GetNodeLoc(obj, nodenum, ivar, idof) &
& RESULT(ans)
TYPE(DOF_), INTENT(IN) :: obj
INTEGER(I4B), INTENT(IN) :: nodenum
INTEGER(I4B), INTENT(IN) :: ivar
INTEGER(I4B), INTENT(IN) :: idof(:)
INTEGER(I4B) :: ans(SIZE(idof))
END FUNCTION GetNodeLoc
END INTERFACE
Interface 10
INTERFACE
MODULE PURE FUNCTION GetNodeLoc(obj, nodenum, ivar, spacecompo, &
& timecompo) RESULT(ans)
TYPE(DOF_), INTENT(IN) :: obj
INTEGER(I4B), INTENT(IN) :: nodenum
INTEGER(I4B), INTENT(IN) :: ivar
INTEGER(I4B), INTENT(IN) :: spacecompo
INTEGER(I4B), INTENT(IN) :: timecompo(:)
INTEGER(I4B) :: ans(SIZE(timecompo))
END FUNCTION GetNodeLoc
END INTERFACE
Interface 11
INTERFACE
MODULE PURE FUNCTION GetNodeLoc(obj, nodenum, ivar, spacecompo, &
& timecompo) RESULT(ans)
TYPE(DOF_), INTENT(IN) :: obj
INTEGER(I4B), INTENT(IN) :: nodenum
INTEGER(I4B), INTENT(IN) :: ivar
INTEGER(I4B), INTENT(IN) :: spacecompo(:)
INTEGER(I4B), INTENT(IN) :: timecompo
INTEGER(I4B) :: ans(SIZE(spacecompo))
END FUNCTION GetNodeLoc
END INTERFACE
Interface 12
INTERFACE
MODULE PURE FUNCTION GetNodeLoc(obj, nodenum, ivar, spacecompo, &
& timecompo) RESULT(ans)
TYPE(DOF_), INTENT(IN) :: obj
INTEGER(I4B), INTENT(IN) :: nodenum(:)
INTEGER(I4B), INTENT(IN) :: ivar
INTEGER(I4B), INTENT(IN) :: spacecompo
INTEGER(I4B), INTENT(IN) :: timecompo(:)
INTEGER(I4B) :: ans(SIZE(timecompo) * SIZE(nodenum))
END FUNCTION GetNodeLoc
END INTERFACE
Interface 13
INTERFACE
MODULE PURE FUNCTION GetNodeLoc(obj, nodenum, ivar, spacecompo, &
& timecompo) RESULT(ans)
TYPE(DOF_), INTENT(IN) :: obj
INTEGER(I4B), INTENT(IN) :: nodenum(:)
INTEGER(I4B), INTENT(IN) :: ivar
INTEGER(I4B), INTENT(IN) :: spacecompo(:)
INTEGER(I4B), INTENT(IN) :: timecompo
INTEGER(I4B) :: ans(SIZE(spacecompo) * SIZE(nodenum))
END FUNCTION GetNodeLoc
END INTERFACE
Examples
- ️܀ Example 1
- ️܀ Example 2
- ↢
This example show how to GetNodeLoc
method of [[DOF_]].
PROGRAM main
USE easifemBase
IMPLICIT NONE
TYPE( DOF_ ) :: obj
CALL Initiate( obj, tNodes=[20, 10], &
& names=["V", "P"], spaceCompo=[3,1], &
& timeCompo=[2,2], storageFMT = FMT_DOF )
v
, spacecompo=1, timecompo=1, at node 1
CALL OK( getNodeLoc(obj, 1, 1) .EQ. 1, &
& 'getNodeLoc(obj, 1, 1): ' )
v
, spacecompo=2, timecompo=1, at node 1
CALL OK( getNodeLoc(obj, 1, 2) .EQ. 21, &
& 'getNodeLoc(obj, 1, 2): ' )
v
, spacecompo=3, timecompo=1, at node 1
CALL OK( getNodeLoc(obj, 1, 3) .EQ. 41, &
& 'getNodeLoc(obj, 1, 3): ' )
v
, spacecompo=1, timecompo=2, at node 1
CALL OK( getNodeLoc(obj, 1, 4) .EQ. 61, &
& 'getNodeLoc(obj, 1, 4): ' )
v
, spacecompo=2, timecompo=2, at node 1
CALL OK( getNodeLoc(obj, 1, 5) .eq. 81, &
& 'getNodeLoc(obj, 1, 5): ' )
v
, spacecompo=3, timecompo=2, at node 1
CALL OK( getNodeLoc(obj, 1, 6) .eq. 101, &
& 'getNodeLoc(obj, 1, 6): ' )
P
, spacecompo=1, timecompo=1, at node 1
CALL OK( getNodeLoc(obj, 1, 7) .eq. 121, &
& 'getNodeLoc(obj, 1, 7): ' )
P
, spacecompo=1, timecompo=2, at node 1
CALL OK( getNodeLoc(obj, 1, 8) .eq. 131, &
& 'getNodeLoc(obj, 1, 8): ' )
V
, spacecompo=1, timecompo=1, at node 10
CALL OK( getNodeLoc(obj, 10, 1) .eq. 10, &
& 'getNodeLoc(obj, 10, 1): ' )
V
, spacecompo=2, timecompo=1, at node 10
CALL OK( getNodeLoc(obj, 10, 2) .eq. 30, &
& 'getNodeLoc(obj, 10, 2): ' )
V
, spacecompo=3, timecompo=1, at node 10
CALL OK( getNodeLoc(obj, 10, 3) .eq. 50, &
& 'getNodeLoc(obj, 10, 3): ' )
V
, spacecompo=1, timecompo=2, at node 10
CALL OK( getNodeLoc(obj, 10, 4) .eq. 70, &
& 'getNodeLoc(obj, 10, 4): ' )
V
, spacecompo=2, timecompo=2, at node 10
CALL OK( getNodeLoc(obj, 10, 5) .eq. 90, &
& 'getNodeLoc(obj, 10, 5): ' )
V
, spacecompo=3, timecompo=2, at node 10
CALL OK( getNodeLoc(obj, 10, 6) .eq. 110, &
& 'getNodeLoc(obj, 10, 6): ' )
P
, spacecompo=1, timecompo=1, at node 10
CALL OK( getNodeLoc(obj, 10, 7) .eq. 130, &
& 'getNodeLoc(obj, 10, 7): ' )
P
, spacecompo=1, timecompo=2, at node 10
CALL OK( getNodeLoc(obj, 10, 8) .eq. 140, &
& 'getNodeLoc(obj, 10, 8): ' )
V
, spacecompo=1, timecompo=1
CALL OK( ALL(getNodeLoc(obj, 1) .EQ. [1,20,1]), &
& 'getNodeLoc(obj, 1): ' )
V
, spacecompo=2, timecompo=1
CALL OK( all(getNodeLoc(obj, 2) .eq. [21,40,1]), &
& 'getNodeLoc(obj, 2): ' )
V
, spacecompo=3, timecompo=1
CALL OK( all(getNodeLoc(obj, 3) .eq. [41,60,1]), &
& 'getNodeLoc(obj, 3): ' )
P
, spacecompo=1, timecompo=1
CALL OK( all(getNodeLoc(obj, 7) .eq. [121,130,1]), &
& 'getNodeLoc(obj, 7): ' )
P
, spacecompo=1, timecompo=2
CALL OK( all(getNodeLoc(obj, 8) .eq. [131,140,1]), &
& 'getNodeLoc(obj, 7): ' )
CALL Deallocate( obj )
END PROGRAM main
This example show how to GetNodeLoc
method of [[DOF_]].
PROGRAM main
USE easifemBase
IMPLICIT NONE
TYPE( DOF_ ) :: obj
Initiate DOF
CALL Initiate( obj, tNodes=[20, 20], &
& names=["V", "P"], spaceCompo=[3,1], &
& timeCompo=[2,2], storageFMT = FMT_NODES )
CALL OK( getNodeLoc(obj, 1, 1) .eq. 1, &
& 'getNodeLoc(obj, 1, 1): ' )
CALL OK( getNodeLoc(obj, 1, 2) .eq. 2, &
& 'getNodeLoc(obj, 1, 2): ' )
CALL OK( getNodeLoc(obj, 1, 3) .eq. 3, &
& 'getNodeLoc(obj, 1, 3): ' )
CALL OK( getNodeLoc(obj, 1, 4) .eq. 4, &
& 'getNodeLoc(obj, 1, 4): ' )
CALL OK( getNodeLoc(obj, 1, 5) .eq. 5, &
& 'getNodeLoc(obj, 1, 5): ' )
CALL OK( getNodeLoc(obj, 1, 6) .eq. 6, &
& 'getNodeLoc(obj, 1, 6): ' )
CALL OK( getNodeLoc(obj, 1, 7) .eq. 7, &
& 'getNodeLoc(obj, 1, 7): ' )
CALL OK( getNodeLoc(obj, 1, 8) .eq. 8, &
& 'getNodeLoc(obj, 1, 8): ' )
CALL OK( all(getNodeLoc(obj, 1) .eq. [1,160,8]), &
& 'getNodeLoc(obj, 1): ' )
CALL OK( all(getNodeLoc(obj, 2) .eq. [2,160,8]), &
& 'getNodeLoc(obj, 2): ' )
CALL OK( all(getNodeLoc(obj, 3) .eq. [3,160,8]), &
& 'getNodeLoc(obj, 3): ' )
CALL OK( all(getNodeLoc(obj, 7) .eq. [7,160,8]), &
& 'getNodeLoc(obj, 7): ' )
CALL OK( all(getNodeLoc(obj, 8) .eq. [8,160,8]), &
& 'getNodeLoc(obj, 7): ' )
CALL Deallocate( obj )
END PROGRAM main