OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_anim_ply_xyznod.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_anim_ply_xyznod ../engine/source/mpi/anim/spmd_anim_ply_xyznod.F
25!||--- called by ------------------------------------------------------
26!|| xyznod_ply ../engine/source/output/anim/generate/xyznod_ply.F
27!||--- calls -----------------------------------------------------
28!|| write_r_c ../common_source/tools/input_output/write_routtines.c
29!||--- uses -----------------------------------------------------
30!|| plyxfem_mod ../engine/share/modules/plyxfem_mod.F
31!|| spmd_mod ../engine/source/mpi/spmd_mod.F90
32!||====================================================================
33 SUBROUTINE spmd_anim_ply_xyznod( NODGLOB,IPLY, IDPLY,
34 * NOD_PXFEM, X, ZI_PLY,EMPSIZPL )
35C-----------------------------------------------
36C M o d u l e s
37C-----------------------------------------------
38 USE plyxfem_mod
39 USE spmd_mod
40C-----------------------------------------------
41C I m p l i c i t T y p e s
42C-----------------------------------------------
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 "com01_c.inc"
52#include "param_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(*),EMPSIZPL
58 INTEGER IPLY,IDPLY
60 . x(3,*),zi_ply(nplyxfe,*)
61 REAL R4
62C-----------------------------------------------
63C L O C A L V A R I A B L E S
64C-----------------------------------------------
65#ifdef MPI
66 INTEGER MSGOFF,MSGOFF2,STAT(MPI_STATUS_SIZE,NSPMD-1), IERR
67C-----------------------------------------------
68 DATA msgoff/7055/
69 DATA msgoff2/7056/
70C-----------------------------------------------
71 INTEGER I,N,II,ND,EMPL,P,ITAG
72 INTEGER PLYSIZ
74 . vn,val,norm
75C
76 REAL , DIMENSION(:,:), ALLOCATABLE :: WRTBUF
78 * , DIMENSION(:,:), ALLOCATABLE :: fsendbuf,frecbuf
79 INTEGER, DIMENSION(:), ALLOCATABLE :: ISENDBUF,IRECBUF
80C-----------------------------------------------
81
82 ii = idply
83C
84
85 IF (ispmd ==0) THEN
86 plysiz = plynod(iply)%PLYNUMNODS
87 ALLOCATE(wrtbuf(3,plysizg(iply)))
88
89C Les plynods du proc 0
90 DO nd=1,plysiz
91 i = plynod(iply)%NODES(nd)
92 n = nod_pxfem(i)
93 norm = sqrt(vn_nod(1,n)**2+vn_nod(2,n)**2+vn_nod(3,n)**2)
94 norm = one/max(em20,norm)
95 empl = plynod(iply)%PLYNODID(nd)-empsizpl
96
97 vn = vn_nod(1,n)*norm
98 val = x(1,i)+zi_ply(n,iply)*vn + ply(iply)%U(1,n)
99 wrtbuf(1,empl)= val
100
101 vn = vn_nod(2,n)*norm
102 val = x(2,i)+zi_ply(n,iply)*vn + ply(iply)%U(2,n)
103 wrtbuf(2,empl)= val
104
105 vn = vn_nod(3,n)*norm
106 val = x(3,i)+zi_ply(n,iply)*vn + ply(iply)%U(3,n)
107 wrtbuf(3,empl)= val
108 END DO
109C Les plynods des autres procs
110 DO p=2,nspmd
111 IF (plyiadnod(iply,p)>0)THEN
112 ALLOCATE(irecbuf(plyiadnod(iply,p)))
113 ALLOCATE(frecbuf(3,plyiadnod(iply,p)))
114 itag=msgoff
115 CALL mpi_recv(irecbuf,plyiadnod(iply,p), mpi_integer,
116 . it_spmd(p),itag, spmd_comm_world, stat, ierr)
117 itag=msgoff2
118 CALL mpi_recv(frecbuf,plyiadnod(iply,p)*3, real,
119 . it_spmd(p),itag, spmd_comm_world, stat, ierr)
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
130 CALL write_r_c(wrtbuf,3*plysizg(iply))
131 DEALLOCATE(wrtbuf)
132 empsizpl=empsizpl+plysizg(iply)
133 ELSE
134 plysiz = plynod(iply)%PLYNUMNODS
135 ALLOCATE (fsendbuf(3,plysiz))
136 ALLOCATE (isendbuf(plysiz))
137 IF (plysiz > 0) THEN
138 DO nd=1,plysiz
139 i = plynod(iply)%NODES(nd)
140 n = nod_pxfem(i)
141 norm = sqrt(vn_nod(1,n)**2+vn_nod(2,n)**2+vn_nod(3,n)**2)
142 norm = one/max(em20,norm)
143 vn = vn_nod(1,n)*norm
144 fsendbuf(1,nd) = x(1,i)+zi_ply(n,iply)*vn + ply(iply)%U(1,n)
145 vn = vn_nod(2,n)*norm
146 fsendbuf(2,nd) = x(2,i)+zi_ply(n,iply)*vn + ply(iply)%U(2,n)
147 vn = vn_nod(3,n)*norm
148 fsendbuf(3,nd) = x(3,i)+zi_ply(n,iply)*vn + ply(iply)%U(3,n)
149 isendbuf(nd) = plynod(iply)%PLYNODID(nd)
150 END DO
151 itag=msgoff
152 CALL mpi_send(isendbuf,plysiz,mpi_integer,it_spmd(1),
153 . itag,spmd_comm_world,ierr)
154
155 itag=msgoff2
156 CALL mpi_send(fsendbuf,plysiz*3,real,it_spmd(1),
157 . itag,spmd_comm_world,ierr)
158C
159 DEALLOCATE(isendbuf,fsendbuf)
160 ENDIF
161 ENDIF
162C-----------------------------------------------
163
164#endif
165 RETURN
166 END
#define my_real
Definition cppsort.cpp:32
norm(diag(diag(diag(inv(mat))) -id.SOL), 2) % destroy mumps instance id.JOB
#define max(a, b)
Definition macros.h:21
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_xyznod(nodglob, iply, idply, nod_pxfem, x, zi_ply, empsizpl)
void write_r_c(float *w, int *len)