OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
cholfact.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!|| cholfact ../engine/source/tools/lagmul/cholfact.F
25!||--- called by ------------------------------------------------------
26!|| lag_mult_sdp ../engine/source/tools/lagmul/lag_mult_solv.F
27!|| lag_mult_solv ../engine/source/tools/lagmul/lag_mult_solv.F
28!|| lag_mult_solvp ../engine/source/tools/lagmul/lag_mult_solv.F
29!||====================================================================
30 INTEGER FUNCTION cholfact(N,DIAG,H,IADH,JCIH,WCOL,IROW,JCOL)
31C-----------------------------------------------
32C I m p l i c i t T y p e s
33C-----------------------------------------------
34#include "implicit_f.inc"
35C-----------------------------------------------
36C D u m m y A r g u m e n t s
37C-----------------------------------------------
38 INTEGER n, iadh(*),jcih(*),irow(*),jcol(*)
39 my_real diag(*),h(*),wcol(*)
40C-----------------------------------------------
41C L o c a l V a r i a b l e s
42C-----------------------------------------------
43 INTEGER i, j, k, isk, iek, isj, iej, ic, iptr
44 my_real lval, t
45C======================================================================|
46 DO j = 1, n
47 irow(j) = 0
48 jcol(j) = 0
49 ENDDO
50C---
51 DO k = 1,n
52 isk = iadh(k)
53 iek = iadh(k+1)-1
54 DO j = isk, iek
55 ic = jcih(j)
56 wcol(ic) = h(j)
57 irow(ic) = 1
58 ENDDO
59C---
60 IF (diag(k)<=0.) GOTO 999
61 diag(k) = sqrt(diag(k))
62C---
63 j = jcol(k)
64100 CONTINUE
65 IF (j==0) GOTO 200
66 isj = irow(j)
67 iej = iadh(j+1)-1
68 lval = h(isj)
69 isj = isj + 1
70 IF (isj<iej) THEN
71 irow(j) = isj
72 iptr = j
73 j = jcol(j)
74 jcol(iptr) = jcol(jcih(isj))
75 jcol(jcih(isj)) = iptr
76 ELSE
77 j = jcol(j)
78 ENDIF
79 DO i = isj, iej
80 ic = jcih(i)
81 IF (irow(ic)/=0) THEN
82 wcol(ic) = wcol(ic) - lval*h(i)
83 ENDIF
84 ENDDO
85 GOTO 100
86200 CONTINUE
87C---
88 IF (isk<iek) THEN
89 iptr = jcih(isk)
90 jcol(k) = jcol(iptr)
91 jcol(iptr) = k
92 irow(k) = isk
93 ENDIF
94C---
95 DO j = isk, iek
96 ic = jcih(j)
97 t = wcol(ic)/diag(k)
98 diag(ic) = diag(ic) - t*t
99 h(j) = t
100 irow(ic) = 0
101 ENDDO
102 ENDDO
103C----
104 cholfact = 0
105 RETURN
106999 CONTINUE
107 cholfact = k
108C-----------------------------------------------
109 RETURN
110 END
111
112!||====================================================================
113!|| prechol ../engine/source/tools/lagmul/cholfact.F
114!||--- called by ------------------------------------------------------
115!|| lag_mult_solv ../engine/source/tools/lagmul/lag_mult_solv.F
116!|| lag_mult_solvp ../engine/source/tools/lagmul/lag_mult_solv.F
117!||====================================================================
118 SUBROUTINE prechol(Z,D,L,R,NC,IADH,JCIH)
119C-----------------------------------------------
120C I m p l i c i t T y p e s
121C-----------------------------------------------
122#include "implicit_f.inc"
123C-----------------------------------------------
124C D u m m y A r g u m e n t s
125C-----------------------------------------------
126 INTEGER NC,IADH(*),JCIH(*)
127 my_real
128 . z(*),d(*),l(*),r(*)
129C-----------------------------------------------
130C L o c a l V a r i a b l e s
131C-----------------------------------------------
132 INTEGER I,J,IH
133 my_real s
134C======================================================================|
135C--- back subst Ly = r
136 DO i=1,nc
137 z(i) = r(i)
138 ENDDO
139 DO i=1,nc
140 z(i) = z(i) / d(i)
141 DO ih=iadh(i),iadh(i+1)-1
142 j = jcih(ih)
143 z(j) = z(j) - l(ih)*z(i)
144 ENDDO
145 ENDDO
146C--- back subst LT z = y
147 DO i=nc,1,-1
148 s = z(i)
149 DO ih=iadh(i),iadh(i+1)-1
150 j = jcih(ih)
151 s = s - l(ih)*z(j)
152 ENDDO
153 z(i) = s / d(i)
154 ENDDO
155C-----------------------------------------------
156 RETURN
157 END
integer function cholfact(n, diag, h, iadh, jcih, wcol, irow, jcol)
Definition cholfact.F:31
subroutine prechol(z, d, l, r, nc, iadh, jcih)
Definition cholfact.F:119
#define my_real
Definition cppsort.cpp:32