OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
dxyzsph.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!|| dxyzsph ../engine/source/output/anim/generate/dxyzsph.F
25!||--- called by ------------------------------------------------------
26!|| genani ../engine/source/output/anim/generate/genani.F
27!||--- calls -----------------------------------------------------
28!|| spmd_gather_sph ../engine/source/mpi/anim/spmd_gather_sph.F
29!|| write_r_c ../common_source/tools/input_output/write_routtines.c
30!||====================================================================
31 SUBROUTINE dxyzsph (NESPH,KXSP,X,SPBUF,SNNSPHG,NNSPH)
32C-----------------------------------------------
33C I m p l i c i t T y p e s
34C-----------------------------------------------
35#include "implicit_f.inc"
36C-----------------------------------------------
37C C o m m o n B l o c k s
38C-----------------------------------------------
39#include "com01_c.inc"
40#include "sphcom.inc"
41#include "task_c.inc"
42C-----------------------------------------------
43C D u m m y A r g u m e n t s
44C-----------------------------------------------
45 INTEGER NESPH, KXSP(NISP,*),SNNSPHG,NNSPH
47 . x(3,*),spbuf(nspbuf,*)
48C-----------------------------------------------
49C L o c a l V a r i a b l e s
50C-----------------------------------------------
51 INTEGER N, J, INOD,CNT,BUF
53 3 xi,yi,zi,r,
54 4 xq(3),fact
55 REAL R4,R4NP(3*NNSPH)
56C-----------------------------------------------
57 IF (numsph+maxpjet==0) GOTO 100
58C-----------------------------------------------
59 cnt = 0
60 fact =(three/(four*sqrt(two)))**third
61 DO 200 n=1,numsph+maxpjet
62 inod=kxsp(3,n)
63 xi =x(1,inod)
64 yi =x(2,inod)
65 zi =x(3,inod)
66 r = spbuf(1,n)*fact
67 xq(1) =xi+r
68 xq(2) =yi-r
69 xq(3) =zi-r
70C XQ(1) =XI+R*SQRT(2.)
71C XQ(2) =YI+R*SQRT(2.)/SQRT(3.)
72C XQ(3) =ZI-R/SQRT(3.)
73 IF (nspmd == 1) THEN
74 DO j=1,3
75 r4 = xq(j)
76 CALL write_r_c(r4,1)
77 ENDDO
78 ELSE
79 cnt = cnt + 1
80 r4np(cnt) = xq(1)
81 cnt = cnt + 1
82 r4np(cnt) = xq(2)
83 cnt = cnt + 1
84 r4np(cnt) = xq(3)
85 ENDIF
86 xq(1) =xi-r
87 xq(2) =yi+r
88 xq(3) =zi-r
89C XQ(1) =XI-R*SQRT(2.)
90C XQ(2) =YI+R*SQRT(2.)/SQRT(3.)
91C XQ(3) =ZI-R/SQRT(3.)
92 IF (nspmd == 1) THEN
93 DO j=1,3
94 r4 = xq(j)
95 CALL write_r_c(r4,1)
96 ENDDO
97 ELSE
98 cnt = cnt + 1
99 r4np(cnt) = xq(1)
100 cnt = cnt + 1
101 r4np(cnt) = xq(2)
102 cnt = cnt + 1
103 r4np(cnt) = xq(3)
104 ENDIF
105 xq(1) =xi-r
106 xq(2) =yi-r
107 xq(3) =zi+r
108C XQ(1) =XI
109C XQ(2) =YI-R*2.*SQRT(2.)/SQRT(3.)
110C XQ(3) =ZI-R/SQRT(3.)
111 IF (nspmd == 1) THEN
112 DO j=1,3
113 r4 = xq(j)
114 CALL write_r_c(r4,1)
115 ENDDO
116 ELSE
117 cnt = cnt + 1
118 r4np(cnt) = xq(1)
119 cnt = cnt + 1
120 r4np(cnt) = xq(2)
121 cnt = cnt + 1
122 r4np(cnt) = xq(3)
123 ENDIF
124 xq(1) =xi+r
125 xq(2) =yi+r
126 xq(3) =zi+r
127C XQ(1) =XI
128C XQ(2) =YI
129C XQ(3) =ZI+SQRT(3.)*R
130 IF (nspmd == 1) THEN
131 DO j=1,3
132 r4 = xq(j)
133 CALL write_r_c(r4,1)
134 ENDDO
135 ELSE
136 cnt = cnt + 1
137 r4np(cnt) = xq(1)
138 cnt = cnt + 1
139 r4np(cnt) = xq(2)
140 cnt = cnt + 1
141 r4np(cnt) = xq(3)
142 ENDIF
143 200 CONTINUE
144 100 CONTINUE
145C-------------------------------------------------------
146 IF (nspmd > 1) THEN
147 IF (ispmd==0) THEN
148 buf = 3*snnsphg
149 ELSE
150 buf=1
151 ENDIF
152 CALL spmd_gather_sph(r4np,numsph*4,buf)
153 ENDIF
154C
155 RETURN
156 END
#define my_real
Definition cppsort.cpp:32
subroutine dxyzsph(nesph, kxsp, x, spbuf, snnsphg, nnsph)
Definition dxyzsph.F:32
subroutine spmd_gather_sph(v, tv, num)
void write_r_c(float *w, int *len)