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, MTE, NB0, NB1, NB2, NB3,
54 . nb4, nb5, nnb3, mb1, mb2, mb3, mb4, mb5, k, ist, ip, l,
55 . lwa, imat, iprop, nx, igtyp, nuvar, nuvarn,nel,nft,
56 . kvar,kvarn
58 . wwa(100)
59 INTEGER :: J_FIRST,NITER,IAD,NN,IADV,NVAR,ITYP,IJK
60 INTEGER, DIMENSION(NTHGRP2) :: INDEX_NST
61C-------------------------
62C ELEMENTS NSTRANDS
63C-------------------------
64
65 ijk = 0
66 wa_size = 0
67 index_nst(1:nthgrp2) = 0
68 DO niter=1,nthgrp2
69 ityp=ithgrp(2,niter)
70 nn =ithgrp(4,niter)
71 iad =ithgrp(5,niter)
72 nvar=ithgrp(6,niter)
73 iadv=ithgrp(7,niter)
74 ii=0
75 IF(ityp==100)THEN
76! -------------------------------
77 ii=0
78 ih=iad
79
80 DO WHILE (ithbuf(ih+nn) /= ispmd .AND. ih < iad+nn)
81 ih = ih + 1
82 ENDDO
83 IF (ih >= iad+nn) GOTO 666
84
85 DO ng=1,ngroup
86 ity=iparg(5,ng)
87 IF (ity == 100) THEN
88C multi-purpose elements are nstrands elements only (to be modified).
89 nel=iparg(2,ng)
90 nft=iparg(3,ng)
91
92 DO i=1,nel
93 n =i+nft
94 k =ithbuf(ih)
95 IF (k == n) THEN
96 DO j=1,nn
97C loop over strands into the ONE NSTRAND TH group.
98C strand to save:
99 wa_size = wa_size + nvar
100 ih=ih+1
101 ENDDO ! DO J=1,NN
102 wa_size = wa_size + 1
103 ENDIF ! IF (K == N)
104 ENDDO ! DO I=1,NEL
105 ENDIF ! IF (ITY == 100)
106 ENDDO ! DO NG=1,NGROUP
107 ENDIF
108 666 continue
109 index_nst(niter) = wa_size
110 ENDDO
111
112
113 j_first = 0
114 bool = .true.
115 DO i=1,nthgrp2
116 IF(bool.EQV..true.) THEN
117 IF( index_nst(i)/=0 ) THEN
118 bool = .false.
119 j_first = i
120 ENDIF
121 ENDIF
122 ENDDO
123
124 j = 0
125 IF(j_first>0) THEN
126 j=j+1
127 index_wa_nst(j) = index_nst(j_first)
128 j=j+1
129 index_wa_nst(j) = j_first
130 DO i=j_first+1,nthgrp2
131 IF( index_nst(i)-index_nst(i-1)>0 ) THEN
132 j=j+1
133 index_wa_nst(j) = index_nst(i)
134 j=j+1
135 index_wa_nst(j) = i
136 ENDIF
137 ENDDO
138 ENDIF
139 index_wa_nst(2*nthgrp2+1) = j ! number of non-zero index
140C-----------
141 RETURN
142 END SUBROUTINE thnst_count
#define my_real
Definition cppsort.cpp:32
subroutine thnst_count(nthgrp2, ithgrp, wa_size, index_wa_nst, iparg, ithbuf, sithbuf)
Definition thnst_count.F:30