OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
thquad_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!|| thquad_count ../engine/source/output/th/thquad_count.F
25!||--- called by ------------------------------------------------------
26!|| init_th ../engine/source/output/th/init_th.F
27!||====================================================================
28 SUBROUTINE thquad_count(NTHGRP2 ,ITHGRP,WA_SIZE,INDEX_WA_QUAD,
29 1 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"
44#include "tabsiz_c.inc"
45C-----------------------------------------------
46C D u m m y A r g u m e n t s
47C-----------------------------------------------
48 INTEGER,INTENT(IN) :: SITHBUF
49 INTEGER IPARG(NPARG,NGROUP),ITHBUF(SITHBUF)
50 INTEGER, INTENT(inout) :: WA_SIZE,NTHGRP2
51 INTEGER, DIMENSION(2*NTHGRP2+1), INTENT(inout) :: INDEX_WA_QUAD
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 INTEGER II, KRK, LL, I, J, K, L ,N, IH, IP, NG, MTE, NUVAR,
57 . nc1, nc2, nc3, nc4, nel, mtn1,kk(6),ij,nptr,npts,
58 . ir,is
59 LOGICAL :: BOOL
60 INTEGER :: J_FIRST,NITER,IADB,NN,IADV,NVAR,ITYP,IJK
61 INTEGER, DIMENSION(NTHGRP2) :: INDEX_QUAD
62
63C--------------------------------------------
64
65 ijk = 0
66 wa_size = 0
67 index_quad(1:nthgrp2) = 0
68 ijk = 0
69 DO niter=1,nthgrp2
70 ityp=ithgrp(2,niter)
71 nn =ithgrp(4,niter)
72 iadb =ithgrp(5,niter)
73 nvar=ithgrp(6,niter)
74 iadv=ithgrp(7,niter)
75 ii=0
76 IF(ityp==2.OR.ityp==117)THEN
77! -----------------------------
78 nuvar = 0
79 ii=0
80 ih=iadb
81 IF(ityp == 117) ityp = 7
82
83C decalage IH
84 DO WHILE((ithbuf(ih+nn)/=ispmd).AND.(ih<iadb+nn))
85 ih = ih + 1
86 ENDDO
87C----
88 IF (ih>=iadb+nn) GOTO 666
89C----
90c
91 DO ng=1,ngroup
92 ity=iparg(5,ng)
93 IF (ity == ityp) THEN
94 nft = iparg(3,ng)
95 mte = iparg(1,ng)
96 nel = iparg(2,ng)
97 IF(mte /= 13) THEN
98C
99 DO i=1,nel
100 n=i+nft
101 k=ithbuf(ih)
102 ip=ithbuf(ih+nn)
103C
104 IF (k==n)THEN
105 ih=ih+1
106C recherche du ii correct
107 ii = ((ih-1) - iadb)*nvar
108 DO WHILE((ithbuf(ih+nn)/=ispmd).AND.(ih<iadb+nn))
109 ih = ih + 1
110 ENDDO
111 IF (ih > iadb+nn) GOTO 666
112 wa_size = wa_size + nvar + 1
113 ENDIF
114 ENDDO
115c --------------
116 ENDIF ! mte /= 13
117 ENDIF
118 ENDDO ! groupe
119! -----------------------------
120 ENDIF
121 666 continue
122 index_quad(niter) = wa_size
123 ENDDO
124
125
126 j_first = 0
127 bool = .true.
128 DO i=1,nthgrp2
129 IF(bool.EQV..true.) THEN
130 IF( index_quad(i)/=0 ) THEN
131 bool = .false.
132 j_first = i
133 ENDIF
134 ENDIF
135 ENDDO
136
137 j = 0
138 IF(j_first>0) THEN
139 j=j+1
140 index_wa_quad(j) = index_quad(j_first)
141 j=j+1
142 index_wa_quad(j) = j_first
143 DO i=j_first+1,nthgrp2
144 IF( index_quad(i)-index_quad(i-1)>0 ) THEN
145 j=j+1
146 index_wa_quad(j) = index_quad(i)
147 j=j+1
148 index_wa_quad(j) = i
149 ENDIF
150 ENDDO
151 ENDIF
152 index_wa_quad(2*nthgrp2+1) = j ! number of non-zero index
153C-----------
154 RETURN
155 END SUBROUTINE thquad_count
subroutine thquad_count(nthgrp2, ithgrp, wa_size, index_wa_quad, iparg, ithbuf, sithbuf)