OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
split_seg_ielem.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!|| split_seg_ielem ../starter/source/restart/ddsplit/split_seg_ielem.F
25!||--- called by ------------------------------------------------------
26!|| split_interfaces ../starter/source/restart/ddsplit/split_interfaces.F
27!||--- calls -----------------------------------------------------
28!||--- uses -----------------------------------------------------
29!|| front_mod ../starter/share/modules1/front_mod.F
30!||====================================================================
31 SUBROUTINE split_seg_ielem(IELEM_M ,PROC_MVOISIN ,MVOISIN ,NRTM ,
32 . NRTM_L ,TAG_SEG ,CEP ,CEL ,
33 . IDEL_SOLID,INTERCEP ,PROC ,NUMELS ,
34 . NUMELQ ,NUMELC ,NUMELT ,NUMELP ,
35 . NUMELR ,NUMELTG)
36c
37c split & write segments array (type INTEGER) with local value
38c
39C-----------------------------------------------
40C M o d u l e s
41C-----------------------------------------------
42 USE intbufdef_mod
43 USE front_mod
44C-----------------------------------------------
45C I m p l i c i t T y p e s
46C-----------------------------------------------
47#include "implicit_f.inc"
48C-----------------------------------------------
49C D u m m y A r g u m e n t s
50C-----------------------------------------------
51 INTEGER , INTENT(IN) :: NRTM !< number of main segments (global)
52 INTEGER , INTENT(IN) :: NRTM_L !< number of main segments (local)
53 INTEGER , INTENT(IN) :: PROC !< current proc
54 INTEGER , INTENT(IN) :: NUMELS !< number of solid elements (global)
55 INTEGER , INTENT(IN) :: NUMELQ !< number of quad elements (global)
56 INTEGER , INTENT(IN) :: NUMELC !< number of shell elements (global)
57 INTEGER , INTENT(IN) :: NUMELT !< number of truss elements (global)
58 INTEGER , INTENT(IN) :: NUMELP !< number of beam elements (global)
59 INTEGER , INTENT(IN) :: NUMELR !< number of spring elements (global)
60 INTEGER , INTENT(IN) :: NUMELTG !< number of shell3n elements (global)
61
62 INTEGER , INTENT(IN) :: IDEL_SOLID !< solid eroosion flag
63 INTEGER , INTENT(IN) :: IELEM_M(2,NRTM) !< elements connected to main segments
64 INTEGER , INTENT(IN) :: TAG_SEG(NRTM_L) !< local seg to global segment
65 INTEGER , INTENT(IN) :: CEP(*),CEL(*) !< arrays of proc of elements and local number of element
66 INTEGER , INTENT(IN) :: MVOISIN(4,NRTM) !< neighbhoors of main segments
67 INTEGER , INTENT(INOUT) :: PROC_MVOISIN(4,NRTM) !< procs of neighbhoors of main segments : to be built
68 TYPE(intersurfp) :: INTERCEP !< procs of main segments
69C-----------------------------------------------
70C L o c a l V a r i a b l e s
71C-----------------------------------------------
72 INTEGER I,J,K,GLOB,IE1,IEL1,IE2,IEL2,N
73 INTEGER :: OFFSET_SHELL,OFFSET_SHELL3N
74 INTEGER, DIMENSION(:),ALLOCATABLE :: IBUF1,IBUF3
75C ----------------------------------------
76 ALLOCATE(ibuf1(2*nrtm_l))
77 ibuf1(1:2*nrtm_l) = 0
78 ALLOCATE(ibuf3(4*nrtm_l))
79 IF(idel_solid > 0) THEN
80 ibuf3(1:4*nrtm_l) = 0
81 ELSE
82 ibuf3(1:4*nrtm_l) = 0 !should always be allocated
83 ENDIF
84 offset_shell=numels+numelq
85 offset_shell3n=offset_shell+numelc+numelt+numelp+numelr
86 ! ---------------------
87 ! loop over the segment of the current proc
88 ! a segment can be connected to :
89 ! * a solid --> no offset
90 ! * a shell --> offset = global number of solid+quad, ielem_ m = local shell id + offset
91 ! * a shell 3n --> offset = global number of solid+quad+shell+truss+beam+spring ielem_ m = local shell3n id + offset
92 DO i=1, nrtm_l
93 k=tag_seg(i) ! get the segment id
94 ie1 = ielem_m(1,k) ! get the element id (element of the segment)
95 ! ----------------
96 iel1 = 0
97 ! convert the global element id to local element id (local to the processor)
98 IF(ie1 <= numels) THEN ! segment is connected to a solid
99 iel1 = cel(ie1)
100 ELSEIF(offset_shell<ie1.AND.ie1<=offset_shell+numelc) THEN ! segment is connected to a shell
101 iel1 = offset_shell+cel(ie1)
102 ELSEIF(offset_shell3n<ie1.AND.ie1<=offset_shell3n+numeltg) THEN ! segment is connected to a shell3n
103 iel1 = offset_shell3n+cel(ie1)
104 ENDIF
105 ! ----------------
106 ie2 = ielem_m(2,k)
107 iel2 = 0
108 IF(ie2 > 0) THEN
109 iel2 = cel(ie2)
110 ENDIF
111 IF(cep(ie1)==proc ) THEN
112 ibuf1(2*(i-1)+1) =iel1
113 IF(ie2 >0) THEN
114 IF(cep(ie2)==proc ) THEN
115 ibuf1(2*(i-1)+2) =iel2
116 ELSE
117 ibuf1(2*(i-1)+2) =-ie2
118 ENDIF
119 ENDIF
120 ENDIF
121 ENDDO
122 ! ---------------------
123 DO i = 1, nrtm
124 DO j = 1,4
125 k = mvoisin(j,i)
126 IF(k /= 0) proc_mvoisin(j,i) = intercep%P(k)
127 ENDDO
128 ENDDO
129 DO i = 1, nrtm_l
130 k=tag_seg(i)
131 DO j = 1,4
132 n = mvoisin(j,k)
133 IF(n /= 0) ibuf3(4*(i-1)+j) = proc_mvoisin(j,k)
134 ENDDO
135 ENDDO
136
137 CALL write_i_c(ibuf1,2*nrtm_l)
138 CALL write_i_c(ibuf3,4*nrtm_l)
139
140 DEALLOCATE(ibuf1)
141 DEALLOCATE(ibuf3)
142
143 RETURN
144 END
subroutine split_seg_ielem(ielem_m, proc_mvoisin, mvoisin, nrtm, nrtm_l, tag_seg, cep, cel, idel_solid, intercep, proc, numels, numelq, numelc, numelt, numelp, numelr, numeltg)
void write_i_c(int *w, int *len)