OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
w_cluster.F File Reference
#include "implicit_f.inc"
#include "com04_c.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine w_cluster (cluster)

Function/Subroutine Documentation

◆ w_cluster()

subroutine w_cluster ( type (cluster_), dimension(ncluster) cluster)

Definition at line 33 of file w_cluster.F.

34C-----------------------------------------------
35C Description:
36C -IN: Array of CLUSTER structures
37C -OUT: nothing
38C Writes the structure into the restart file
39C (reading done READ_CLUSTER)
40C-----------------------------------------------
41C M o d u l e s
42C-----------------------------------------------
43 USE cluster_mod
44C-----------------------------------------------
45C I m p l i c i t T y p e s
46C-----------------------------------------------
47#include "implicit_f.inc"
48C-----------------------------------------------
49C C o m m o n B l o c k s
50C-----------------------------------------------
51#include "com04_c.inc"
52C-----------------------------------------------
53C D u m m y A r g u m e n t s
54C-----------------------------------------------
55 TYPE (CLUSTER_) ,DIMENSION(NCLUSTER) :: CLUSTER
56C-----------------------------------------------
57C L o c a l V a r i a b l e s
58C-----------------------------------------------
59 INTEGER I, J,K, IEL, NEL,NELG, NNOD
60 INTEGER II,IFAIL,ITY,ID,RL,IL
61 INTEGER ILCLUSTER(NCLUSTER),RLCLUSTER(NCLUSTER)
62 INTEGER RLCLUSTER_MAX,ILCLUSTER_MAX
63 my_real,
64 . DIMENSION(:), ALLOCATABLE :: rcltab
65 INTEGER, DIMENSION(:), ALLOCATABLE :: ICLTAB
66C=======================================================================
67
68 IF(ncluster > 0) THEN
69 ilcluster(1:ncluster) = 0
70 rlcluster(1:ncluster) = zero
71 ENDIF
72 rlcluster_max = 0
73 ilcluster_max = 0
74
75 DO i = 1, ncluster
76 ity = cluster(i)%TYPE
77 nel = cluster(i)%NEL
78 nnod = cluster(i)%NNOD
79 ifail = cluster(i)%IFAIL
80 ilcluster(i) = 8 + 2 * (nel + nnod)
81 rlcluster(i) = 1
82 IF (ifail > 0) rlcluster(i) = rlcluster(i) + 4
83 IF (ifail == 3) rlcluster(i) = rlcluster(i) + 8
84 IF ( rlcluster_max < rlcluster(i) ) THEN
85 rlcluster_max = rlcluster(i)
86 ENDIF
87 IF ( ilcluster_max < ilcluster(i) ) THEN
88 ilcluster_max = ilcluster(i)
89 ENDIF
90 ENDDO !NCLUSTER
91
92 IF(ncluster > 0) THEN
93 CALL write_i_c(ilcluster,ncluster)
94 CALL write_i_c(rlcluster,ncluster)
95 ALLOCATE (icltab(ilcluster_max)) ! Integer CLuster TABle
96 ALLOCATE (rcltab(rlcluster_max)) ! Real CLuster TABle
97 ENDIF
98
99 DO i = 1, ncluster
100 icltab(1:ilcluster(i)) = 0
101 rcltab(1:rlcluster(i)) = zero
102 il = 0
103 rl = 0
104 icltab(il+1) = cluster(i)%ID
105 icltab(il+2) = cluster(i)%TYPE
106 icltab(il+3) = cluster(i)%IFAIL
107 icltab(il+4) = cluster(i)%IGR
108 icltab(il+5) = cluster(i)%NEL
109 icltab(il+6) = cluster(i)%NNOD
110 icltab(il+7) = cluster(i)%SKEW
111 icltab(il+8) = cluster(i)%OFF
112 il = il + 8
113 rcltab(rl+1) = cluster(i)%FAIL
114 rl = rl + 1
115 nel = cluster(i)%NEL
116 nnod = cluster(i)%NNOD
117c
118 DO j = 1,nel
119 id = cluster(i)%ELEM(j)
120 icltab(il + j) = cluster(i)%NG(j) !element local group number
121 icltab(il + j+nel) = id ! element index in the group
122 ENDDO ! J = 1,NEL
123c
124 il = il + nel*2
125 DO j = 1,nnod
126 icltab(il + j) = cluster(i)%NOD1(j)
127 icltab(il + j+nnod) = cluster(i)%NOD2(j)
128 ENDDO
129
130 il = il + nnod*2
131 IF (cluster(i)%IFAIL > 0) THEN
132 rcltab(rl + 1) = cluster(i)%FMAX(1)
133 rcltab(rl + 2) = cluster(i)%FMAX(2)
134 rcltab(rl + 3) = cluster(i)%MMAX(1)
135 rcltab(rl + 4) = cluster(i)%MMAX(2)
136 rl = rl + 4
137 ENDIF
138
139 IF (cluster(i)%IFAIL == 3) THEN
140 rcltab(rl + 1) = cluster(i)%AX(1)
141 rcltab(rl + 2) = cluster(i)%AX(2)
142 rcltab(rl + 3) = cluster(i)%AX(3)
143 rcltab(rl + 4) = cluster(i)%AX(4)
144 rcltab(rl + 5) = cluster(i)%NX(1)
145 rcltab(rl + 6) = cluster(i)%NX(2)
146 rcltab(rl + 7) = cluster(i)%NX(3)
147 rcltab(rl + 8) = cluster(i)%NX(4)
148 ENDIF
149
150 CALL write_db(rcltab,rlcluster(i))
151 CALL write_i_c(icltab,ilcluster(i))
152
153 ENDDO ! I = 1, NCLUSTER
154
155 IF(ncluster > 0) THEN
156 DEALLOCATE (rcltab)
157 DEALLOCATE (icltab)
158 ENDIF
159
160
161C-----------
162 RETURN
#define my_real
Definition cppsort.cpp:32
initmumps id
subroutine write_db(a, n)
Definition write_db.F:140
void write_i_c(int *w, int *len)