OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
thsph_count.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!|| thsph_count ../engine/source/output/th/thsph_count.F
25!||--- called by ------------------------------------------------------
26!|| init_th ../engine/source/output/th/init_th.F
27!||====================================================================
28 SUBROUTINE thsph_count(NTHGRP2, ITHGRP, WA_SIZE, INDEX_WA_SPH,
29 . IPARG , ITHBUF ,SITHBUF)
30C-----------------------------------------------
31C M o d u l e s
32C-----------------------------------------------
33C-----------------------------------------------
34C I m p l i c i t T y p e s
35C-----------------------------------------------
36#include "implicit_f.inc"
37C-----------------------------------------------
38C C o m m o n B l o c k s
39C-----------------------------------------------
40#include "vect01_c.inc"
41#include "com01_c.inc"
42#include "task_c.inc"
43#include "param_c.inc"
44C-----------------------------------------------
45C D u m m y A r g u m e n t s
46C-----------------------------------------------
47 INTEGER, INTENT(in) :: SITHBUF
48 INTEGER IPARG(NPARG,*),ITHBUF(*)
49 INTEGER, INTENT(in) :: NTHGRP2
50 INTEGER, INTENT(inout) :: WA_SIZE
51 INTEGER, DIMENSION(2*NTHGRP2+1), INTENT(inout) :: INDEX_WA_SPH
52 INTEGER, DIMENSION(NITHGR,*), INTENT(in) :: ITHGRP
53C-----------------------------------------------
54C L o c a l V a r i a b l e s
55C-----------------------------------------------
56 LOGICAL :: BOOL
57 INTEGER II,JJ, I, J, N, IH, NG,
58 . k, ist, ip, l, lwa, nel,kk(6)
59 INTEGER :: J_FIRST,NITER,IADR,NN,IADV,NVAR,ITYP,IJK
60 INTEGER, DIMENSION(NTHGRP2) :: INDEX_SPH
61C-----------------------------------------------
62C S o u r c e L i n e s
63C-----------------------------------------------
64 ijk = 0
65 wa_size = 0
66 index_sph(1:nthgrp2) = 0
67 DO niter=1,nthgrp2
68 ityp=ithgrp(2,niter)
69 nn =ithgrp(4,niter)
70 iadr =ithgrp(5,niter)
71 nvar=ithgrp(6,niter)
72 iadv=ithgrp(7,niter)
73 ii=0
74 IF(ityp==51)THEN
75
76 ii=0
77 ih=iadr
78 DO WHILE((ithbuf(ih+nn)/=ispmd).AND.(ih<iadr+nn))
79 ih = ih + 1
80 ENDDO
81 IF (ih>=iadr+nn) GOTO 666
82C-------------------
83 DO ng=1,ngroup
84 ity=iparg(5,ng)
85c
86 IF(ity==51.OR.ity==52) THEN
87 nel = iparg(2,ng)
88 nft = iparg(3,ng)
89 DO i=1,6
90 kk(i) = nel*(i-1)
91 ENDDO
92
93 DO i=1,nel
94 n=i+nft
95 jj = 6*(i-1)
96 k=ithbuf(ih)
97 ip=ithbuf(ih+nn)
98C
99 IF (k==n)THEN
100 ih=ih+1
101 !---spmd specific treatment---!
102 !---search for ii---!
103 ii = ((ih-1) - iadr)*nvar
104 DO WHILE((ithbuf(ih+nn)/=ispmd).AND.(ih<iadr+nn))
105 ih = ih + 1
106 ENDDO
107 IF(ih>iadr+nn) GOTO 666
108 wa_size = wa_size + nvar + 1
109 ENDIF
110 ENDDO
111 ENDIF
112 ENDDO
113 ENDIF
114 666 continue
115 index_sph(niter) = wa_size
116 ENDDO
117
118
119 j_first = 0
120 bool = .true.
121 DO i=1,nthgrp2
122 IF(bool.EQV..true.) THEN
123 IF( index_sph(i)/=0 ) THEN
124 bool = .false.
125 j_first = i
126 ENDIF
127 ENDIF
128 ENDDO
129
130 j = 0
131 IF(j_first>0) THEN
132 j=j+1
133 index_wa_sph(j) = index_sph(j_first)
134 j=j+1
135 index_wa_sph(j) = j_first
136 DO i=j_first+1,nthgrp2
137 IF( index_sph(i)-index_sph(i-1)>0 ) THEN
138 j=j+1
139 index_wa_sph(j) = index_sph(i)
140 j=j+1
141 index_wa_sph(j) = i
142 ENDIF
143 ENDDO
144 ENDIF
145 index_wa_sph(2*nthgrp2+1) = j ! number of non-zero index
146C-----------
147 RETURN
148 END SUBROUTINE thsph_count
subroutine thsph_count(nthgrp2, ithgrp, wa_size, index_wa_sph, iparg, ithbuf, sithbuf)
Definition thsph_count.F:30