OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
jacobview_v.F
Go to the documentation of this file.
1Copyright> OpenRadioss
2Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3Copyright>
4Copyright> This program is free software: you can redistribute it and/or modify
5Copyright> it under the terms of the GNU Affero General Public License as published by
6Copyright> the Free Software Foundation, either version 3 of the License, or
7Copyright> (at your option) any later version.
8Copyright>
9Copyright> This program is distributed in the hope that it will be useful,
10Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12Copyright> GNU Affero General Public License for more details.
13Copyright>
14Copyright> You should have received a copy of the GNU Affero General Public License
15Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16Copyright>
17Copyright>
18Copyright> Commercial Alternative: Altair Radioss Software
19Copyright>
20Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21Copyright> software under a commercial license. Contact Altair to discuss further if the
22Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23!||====================================================================
24!|| jacobiew_v ../engine/source/materials/mat_share/jacobview_v.F
25!||--- called by ------------------------------------------------------
26!|| fail_inievo_ib ../engine/source/materials/fail/inievo/fail_inievo_ib.F90
27!|| fail_inievo_s ../engine/source/materials/fail/inievo/fail_inievo_s.F
28!||====================================================================
29 SUBROUTINE jacobiew_v(DIM1,DIM2,A,EW,EV,NROT)
30C-----------------------------------------------
31C I m p l i c i t T y p e s
32C-----------------------------------------------
33#include "implicit_f.inc"
34 INTEGER, INTENT(in) :: DIM1
35 INTEGER, INTENT(in) :: DIM2
36 INTEGER, DIMENSION(DIM1) :: NROT
37 my_real, DIMENSION(DIM1,DIM2), intent(inout) :: ew
38 my_real, DIMENSION(DIM1,DIM2,DIM2), intent(inout) :: a,ev
39
40 my_real, DIMENSION(:,:), ALLOCATABLE :: b,z
41 INTEGER IZ,IS,ITER,J,IJK,I
42 INTEGER :: NINDX
43 INTEGER, DIMENSION(DIM1) :: INDX
44 my_real, DIMENSION(DIM1) :: sumrs,eps
45 my_real :: g,h,t,c,s,tau,theta
46C----------------------------------------------------------------
47
48 ! ---------------------
49 ALLOCATE( b(dim1,dim2) )
50 ALLOCATE( z(dim1,dim2) )
51 DO iz=1,dim2
52 DO is=1,dim2
53 IF(iz>is) THEN
54 DO i=1,dim1
55 a(i,is,iz) = a(i,iz,is)
56 ENDDO
57 ENDIF
58 ev(1:dim1,iz,is)=zero
59 ENDDO
60 b(1:dim1,iz)=a(1:dim1,iz,iz)
61 ew(1:dim1,iz)=b(1:dim1,iz)
62 z(1:dim1,iz)=0.
63 ev(1:dim1,iz,iz)=one
64 ENDDO
65 nrot(1:dim1)=0
66 ! ---------------------
67
68
69 ! ---------------------
70 DO iter = 1,50
71 sumrs(1:dim1) = zero
72 ! ---------------------
73 ! diagonal sum
74 DO iz=1,dim2-1
75 DO is=iz+1,dim2
76 sumrs(1:dim1)=sumrs(1:dim1)+abs(a(1:dim1,iz,is))
77 ENDDO
78 ENDDO
79 ! ---------------------
80 ! check if the computation is mandatory : sumrs(i) = 0 --> skip the element
81 nindx = 0
82 DO i=1,dim1
83 IF (sumrs(i)/=zero) THEN
84 nindx = nindx + 1
85 indx(nindx) = i
86 ENDIF
87 ENDDO
88 ! ---------------------
89 IF (iter > 4) THEN
90 eps(1:dim1) = zero
91 ELSE
92 eps(1:dim1) = one_fifth*sumrs(1:dim1)/dim2**2
93 ENDIF
94 ! ---------------------
95 DO iz=1,dim2-1
96 DO is=iz+1,dim2
97#include "vectorize.inc"
98 DO ijk=1,nindx
99 i = indx(ijk)
100 g = 100. * abs(a(i,iz,is))
101 IF ( iter>4 .AND. abs(ew(i,iz))+g==abs(ew(i,iz))
102 & .AND. abs(ew(i,is))+g==abs(ew(i,is))) THEN
103 a(i,iz,is)=zero
104 ELSEIF (abs(a(i,iz,is)) > eps(i)) THEN
105 h = ew(i,is)-ew(i,iz)
106 IF (abs(h)+g==abs(h)) THEN
107 t = a(i,iz,is)/h
108 ELSE
109 theta = half*h/a(i,iz,is)
110 t=one/(abs(theta)+sqrt(one+theta**2))
111 IF (theta < zero) t=-t
112 ENDIF
113 c=one/sqrt(one+t**2)
114 s=t*c
115 tau=s/(one+c)
116 h=t*a(i,iz,is)
117 z(i,iz)=z(i,iz)-h
118 z(i,is)=z(i,is)+h
119 ew(i,iz)=ew(i,iz)-h
120 ew(i,is)=ew(i,is)+h
121 a(i,iz,is)=zero
122 DO j=1,iz-1
123 g=a(i,j,iz)
124 h=a(i,j,is)
125 a(i,j,iz)=g-s*(h+g*tau)
126 a(i,j,is)=h+s*(g-h*tau)
127 ENDDO
128 DO j=iz+1,is-1
129 g=a(i,iz,j)
130 h=a(i,j,is)
131 a(i,iz,j)=g-s*(h+g*tau)
132 a(i,j,is)=h+s*(g-h*tau)
133 ENDDO
134 DO j=is+1,dim2
135 g=a(i,iz,j)
136 h=a(i,is,j)
137 a(i,iz,j)=g-s*(h+g*tau)
138 a(i,is,j)=h+s*(g-h*tau)
139 ENDDO
140 DO j=1,dim2
141 g=ev(i,j,iz)
142 h=ev(i,j,is)
143 ev(i,j,iz)=g-s*(h+g*tau)
144 ev(i,j,is)=h+s*(g-h*tau)
145 ENDDO
146 nrot(i)=nrot(i)+1
147 ENDIF
148 ENDDO
149 ENDDO
150 ENDDO
151 ! ---------------------
152 ! update b/ew/z
153 DO iz=1,dim2
154#include "vectorize.inc"
155 DO ijk=1,nindx
156 i = indx(ijk)
157 b(i,iz)=b(i,iz)+z(i,iz)
158 ew(i,iz)=b(i,iz)
159 z(i,iz)=zero
160 ENDDO
161 ENDDO
162 ! ---------------------
163 ENDDO
164
165 DEALLOCATE( b )
166 DEALLOCATE( z )
167
168 RETURN
169 END SUBROUTINE jacobiew_v
#define my_real
Definition cppsort.cpp:32
subroutine jacobiew_v(dim1, dim2, a, ew, ev, nrot)
Definition jacobview_v.F:30