OpenRadioss
2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
count_remote_nb_elem_edge.F
Go to the documentation of this file.
1
Copyright> OpenRadioss
2
Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3
Copyright>
4
Copyright> This program is free software: you can redistribute it and/or modify
5
Copyright> it under the terms of the GNU Affero General Public License as published by
6
Copyright> the Free Software Foundation, either version 3 of the License, or
7
Copyright> (at your option) any later version.
8
Copyright>
9
Copyright> This program is distributed in the hope that it will be useful,
10
Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11
Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
Copyright> GNU Affero General Public License for more details.
13
Copyright>
14
Copyright> You should have received a copy of the GNU Affero General Public License
15
Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16
Copyright>
17
Copyright>
18
Copyright> Commercial Alternative: Altair Radioss Software
19
Copyright>
20
Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21
Copyright> software under a commercial license. Contact Altair to discuss further if the
22
Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23
!||====================================================================
24
!|| count_remote_nb_elem_edge ../engine/source/interfaces/interf/count_remote_nb_elem_edge.F
25
!||--- called by ------------------------------------------------------
26
!|| init_nodal_state ../engine/source/interfaces/interf/init_nodal_state.F
27
!||--- uses -----------------------------------------------------
28
!|| element_mod ../common_source/modules/elements/element_mod.F90
29
!|| nodal_arrays_mod ../common_source/modules/nodal_arrays.F90
30
!||====================================================================
31
SUBROUTINE
count_remote_nb_elem_edge
( SIZE_BUFFER,BUFFER,GEO,IXS,IXC,
32
. IXT,IXP,IXR,IXTG,ADDCNEL,NODES,CNEL,CHUNK,
33
. IXS10)
34
!$COMMENT
35
! COUNT_REMOTE_NB_ELEM_EDGE description
36
! check if a list of node is associated
37
! to a deleted element :
38
! - if it's true : need to deactivate the node from the interface
39
! COUNT_REMOTE_NB_ELEM_EDGE organization
40
! loop over the 2 or 4 nodes:
41
! - convert the global id to local id
42
! - check if a element is associated to the list of node (2 or 4 nodes)
43
! -
if
it
's true, send to the remote processor "you need to deactivate
44
! the nodes from your interface!"
45
!$ENDCOMMENT
46
USE nodal_arrays_mod
47
use element_mod , only : nixs,nixc,nixt,nixp,nixr,nixtg
48
C-----------------------------------------------
49
C I m p l i c i t T y p e s
50
C-----------------------------------------------
51
#include "implicit_f.inc"
52
C-----------------------------------------------
53
C C o m m o n B l o c k s
54
C-----------------------------------------------
55
#include "com04_c.inc"
56
#include "param_c.inc"
57
#include "scr17_c.inc"
58
C-----------------------------------------------
59
C D u m m y A r g u m e n t s
60
C-----------------------------------------------
61
INTEGER, INTENT(in) :: SIZE_BUFFER
62
INTEGER, INTENT(in) :: CHUNK ! chunk size : 1-> interface id, 2-> surface id, 3:6-> node id (for type11, 5&6 values are equal to 0)
63
INTEGER, DIMENSION(SIZE_BUFFER), INTENT(inout) :: BUFFER
64
INTEGER, DIMENSION(NIXS,NUMELS),TARGET, INTENT(in) :: IXS ! solid array
65
INTEGER, DIMENSION(NIXC,NUMELC),TARGET, INTENT(in) :: IXC ! shell array
66
INTEGER, DIMENSION(NIXT,NUMELT),TARGET, INTENT(in) :: IXT! truss array
67
INTEGER, DIMENSION(NIXP,NUMELP),TARGET, INTENT(in) :: IXP! beam array
68
INTEGER, DIMENSION(NIXR,NUMELR),TARGET, INTENT(in) :: IXR! spring array
69
INTEGER, DIMENSION(NIXTG,NUMELTG),TARGET, INTENT(in) :: IXTG! triangle array
70
INTEGER, DIMENSION(0:NUMNOD+1), INTENT(in) :: ADDCNEL ! address for the CNEL array
71
TYPE(nodal_arrays_), intent(inout) :: NODES
72
my_real, DIMENSION(NPROPG,NUMGEO), INTENT(in) :: GEO
73
INTEGER, DIMENSION(0:LCNEL), INTENT(in) :: CNEL ! connectivity node-->element
74
75
C-----------------------------------------------
76
C L o c a l V a r i a b l e s
77
C-----------------------------------------------
78
INTEGER :: I,J,K
79
INTEGER :: N1,N2,N3,N4,NIN
80
INTEGER :: NUMBER_NODE
81
INTEGER, DIMENSION(4) :: LOCAL_NODE,GLOBAL_NODE
82
INTEGER :: ELEM_ID,NODE_ID
83
INTEGER :: OFFSET_SOLID,OFFSET_QUAD,OFFSET_SHELL
84
INTEGER :: OFFSET_TRUSS,OFFSET_BEAM,OFFSET_SPRING
85
INTEGER :: OFFSET_TRIANGLE,OFFSET_UR
86
87
INTEGER, DIMENSION(:), ALLOCATABLE :: TAG_NODE
88
INTEGER :: NUMBER_ELEMENT, NUMBER_ELEMENT_HERE
89
INTEGER, DIMENSION(:), ALLOCATABLE :: LIST_ELEMENT
90
LOGICAL, DIMENSION(:), ALLOCATABLE :: ALREADY_HERE
91
INTEGER, DIMENSION(6,NUMELS10), INTENT(in) :: IXS10!< tetra10 data
92
93
C-----------------------------------------------
94
! --------------------------
95
OFFSET_SOLID = 0
96
OFFSET_QUAD=OFFSET_SOLID+NUMELS
97
OFFSET_SHELL=OFFSET_QUAD+NUMELQ
98
OFFSET_TRUSS=OFFSET_SHELL+NUMELC
99
OFFSET_BEAM=OFFSET_TRUSS+NUMELT
100
OFFSET_SPRING=OFFSET_BEAM+NUMELP
101
OFFSET_TRIANGLE=OFFSET_SPRING+NUMELR
102
OFFSET_UR=OFFSET_TRIANGLE+NUMELTG
103
! --------------------------
104
! allocation of already_here array
105
! cnel is not bijective (2 differents index can give the same cnel(i) value)
106
! --> need to tag the elements to avoid a duplication
107
NUMBER_ELEMENT = NUMELS + NUMELQ + NUMELC + NUMELT + NUMELP + NUMELR + NUMELTG
108
ALLOCATE( LIST_ELEMENT(NUMBER_ELEMENT) ) ! <-- list of element to flush only the modified cells
109
ALLOCATE( ALREADY_HERE(NUMBER_ELEMENT) ) ! <-- boolean to avoid any element duplications
110
ALREADY_HERE(1:NUMBER_ELEMENT) = .FALSE.
111
NUMBER_ELEMENT_HERE = 0
112
113
ALLOCATE( TAG_NODE(NUMNOD+1) )
114
TAG_NODE(1:NUMNOD+1) = 0
115
DO J=1,SIZE_BUFFER,CHUNK
116
NIN = BUFFER(J)
117
GLOBAL_NODE(1:4) = BUFFER(J+2:J+CHUNK-1)
118
LOCAL_NODE(1) = GET_LOCAL_NODE_ID(NODES,GLOBAL_NODE(1))
119
LOCAL_NODE(2) = GET_LOCAL_NODE_ID(NODES,GLOBAL_NODE(2))
120
LOCAL_NODE(3:4) = NUMNOD+1
121
NUMBER_NODE = 2 ! for type 11, there are 2 nodes per segments
122
IF(GLOBAL_NODE(3)/=0) LOCAL_NODE(3) = GET_LOCAL_NODE_ID(NODES, GLOBAL_NODE(3))
123
IF(GLOBAL_NODE(4)/=0) LOCAL_NODE(4) = GET_LOCAL_NODE_ID(NODES, GLOBAL_NODE(4))
124
.AND.
IF((GLOBAL_NODE(3)/=0)(GLOBAL_NODE(4)/=0)) NUMBER_NODE = 4 ! for type 7, there are 4 nodes per segments
125
BUFFER(J+2:J+3) = 0
126
N1 = LOCAL_NODE(1)
127
N2 = LOCAL_NODE(2)
128
N3 = LOCAL_NODE(3)
129
N4 = LOCAL_NODE(4)
130
NUMBER_ELEMENT_HERE = 0
131
! ---------------
132
! loop over the elements connected to N1
133
DO I=ADDCNEL(N1),ADDCNEL(N1+1)-1
134
ELEM_ID = CNEL(I) ! <-- element id
135
TAG_NODE(N1) = 0
136
TAG_NODE(N2) = 0
137
TAG_NODE(N3) = 0
138
TAG_NODE(N4) = 0
139
! -----------------
140
! solid element
141
IF(ELEM_ID<=OFFSET_SHELL) THEN
142
DO K=2,9
143
NODE_ID = IXS(K,ELEM_ID)
144
TAG_NODE(NODE_ID) = 1
145
ENDDO
146
.AND.
IF(ELEM_ID>NUMELS8ELEM_ID<=NUMELS8+NUMELS10) THEN
147
DO K=1,6
148
NODE_ID = IXS10(K,ELEM_ID-NUMELS8)
149
TAG_NODE(NODE_ID) = 1
150
ENDDO
151
ENDIF
152
.AND.
ELSEIF(ELEM_ID>OFFSET_SHELLELEM_ID<=OFFSET_TRUSS) THEN
153
! -----------------
154
! shell element
155
DO K=2,5
156
NODE_ID = IXC(K,ELEM_ID-OFFSET_SHELL)
157
TAG_NODE(NODE_ID) = 1
158
ENDDO
159
.AND.
ELSEIF(ELEM_ID>OFFSET_TRUSSELEM_ID<=OFFSET_BEAM) THEN
160
! -----------------
161
! truss
162
DO K=2,3
163
NODE_ID = IXT(K,ELEM_ID-OFFSET_TRUSS)
164
TAG_NODE(NODE_ID) = 1
165
ENDDO
166
.AND.
ELSEIF(ELEM_ID>OFFSET_BEAMELEM_ID<=OFFSET_SPRING) THEN
167
! -----------------
168
! beam element
169
DO K=2,3
170
NODE_ID = IXP(K,ELEM_ID-OFFSET_BEAM)
171
TAG_NODE(NODE_ID) = 1
172
ENDDO
173
.AND.
ELSEIF(ELEM_ID>OFFSET_SPRINGELEM_ID<=OFFSET_TRIANGLE) THEN
174
! -----------------
175
! spring element
176
DO K=2,3
177
NODE_ID = IXR(K,ELEM_ID-OFFSET_SPRING)
178
TAG_NODE(NODE_ID) = 1
179
ENDDO
180
181
IF(NINT(GEO(12,IXR(1,ELEM_ID-OFFSET_SPRING))) == 12) THEN
182
NODE_ID = IXR(4,ELEM_ID-OFFSET_SPRING)
183
TAG_NODE(NODE_ID) = 1
184
ENDIF
185
.AND.
ELSEIF(ELEM_ID>OFFSET_TRIANGLEELEM_ID<=OFFSET_UR) THEN
186
! -----------------
187
! triangle element
188
DO K=2,4
189
NODE_ID = IXTG(K,ELEM_ID-OFFSET_TRIANGLE)
190
TAG_NODE(NODE_ID) = 1
191
ENDDO
192
ENDIF
193
! -----------------
194
! -----------------
195
! check if the element has N1 & N2 & N3 & N4 (if N3 and N4 are real nodes)
196
IF( (TAG_NODE(N1)+TAG_NODE(N2)+TAG_NODE(N3)+TAG_NODE(N4)) == NUMBER_NODE) THEN
197
.NOT.
IF( ALREADY_HERE(ELEM_ID) ) THEN ! check if the element is already taken into account
198
BUFFER(J+2) = BUFFER(J+2) + 1
199
ALREADY_HERE(ELEM_ID) = .TRUE. ! <-- the element is now taken into account
200
NUMBER_ELEMENT_HERE = NUMBER_ELEMENT_HERE + 1
201
LIST_ELEMENT(NUMBER_ELEMENT_HERE) = ELEM_ID
202
ENDIF
203
ENDIF
204
205
! -----------------
206
ENDDO
207
! ---------------
208
209
! ---------------
210
! re-initialization of already_here array for the next node
211
DO I=1,NUMBER_ELEMENT_HERE
212
ELEM_ID = LIST_ELEMENT(I)
213
ALREADY_HERE(ELEM_ID) = .FALSE.
214
ENDDO
215
! ---------------
216
ENDDO
217
218
DEALLOCATE( TAG_NODE )
219
DEALLOCATE( LIST_ELEMENT )
220
DEALLOCATE( ALREADY_HERE )
221
222
RETURN
223
END SUBROUTINE COUNT_REMOTE_NB_ELEM_EDGE
224
count_remote_nb_elem_edge
subroutine count_remote_nb_elem_edge(size_buffer, buffer, geo, ixs, ixc, ixt, ixp, ixr, ixtg, addcnel, nodes, cnel, chunk, ixs10)
Definition
count_remote_nb_elem_edge.F:34
engine
source
interfaces
interf
count_remote_nb_elem_edge.F
Generated by
1.15.0