OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_anim_ply_velvec.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/.
23C-----------------------------------------------
24!||====================================================================
25!|| spmd_anim_ply_velvec ../engine/source/mpi/anim/spmd_anim_ply_velvec.F
26!||--- called by ------------------------------------------------------
27!|| velvec ../engine/source/output/anim/generate/velvec.F
28!||--- calls -----------------------------------------------------
29!|| write_r_c ../common_source/tools/input_output/write_routtines.c
30!||--- uses -----------------------------------------------------
31!|| plyxfem_mod ../engine/share/modules/plyxfem_mod.F
32!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
33!||====================================================================
34 SUBROUTINE spmd_anim_ply_velvec( NODGLOB,IPLY,
35 * NOD_PXFEM, IFUNC,EMPSIZPL)
36C-----------------------------------------------
37C M o d u l e s
38C-----------------------------------------------
39 USE plyxfem_mod
40C-----------------------------------------------
41C I m p l i c i t T y p e s
42C-----------------------------------------------
43 USE spmd_comm_world_mod, ONLY : spmd_comm_world
44#include "implicit_f.inc"
45C-----------------------------------------------------------------
46C M e s s a g e P a s s i n g
47C-----------------------------------------------
48#include "spmd.inc"
49C-----------------------------------------------
50C C o m m o n B l o c k s
51C-----------------------------------------------
52#include "com01_c.inc"
53#include "task_c.inc"
54C-----------------------------------------------
55C D u m m y A r g u m e n t s
56C-----------------------------------------------
57 INTEGER NODGLOB(*),NOD_PXFEM(*)
58 INTEGER IPLY,IFUNC,EMPSIZPL
59 REAL R4
60C-----------------------------------------------
61C L O C A L V A R I A B L E S
62C-----------------------------------------------
63#ifdef MPI
64 INTEGER MSGOFF,MSGOFF2,STAT(MPI_STATUS_SIZE,NSPMD-1), IERR
65 INTEGER I,N,ND,EMPL,P,ITAG,EMP
66 INTEGER PLYSIZ
68 . vn,val
69C
70 REAL , DIMENSION(:,:), ALLOCATABLE :: WRTBUF
72 * , DIMENSION(:,:), ALLOCATABLE :: fsendbuf,frecbuf
73 INTEGER, DIMENSION(:), ALLOCATABLE :: ISENDBUF,IRECBUF
74C-----------------------------------------------
75 DATA msgoff/7060/
76 DATA msgoff2/7061/
77C-----------------------------------------------
78
79C
80 IF (ispmd ==0) THEN
81 plysiz = plynod(iply)%PLYNUMNODS
82 ALLOCATE(wrtbuf(3,plysizg(iply)))
83
84C Les plynods du proc 0
85 DO nd=1,plysiz
86 i = plynod(iply)%NODES(nd)
87 n = nod_pxfem(i)
88 empl = plynod(iply)%PLYNODID(nd)-empsizpl
89
90 IF (ifunc==1)THEN
91 wrtbuf(1,empl)= ply(iply)%V(1,n)
92 wrtbuf(2,empl)= ply(iply)%V(2,n)
93 wrtbuf(3,empl)= ply(iply)%V(3,n)
94
95 ELSEIF (ifunc==2)THEN
96 wrtbuf(1,empl)= ply(iply)%U(1,n)
97 wrtbuf(2,empl)= ply(iply)%U(2,n)
98 wrtbuf(3,empl)= ply(iply)%U(3,n)
99
100 ELSEIF (ifunc==3)THEN
101 wrtbuf(1,empl)= ply(iply)%A(1,n)
102 wrtbuf(2,empl)= ply(iply)%A(2,n)
103 wrtbuf(3,empl)= ply(iply)%A(3,n)
104 ELSE
105 wrtbuf(1,empl)= zero
106 wrtbuf(2,empl)= zero
107 wrtbuf(3,empl)= zero
108 ENDIF
109 END DO
110C Les plynods des autres procs
111 DO p=2,nspmd
112 IF (plyiadnod(iply,p)>0)THEN
113 ALLOCATE(irecbuf(plyiadnod(iply,p)))
114 ALLOCATE(frecbuf(3,plyiadnod(iply,p)))
115 itag=msgoff
116 CALL mpi_recv(irecbuf,plyiadnod(iply,p), mpi_integer,
117 . it_spmd(p),itag, spmd_comm_world, stat, ierr)
118 itag=msgoff2
119 CALL mpi_recv(frecbuf,plyiadnod(iply,p)*3, real,
120 . it_spmd(p),itag, spmd_comm_world, stat, ierr)
121
122 DO i=1,plyiadnod(iply,p)
123 empl = irecbuf(i)-empsizpl
124 wrtbuf(1,empl)=frecbuf(1,i)
125 wrtbuf(2,empl)=frecbuf(2,i)
126 wrtbuf(3,empl)=frecbuf(3,i)
127 ENDDO
128 DEALLOCATE(irecbuf,frecbuf)
129 ENDIF
130 ENDDO
131 CALL write_r_c(wrtbuf,3*plysizg(iply))
132 DEALLOCATE(wrtbuf)
133 empsizpl = empsizpl + plysizg(iply)
134 ELSE
135 plysiz = plynod(iply)%PLYNUMNODS
136 ALLOCATE (fsendbuf(3,plysiz))
137 ALLOCATE (isendbuf(plysiz))
138 IF (plysiz > 0) THEN
139 DO nd=1,plysiz
140 i = plynod(iply)%NODES(nd)
141 n = nod_pxfem(i)
142
143 IF (ifunc==1)THEN
144 fsendbuf(1,nd) = ply(iply)%V(1,n)
145 fsendbuf(2,nd) = ply(iply)%V(2,n)
146 fsendbuf(3,nd) = ply(iply)%V(3,n)
147
148 ELSEIF (ifunc==2)THEN
149 fsendbuf(1,nd) = ply(iply)%U(1,n)
150 fsendbuf(2,nd) = ply(iply)%U(2,n)
151 fsendbuf(3,nd) = ply(iply)%U(3,n)
152
153 ELSEIF (ifunc==3)THEN
154 fsendbuf(1,nd) = ply(iply)%A(1,n)
155 fsendbuf(2,nd) = ply(iply)%A(2,n)
156 fsendbuf(3,nd) = ply(iply)%A(3,n)
157 ELSE
158 fsendbuf(1,nd) = zero
159 fsendbuf(2,nd) = zero
160 fsendbuf(3,nd) = zero
161 ENDIF
162
163 isendbuf(nd) = plynod(iply)%PLYNODID(nd)
164 END DO
165
166 itag=msgoff
167 CALL mpi_send(isendbuf,plysiz,mpi_integer,it_spmd(1),
168 . itag,spmd_comm_world,ierr)
169
170 itag=msgoff2
171 CALL mpi_send(fsendbuf,plysiz*3,real,it_spmd(1),
172 . itag,spmd_comm_world,ierr)
173C
174 DEALLOCATE(isendbuf,fsendbuf)
175 ENDIF
176 ENDIF
177C-----------------------------------------------
178#endif
179 RETURN
180 END
#define my_real
Definition cppsort.cpp:32
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(plynods), dimension(:), allocatable plynod
Definition plyxfem_mod.F:44
type(ply_data), dimension(:), allocatable ply
Definition plyxfem_mod.F:91
integer, dimension(:), allocatable plysizg
integer, dimension(:,:), allocatable plyiadnod
Definition plyxfem_mod.F:46
subroutine spmd_anim_ply_velvec(nodglob, iply, nod_pxfem, ifunc, empsizpl)
void write_r_c(float *w, int *len)