OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
thnst_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!|| thnst_count ../engine/source/output/th/thnst_count.F
25!||--- called by ------------------------------------------------------
26!|| init_th ../engine/source/output/th/init_th.F
27!||====================================================================
28 SUBROUTINE thnst_count(NTHGRP2, ITHGRP, WA_SIZE, INDEX_WA_NST,
29 . IPARG,ITHBUF,SITHBUF)
30C-----------------------------------------------
31C I m p l i c i t T y p e s
32C-----------------------------------------------
33#include "implicit_f.inc"
34C-----------------------------------------------
35C C o m m o n B l o c k s
36C-----------------------------------------------
37#include "com01_c.inc"
38#include "task_c.inc"
39#include "param_c.inc"
40C-----------------------------------------------
41C D u m m y A r g u m e n t s
42C-----------------------------------------------
43 INTEGER, INTENT(in) ::SITHBUF
44 INTEGER IPARG(NPARG,*),ITHBUF(SITHBUF)
45 INTEGER, INTENT(in) :: NTHGRP2
46 INTEGER, INTENT(inout) :: WA_SIZE
47 INTEGER, DIMENSION(2*NTHGRP2+1), INTENT(inout) :: INDEX_WA_NST
48 INTEGER, DIMENSION(NITHGR,*), INTENT(in) :: ITHGRP
49C-----------------------------------------------
50C L o c a l V a r i a b l e s
51C-----------------------------------------------
52 LOGICAL :: BOOL
53 INTEGER II, I, J, N, IH, NG, ITY,
54 . k,
55 . nxn,nel,nft
56 INTEGER :: J_FIRST,NITER,IAD,NN,IADV,NVAR,ITYP,IJK
57 INTEGER, DIMENSION(NTHGRP2) :: INDEX_NST
58C-------------------------
59C ELEMENTS NSTRANDS
60C-------------------------
61
62 ijk = 0
63 wa_size = 0
64 index_nst(1:nthgrp2) = 0
65 DO niter=1,nthgrp2
66 ityp=ithgrp(2,niter)
67 nn =ithgrp(4,niter)
68 iad =ithgrp(5,niter)
69 nvar=ithgrp(6,niter)
70 iadv=ithgrp(7,niter)
71 ii=0
72 IF(ityp==100)THEN
73! -------------------------------
74 ii=0
75 ih=iad
76
77 DO WHILE (ithbuf(ih+nn) /= ispmd .AND. ih < iad+nn)
78 ih = ih + 1
79 ENDDO
80 IF (ih >= iad+nn) GOTO 666
81
82 DO ng=1,ngroup
83 ity=iparg(5,ng)
84 IF (ity == 100) THEN
85C multi-purpose elements are nstrands elements only (to be modified).
86 nel=iparg(2,ng)
87 nft=iparg(3,ng)
88
89 DO i=1,nel
90 n =i+nft
91 k =ithbuf(ih)
92 IF (k == n) THEN
93 DO j=1,nn
94C loop over strands into the ONE NSTRAND TH group.
95C strand to save:
96 wa_size = wa_size + nvar
97 ih=ih+1
98 ENDDO ! DO J=1,NN
99 wa_size = wa_size + 1
100 ENDIF ! IF (K == N)
101 ENDDO ! DO I=1,NEL
102 ENDIF ! IF (ITY == 100)
103 ENDDO ! DO NG=1,NGROUP
104 ENDIF
105 666 continue
106 index_nst(niter) = wa_size
107 ENDDO
108
109
110 j_first = 0
111 bool = .true.
112 DO i=1,nthgrp2
113 IF(bool.EQV..true.) THEN
114 IF( index_nst(i)/=0 ) THEN
115 bool = .false.
116 j_first = i
117 ENDIF
118 ENDIF
119 ENDDO
120
121 j = 0
122 IF(j_first>0) THEN
123 j=j+1
124 index_wa_nst(j) = index_nst(j_first)
125 j=j+1
126 index_wa_nst(j) = j_first
127 DO i=j_first+1,nthgrp2
128 IF( index_nst(i)-index_nst(i-1)>0 ) THEN
129 j=j+1
130 index_wa_nst(j) = index_nst(i)
131 j=j+1
132 index_wa_nst(j) = i
133 ENDIF
134 ENDDO
135 ENDIF
136 index_wa_nst(2*nthgrp2+1) = j ! number of non-zero index
137C-----------
138 RETURN
139 END SUBROUTINE thnst_count
subroutine thnst_count(nthgrp2, ithgrp, wa_size, index_wa_nst, iparg, ithbuf, sithbuf)
Definition thnst_count.F:30