OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_anim_ply_xyznor.F File Reference
#include "implicit_f.inc"
#include "spmd.inc"
#include "com01_c.inc"
#include "scr14_c.inc"
#include "task_c.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine spmd_anim_ply_xyznor (nodglob, iply, xnorm, empsizpl)

Function/Subroutine Documentation

◆ spmd_anim_ply_xyznor()

subroutine spmd_anim_ply_xyznor ( integer, dimension(*) nodglob,
integer iply,
xnorm,
integer empsizpl )

Definition at line 33 of file spmd_anim_ply_xyznor.F.

34C-----------------------------------------------
35C M o d u l e s
36C-----------------------------------------------
37 USE plyxfem_mod
38C-----------------------------------------------
39C I m p l i c i t T y p e s
40C-----------------------------------------------
41 USE spmd_comm_world_mod, ONLY : spmd_comm_world
42#include "implicit_f.inc"
43C-----------------------------------------------------------------
44C M e s s a g e P a s s i n g
45C-----------------------------------------------
46#include "spmd.inc"
47C-----------------------------------------------
48C C o m m o n B l o c k s
49C-----------------------------------------------
50#include "com01_c.inc"
51#include "scr14_c.inc"
52#include "task_c.inc"
53C-----------------------------------------------
54C D u m m y A r g u m e n t s
55C-----------------------------------------------
56 INTEGER NODGLOB(*)
57 INTEGER IPLY,IDPLY,EMPSIZPL
59 . xnorm(3,*)
60 REAL R4
61C-----------------------------------------------
62C L O C A L V A R I A B L E S
63C-----------------------------------------------
64#ifdef MPI
65 INTEGER MSGOFF,MSGOFF2,STAT(MPI_STATUS_SIZE,NSPMD-1), IERR
66 INTEGER I,N,ND,EMPL,P,ITAG,INORM(3),K,IXNN
67
68 INTEGER PLYSIZ
70 . s3000,s
71C
72 INTEGER, DIMENSION(:,:), ALLOCATABLE :: WRTBUF
73 INTEGER, DIMENSION(:,:), ALLOCATABLE :: FSENDBUF,FRECBUF
74 INTEGER, DIMENSION(:), ALLOCATABLE :: ISENDBUF,IRECBUF
75C-----------------------------------------------
76 DATA msgoff/7058/
77 DATA msgoff2/7059/
78C-----------------------------------------------
79 s3000 = three1000
80 ixnn = s3000
81 IF(fmt_ani==4)ixnn=0
82C
83 IF (ispmd ==0) THEN
84 plysiz = plynod(iply)%PLYNUMNODS
85 ALLOCATE(wrtbuf(3,plysizg(iply)))
86
87C Les plynods du proc 0
88 DO nd=1,plysiz
89 i = plynod(iply)%NODES(nd)
90 empl = plynod(iply)%PLYNODID(nd)-empsizpl
91
92 s = sqrt(xnorm(1,i)**2 + xnorm(2,i)**2 + xnorm(3,i)**2)
93 IF(s/=zero)THEN
94 s = s3000 / s
95 inorm(1) = xnorm(1,i) * s
96 inorm(2) = xnorm(2,i) * s
97 inorm(3) = xnorm(3,i) * s
98 ELSE
99 inorm(1) = 0
100 inorm(2) = 0
101 inorm(3) = ixnn
102 END IF
103
104 wrtbuf(1,empl)= inorm(1)
105 wrtbuf(2,empl)= inorm(2)
106 wrtbuf(3,empl)= inorm(3)
107 END DO
108C Les plynods des autres procs
109 DO p=2,nspmd
110 ALLOCATE(irecbuf(plyiadnod(iply,p)))
111 ALLOCATE(frecbuf(3,plyiadnod(iply,p)))
112
113 itag=msgoff
114
115 CALL mpi_recv(irecbuf,plyiadnod(iply,p), mpi_integer,
116 . it_spmd(p),itag, spmd_comm_world, stat, ierr)
117
118 itag=msgoff2
119 CALL mpi_recv(frecbuf,plyiadnod(iply,p)*3, mpi_integer,
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 ENDDO
130
131 CALL write_s_c(wrtbuf,3*plysizg(iply))
132 DEALLOCATE(wrtbuf)
133 empsizpl=empsizpl+plysizg(iply)
134
135 ELSE
136 plysiz = plynod(iply)%PLYNUMNODS
137 ALLOCATE (fsendbuf(3,plysiz))
138 ALLOCATE (isendbuf(plysiz))
139
140 DO nd=1,plysiz
141 i = plynod(iply)%NODES(nd)
142
143 s = sqrt(xnorm(1,i)**2 + xnorm(2,i)**2 + xnorm(3,i)**2)
144 IF(s/=zero)THEN
145 s = s3000 / s
146 inorm(1) = xnorm(1,i) * s
147 inorm(2) = xnorm(2,i) * s
148 inorm(3) = xnorm(3,i) * s
149 ELSE
150 inorm(1) = 0
151 inorm(2) = 0
152 inorm(3) = ixnn
153 END IF
154
155 fsendbuf(1,nd) = inorm(1)
156 fsendbuf(2,nd) = inorm(2)
157 fsendbuf(3,nd) = inorm(3)
158
159 isendbuf(nd) = plynod(iply)%PLYNODID(nd)
160 END DO
161
162 itag=msgoff
163 CALL mpi_send(isendbuf,plysiz,mpi_integer,it_spmd(1),
164 . itag,spmd_comm_world,ierr)
165
166 itag=msgoff2
167 CALL mpi_send(fsendbuf,plysiz*3,mpi_integer,it_spmd(1),
168 . itag,spmd_comm_world,ierr)
169C
170 DEALLOCATE(isendbuf,fsendbuf)
171 ENDIF
172
173#endif
174 RETURN
#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
integer, dimension(:), allocatable plysizg
integer, dimension(:,:), allocatable plyiadnod
Definition plyxfem_mod.F:46
void write_s_c(int *w, int *len)