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_routines.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
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
66 INTEGER PLYSIZ
67C
68 REAL , DIMENSION(:,:), ALLOCATABLE :: WRTBUF
70 * , DIMENSION(:,:), ALLOCATABLE :: fsendbuf,frecbuf
71 INTEGER, DIMENSION(:), ALLOCATABLE :: ISENDBUF,IRECBUF
72C-----------------------------------------------
73 DATA msgoff/7060/
74 DATA msgoff2/7061/
75C-----------------------------------------------
76
77C
78 IF (ispmd ==0) THEN
79 plysiz = plynod(iply)%PLYNUMNODS
80 ALLOCATE(wrtbuf(3,plysizg(iply)))
81
82C the plynods of processor 0
83 DO nd=1,plysiz
84 i = plynod(iply)%NODES(nd)
85 n = nod_pxfem(i)
86 empl = plynod(iply)%PLYNODID(nd)-empsizpl
87
88 IF (ifunc==1)THEN
89 wrtbuf(1,empl)= ply(iply)%V(1,n)
90 wrtbuf(2,empl)= ply(iply)%V(2,n)
91 wrtbuf(3,empl)= ply(iply)%V(3,n)
92
93 ELSEIF (ifunc==2)THEN
94 wrtbuf(1,empl)= ply(iply)%U(1,n)
95 wrtbuf(2,empl)= ply(iply)%U(2,n)
96 wrtbuf(3,empl)= ply(iply)%U(3,n)
97
98 ELSEIF (ifunc==3)THEN
99 wrtbuf(1,empl)= ply(iply)%A(1,n)
100 wrtbuf(2,empl)= ply(iply)%A(2,n)
101 wrtbuf(3,empl)= ply(iply)%A(3,n)
102 ELSE
103 wrtbuf(1,empl)= zero
104 wrtbuf(2,empl)= zero
105 wrtbuf(3,empl)= zero
106 ENDIF
107 END DO
108C the plynods of other processors
109 DO p=2,nspmd
110 IF (plyiadnod(iply,p)>0)THEN
111 ALLOCATE(irecbuf(plyiadnod(iply,p)))
112 ALLOCATE(frecbuf(3,plyiadnod(iply,p)))
113 itag=msgoff
114 CALL mpi_recv(irecbuf,plyiadnod(iply,p), mpi_integer,
115 . it_spmd(p),itag, spmd_comm_world, stat, ierr)
116 itag=msgoff2
117 CALL mpi_recv(frecbuf,plyiadnod(iply,p)*3, real,
118 . it_spmd(p),itag, spmd_comm_world, stat, ierr)
119
120 DO i=1,plyiadnod(iply,p)
121 empl = irecbuf(i)-empsizpl
122 wrtbuf(1,empl)=frecbuf(1,i)
123 wrtbuf(2,empl)=frecbuf(2,i)
124 wrtbuf(3,empl)=frecbuf(3,i)
125 ENDDO
126 DEALLOCATE(irecbuf,frecbuf)
127 ENDIF
128 ENDDO
129 CALL write_r_c(wrtbuf,3*plysizg(iply))
130 DEALLOCATE(wrtbuf)
131 empsizpl = empsizpl + plysizg(iply)
132 ELSE
133 plysiz = plynod(iply)%PLYNUMNODS
134 ALLOCATE (fsendbuf(3,plysiz))
135 ALLOCATE (isendbuf(plysiz))
136 IF (plysiz > 0) THEN
137 DO nd=1,plysiz
138 i = plynod(iply)%NODES(nd)
139 n = nod_pxfem(i)
140
141 IF (ifunc==1)THEN
142 fsendbuf(1,nd) = ply(iply)%V(1,n)
143 fsendbuf(2,nd) = ply(iply)%V(2,n)
144 fsendbuf(3,nd) = ply(iply)%V(3,n)
145
146 ELSEIF (ifunc==2)THEN
147 fsendbuf(1,nd) = ply(iply)%U(1,n)
148 fsendbuf(2,nd) = ply(iply)%U(2,n)
149 fsendbuf(3,nd) = ply(iply)%U(3,n)
150
151 ELSEIF (ifunc==3)THEN
152 fsendbuf(1,nd) = ply(iply)%A(1,n)
153 fsendbuf(2,nd) = ply(iply)%A(2,n)
154 fsendbuf(3,nd) = ply(iply)%A(3,n)
155 ELSE
156 fsendbuf(1,nd) = zero
157 fsendbuf(2,nd) = zero
158 fsendbuf(3,nd) = zero
159 ENDIF
160
161 isendbuf(nd) = plynod(iply)%PLYNODID(nd)
162 END DO
163
164 itag=msgoff
165 CALL mpi_send(isendbuf,plysiz,mpi_integer,it_spmd(1),
166 . itag,spmd_comm_world,ierr)
167
168 itag=msgoff2
169 CALL mpi_send(fsendbuf,plysiz*3,real,it_spmd(1),
170 . itag,spmd_comm_world,ierr)
171C
172 DEALLOCATE(isendbuf,fsendbuf)
173 ENDIF
174 ENDIF
175C-----------------------------------------------
176#endif
177 RETURN
178 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:92
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)