OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_fvb_atr.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!|| spmd_fvb_atr ../engine/source/mpi/anim/spmd_fvb_atr.F
25!||--- called by ------------------------------------------------------
26!|| genani ../engine/source/output/anim/generate/genani.F
27!||--- calls -----------------------------------------------------
28!|| write_i_c ../common_source/tools/input_output/write_routtines.c
29!||--- uses -----------------------------------------------------
30!|| fvbag_mod ../engine/share/modules/fvbag_mod.F
31!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
32!||====================================================================
33 SUBROUTINE spmd_fvb_atr(NBID1, NBID2, NBID3, FVEL2FA, FVINUM,
34 . FVOFF)
35C-----------------------------------------------
36C M o d u l e s
37C-----------------------------------------------
38 USE fvbag_mod
39C-----------------------------------------------
40C I m p l i c i t T y p e s
41C-----------------------------------------------
42 USE spmd_comm_world_mod, ONLY : spmd_comm_world
43#include "implicit_f.inc"
44C-----------------------------------------------------------------
45C M e s s a g e P a s s i n g
46C-----------------------------------------------
47#include "spmd.inc"
48C-----------------------------------------------
49C C o m m o n B l o c k s
50C-----------------------------------------------
51#include "task_c.inc"
52C-----------------------------------------------
53C D u m m y A r g u m e n t s
54C-----------------------------------------------
55 INTEGER NBID1, NBID2, NBID3, FVEL2FA(*), FVINUM(*), FVOFF(2,*)
56C-----------------------------------------------
57C L o c a l V a r i a b l e s
58C-----------------------------------------------
59#ifdef MPI
60 INTEGER ELOFF, I, PMAIN, II, J, K, KK, N, NN, INOD(4), NND,
61 . itag, msgoff, len, jj, iad, iade, iadf,
62 . stat(mpi_status_size), ierr, nntr
63 INTEGER, DIMENSION(:), ALLOCATABLE :: ITAGT, IBUF
64C-----------------------------------------------
65 DATA msgoff/7040/
66C-----------------------------------------------
67C
68 eloff=0
69 DO i=1,nfvbag
70 pmain=fvspmd(i)%PMAIN
71 IF (ispmd==0) THEN
72 IF (ispmd==pmain-1) THEN
73 ALLOCATE(itagt(fvdata(i)%NNTR))
74 ii=0
75 DO j=1,fvdata(i)%NNTR
76 itagt(j)=0
77 ENDDO
78C
79 DO j=1,fvdata(i)%NPOLH_ANIM
80 DO k=fvdata(i)%IFVPADR_ANIM(j),
81 . fvdata(i)%IFVPADR_ANIM(j+1)-1
82 kk=fvdata(i)%IFVPOLH_ANIM(k)
83 DO n=fvdata(i)%IFVTADR_ANIM(kk),
84 . fvdata(i)%IFVTADR_ANIM(kk+1)-1
85 nn=fvdata(i)%IFVPOLY_ANIM(n)
86 IF (itagt(nn)==1) cycle
87 inod(1)=fvoff(1,i)+fvdata(i)%IFVTRI_ANIM(1,nn)-1
88 inod(2)=fvoff(1,i)+fvdata(i)%IFVTRI_ANIM(2,nn)-1
89 inod(3)=fvoff(1,i)+fvdata(i)%IFVTRI_ANIM(3,nn)-1
90 inod(4)=inod(3)
91 ii=ii+1
92C Nombre de noeuds distincts de la coque (apres fusion dans FVMESH)
93 nnd=1
94 IF (inod(2)/=inod(1)) nnd=nnd+1
95 IF (inod(3)/=inod(1).AND.
96 . inod(3)/=inod(2)) nnd=nnd+1
97 IF (nnd/=3) THEN
98 inod(1)=nbid1-1
99 inod(2)=nbid2-1
100 inod(3)=nbid3-1
101 inod(4)=inod(3)
102 ENDIF
103C
104 CALL write_i_c(inod,4)
105 itagt(nn)=1
106 fvel2fa(eloff+nn)=eloff+ii
107 fvinum(eloff+ii)=eloff+nn
108 ENDDO
109 ENDDO
110 ENDDO
111 eloff=eloff+fvdata(i)%NNTR
112 DEALLOCATE(itagt)
113 ELSE
114 itag=msgoff
115 CALL mpi_recv(nntr, 1, mpi_integer, it_spmd(pmain),
116 . itag, spmd_comm_world, stat, ierr)
117C
118 len=6*nntr
119 ALLOCATE(ibuf(len))
120 itag=msgoff+1
121 CALL mpi_recv(ibuf, len, mpi_integer, it_spmd(pmain),
122 . itag, spmd_comm_world, stat, ierr)
123C
124 jj=0
125 DO j=1,nntr
126 inod(1)=fvoff(1,i)+ibuf(jj+1)
127 inod(2)=fvoff(1,i)+ibuf(jj+2)
128 inod(3)=fvoff(1,i)+ibuf(jj+3)
129 inod(4)=fvoff(1,i)+ibuf(jj+4)
130C
131C Nombre de noeuds distincts de la coque (apres fusion dans FVMESH)
132 nnd=1
133 IF (inod(2)/=inod(1)) nnd=nnd+1
134 IF (inod(3)/=inod(1).AND.
135 . inod(3)/=inod(2)) nnd=nnd+1
136 IF (nnd/=3) THEN
137 inod(1)=nbid1-1
138 inod(2)=nbid2-1
139 inod(3)=nbid3-1
140 inod(4)=inod(3)
141 ENDIF
142C
143 CALL write_i_c(inod,4)
144 jj=jj+4
145C
146 fvel2fa(eloff+j)=eloff+ibuf(4*nntr+j)
147 fvinum(eloff+j)=eloff+ibuf(5*nntr+j)
148 ENDDO
149 eloff=eloff+nntr
150 DEALLOCATE(ibuf)
151 ENDIF
152 ELSE
153 IF (ispmd==pmain-1) THEN
154 itag=msgoff
155 CALL mpi_send(fvdata(i)%NNTR, 1, mpi_integer,
156 . it_spmd(1), itag, spmd_comm_world,
157 . ierr)
158C
159 len=6*fvdata(i)%NNTR
160 ALLOCATE(ibuf(len), itagt(fvdata(i)%NNTR))
161 ii=0
162 iad=0
163 iade=4*fvdata(i)%NNTR
164 iadf=iade+fvdata(i)%NNTR
165C
166 DO j=1,fvdata(i)%NNTR
167 itagt(j)=0
168 ENDDO
169C
170 DO j=1,fvdata(i)%NPOLH_ANIM
171 DO k=fvdata(i)%IFVPADR_ANIM(j),
172 . fvdata(i)%IFVPADR_ANIM(j+1)-1
173 kk=fvdata(i)%IFVPOLH_ANIM(k)
174 DO n=fvdata(i)%IFVTADR_ANIM(kk),
175 . fvdata(i)%IFVTADR_ANIM(kk+1)-1
176 nn=fvdata(i)%IFVPOLY_ANIM(n)
177 IF (itagt(nn)==1) cycle
178 inod(1)=fvdata(i)%IFVTRI_ANIM(1,nn)-1
179 inod(2)=fvdata(i)%IFVTRI_ANIM(2,nn)-1
180 inod(3)=fvdata(i)%IFVTRI_ANIM(3,nn)-1
181 inod(4)=inod(3)
182 ii=ii+1
183C
184 ibuf(iad+1)=inod(1)
185 ibuf(iad+2)=inod(2)
186 ibuf(iad+3)=inod(3)
187 ibuf(iad+4)=inod(4)
188 iad=iad+4
189 itagt(nn)=1
190 ibuf(iade+nn)=ii
191 ibuf(iadf+ii)=nn
192 ENDDO
193 ENDDO
194 ENDDO
195 itag=msgoff+1
196 CALL mpi_send(ibuf, len, mpi_integer, it_spmd(1),
197 . itag, spmd_comm_world, ierr)
198C
199 DEALLOCATE(ibuf, itagt)
200 ENDIF
201 ENDIF
202 ENDDO
203C
204#endif
205 RETURN
206 END
subroutine mpi_recv(buf, cnt, datatype, source, tag, comm, status, ierr)
Definition mpi.f:461
subroutine mpi_send(buf, cnt, datatype, dest, tag, comm, ierr)
Definition mpi.f:480
type(fvbag_spmd), dimension(:), allocatable fvspmd
Definition fvbag_mod.F:129
type(fvbag_data), dimension(:), allocatable fvdata
Definition fvbag_mod.F:128
integer nfvbag
Definition fvbag_mod.F:127
subroutine spmd_fvb_atr(nbid1, nbid2, nbid3, fvel2fa, fvinum, fvoff)
void write_i_c(int *w, int *len)