-
Notifications
You must be signed in to change notification settings - Fork 0
/
hsv_get_X.F
130 lines (121 loc) · 4.74 KB
/
hsv_get_X.F
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
c ########################################################################################
real*8 function hsv_get_scalar(nameX, history)
c
implicit none
c
character(len=5), intent(in) :: nameX
real*8, intent(in), dimension(*) :: history
integer :: start_index
c
start_index = hsv_get_sth(nameX, 'start_',history)
if ( hsv_get_sth(nameX, 'length',history) /= 1 ) then
write(*,*) "hsv_get_scalar<< Selected nameX (",nameX,
& " is not a scalar. Check for typos or choose a different
& function that also handles this."
call cstop('E R R O R T E R M I N A T I O N')
endif
c
hsv_get_scalar = history(start_index)
c
end function hsv_get_scalar
c ########################################################################################
subroutine hsv_get_symTen2_sub(nameX, history, symTen)
c
use Tensor
!implicit none
c
!type(Tensor2) :: hsv_get_symTen2
character(len=5), intent(in) :: nameX
!dimension history(*)
real*8, intent(in) :: history(*)
type(Tensor2), intent(out) :: symTen
integer :: start_index, end_index
c
start_index = hsv_get_sth(nameX, 'start_',history)
end_index = hsv_get_sth(nameX, 'end__',history)
if ( hsv_get_sth(nameX, 'length',history) /= 6 ) then
write(*,*) "hsv_get_symTen2<< Selected nameX (",nameX,
& " is not a sym tensor. Check for typos or choose a different
& function that also handles this."
call cstop('E R R O R T E R M I N A T I O N')
endif
c
symTen = symstore_2sa(
& real(history(start_index:end_index),8) )
c
end subroutine hsv_get_symTen2_sub
c ########################################################################################
type(Tensor2) function hsv_get_symTen2(nameX, history)
c
use Tensor
!implicit none
c
!type(Tensor2) :: hsv_get_symTen2
character(len=5), intent(in) :: nameX
!dimension history(*)
real*8, intent(in) :: history(*)
integer :: start_index, end_index
c
start_index = hsv_get_sth(nameX, 'start_',history)
end_index = hsv_get_sth(nameX, 'end__',history)
if ( hsv_get_sth(nameX, 'length',history) /= 6 ) then
write(*,*) "hsv_get_symTen2<< Selected nameX (",nameX,
& " is not a sym tensor. Check for typos or choose a different
& function that also handles this."
call cstop('E R R O R T E R M I N A T I O N')
endif
c
hsv_get_symTen2 = symstore_2sa(
& real(history(start_index:end_index),8) )
c
end function hsv_get_symTen2
c ########################################################################################
type(Tensor2) function hsv_get_unsymTen2( nameX, history,
& index_offset_in )
c
use Tensor
use TensorXLSDYNA
!implicit none
c
character(len=5), intent(in) :: nameX
real*8, intent(in) :: history(*)
real*8, optional :: index_offset_in
integer index_offset
integer :: start_index, end_index
c
c If we get an offset for the indices, we apply this,
c else we keep the offset as zero
if ( present(index_offset_in) ) then
index_offset = INT(index_offset_in)
if (index_offset_in == -1) then
write(*,*) "hsv_get_unsymTen2<< Activated debugging output
& to determine the offset of the deformation gradient."
write(*,*) "hsv(1:100)=", history(1:100)
call cstop ('E R R O R T E R M I N A T I O N')
elseif (index_offset_in < 0) then
write(*,*) "hsv_get_unsymTen2<< Input index_offset_in (",
& index_offset,") is
& negative, but only offsets >=0 are valid. Check whether you
& actually want an offset for this unsymmetric tensor."
call cstop ('E R R O R T E R M I N A T I O N')
endif
else
index_offset = 0
endif
c
start_index = hsv_get_sth(nameX, 'start_',history) + index_offset
end_index = hsv_get_sth(nameX, 'end__',history) + index_offset
c
if ( hsv_get_sth(nameX, 'length',history) /= 9 ) then
write(*,*) "hsv_get_unsymTen2<< Selected nameX (",nameX,
& " is not an unsym tensor. Check for typos or choose a different
& function that also handles this. nameX-Length=",
& hsv_get_sth(nameX, 'length',history),
& ". Start=",start_index,". End=",end_index
call cstop ('E R R O R T E R M I N A T I O N')
endif
c
hsv_get_unsymTen2 = defoGrad(history(start_index:end_index))
c
end function hsv_get_unsymTen2
c ########################################################################################